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

📄 mana_member_sele.php

📁 自己实现一个实用的商店应用系统
💻 PHP
字号:
<?php////////////////////////////////////////////////////////// Author by Shuweich// Date : 2007.07.27// 建站支持: http://www.shuweich.net// 作者: Shuweich// QQ: 1502384// ICQ: 190492112// MSN: shuweich@hotmail.com// E-mail: root@shuweich.net// E-mail: shuweich@163.com// CMS交流站点: http://www.shuweich.net////////////////////////////////////////////////////////// 模块管理 by market// For 系统管理员(站长及经理)////////////////////////////////////////////////////////include '../../../include/cp_header.php';include '../head_inc.php';xoops_cp_header();include 'admhead.php';if       ( $_REQUEST['fl'] === 'a' ) { $title = ' 普通会员管理'; $_auth = -4; $_where = ' and ( auth=-4 or auth=-14 ) ';} elseif ( $_REQUEST['fl'] === 'b' ) { $title = ' 银卡会员管理'; $_auth = -3; $_where = ' and ( auth=-3 or auth=-13 ) ';} elseif ( $_REQUEST['fl'] === 'c' ) { $title = ' 金卡会员管理'; $_auth = -2; $_where = ' and ( auth=-2 or auth=-12 ) ';} elseif ( $_REQUEST['fl'] === 'd' ) { $title = ' 钻石会员管理'; $_auth = -1; $_where = ' and ( auth=-1 or auth=-11 ) ';} elseif ( $_REQUEST['fl'] === 'e' ) { $title = ' 店内员工管理'; $_auth =  0; $_where = ' and auth>=0 ';} else { $title = ' 其它人员管理'; $_auth > -200; $_where = ' 1 = 1 ';}echo "<span style='font-size:18px;color:#8dff8d;'>$title</span>\n";while(list($k,$v)=each($_POST['bh0_'])){   $st_id = $_REQUEST['store_id0_'.$k];  $user_card = $_REQUEST['user_card0_'.$k];  $user_supc = $_REQUEST['user_supc0_'.$k];  $user_auth = $_REQUEST['user_auth0_'.$k];  $upd = "update ".$xoopsDB->prefix("market_member")." set store_id='".$st_id."',user_card='".$user_card."',user_supc='".$user_supc."',auth=".$user_auth." where bh=".$k;  $st0 = $xoopsDB->queryF($upd);}## 录入员工资料if ( isset($_POST['add_']) && $_POST['add_'] === '1' ) {  $ins  = "insert into ".$xoopsDB->prefix("market_member");  $ins .= " (bh,store_id,user_id,user_name,user_sex,user_jtime,user_card,user_disc,user_birthday,user_mb,user_addr,auth)";  $ins .= " values (0,";  $ins .= "'".$_POST['store_id1']."',";  $ins .= "'".$_POST['user_id1']."',";  $ins .= "'".$_POST['user_name1']."',";  $ins .= "'".$_POST['user_sex1']."',";  $ins .= "now(),";  $ins .= "'".$_POST['user_card1']."',";  $ins .= "'".$_Odis[$_POST['user_disc1']]."',";  $ins .= "'".$_POST['_yy1']."-".$_POST['_mm1']."-".$_POST['_dd1']."',";  $ins .= "'".$_POST['user_mb1']."',";  $ins .= "'".$_POST['user_addr1']."',";  $ins .= "'".$_POST['auth1']."')";  // echo $_Odis[$_POST['user_disc1']];  // echo "<pre>";	print_r($_REQUEST);	echo "<hr />".$ins."</pre>\n";}$in0 = $xoopsDB->queryF($ins);?><form action="<?php echo $PHP_SELF; ?>" method="post" name="mana_member"><?php$que  = "select store_id from ".$xoopsDB->prefix("market_store");$que .= " where user_id=".$xoopsUser->getVar('uid');$res = $xoopsDB->query($que);$mstore='(';while ( $row = $xoopsDB->fetchrow($res) ) { $mstore .= '"'.$row[0].'",'; }$mstore = substr($mstore,0,-1).')';$que  = "select bh,store_id,user_id,user_name,user_sex,user_card,user_supc,grp_rs,auth";$que .= " from ".$xoopsDB->prefix("market_member");$que .= " where store_id in ".$mstore.$_where;$que .= " order by store_id,user_id";## echo $que."<hr />\n";$res = $xoopsDB->query($que);echo "<table border='0'>\n";echo "<tr><th>修改</th><th>门店</th><th>会员</th><th>性别</th>";echo "<th>会员卡号</th><th>上级卡号</th><th>";echo $_auth>=0?'权限':'标志';echo "</th></tr>";$xh=0;while ( $row = $xoopsDB->fetchrow($res) ) {  echo "<tr ";  if ($xh % 2 == 0) echo "class='odd'";  else echo "class='even'";  echo " >";		$xh++;  echo "\n<td><input type='checkbox' name='bh0_[".$row[0]."]' value='1' /></td>";		## 修改  echo "\n<td><select name='store_id0_".$row[0]."' size='1'>";  $q_sid = "select store_id,s_name from ".$xoopsDB->prefix("market_store");  $q_sid.= " where  user_id=".$xoopsUser->getVar('uid')." order by store_id";  $r_sid = $xoopsDB->query($q_sid);  while ( $s_id = $xoopsDB->fetchrow($r_sid) ) {    echo "<option value='".$s_id[0]."' ";    echo ($row[1] == $s_id[0]?'selected':'')." >".$s_id[1]."</option>";  }  echo "</select></td>";			## 门店  echo "\n<td>$row[2]:$row[3]</td>";		## 会员  echo "\n<td><select name='user_sex0_".$row[0]."' size='1' Disabled='true' ><option value='女' ";  echo ($row[4] == '女'?'selected':'')." >女</option><option value='男' ";  echo ($row[4] == '男'?'selected':'')." >男</option></select></td>";			## 性别  echo "\n<td><input type='text' size='14' maxlength='21' name='user_card0_".$row[0]."' value='$row[5]' /></td>";			## 会员卡号  echo "\n<td><input type='text' size='14' maxlength='21' name='user_supc0_".$row[0]."' value='$row[6]' /></td>";			## 上级卡号  echo "\n<td><select name='user_auth0_".$row[0]."' size='1'>";  if ( $_auth >= 0 ) $auth0 = array('0'=>'临时人员','1'=>'操作员','2'=>'领班','3'=>'管理员','4'=>'维护员','9'=>'超级用户');  elseif ( $_auth == -1 || $auth == -11 ) $auth0 = array('-11'=>'未审核','-1'=>'已审核');  elseif ( $_auth == -2 || $auth == -12 ) $auth0 = array('-12'=>'未审核','-2'=>'已审核');  elseif ( $_auth == -3 || $auth == -13 ) $auth0 = array('-13'=>'未审核','-3'=>'已审核');  elseif ( $_auth == -4 || $auth == -14 ) $auth0 = array('-14'=>'未审核','-4'=>'已审核');  elseif ( $_auth == -5 || $auth == -15 ) $auth0 = array('-15'=>'未审核','-5'=>'已审核');  else $auth0 = array('-20'=>'未知状态');  while ( list($key,$val) = each($auth0) ) {    echo "<option value='".$key."' ";    echo ($row[8] == $key?'selected':'')." >".$val."</option>";  }  echo "</select></td>";			## 权限  echo "</tr>\n";}echo "<tr><th>修改</th><th>门店</th><th>会员</th><th>性别</th>";echo "<th>会员卡号</th><th>上级卡号</th><th>";echo $_auth>=0?'权限':'标志';echo "</th></tr>";echo "</table>\n";echo "<hr />\n";echo "<input type='reset' name='R01' value='重选' />";echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";echo "<input type='submit' name='S01' value='确认' />";echo "</form>\n";if ( $_REQUEST['fl'] === 'e' ) {?><form name='add_oper' id='add_oper' action='<?php echo $_SERVER['PHP_SELF']."?fl=e"; ?>' method='post'>&nbsp;<span style='font-size:16px;'>录入新员工资料:</span><hr style='width:538px;height:2px;' /><input type='hidden' name='add_' id='add_' value='1' /><table border="0" name="BB1"><tr><td>所属门店:</td><td><select id='store_id1' name='store_id1' size='1'><option value='_' selected>请选择所属门店</option><?php  $q_sid = "select store_id,s_name from ".$xoopsDB->prefix("market_store");  $q_sid.= " where  user_id=".$xoopsUser->getVar('uid')." order by store_id";  $r_sid = $xoopsDB->query($q_sid);  while ( $s_id = $xoopsDB->fetchrow($r_sid) ) {    echo "<option value='".$s_id[0]."'>".$s_id[1]."</option>";  }?></select><?php echo $_RS; ?></td><td></td></tr><tr><td>系统用户:</td><td><input type='text' id='user_id1' name='user_id1' size='9'  maxlength='9' value='' readonly /><?php echo $_RS; ?></td><td align='left'><select id='sele_uid' name='sele_uid' size='1' onchange='javascript:document.getElementById("user_id1").value=this.options[this.selectedIndex].value;'><option value='__' selected>请选择系统用户</option><?php$que = "select groupid from ".$xoopsDB->prefix("groups");$que.= " where name in (".$_Ugrp.")";$res = $xoopsDB->query($que);$groups1 = '';while ( $row = $xoopsDB->fetchrow($res) ) {  $groups1 .= $row[0].',';}$groups1 = substr($groups1,0,-1);$que = "select a.uid,a.uname,a.name from ";$que.= $xoopsDB->prefix("users")." a left join ".$xoopsDB->prefix("groups_users_link")." b using (uid) ";$que.= " where b.groupid in (".$groups1.") ";$que.= " order by uid";$res = $xoopsDB->query($que);$xx = '';while($u_id = $xoopsDB->fetchrow($res)) {   if ( $u_id[0] == $row[1] ) $xx = 'selected'; else $xx = '';  echo "<option value='".$u_id[0]."' ".$xx." >".$u_id[0].":".$u_id[1]."->".$u_id[2]."</option>";}?></select></td></tr><tr><td align='right'>姓名:</td><td align='left'><input type='text' id='user_name1' name='user_name1' value='' /><?php echo $_RS; ?></td></tr><tr><td align='right'>性别:</td><td align='left'><select name='user_sex1' size='1'><option value='男'>男</option><option value='女'>女</option></select> </td></tr><tr><td align='right'>卡号:</td><td aligh='left'><input type='text' name='user_card1' size='14' /><?php echo $_RS; ?></td></tr><tr><td align='right'>级别:</td><td align='left'><select id='user_disc1' name='user_disc1' size='1'><?phpwhile(list($k,$v)=each($_Oaut)){	echo "<option value='".$k."' ";	echo ($k == -4?'selected':'');	echo " >".$v."</option>";}?></select><?php echo $_RS; ?></td></tr><tr><td align='right'>生日:</td><td aligh='left'>  <?php      echo "<select id='_yy1' name='_yy1'>\n";      for ( $i = date('Y') - 120; $i <= date('Y') - 0; $i++ ) {        echo "<option value='".$i."'"; if ( $i == date('Y') - 29 ) echo " selected "; echo ">".$i."</option>\n";      }      echo "</select>年";      echo "<select id='_mm1' name='_mm1'>\n";      for ( $i = 1; $i <= 12; $i++ ) {        echo "<option value='".$i."'"; if ( $i == date('m') ) echo " selected "; echo ">".$i."</option>\n";      }      echo "</select>月";      echo "<select id='_dd1' name='_dd1'>\n";      for ( $i = 1; $i <= 31; $i++ ) {        echo "<option value='".$i."'"; if ( $i == date('d') ) echo " selected "; echo ">".$i."</option>\n";      }      echo "</select>日$_RS\n";  ?></td></tr><tr><td align='right'>手机:</td><td><input type='text' id='user_mb1' name='user_mb1' size='30' maxlength='39' value='' /></td><td align='left'>多个请用逗号分隔</td></tr><tr><td align='right'>联系地址:</td><td aligh='left' colspan='2'><input type='text' id='user_addr1' name='user_addr1' size='60' maxlength='120' /></td></tr><tr><td align='right'>权限:</td><td align='left'><select id='auth1' name='auth1' size='1'><?php$auth0 = array('0'=>'临时人员','1'=>'操作员','2'=>'领班','3'=>'管理员','4'=>'维护员','9'=>'超级用户');while ( list($key,$val) = each($auth0) ) {  echo "<option value='".$key."' ";  echo ($key == 1?'selected':'')." >".$val."</option>";}?></select><?php echo $_RS; ?></td></tr></table><hr /><input type='reset' name='R01' value='重选' />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type='submit' name='S01' value='确认' /></form><?php}xoops_cp_footer();?>

⌨️ 快捷键说明

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