⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 member.php

📁 phpcms网站管理系统  很不错的 有需要的就下载看看八 
💻 PHP
📖 第 1 页 / 共 2 页
字号:
	  $condition .= $locked>-1 ? " and m.locked='$locked'" : "";
	  $condition .= $email ? " and m.email='$email'" : "";
	  $condition .= $truename ? " and i.truename='$truename'" : "";
	  $condition .= $province ? " and i.province='$province'" : "";
	  $condition .= $qq ? " and i.qq='$qq'" : "";
	  $condition .= $msn ? " and i.msn='$msn'" : "";
	  $condition .= $icq ? " and i.icq='$icq'" : "";
	  $condition .= $skype ? " and i.skype='$skype'" : "";
	  $condition .= $industry ? " and i.industry='$industry'" : "";
	  $condition .= $edulevel ? " and i.edulevel='$edulevel'" : "";
	  $condition .= $income ? " and i.income='$income'" : "";
	  $condition .= $occupation ? " and i.occupation='$occupation'" : "";
	  $condition .= $frommoney ? " and m.money>=$frommoney" : "";
	  $condition .= $tomoney ? " and m.money<=$tomoney" : "";
	  $condition .= $frompayment ? " and m.payment>=$frompayment" : "";
	  $condition .= $topayment ? " and m.payment<=$topayment" : "";
	  $condition .= $frompoint ? " and m.point>=$frompoint" : "";
	  $condition .= $topoint ? " and m.point<=$topoint" : "";
	  $condition .= $fromcredit ? " and m.credit>=$fromcredit" : "";
	  $condition .= $tocredit ? " and m.credit<=$tocredit" : "";

	  $condition .= $city ? " and i.city like '%$city%'" : "";
	  $condition .= $homepage ? " and i.homepage like '%$homepage%'" : "";
	  $condition .= $address ? " and i.address like '%$address%'" : "";

      $r = $db->get_one("select count(*) as num from ".TABLE_MEMBER." m,".TABLE_MEMBERINFO." i where m.userid=i.userid and m.groupid>3 $condition");
      $number=$r["num"];
      $pages = phppages($number,$page,$_PHPCMS['pagesize']);

      $result=$db->query("SELECT m.* FROM ".TABLE_MEMBER." m,".TABLE_MEMBERINFO." i WHERE m.userid=i.userid and m.groupid>3 $condition order by m.userid desc limit $offset,$_PHPCMS[pagesize]");
      while($r=$db->fetch_array($result)){
		    $r[groupname] = $groups[$r[groupid]][groupname];
            $r[lastlogintime] = $r[lastlogintime] ? date("Y-m-d H:i:s",$r[lastlogintime]) : '';
			if($r[enddate]=="0000-00-00") 
		    {
				$r[validdatenum] = "<font color='blue'>无限期</font>";
		    }
		    else
		    {
			    $r[validdatenum] = $date->get_diff($r[enddate],date("Y-m-d"));
			    $r[validdatenum] = $r[validdatenum] <= 0 ? "<font color='red'>".$r[validdatenum]."</font>天" : $r[validdatenum];
		    }
			$r[locked] = $r[locked] ? "<font color='red'>锁定</font>" : "正常";
            $members[]=$r;
      }
	  $groupids = showgroup("select","groupid",$groupid);
	  $result = $db->query("SELECT province FROM ".TABLE_PROVINCE." WHERE country='中华人民共和国' ORDER BY provinceid");
	  while($r = $db->fetch_array($result))
	  {
		  $provinces[] = $r['province'];
	  }
	  $groups = array();
	  $result = $db->query("SELECT groupid,groupname FROM ".TABLE_USERGROUP." WHERE groupid>3 ORDER BY groupid");
	  while($r = $db->fetch_array($result))
	  {
		  $groups[$r['groupid']] = $r['groupname'];
	  }
      include admintpl('member_manage');
      break;

case 'view':
	  require PHPCMS_ROOT."/class/ip.php";
	  $getip = new IpLocation;

	  $r=$db->get_one("SELECT * FROM ".TABLE_MEMBER." m, ".TABLE_MEMBERINFO." i WHERE m.userid=i.userid AND m.userid=$userid");
	  @extract($r);
	  @extract($groups[$groupid],EXTR_SKIP);

      $regiparea = $getip->getlocation($regip);
	  $regiparea = $regip ? " - ".$regiparea['country'] : "";
      $lastloginiparea = $getip->getlocation($regip);
	  $lastloginiparea = $lastloginip ? " - ".$lastloginiparea['country'] : "";

	  $chargetype = $chargetype==1 ? "有效期" : "扣点数";
	  $enableaddalways = $enableaddalways==1 ? "<font color='red'>是</font>" : "否";
	  $gender = $gender==1 ? "男" : "女";
	  $regtime = $regtime ? date("Y-m-d H:i:s",$regtime) : "";
	  $lastlogintime = $lastlogintime ? date("Y-m-d H:i:s",$lastlogintime) : '';
	  $begindate = $begindate > "0000-00-00" ? $begindate : "";
	  $enddate = $enddate > "0000-00-00" ? $enddate : "";
	  if($birthday > "0000-00-00")
	  {
		 $date->set_date($birthday);
		 $old = date("Y")-$date->get_year();
	  }
	  $locked = $locked ? "<font color='red'>已被锁定</font>" : "正常";
	  include admintpl('member_view');
	  break;

