| Current Path : /home/zqegovsj/public_html/us3.supplierlist.com/member/master/ |
| Current File : /home/zqegovsj/public_html/us3.supplierlist.com/member/master/useredit.php |
<?php
$inc_path = "../../haibo/en/";$ua_sm_compile_dir = "newmember/";
require($inc_path."global.php");
require("session.php");$tb_prefix= $_SESSION['Version']."_";
require($inc_path .APP_NAME. 'configs/db_session.php');
uses("member","membertype", "area", "company","companytype","trade", "product","industry","access","setting");
require($inc_path.APP_NAME.'include/page_admin.php');
$companytype = new Companytypes();
$keyword=new Keywords();
$setting= new Settings();
$access = new Accesses();
$industry = new Industries();
$area = new Areas();
$company = new Companies();
$trade = new Trades();
$product = new Products();
$membertype = new Membertypes();
$tpl_file = "user_edit";
if ($_POST['edit']!='') {$nowtime = time();
$exp_time = $nowtime+10*86400;
function upload($row,$table,$id_name,$id)
{
@$a=array_values($row);
@$b=array_keys($row);
$sql.="UPDATE `".$table."` SET `".$b[0]."` =
'".$a[0];
for($i=1;$i<count($row);$i++){
$sql.="',
`".$b[$i]."` = '".$a[$i];
}
$sql.="' WHERE `".$id_name."` =".$id;
return $sql;
}
$arr=array();
$arr[username]=$_POST['member']['username'];
if($_POST['member']['passwd']!='')$arr[userpass]=md5($_POST['member']['passwd']);
$arr[name]=$_POST['member']['name'];
$arr[department]=$_POST['member']['department'];
$arr[created]=$nowtime;
$arr[email]=$_POST['member']['email'];
$arr[tel]=$_POST['member']['tel'];
$arr[gender]=$_POST['member']['gender'];
$arr[fax]=$_POST['member']['max'];
$arr[mobile]=$_POST['member']['mobile'];
$arr[notes]=$_POST['member']['notes'];
$g_db->Execute(upload($arr,'users','id',$_GET['user_id']));
}
$conditions = " member_id = ".$_SESSION['MemberID']." and id=".$_GET['user_id'];
$sql = "select * from users where ".$conditions;
$res = $g_db->GetArray($sql);
setvar("m",$res[0]);
setvar("user_id",$_GET['user_id']);
include("head.php");template("newmember/".$tpl_file);
?>