| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202 |
- <?
- include("../config/conn.php");
- include("../config/function.php");
- require("../config/tpclass.php");
- sesCheck();
- $sj=date("Y-m-d H:i:s");
- $bh=returndeldian($_GET[bh]);
- $userid=returnuserid($_SESSION[SHOPUSER]);
- while0("*","yjcode_pro where userid=".$userid." and bh='".$bh."'");if(!$row=mysql_fetch_array($res)){php_toheader("productlist.php");}
- $tit=$row[tit];
- $id=intval($_GET[id]);
- while0("*","yjcode_taocan where userid=".$userid." and id=".$id);if(!$row=mysql_fetch_array($res)){php_toheader("taocanlist.php?bh=".$bh);}
-
- //函数开始
- if($_GET[control]=="update"){
- zwzr();
- if(panduan("*","yjcode_taocan where userid=".$userid." and probh='".$bh."' and admin is null and tit='".sqlzhuru($_POST[t1])."' and id<>".$id)==1){Audit_alert("该套餐内容已存在!","taocan.php?id=".$_GET[id]."&bh=".$bh);}
-
- $kcnum=sqlzhuru($_POST[tkcnum]);if(!is_numeric($kcnum)){$kcnum=0;}
- $fhxs=intval(sqlzhuru($_POST[Rfhxs]));
- updatetable("yjcode_taocan","tit='".sqlzhuru($_POST[t1])."',
- xh=".sqlzhuru($_POST[t2]).",
- money1=".sqlzhuru($_POST[tmoney1]).",
- money2=".sqlzhuru($_POST[tmoney2]).",
- zt=0,
- fhxs=".$fhxs.",
- wpurl='".sqlzhuru($_POST[twpurl])."',
- wppwd='".sqlzhuru($_POST[twppwd])."',
- wppwd1='".sqlzhuru($_POST[twppwd1])."',
- kcnum=".$kcnum."
- where id=".$id);
-
- updatetable("yjcode_taocan","tit='".sqlzhuru($_POST[t1])."' where tit='".sqlzhuru($_POST[oldty1])."' and probh='".$bh."'");
-
- uploadtpnodata(2,"upload/".$row[userid]."/".$row[probh]."/","tc".$id.".png","allpic",350,350,150,150,"no");
- //上传B
- if(3==$fhxs){
- $up1=$_FILES["inp1"]["name"];
- if(!empty($up1)){
- $mc=MakePassAll(15)."-".time()."-".$userid.".".returnhz($up1);
- $lj="../upload/".$userid."/".$bh."/";
- move_uploaded_file($_FILES["inp1"]['tmp_name'],$lj.$mc);
- delFile($lj.$row[upf]);
- updatetable("yjcode_taocan","upf='".$mc."' where id=".$id." and userid=".$userid);
- }
- }
- //上传E
- //卡密B
- if(4==$fhxs){
- $c=str_replace("\r","",($_POST[s1]));
- $d=preg_split("/\n/",$c);
- for($i=0;$i<=count($d);$i++){
- if(!empty($d[$i])){
- $e=preg_split("/\s/",$d[$i]);
- if(panduan("probh,tcid,userid,ka","yjcode_taocan_kc where probh='".$bh."' and ka='".$ka."' and tcid=".$id." and userid=".$userid)==0){
- $mi="";
- if(count($e)>=2){for($ei=1;$ei<count($e);$ei++){$mi=$mi." ".$e[$ei];}}
- intotable("yjcode_taocan_kc","probh,tcid,userid,ka,mi,ifok","'".$bh."',".$id.",".$userid.",'".$e[0]."','".$mi."',0");
- }
- }
- }
- kamikc_tc($bh,$id);
- }
- //卡密E
-
- php_toheader("taocan.php?t=suc&id=".$id."&bh=".$bh);
- }elseif($_GET[control]=="del"){
- zwzr();
- delFile("../upload/".$row[userid]."/".$row[probh]."/tc".$row[id].".png");
- delFile("../upload/".$row[userid]."/".$row[probh]."/tc".$row[id]."-1.png");
- php_toheader("taocan.php?t=suc&id=".$id."&bh=".$bh);
- }
- //函数结果
- ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="x-ua-compatible" content="ie=7" />
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
- <title>用户管理面板 - <?=webname?></title>
- <? include("cssjs.html");?>
- <link href="css/sell.css" rel="stylesheet" type="text/css" />
- <style type="text/css">
- .userright .rkuang{margin-top:0;}
- </style>
- <script language="javascript">
- function tj(){
- if((document.f1.t1.value).replace(/\s/,"")==""){alert("请输入套餐说明!");document.f1.t1.focus();return false;}
- if((document.f1.tmoney2.value).replace(/\s/,"")==""){alert("请输入原价!");document.f1.tmoney2.focus();return false;}
- if((document.f1.tmoney1.value).replace(/\s/,"")==""){alert("请输入优惠价!");document.f1.tmoney1.focus();return false;}
- if((document.f1.t2.value).replace(/\s/,"")=="" || isNaN(document.f1.t2.value)){alert("请输入有效的排序号!");document.f1.t2.focus();return false;}
- layer.msg('正在提交', {icon: 16 ,time: 0,shade :0.25});
- f1.action="taocan.php?control=update&id=<?=$row[id]?>&bh=<?=$bh?>";
- }
- function fhxsonc(x){
- for(i=0;i<=4;i++){
- d=document.getElementById("fhxs"+i);if(d){d.style.display="none";}
- }
- d=document.getElementById("fhxs"+x);if(d){d.style.display="";}
- if(x==4){document.getElementById("kcuk").style.display="none";}else{document.getElementById("kcuk").style.display="";}
- }
- function deltp(){
- if(confirm("确定要删除该图标吗?")){location.href="taocan.php?id=<?=$id?>&bh=<?=$bh?>&control=del";}else{return false;}
- }
- </script>
- </head>
- <body>
- <div class="userright">
- <!--白B-->
- <div class="rkuang">
-
- <? systs("恭喜您,操作成功!","taocan.php?id=".$id."&bh=".$bh)?>
-
- <form name="f1" method="post" onsubmit="return tj()" enctype="multipart/form-data">
- <input type="hidden" value="<?=$row[tit]?>" name="oldty1" />
- <ul class="uk">
- <li class="l1">套餐说明:</li>
- <li class="l2"><input type="text" class="inp" name="t1" value="<?=$row[tit]?>" /></li>
- <li class="l1">套餐图标:</li>
- <li class="l2"><span class="finp"><input type="file" class="inp1" name="inp2" id="inp2" size="15" accept=".jpg,.gif,.jpeg,.png"> 推荐尺寸:350*350,不上传则显示文字形式</span></li>
- <? $ntp="../upload/".$row[userid]."/".$row[probh]."/tc".$row[id].".png";if(is_file($ntp)){?>
- <li class="l5"></li>
- <li class="l6"><img src="<?=$ntp?>" width="55" height="55" /><br><br>[<a href="javascript:void(0);" onclick="deltp()">删除</a>]</li>
- <? }?>
- <li class="l1">原价:</li>
- <li class="l2"><input type="text" class="inp" name="tmoney2" value="<?=$row[money2]?>" /> 元</li>
- <li class="l1">优惠价:</li>
- <li class="l2"><input type="text" class="inp" name="tmoney1" value="<?=$row[money1]?>" /> 元</li>
- <li class="l1">排序:</li>
- <li class="l2"><input type="text" class="inp" name="t2" value="<?=$row[xh]?>" /> <span class="fd">序号越小,越靠前</span></li>
- </ul>
-
- <ul class="uk uk0" id="kcuk">
- <li class="l1"><span class="red">*</span> 库存量:</li>
- <li class="l2"><input class="inp" name="tkcnum" value="<?=returnjgdw($row[kcnum],"",0)?>" size="10" type="text"/> <span class="fd">(如果是点卡交易类,库存值无需填写,将自动读取)</span></li>
- </ul>
- <ul class="uk uk0">
- <li class="l1 red"><span class="red">*</span> 发货形式:</li>
- <li class="l2">
- <label><input name="Rfhxs" type="radio" value="0" onclick="fhxsonc(0)" <? if(0==$row[fhxs]){?>checked="checked"<? }?> /> 保持一致</label>
- <? if(strstr($rowcontrol[fhxs],"1") || empty($rowcontrol[fhxs])){?>
- <label><input name="Rfhxs" type="radio" value="1" onclick="fhxsonc(1)" <? if(1==$row[fhxs]){?>checked="checked"<? }?> /> 手动发货</label>
- <? }?>
- <? if(strstr($rowcontrol[fhxs],"2") || empty($rowcontrol[fhxs])){?>
- <label><input name="Rfhxs" type="radio" value="2" onclick="fhxsonc(2)" <? if(2==$row[fhxs]){?>checked="checked"<? }?> /> 网盘下载</label>
- <? }?>
- <? if(strstr($rowcontrol[fhxs],"3") || empty($rowcontrol[fhxs])){?>
- <label><input name="Rfhxs" type="radio" value="3" onclick="fhxsonc(3)" <? if(3==$row[fhxs]){?>checked="checked"<? }?> /> 网站下载</label>
- <? }?>
- <? if(strstr($rowcontrol[fhxs],"4") || empty($rowcontrol[fhxs])){?>
- <label><input name="Rfhxs" type="radio" value="4" onclick="fhxsonc(4)" <? if(4==$row[fhxs]){?>checked="checked"<? }?> /> 点卡交易</label>
- <? }?>
- <? if(strstr($rowcontrol[fhxs],"5") || empty($rowcontrol[fhxs])){?>
- <label><input name="Rfhxs" type="radio" value="5" onclick="fhxsonc(5)" <? if(5==$row[fhxs]){?>checked="checked"<? }?> /> 实物快递</label>
- <? }?>
- </li>
- </ul>
- <ul class="uk uk0" id="fhxs2" style="display:none;">
- <li class="l1">网盘地址:</li>
- <li class="l2"><input class="inp" name="twpurl" value="<?=$row[wpurl]?>" size="80" type="text"/></li>
- <li class="l1">网盘密码:</li>
- <li class="l2"><input class="inp" name="twppwd" value="<?=$row[wppwd]?>" size="20" type="text"/></li>
- <li class="l1">解压密码:</li>
- <li class="l2"><input class="inp" name="twppwd1" value="<?=$row[wppwd1]?>" size="20" type="text"/></li>
- </ul>
- <ul class="uk uk0" id="fhxs3" style="display:none;">
- <li class="l1">上传文件:</li>
- <li class="l2"><input type="file" name="inp1" id="inp1" size="25"></li>
- <? if(!empty($row[upf])){?>
- <li class="l1">文件预览:</li>
- <li class="l21">【<a href="../upload/<?=$row[userid]?>/<?=$row[bh]?>/<?=$row[upf]?>" class="blue" target="_blank">点击预览</a>】</li>
- <? }?>
- </ul>
- <ul class="uk uk0" id="fhxs4" style="display:none;">
- <li class="l1">库存:</li>
- <li class="l21"><strong class="red"><?=$row[kcnum]?>件</strong> [<a href="kclist_tc.php?bh=<?=$bh?>&tcid=<?=$row[id]?>" target="_blank" class="blue">管理库存</a>]</li>
- <li class="l1">说明:</li>
- <li class="l21 red">导入格式为卡号+空格+密码(可跟上附加内容),一行一组,如AAAAA BBBBB</li>
- <li class="l9">卡密内容:</li>
- <li class="l10"><textarea name="s1"></textarea></li>
- </ul>
- <ul class="uk uk0">
- <li class="l3"><? tjbtnr("保存修改","taocanlist.php?bh=".$bh);?></li>
- </ul>
- </form>
- </div>
- <!--白E-->
- </div>
- <script language="javascript">
- fhxsonc(<?=$row[fhxs]?>);
- </script>
- </body>
- </html>
|