case 'note':
	if($save)
	{
        $db->query("UPDATE ".TABLE_MEMBER." SET note='$note' WHERE userid='$userid'");
		showmessage('操作成功!',$PHP_REFERER);
    }
	else
	{
		$r=$db->get_one("SELECT username,note FROM ".TABLE_MEMBER." WHERE userid='$userid'");
		@extract($r);
		include admintpl('member_note');
	}
	break;


case 'password':
      if($submit){
            if(strlen($password)<6 || strlen($password)>32){
                 showmessage("密码不能为空且不得少于6个字符或超过32个字符!请返回!");
            }
	    $badwords=array("\\",'&',' ',"'",'"','/','*',',','<','>',"\r","\t","\n",'#');
	    foreach($badwords as $value){
		     if(strpos($password,$value)!==false){ 
			showmessage('密码中不得包含非法字符!请返回!'); 
		     }
	    }
            if($password=="" || $oldpassword==""){
                 showmessage('请输入密码!请返回!',$referer);
            }
            $oldpassword=md5($oldpassword);
            $query="select * from ".TABLE_MEMBER." where username='$_SESSION[phpcms_username]' and password='$oldpassword'";
            $result=$db->query($query);
            if($db->num_rows($result)==0){
               showmessage('原密码错误!',$referer);
            }
            $password=md5($password);
            $query="update ".TABLE_MEMBER." set password='$password' where username='$_SESSION[phpcms_username]'";
            $db->query($query);
            if($db->affected_rows()>0){
                  showmessage('操作成功!',$referer);
            }else{
                  showmessage('操作失败!请返回!');
            }
      }else{
            include admintpl('member_password');
      }
      break;

case 'pass':
      if(empty($userid)){
         showmessage('非法参数!请返回!');
      }
      $userids=is_array($userid) ? implode(',',$userid) : $userid;
	  $r=$db->get_one("select * from ".TABLE_USERGROUP." where groupid=4");
	  @extract($r);
	  $begindate = date("Y-m-d");
	  $date->dayadd($defaultvalidday);
	  $enddate = $defaultvalidday == -1 ? "0000-00-00" : $date->get_date();
      $db->query("UPDATE ".TABLE_MEMBER." SET groupid=4,chargetype=$chargetype,point=$defaultpoint,begindate='$begindate',enddate='$enddate' WHERE userid IN ($userids)");
      if($db->affected_rows()>0){
            showmessage('操作成功!',$PHP_REFERER);
      }else{
            showmessage('操作失败!请返回!');
      }
      break;

case 'passall':

      $result=$db->query("select * from ".TABLE_USERGROUP." where groupid='$groupid'");
      @extract($db->fetch_array($result));
      $db->query("UPDATE ".TABLE_MEMBER." SET groupid=$groupid,chargetype=$chargetype,point=$defaultpoint,validdate=$defaultvaliddate,begindate=$timestamp WHERE groupid=3");
      if($db->affected_rows()>0){
            showmessage('操作成功!',$PHP_REFERER);
      }else{
            showmessage('操作失败!请返回!');
      }
      break;

case 'lock':
      if(empty($userid)){
         showmessage('非法参数!请返回!');
      }
      $userids=is_array($userid) ? implode(',',$userid) : $userid;
      $db->query("UPDATE ".TABLE_MEMBER." SET locked=$val WHERE userid IN ($userids)");
      if($db->affected_rows()>0){
            showmessage('操作成功!',$PHP_REFERER);
      }else{
            showmessage('操作失败!请返回!');
      }
      break;

case 'user_exists':
	if(user_exists($username))
	{
	    showmessage('该用户名已经存在!');
	}
	else
	{
	    showmessage('该用户名不存在!');
	}
	break;

case 'delete':
      if(empty($userid)){
         showmessage('非法参数!请返回!');
      }
      $userids=is_array($userid) ? implode(',',$userid) : $userid;
      $db->query("DELETE FROM ".TABLE_MEMBER." WHERE userid IN ($userids)");
      if($db->affected_rows()>0){
            showmessage('操作成功!',$referer);
      }else{
            showmessage('操作失败!请返回!');
      }
      break;

case 'deleteallnopass':
      $db->query("DELETE FROM ".TABLE_MEMBER." WHERE groupid=3");
      if($db->affected_rows()>0){
            showmessage('操作成功!',$referer);
      }else{
            showmessage('操作失败!请返回!');
      }
      break;
}
?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -