📄 acc_blxhyk.php
字号:
<?php
////////////////////////////////////////////////////////
// Author by Shuweich
// Date : 2007.11.13
// 建站支持: http://www.shuweich.net
// 作者: Shuweich
// QQ: 1502384
// ICQ: 190492112
// MSN: shuweich@hotmail.com
// E-mail: root@shuweich.net
// E-mail: shuweich@163.com
////////////////////////////////////////////////////////
// 模块管理 by txdyz
// For 添加会员资料
////////////////////////////////////////////////////////
include_once '../../mainfile.php';
include_once 'head_win.php';
include_once 'head_inc.php';
if ( isset($_REQUEST['is_s9']) && $_REQUEST['is_s9'] == '1' ) {
$que = "select store_id,user_card from ".$xoopsDB->prefix("market_member");
$que .= " where store_id='".$_REQUEST['s_id0']."' and user_card='".$_REQUEST['user_card0']."'";
$res = $xoopsDB->query($que);
$pes = $xoopsDB->getRowsNum($res);
if ( $pes == 0 ) {
echo "<center>无此卡号(或数据表文件故障),请先领卡再发卡,谢谢合作!\n";
echo "<hr /><input type='button' value='关闭窗口' onclick='returnValue=1;window.close();' /></center>\n";
exit();
}
if ( $_REQUEST['user_addr0'] == '' ) $_REQUEST['user_addr0']='武汉';
$upd = "update ".$xoopsDB->prefix("market_member")." set ";
$upd .= "user_name='".$_REQUEST['user_name0']."',";
$upd .= "user_sex='".$_REQUEST['user_sex0']."',";
$upd .= "user_birthday='".$_REQUEST['user_birthday0']."',";
$upd .= "user_addr='".$_REQUEST['user_addr0']."',";
$upd .= "user_mb='".$_REQUEST['user_mb0']."',";
$upd .= "user_tel='".$_REQUEST['user_tel0']."',";
$upd .= "user_idc='".$_REQUEST['user_idc0']."',";
$upd .= "user_xq='".$_REQUEST['user_xq0']."',";
$upd .= "user_disc='".$_Disc[$_REQUEST['auth00']]."',";
$upd .= "auth=".$_REQUEST['auth00'];
$upd .= " where store_id='".$_REQUEST['s_id0']."' and user_card='".$_REQUEST['user_card0']."'";
$up0 = $xoopsDB->queryF($upd);
if ( $up0 ) {
echo "<center>会员卡申请成功!";
echo "<hr /><input type='button' value='关闭窗口' onclick='returnValue=1;window.close();' /></center>\n";
} else {
echo "<center>会员卡申请失败,请仔细查找原因!";
echo "<hr /><input type='button' value='关闭窗口' onclick='returnValue=1;window.close();' /></center>\n";
}
} else {
## 会员添加前需要做领卡操作,即在数据表中记录卡号。未记录之卡号,将不能启用!
$que = "select store_id,user_card from ".$xoopsDB->prefix("market_member");
$que.= " where user_name='' and store_id='".$_REQUEST['s_id0']."' and auth<=0 order by user_card limit 0,1";
$res = $xoopsDB->query($que);
$pes = $xoopsDB->getRowsNum($res);
if ( $pes == 0 ) {
echo "您没有做批量领卡或数据表故障,请联系管理员!\n";
} else {
$imem = $xoopsDB->fetchrow($res);
?>
<script language='javascript'>
<!--
function check_cn() {
var m_cn = '<?php echo $imem[1]; ?>';
var th = '<?php echo $_REQUEST['th']; ?>';
var cnum = document.getElementById('cardnumber0').value;
if ( cnum != m_cn && th != 1 ) {
alert("会员卡号错误!\n应发卡号为:"+m_cn); return false;
} else {
var cardNumStr = String(document.getElementById('cardnumber0').value);
var reg = /^([0-9]{13})$/;
var flag = reg.test(cardNumStr);
if ( !flag ) {
alert('卡号错误,请仔细检查!');
return false;
}
document.getElementById('user_card0').value=cnum;
document.getElementById('user_birthday0').value=document.getElementById('ub_yy').value+'-'+document.getElementById('ub_mm').value+'-'+document.getElementById('ub_dd').value;
return true;
}
}
// -->
</script>
<form action='<?php echo $_SERVER['PHP_SELF']; ?>' method='post' name='BLXK' onSubmit='javascript:return check_cn();'>
<center><br />请扫入会员卡号:
<input type="text" name="cardnumber0" size="13" maxlength="13" onchange="javascript:check_cn();" />
<hr style='width:280px;color:#fa8;height:3px;' />
<input type='hidden' name='is_s9' value='1' />
<input type='hidden' name='s_id0' value='<?php echo $_REQUEST['s_id0']; ?>' />
<input type='hidden' name='user_birthday0' value='' />
<table border='1'>
<tr><th>项目</th><th>内容</th></tr>
<tr><td align='right'>姓名</td> <td align='left'><input type='text' name='user_name0' value='' /> </td></tr>
<tr><td align='right'>性别</td> <td align='left'><select name='user_sex0' size='1'><option value='男'>男</option><option value='女'>女</option></select> </td></tr>
<tr><td align='right'>会员卡号</td> <td aligh='left'><input type='text' name='user_card0' size='14' readonly /> </td></tr>
<tr><td align='right'>生日</td> <td aligh='left'>
<?php
echo "<select name='ub_yy'>\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 name='ub_mm'>\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 name='ub_dd'>\n";
for ( $i = 1; $i <= 31; $i++ ) {
echo "<option value='".$i."'"; if ( $i == date('d') ) echo " selected "; echo ">".$i."</option>\n";
}
echo "</select>日\n";
?>
</td></tr>
<tr><td align='right'>送货地址</td> <td align='left'><input type='text' id='user_addr0' name='user_addr0' value='武汉' /> </td></tr>
<tr><td align='right'>手机号</td> <td align='left'><input type='text' id='user_mb0' name='user_mb0' value='' /> </td></tr>
<tr><td align='right'>固定电话</td> <td align='left'><input type='text' id='user_tel0' name='user_tel0' value='' /> </td></tr>
<tr><td align='right'>证件号码</td> <td align='left'><input type='text' id='user_idc0' name='user_idc0' value='' /> </td></tr>
<tr><td align='right'>兴趣爱好</td> <td align='left'><textarea type='text' id='user_xq0' name='user_xq0'></textarea> </td></tr>
<tr><td align='right'>会员类别</td>
<td align='left'>
<select id='auth00' name='auth00' size='1'>
<?php
foreach ( $_Auth as $k => $v ) {
echo "<option value='".$k."' ";
echo $k==-4?'selected':'';
echo ">".$v."</option>\n";
}
?>
</select>
</td></tr>
</table>
<hr style='width:320px;color:#0a8;height:5px;' />
<input type="reset" name="M001" value="全部重填" />
<input type="submit" name="M001" value="提交会员资料" />
</center>
<?php
}
echo "</form>\n";
}
include_once '../../footer.php';
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -