productlx.php 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. <?
  2. include("../../config/conn.php");
  3. include("../../config/function.php");
  4. sesCheck_m();
  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. $sj=date("Y-m-d H:i:s");
  9. $uip=$_SERVER["REMOTE_ADDR"];
  10. //函数开始
  11. if($_GET[control]=="add"){
  12. zwzr();
  13. $bh=time()."-".$userid;
  14. createDir("../../upload/".$userid."/".$bh."/");
  15. $ty1id=intval($_POST[type1id]);
  16. $ty2id=intval($_POST[type2id]);
  17. $ty3id=intval($_POST[type3id]);
  18. $ty4id=intval($_POST[type4id]);
  19. $ty5id=intval($_POST[type5id]);
  20. intotable("yjcode_pro","bh,userid,sj,lastsj,uip,ty1id,ty2id,ty3id,ty4id,ty5id,zt,djl,xsnum,yhxs,ifxj,pf1,pf2,pf3,iftj,fhxs","'".$bh."',".$userid.",'".$sj."','".$sj."','".$uip."',".$ty1id.",".$ty2id.",".$ty3id.",".$ty4id.",".$ty5id.",99,0,0,1,0,5,5,5,0,1");
  21. deletetable("yjcode_fbhis where userid=".$userid." and ty1id=".$ty1id." and ty2id=".$ty2id." and ty3id=".$ty3id." and ty4id=".$ty4id." and ty5id=".$ty5id);
  22. intotable("yjcode_fbhis","userid,ty1id,ty2id,ty3id,ty4id,ty5id,sj,uip","".$userid.",".$ty1id.",".$ty2id.",".$ty3id.",".$ty4id.",".$ty5id.",'".$sj."','".$uip."'");
  23. $a=returncount("yjcode_fbhis where userid=".$userid);if($a>5){$b=$a-5;deletetable("yjcode_fbhis where userid=".$userid." order by sj asc limit ".$b);}
  24. php_toheader("product.php?bh=".$bh);
  25. }elseif($_GET[control]=="update"){
  26. zwzr();
  27. $ty1id=intval($_POST[type1id]);
  28. $ty2id=intval($_POST[type2id]);
  29. $ty3id=intval($_POST[type3id]);
  30. $ty4id=intval($_POST[type4id]);
  31. $ty5id=intval($_POST[type5id]);
  32. updatetable("yjcode_pro","ty1id=".$ty1id.",ty2id=".$ty2id.",ty3id=".$ty3id.",ty4id=".$ty4id.",ty5id=".$ty5id." where userid=".$userid." and id=".$_GET[id]);
  33. deletetable("yjcode_fbhis where userid=".$userid." and ty1id=".$ty1id." and ty2id=".$ty2id." and ty3id=".$ty3id." and ty4id=".$ty4id." and ty5id=".$ty5id);
  34. intotable("yjcode_fbhis","userid,ty1id,ty2id,ty3id,ty4id,ty5id,sj,uip","".$userid.",".$ty1id.",".$ty2id.",".$ty3id.",".$ty4id.",".$ty5id.",'".$sj."','".$uip."'");
  35. $a=returncount("yjcode_fbhis where userid=".$userid);if($a>5){$b=$a-5;deletetable("yjcode_fbhis where userid=".$userid." order by sj asc limit ".$b);}
  36. php_toheader("product.php?bh=".$_GET[bh]);
  37. }
  38. //函数结束
  39. ?>
  40. <html>
  41. <head>
  42. <meta http-equiv="x-ua-compatible" content="ie=7" />
  43. <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
  44. <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
  45. <title>会员中心 <?=webname?></title>
  46. <? include("../tem/cssjs.html");?>
  47. <link href="css/sell.css" rel="stylesheet" type="text/css" />
  48. <script language="javascript">
  49. //商品分类点击筛选
  50. function typeonc(){
  51. obj=options=$("#d1 option:selected");;
  52. ptype2.location="protype2.php?type1id="+options.val();
  53. ptype3.location="protype3.php";
  54. ptype4.location="protype4.php";
  55. ptype5.location="protype5.php";
  56. document.f1.type1id.value=options.val();
  57. document.f1.type2id.value=0;
  58. document.f1.type3id.value=0;
  59. document.f1.type4id.value=0;
  60. document.f1.type5id.value=0;
  61. }
  62. function tjadd(){
  63. if(document.f1.type1id.value=="0"){alert("请选择商品类别");return false;}
  64. layer.open({type: 2,content: '正在提交',shadeClose:false});
  65. f1.action="productlx.php?control=add";
  66. }
  67. function tjupdate(x){
  68. if(document.f1.type1id.value=="0"){alert("请选择商品类别");return false;}
  69. layer.open({type: 2,content: '正在提交',shadeClose:false});
  70. f1.action="productlx.php?control=update&id=<?=$_GET[id]?>"+"&bh="+x;
  71. }
  72. </script>
  73. </head>
  74. <body>
  75. <? include("topuser.php");?>
  76. <div class="bfbtop2 box">
  77. <div class="d1" onClick="gourl('productlist.php')"><img src="img/topleft1.png" height="21" /></div>
  78. <div class="d2">设置分类</div>
  79. <div class="d3"></div>
  80. </div>
  81. <!--begin-->
  82. <? if($_GET[action]==""){?>
  83. <form name="f1" method="post" onSubmit="return tjadd()">
  84. <input type="hidden" name="type1id" value="0" />
  85. <input type="hidden" name="type2id" value="0" />
  86. <input type="hidden" name="type3id" value="0" />
  87. <input type="hidden" name="type4id" value="0" />
  88. <input type="hidden" name="type5id" value="0" />
  89. <div class="uk box">
  90. <div class="d1">一级分类<span class="s1"></span></div>
  91. <div class="d2">
  92. <select name="d1" id="d1" style="font-size:13px;" onChange="typeonc()">
  93. <option value="">点击选择一级分类</option>
  94. <? while1("*","yjcode_type where admin=1 order by xh asc");while($row1=mysql_fetch_array($res1)){?>
  95. <option value="<?=$row1[id]?>"><?=$row1[type1]?></option>
  96. <? }?>
  97. </select>
  98. </div>
  99. <div class="d3"><img src="../img/rightjian.png" height="13" /></div>
  100. </div>
  101. <div class="uk box">
  102. <div class="d1">二级分类<span class="s1"></span></div>
  103. <div class="d2">
  104. <iframe name="ptype2" id="ptype2" height="30" style="margin-left:-4px;" width="100%" border="0" frameborder="0"></iframe>
  105. </div>
  106. <div class="d3"><img src="../img/rightjian.png" height="13" /></div>
  107. </div>
  108. <div class="uk box">
  109. <div class="d1">三级分类<span class="s1"></span></div>
  110. <div class="d2">
  111. <iframe name="ptype3" id="ptype3" height="30" width="100%" border="0" frameborder="0"></iframe>
  112. </div>
  113. <div class="d3"><img src="../img/rightjian.png" height="13" /></div>
  114. </div>
  115. <div class="uk box">
  116. <div class="d1">四级分类<span class="s1"></span></div>
  117. <div class="d2">
  118. <iframe name="ptype4" id="ptype4" height="30" width="100%" border="0" frameborder="0"></iframe>
  119. </div>
  120. <div class="d3"><img src="../img/rightjian.png" height="13" /></div>
  121. </div>
  122. <div class="uk box">
  123. <div class="d1">五级分类<span class="s1"></span></div>
  124. <div class="d2">
  125. <iframe name="ptype5" id="ptype5" height="30" width="100%" border="0" frameborder="0"></iframe>
  126. </div>
  127. <div class="d3"><img src="../img/rightjian.png" height="13" /></div>
  128. </div>
  129. <div class="fbbtn box">
  130. <div class="d1"><? tjbtnr_m("下一步")?></div>
  131. </div>
  132. </form>
  133. <?
  134. }elseif($_GET[action]=="update"){
  135. while0("*","yjcode_pro where id=".$_GET[id]."");if(!$row=mysql_fetch_array($res)){php_toheader("productlist.php");}
  136. ?>
  137. <form name="f1" method="post" onSubmit="return tjupdate('<?=$row[bh]?>')">
  138. <input type="hidden" name="type1id" value="<?=$row[ty1id]?>" />
  139. <input type="hidden" name="type2id" value="<?=$row[ty2id]?>" />
  140. <input type="hidden" name="type3id" value="<?=$row[ty3id]?>" />
  141. <input type="hidden" name="type4id" value="<?=$row[ty4id]?>" />
  142. <input type="hidden" name="type5id" value="<?=$row[ty5id]?>" />
  143. <div class="uk box">
  144. <div class="d1">一级分类<span class="s1"></span></div>
  145. <div class="d2">
  146. <select name="d1" id="d1" style="font-size:13px;" onChange="typeonc()">
  147. <option value="">点击选择一级分类</option>
  148. <? while1("*","yjcode_type where admin=1 order by xh asc");while($row1=mysql_fetch_array($res1)){?>
  149. <option value="<?=$row1[id]?>"<? if($row1[id]==$row[ty1id]){?> selected<? }?>><?=$row1[type1]?></option>
  150. <? }?>
  151. </select>
  152. </div>
  153. <div class="d3"><img src="../img/rightjian.png" height="13" /></div>
  154. </div>
  155. <div class="uk box">
  156. <div class="d1">二级分类<span class="s1"></span></div>
  157. <div class="d2">
  158. <iframe src="protype2.php?type1id=<?=$row[ty1id]?>&nid=<?=$row[ty2id]?>" name="ptype2" id="ptype2" height="30" style="margin-left:-4px;" width="100%" border="0" frameborder="0"></iframe>
  159. </div>
  160. <div class="d3"><img src="../img/rightjian.png" height="13" /></div>
  161. </div>
  162. <div class="uk box">
  163. <div class="d1">三级分类<span class="s1"></span></div>
  164. <div class="d2">
  165. <iframe src="protype3.php?type1id=<?=$row[ty1id]?>&type2id=<?=$row[ty2id]?>&nid=<?=$row[ty3id]?>" name="ptype3" id="ptype3" height="30" width="100%" border="0" frameborder="0"></iframe>
  166. </div>
  167. <div class="d3"><img src="../img/rightjian.png" height="13" /></div>
  168. </div>
  169. <div class="uk box">
  170. <div class="d1">四级分类<span class="s1"></span></div>
  171. <div class="d2">
  172. <iframe src="protype4.php?type1id=<?=$row[ty1id]?>&type2id=<?=$row[ty2id]?>&type3id=<?=$row[ty3id]?>&nid=<?=$row[ty4id]?>" name="ptype4" id="ptype4" height="30" width="100%" border="0" frameborder="0"></iframe>
  173. </div>
  174. <div class="d3"><img src="../img/rightjian.png" height="13" /></div>
  175. </div>
  176. <div class="uk box">
  177. <div class="d1">五级分类<span class="s1"></span></div>
  178. <div class="d2">
  179. <iframe src="protype5.php?type1id=<?=$row[ty1id]?>&type2id=<?=$row[ty2id]?>&type3id=<?=$row[ty3id]?>&type4id=<?=$row[ty4id]?>&nid=<?=$row[ty5id]?>" name="ptype5" id="ptype5" height="30" width="100%" border="0" frameborder="0"></iframe>
  180. </div>
  181. <div class="d3"><img src="../img/rightjian.png" height="13" /></div>
  182. </div>
  183. <div class="fbbtn box">
  184. <div class="d1"><? tjbtnr_m("下一步")?></div>
  185. </div>
  186. </form>
  187. <? }?>
  188. <!--end-->
  189. </body>
  190. </html>