?
Path : /home/admin/domains/happytokorea.com/public_html_bk/backoffice/user/ |
Current File : /home/admin/domains/happytokorea.com/public_html_bk/backoffice/user/users.php |
<?php $root_path="../"; include($root_path."header.php"); $db_tm = new sql_db($dbhost, $dbuser, $dbpasswd, $dbname, false); $template = new Template($user_tpl_path); foreach(${"_" . $_SERVER["REQUEST_METHOD"]} as $k=>$v) $$k=$v; 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>"; } $user_id=$rows_01['user_id']; $user_name=$rows_01['user_name']; $password=$rows_01['password']; $fname=$rows_01['fname']; $lname=$rows_01['lname']; $addr=$rows_01['addr']; $position=$rows_01['position']; $email=$rows_01['email']; } $template->set_filenames(array('body' =>'users.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, "user_id"=>$user_id, "user_name"=>$user_name, "password"=>$password, "fname"=>$fname, "lname"=>$lname, "addr"=>$addr, "position"=>$position, "email"=>$email, )); $template->pparse('body'); ?>