[HTML]
function Zeng_integral () {
$jifen =& m (' integral ');
/* Judging Internet Cafes * *
$store =isset ($store _id) intval ($store _id): 0;
$injifen = $jifen->get (Array (' user_id ' =>$_session[' user_info ' [' user_id ']));
$yanzhen =json_decode ($injifen [' Integrallog '],true);
if (Isset ($injifen)) {
$arrstore =array ();
foreach ($yanzhen as $k = = $v) {
$arrstore []= $v [' store_id '];
}
/* Determine if the internet point points exist if * *
if (In_array ($store, $arrstore)) {
foreach ($yanzhen as $key = = $val) {
$yanzhen [$key] [' store_id ']= $key;
$yanzhen [$key] [' Jifen ']= $val [' Jifen ']+5;
}
$integral =json_encode ($yanzhen);
}else {
foreach ($yanzhen as $key = = $val) {
$yanzhen [$store] [' store_id ']= $store;
$yanzhen [$store] [' Jifen ']=1;
}
$integral =json_encode ($yanzhen);
}
/* Construct data */
$data =array (
' Integrallog ' = $integral,
);
$integ = $jifen->edit ($injifen [' id '], $data);
if ($integ) {
return true;
}
}else {
/* Construct Array */
$config =array ();
$config [$store] [' store_id ']= $store;
$config [$store] [' Jifen ']=1;
$integral =json_encode ($config);
/* Construct data */
$data =array (
' user_id ' =>$_session[' user_info ' [' user_id '],
' Integrallog ' = $integral,
);
$integ = $jifen->add ($data);
if ($integ) {
return true;
}
}
}
function Zeng_integral () {
$jifen =& m (' integral ');
/* Judging Internet Cafes * *
$store =isset ($store _id) intval ($store _id): 0;
$injifen = $jifen->get (Array (' user_id ' =>$_session[' user_info ' [' user_id ']));
$yanzhen =json_decode ($injifen [' Integrallog '],true);
if (Isset ($injifen)) {
$arrstore =array ();
foreach ($yanzhen as $k = = $v) {
$arrstore []= $v [' store_id '];
}
/* Determine if the internet point points exist if * *
if (In_array ($store, $arrstore)) {
foreach ($yanzhen as $key = = $val) {
$yanzhen [$key] [' store_id ']= $key;
$yanzhen [$key] [' Jifen ']= $val [' Jifen ']+5;
}
$integral =json_encode ($yanzhen);
}else {
foreach ($yanzhen as $key = = $val) {
$yanzhen [$store] [' store_id ']= $store;
$yanzhen [$store] [' Jifen ']=1;
}
$integral =json_encode ($yanzhen);
}
/* Construct data */
$data =array (
' Integrallog ' = $integral,
);
$integ = $jifen->edit ($injifen [' id '], $data);
if ($integ) {
return true;
} www.2cto.com
}else {
/* Construct Array */
$config =array ();
$config [$store] [' store_id ']= $store;
$config [$store] [' Jifen ']=1;
$integral =json_encode ($config);
/* Construct data */
$data =array (
' user_id ' =>$_session[' user_info ' [' user_id '],
' Integrallog ' = $integral,
);
$integ = $jifen->add ($data);
if ($integ) {
return true;
}
}
}
Author: chaojie2009
http://www.bkjia.com/PHPjc/478155.html www.bkjia.com true http://www.bkjia.com/PHPjc/478155.html techarticle [HTML] function zeng_integral () {$jifen = m (integral);/* Determine Internet Café */$store =isset ($store _id)? Intval ($store _id): 0; $ injifen= $jifen-get (Array (user_id=$_session[user_info][user_id]) ...