欢迎来到天天文库
浏览记录
ID:36010183
大小:68.50 KB
页数:15页
时间:2019-04-28
《ecshop代码要求》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、1.数据库连接关键代码/*初始化数据库类*/require(ROOT_PATH.'includes/cls_mysql.php');$db=newcls_mysql($db_host,$db_user,$db_pass,$db_name);$db_host=$db_user=$db_pass=$db_name=NULL;2.查看用户关键代码部分/*------------------------------------------------------*///--用户帐号列表/*-----------------------
2、-------------------------------*/if($_REQUEST['act']=='list'){/*检查权限*/admin_priv('users_manage');$sql="SELECTrank_id,rank_name,min_pointsFROM".$ecs->table('user_rank')."ORDERBYmin_pointsASC";$rs=$db->query($sql);$ranks=array();while($row=$db->FetchRow($rs)){$ranks[$
3、row['rank_id']]=$row['rank_name'];}$smarty->assign('user_ranks',$ranks);$smarty->assign('ur_here',$_LANG['03_users_list']);$smarty->assign('action_link',array('text'=>$_LANG['04_users_add'],'href'=>'users.php?act=add'));$user_list=user_list();$smarty->assign('user_l
4、ist',$user_list['user_list']);$smarty->assign('filter',$user_list['filter']);$smarty->assign('record_count',$user_list['record_count']);$smarty->assign('page_count',$user_list['page_count']);$smarty->assign('full_page',1);$smarty->assign('sort_user_id','5、ges/sort_desc.gif">');assign_query_info();$smarty->display('users_list.htm');}1.修改用户关键代码部分/*------------------------------------------------------*///--更新用户帐号/*------------------------------------------------------*/elseif($_REQUEST['act']=='update'){/*检查权限*/admin_p6、riv('users_manage');$username=empty($_POST['username'])?'':trim($_POST['username']);$password=empty($_POST['password'])?'':trim($_POST['password']);$email=empty($_POST['email'])?'':trim($_POST['email']);$sex=empty($_POST['sex'])?0:intval($_POST['sex']);$sex=in_array7、($sex,array(0,1,2))?$sex:0;$birthday=$_POST['birthdayYear'].'-'.$_POST['birthdayMonth'].'-'.$_POST['birthdayDay'];$rank=empty($_POST['user_rank'])?0:intval($_POST['user_rank']);$credit_line=empty($_POST['credit_line'])?0:floatval($_POST['credit_line']);$users=&init_8、users();if(!$users->edit_user(array('username'=>$username,'password'=>$password,'email'=>$email,'gender'=>$sex,'bday'=>$birthday),1)){if($
5、ges/sort_desc.gif">');assign_query_info();$smarty->display('users_list.htm');}1.修改用户关键代码部分/*------------------------------------------------------*///--更新用户帐号/*------------------------------------------------------*/elseif($_REQUEST['act']=='update'){/*检查权限*/admin_p
6、riv('users_manage');$username=empty($_POST['username'])?'':trim($_POST['username']);$password=empty($_POST['password'])?'':trim($_POST['password']);$email=empty($_POST['email'])?'':trim($_POST['email']);$sex=empty($_POST['sex'])?0:intval($_POST['sex']);$sex=in_array
7、($sex,array(0,1,2))?$sex:0;$birthday=$_POST['birthdayYear'].'-'.$_POST['birthdayMonth'].'-'.$_POST['birthdayDay'];$rank=empty($_POST['user_rank'])?0:intval($_POST['user_rank']);$credit_line=empty($_POST['credit_line'])?0:floatval($_POST['credit_line']);$users=&init_
8、users();if(!$users->edit_user(array('username'=>$username,'password'=>$password,'email'=>$email,'gender'=>$sex,'bday'=>$birthday),1)){if($
此文档下载收益归作者所有