?
Path : /home/admin/public_html/old/backoffice/process/ |
Current File : /home/admin/public_html/old/backoffice/process/member_option.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']; $member_id=$rows_01['member_id']; $game_zone_id=$rows_01['game_zone_id']; $date_start_play=$rows_01['date_start_play']; $date_end_play=$rows_01['date_end_play']; $game_level=$rows_01['game_level']; $point=$rows_01['point']; $number_of_player=$rows_01['number_of_player']; } $template->set_filenames(array('body' =>'member_option.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, "member_id"=>$member_id, "game_zone_id"=>$game_zone_id, "date_start_play"=>$date_start_play, "date_end_play"=>$date_end_play, "game_level"=>$game_level, "point"=>$point, "number_of_player"=>$number_of_player, )); $template->pparse('body'); ?>