📄 sp_store.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_once '../head_inc.php';xoops_cp_header();include 'admhead.php';echo "<span style='font-size:18px;color:#8dff8d;'>门店信息管理</span><br />\n";?><nobr><select id='sele_sto' name="sele_sto" size="1" onchange="javascript:window.location='<?php echo $PHP_SELF; ?>?s_id7='+this.options[this.selectedIndex].value;"><?php$que = "select store_id,s_name from ".$xoopsDB->prefix("market_store");$que.= " where user_id=".$xoopsUser->getVar('uid')." order by store_id";$res = $xoopsDB->queryF($que);## $rnu = $xoopsDB->getRowsNum($res);echo "<option value='___'>添加新门店资料</option>";while($row = $xoopsDB->fetchrow($res)) { echo "<option value='".$row[0]."' "; echo ($row[0] == $_REQUEST['s_id7']?'selected':''); echo " >".$row[0].":".$row[1]."</option>";}?></select><font style="font-size:14px;color:#F00;">注:如果不做修改操作,请不要点选此处!</font></nobr><?phpif (isset($_REQUEST['vok'])) { if ( $_REQUEST['operation'] == "add" ) { $chg = "insert into ".$xoopsDB->prefix("market_store")." set "; $chg.= " bh=0,"; $chg.= "store_id='".$_REQUEST['store_id0']."',"; } elseif ( $_REQUEST['operation'] == "upd" ) { $chg = "update ".$xoopsDB->prefix("market_store")." set "; } else { echo "<font style='font-size:18px;color:#F00;'>遇到严重的参数传递错误,请联系管理员!</font><hr />\n"; xoops_cp_footer(); exit(); } $chg.= "user_id='".$_REQUEST['user_id0']."',"; $chg.= "s_name='".$_REQUEST['s_name0']."',"; $chg.= "s_addr='".$_REQUEST['s_addr0']."',"; $chg.= "s_phone='".$_REQUEST['s_phone0']."',"; $chg.= "s_maname='".$_REQUEST['s_maname0']."',"; $chg.= "s_m_mb='".$_REQUEST['s_m_mb0']."',"; $chg.= "cci='".$_REQUEST['cci0']."',"; $chg.= "jfxs='".$_REQUEST['jfxs0']."',"; $chg.= "hgxs='".$_REQUEST['hgxs0']."',"; $chg.= "hgzk='".$_REQUEST['hgzk0']."',"; $chg.= "hgfs='".$_REQUEST['hgfs0']."',"; $chg.= "md_href='".$_REQUEST['md_href0']."',"; $chg.= "md_target='".$_REQUEST['md_target0']."',"; $chg.= "shbz='".$_REQUEST['shbz0']."',"; $chg.= "bybz='".$_REQUEST['bybz0']."',"; $chg.= "bz='".$_REQUEST['bz0']."'"; if ( $_REQUEST['operation'] == "upd" ) { $chg.= " where store_id='".$_REQUEST['store_id0']."'"; } ## echo $chg; $st0 = $xoopsDB->queryF($chg); if ( ! $st0 ) echo "<hr />数据处理出错,请联系管理员!\n";}?><form action="<?php echo $PHP_SELF; ?>" method="post" name="add_seri"><table border="0" name="BB1"><?phpif (isset($_REQUEST['s_id7']) && $_REQUEST['s_id7'] != '___' ) { $U = true; ## 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 $que = "select store_id,user_id,s_name,s_addr,s_phone,s_maname,s_m_mb,cci,bz,jfxs,bybz,hgxs,hgzk,hgfs,md_href,md_target,shbz from "; $que .=$xoopsDB->prefix("market_store")." where store_id='".$_REQUEST['s_id7']."' limit 0,1"; $res = $xoopsDB->query($que); ## echo $que."<hr />\n"; ## $rnu = $xoopsDB->getRowsNum($res); $row = $xoopsDB->fetchrow($res);}?> <tr><td>门店代码:</td><td><input type="text" id='store_id0' name="store_id0" size="30" maxlength="21" value="<?php if ($U) echo $row[0]; ?>" <?php if ($U) echo "readonly" ?> /></td><td></td></tr> <tr><td>系统用户:</td><td><input type="text" id='user_id0' name="user_id0" size="30" maxlength="10" value="<?php if ($U) echo $row[1]; ?>" readonly /></td><td align="left"><select id='sele_uid' name="sele_uid" size="1" onchange="javascript:document.getElementById('user_id0').value=this.options[this.selectedIndex].value;"><?php$que = "select groupid from ".$xoopsDB->prefix("groups");$que.= " where name in (".$_Ugrp.")";$res = $xoopsDB->query($que);$groups1 = '';while ( $grps = $xoopsDB->fetchrow($res) ) { $groups1 .= $grps[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->queryF($que);## $rnu = $xoopsDB->getRowsNum($res);$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>门店名号:</td><td><input type="text" id='s_name0' name="s_name0" size="30" maxlength="40" value="<?php if ($U) echo $row[2]; ?>" /></td><td></td></tr><tr><td>门店地址:</td><td><input type="text" id='s_addr0' name="s_addr0" size="30" maxlength="160" value="<?php if ($U) echo $row[3]; ?>" /></td><td></td></tr><tr><td>门店电话:</td><td><input type="text" id='s_phone0' name="s_phone0" size="30" maxlength="60" value="<?php if ($U) echo $row[4]; ?>" /></td><td align="left">多个请用逗号分隔</td></tr><tr><td>店长姓名:</td><td><input type="text" id='s_maname0' name="s_maname0" size="30" maxlength="29" value="<?php if ($U) echo $row[5]; ?>" /></td><td></td></tr><tr><td>店长手机:</td><td><input type="text" id='s_m_mb0' name="s_m_mb0" size="30" maxlength="39" value="<?php if ($U) echo $row[6]; ?>" /></td><td align="left">多个请用逗号分隔</td></tr><tr><td>下属级别:</td><td><input type="text" id='cci0' name="cci0" value="<?php if ($U) echo $row[7]; ?>" readonly /></td><td align="left"><select id='sele_cci' name="sele_cci" size="1" onchange="javascript:document.getElementById('cci0').value=this.options[this.selectedIndex].value;"><?phpfor ( $i=0; $i<255; $i++ ) { echo "<option value='".$i."' "; echo $i==$row[7]?'selected':''; echo " >下辖".$i."个小组</option>\n";}?></select></td></tr><tr><td>积分系数:</td><td><input type="text" id='jfxs0' name="jfxs0" value="<?php if ($U) echo $row[9]; ?>" readonly /></td><td><select id='sele_jfxs' name="sele_jfxs" size="1" onchange="javascript:document.getElementById('jfxs0').value=this.options[this.selectedIndex].value;"><?php$jf = array( '0.001'=>'每仟元积1分', '0.01'=>'每佰元积1分', '0.1'=>'每拾元积1分', '1'=>'每壹圆积1分', '10'=>'每壹圆积10分', '100'=>'每壹圆积100分', '1000'=>'每壹圆积1000分');while(list($k,$v)=each($jf)){ echo "<option value='".$k."' "; echo ($k == $row[9]?'selected':''); echo " >".$v."</option>";}?></select></td></tr><tr><td>换购系数:</td><td><input type="text" id='hgxs0' name="hgxs0" value="<?php if ($U) echo $row[11]; ?>" readonly /></td><td><select id='sele_hgxs' name="sele_hgxs" size="1" onchange="javascript:document.getElementById('hgxs0').value=this.options[this.selectedIndex].value;"><?php$jf = array( '0.001'=>'每仟元扣1分', '0.01'=>'每佰元扣1分', '0.1'=>'每拾元扣1分', '1'=>'每壹圆扣1分', '10'=>'每壹圆扣10分', '100'=>'每壹圆扣100分', '1000'=>'每壹圆扣1000分');while(list($k,$v)=each($jf)){ echo "<option value='".$k."' "; echo ($k == $row[11]?'selected':''); echo " >".$v."</option>";}?></select></td></tr><tr><td>换购折扣:</td><td><input type="text" id='hgzk0' name="hgzk0" size="30" maxlength="160" value="<?php if ($U) echo $row[12]; ?>" /></td><td>会员积分换购折上折</td></tr><tr><td>最低分数:</td><td><input type="text" id='hgfs0' name="hgfs0" size="30" maxlength="160" value="<?php if ($U) echo $row[13]; ?>" /></td><td>会员换购最低分数</td></tr><tr><td>门店网页:</td><td><input type="text" id='md_href0' name="md_href0" size="30" maxlength="100" value="<?php if ($U) echo $row[14]; ?>" /></td><td>站内页面可以路径开首 /modules/...</td></tr><tr><td>打开方式:</td><td><input type="text" id='md_target0' name="md_target0" size="20" maxlength="20" value="<?php if ($U) echo $row[15]; ?>" readonly /></td><td><select id='sele_target' name="sele_target" size="1" onchange="javascript:document.getElementById('md_target0').value=this.options[this.selectedIndex].value;"><?php$jf = array( '_'=>'请选择网页打开方式', '_BLANK'=>'新窗口', '_self'=>'本窗口', '_parent'=>'父窗口', '_top'=>'T本窗口T', '_other'=>'其它窗口');while(list($k,$v)=each($jf)){ echo "<option value='".$k."' "; echo ($k == $row[15]?'selected':''); echo " >".$v."</option>";}?></select></td></tr><tr><td>标志设置:</td><td><input type="text" id='bybz0' name="bybz0" size="51" maxlength="64" value="<?php if ($U) echo $row[10]; ?>" readonly /></td></tr><tr><td colspan='3'><?phpecho "<nobr>\n";## echo "<hr /><pre>\n";## print_r($bybz);## echo "<hr /></pre>\n";for ( $o=0; $o<count($bybz); $o++ ) { echo "<select name='bybz0_".$o."' id='bybz0_".$o."' size='5' onchange='javascript:cre_bybz();'>\n"; while( list($x,$c)=each($bybz[$o]) ) { echo "<option value='".$x."' "; if ( $U && $row[10] !='' ) echo ($x == substr($row[10],$o,1)?'selected':''); else echo ($x == '7'?'selected':''); echo ($x == '9'?' title="停用此项功能" ':''); echo " >".$c."</option>\n"; } echo "</select>\n"; if ( $o % 6 == 5 ) echo "<br />\n";}echo "</nobr>\n";?><script language='javascript'><!-- function cre_bybz() { var bybz6=''; for ( var i = 0; i < <?php echo count($bybz); ?>; i++ ) { var si = String(i); bybz6 += String(document.getElementById('bybz0_'+si).options[document.getElementById('bybz0_'+si).selectedIndex].value); } document.getElementById('bybz0').value=bybz6; }// --></script></td></tr><tr><td>审核标志:</td><td><input type="text" id='shbz0' name="shbz0" size="2" maxlength="2" value="<?php if ($U) echo $row[16]; ?>" readonly /></td><td align='left'><select id='sele_shbz' name="sele_shbz" size="1" onchange="javascript:document.getElementById('shbz0').value=this.options[this.selectedIndex].value;"><?php$jf = array( '_'=>'开店审核标志', '1'=>'已审核', '0'=>'未审核');while(list($k,$v)=each($jf)){ echo "<option value='".$k."' "; echo ($k == $row[16]?'selected':''); echo " >".$v."</option>";}?></select></td></tr><tr><td colspan="3" align="center">门 店 说 明 </td></tr><tr><td colspan="3"><textarea id='bz0' name="bz0"><?php if ($U) echo $row[8]; ?></textarea></td></tr><tr><td colspan="3"><p align="center"><input type="hidden" id='vok' name="vok" value="1" /><?phpif ($U) echo '<input type="hidden" id="operation" name="operation" value="upd" />'."\n";else echo '<input type="hidden" id="operation" name="operation" value="add" />'."\n";?><input type="reset" name="R01" value="重填" /> <input type="submit" name="S01" value="<?php if($U) echo "修改记录"; else echo "添加记录"; ?>" /></p></td></tr></table></form><?phpxoops_cp_footer();?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -