protype2.php 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?
  2. include("../config/conn.php");
  3. include("../config/function.php");
  4. sesCheck();
  5. $sqluser="select * from yjcode_user where uid='".$_SESSION[SHOPUSER]."' and shopzt=2";mysql_query("SET NAMES 'GBK'");$resuser=mysql_query($sqluser);
  6. if(!$rowuser=mysql_fetch_array($resuser)){php_toheader("openshop3.php");}
  7. $userid=$rowuser[id];
  8. $bh=$_GET[bh];
  9. while0("*","yjcode_protype where userid=".$userid." and admin=2 and bh='".$bh."'");
  10. if(!$row=mysql_fetch_array($res)){Audit_alert("来源错误","protypelist.php","parent.");}
  11. if($_GET[control]=="update"){
  12. zwzr();
  13. if(panduan("*","yjcode_protype where admin=2 and name1='".sqlzhuru($_POST[tname1])."' and userid=".$userid." and name2='".sqlzhuru($_POST[tname2])."' and id<>".$row[id])==1)
  14. {Audit_alert("该分组已存在!","protype2.php?bh=".$bh);}
  15. updatetable("yjcode_protype","name2='".sqlzhuru($_POST[tname2])."',xh=".sqlzhuru($_POST[txh]).",zt=0 where id=".$row[id]);
  16. php_toheader("protype2.php?t=suc&bh=".$bh);
  17. }
  18. ?>
  19. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  20. <html xmlns="http://www.w3.org/1999/xhtml">
  21. <head>
  22. <meta http-equiv="x-ua-compatible" content="ie=7" />
  23. <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
  24. <title>商品分组</title>
  25. <style type="text/css">
  26. body{margin:0;font-size:12px;text-align:center;color:#333;word-wrap:break-word;font-family:"Microsoft YaHei",微软雅黑,"MicrosoftJhengHei",华文细黑,STHeiti,MingLiu;}
  27. *{margin:0 auto;padding:0;}
  28. ul{list-style-type:none;margin:0;padding:0;}
  29. .uk{float:left;width:300px;font-size:14px;padding:10px;}
  30. .uk li{float:left;}
  31. .uk .l1{width:79px;padding:7px 10px 0 0;height:36px;text-align:right;}
  32. .uk .l2{width:211px;height:43px;}
  33. .uk .l2 .inp{float:left;border:#CCCCCC solid 1px;height:27px;padding:4px 0 0 5px;width:204px;outline:medium;}
  34. .uk .l3{width:211px;padding-left:89px;}
  35. .uk .l3 input{cursor:pointer;float:left;width:211px;border:0;font-weight:700;color:#fff;background-color:#ff6600;height:35px;}
  36. </style>
  37. <script language="javascript" src="../js/jquery.min.js"></script>
  38. <script language="javascript" src="../js/layer.js"></script>
  39. <script language="javascript">
  40. function tj(){
  41. layer.msg('正在保存', {icon: 16 ,time: 0,shade :0.25});
  42. f1.action="protype2.php?control=update&bh=<?=$bh?>";
  43. }
  44. <? if($_GET["t"]=="suc"){?>
  45. parent.location.reload();
  46. <? }?>
  47. </script>
  48. </head>
  49. <body>
  50. <form name="f1" method="post" onsubmit="return tj()">
  51. <input type="hidden" value="type" name="yjcode" />
  52. <ul class="uk">
  53. <li class="l1">一级分组:</li>
  54. <li class="l2"><input type="text" class="inp" readonly="readonly" name="tname1" value="<?=$row[name1]?>" /></li>
  55. <li class="l1">子类名称:</li>
  56. <li class="l2"><input type="text" class="inp" name="tname2" value="<?=$row[name2]?>" /></li>
  57. <li class="l1">分组序号:</li>
  58. <li class="l2"><input type="text" class="inp" name="txh" value="<?=$row[xh]?>" /></li>
  59. <li class="l3"><? tjbtnr("保存修改")?></li>
  60. </ul>
  61. </form>
  62. </body>
  63. </html>