?
Path : /home/admin/domains/happytokorea.com/public_html_bk/backoffice/process/ |
Current File : /home/admin/domains/happytokorea.com/public_html_bk/backoffice/process/member.php |
<?php $root_path="../"; include($root_path."header.php"); $db_tm=new sql_db($dbhost, $dbuser, $dbpasswd, $dbname, false); $template= new Template($process_tpl_path); $result_group_tb=$db_tm->sql_query("SET NAMES utf8"); $result_group_tb=$db_tm->sql_query("SELECT group_data.TB_NAME_TH FROM group_data WHERE group_data.TB_NAME = '".$TB."'"); $rows=$db_tm->sql_fetchrow($result_group_tb); $TBTH=$rows[TB_NAME_TH]; if($flag=="add"){ $title="Add "; $image="../images/spacer.gif"; } if($flag=="edit"){ $title="Edit "; $idx_data = split('`',$index_data); $sql = "SELECT SQL_TB FROM $selitem where TB_NAME='$TB' "; $result = $db_tm->sql_query("SET NAMES utf8"); $result = $db_tm->sql_query($sql); $rows = $db_tm->sql_fetchrow($result); $sql_error = $db_tm->sql_error($result); $debug_text = ''; if ( $sql_error['message'] != '' ){ $debug_text .= '<br /><br />Error command SQL : ' . $sql_error['message']; echo $debug_text."<br>"; } $result_00 = $db_tm->sql_query("select * from $TB where 0"); $first_fields = $db_tm->sql_fieldname($offset=0,$result_00); $sql_01 = $rows[SQL_TB]." where $first_fields='$idx_data[0]' "; $result_01 = $db_tm->sql_query("SET NAMES utf8"); $result_01 = $db_tm->sql_query($sql_01); $rows_01 = $db_tm->sql_fetchrow($result_01); $sql_error = $db_tm->sql_error($result_01); $debug_text = ''; if ( $sql_error['message'] != '' ){ $debug_text .= '<br /><br />Error command SQL : ' . $sql_error['message']; echo $debug_text."<br>"; } $id=$rows_01['id']; $uid=$rows_01['uid']; $pwd=$rows_01['pwd']; $name=$rows_01['name']; $mobile=$rows_01['mobile']; $email=$rows_01['email']; $point=$rows_01['point']; } $resutl_game_member=$db_tm->sql_query("SELECT game_zone.id,game_zone.name,member_option.id,member_option.member_id,member_option.game_zone_id,member_option.date_start_play,member_option.date_end_play,member_option.game_level,member_option.point,member_option.number_of_player,member.point FROM game_zone Left Join member_option ON member_option.game_zone_id = game_zone.id Inner Join member ON member_option.member_id = member.id WHERE member.id = '".$id."' ORDER BY game_zone.id ASC, member_option.id ASC"); $num_game_member=$db_tm->sql_numrows($result_game_member); for($i=0;$i<$num_gmae_member;$i++){ $rows_game_member=$db_tm->sql_fetchrow($result_game_member); $template->assign_block_vars('game_member', array( //""=>$rows_game_member[""], )); } $template->set_filenames(array('body' =>'member.tpl')); $template->assign_vars(array( "STYLE" =>STYLE, "TITLE" =>$title, "FLAG" =>$flag, "TB" =>$TB, "TBTH" =>$TBTH, "SELITEM" =>$selitem, "IMAGES_PATH" =>$images_path, "INCLUDES_PATH" =>$includes_path, "Image" =>$image, "id"=>$id, "uid"=>$uid, "pwd"=>$pwd, "name"=>$name, "mobile"=>$mobile, "email"=>$email, "point"=>$point, )); $template->pparse('body'); ?>