$today, '__username__' => $_SESSION['username'], '__name__' => $_SESSION['name'], '__point__' => $_SESSION['point']); return strtr($content,$replace_pairs); } function point_history($user_id){ global $dbi; $query = "select * from `accounts` where `user_id` = $user_id order by `account_id` desc"; $result = $dbi->query($query); if($result->num_rows > 0){ $history = ''; while($data = $result->fetch_object()) { $history .= ''; $history .= ''; $history .= ''; $history .= ''; $history .= ''; } $history .= '
購入日ポイント料金
'.$data->created_at.''.$data->point.''.number_format($data->price).'
'; }else{ $history = 'No point'; } $result->free(); return $history; } function refresh_user_session(){ global $dbi; $query = "select `username`,`name`,`manager`,`point` from `users` where `user_id` = {$_SESSION['user_id']}"; $result = $dbi->query($query); $user_data = $result->fetch_object(); $_SESSION['username'] = $user_data->username; $_SESSION['name'] = $user_data->name; $_SESSION['manager'] = $user_data->manager; $_SESSION['point'] = $user_data->point; $result->free(); } ?> connect_errno){ echo $dbi->connect_error; exit; } $dbi->query("set names utf8"); ?>