noRefresh.php 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  1. <?
  2. set_time_limit(0);
  3. require("../config/conn.php");
  4. require("../config/function.php");
  5. sesCheck();
  6. $admin=$_GET[admin];
  7. $bhid=$_GET[idbh];
  8. $tab=$_GET[tab];
  9. $sqluser="select * from yjcode_user where uid='".$_SESSION[SHOPUSER]."'";mysql_query("SET NAMES 'GBK'");$resuser=mysql_query($sqluser);
  10. $rowuser=mysql_fetch_array($resuser);
  11. $userid=$rowuser[id];
  12. $sj=date("Y-m-d H:i:s");
  13. switch($admin){
  14. case "1": //上下架
  15. $nb=preg_split("/,/",$bhid);
  16. for($i=0;$i<count($nb);$i++){
  17. while0("bh,ifxj",$tab." where bh='".$nb[$i]."' and userid=".$userid);while($row=mysql_fetch_array($res)){
  18. if(0==$row[ifxj]){$nn=1;}else{$nn=0;}
  19. updatetable($tab,"ifxj=".$nn." where bh='".$row[bh]."'");
  20. }
  21. }
  22. break;
  23. case "2": //删除商品
  24. $nb=preg_split("/,/",$bhid);
  25. for($i=0;$i<count($nb);$i++){
  26. while1("bh,userid","yjcode_pro where bh='".$nb[$i]."' and userid=".$userid);
  27. if($row1=mysql_fetch_array($res1)){delproduct($row1[bh],$row1[userid]);}
  28. }
  29. break;
  30. case "3": //删除单人任务
  31. $nb=preg_split("/,/",$bhid);
  32. for($i=0;$i<count($nb);$i++){
  33. while0("*","yjcode_task where userid=".$userid." and bh='".$nb[$i]."' and taskty=0 and (zt=0 or zt=1 or zt=2 or zt=5 or zt=6 or zt=7 or zt=9 or zt=10)");
  34. if($row=mysql_fetch_array($res)){
  35. if(0==$row[zt] || 1==$row[zt]){
  36. if($row[money4]>0){
  37. PointIntoM($row[userid],"删除任务,退回订金",$row[money4]);
  38. PointUpdateM($row[userid],$row[money4]);
  39. }
  40. }
  41. if(!empty($row[jsbao]) && (0==$row[zt] || 3==$row[zt] || 4==$row[zt] || 8==$row[zt])){
  42. while1("*","yjcode_taskhf where bh='".$row[bh]."'");if($row1=mysql_fetch_array($res1)){
  43. PointIntoB($row1[useridhf],"删除任务,退还保证金",$row[jsbao],2);
  44. PointUpdateB($row1[useridhf],$row[jsbao]);
  45. }
  46. }
  47. deletetable("yjcode_task where id=".$row[id]);
  48. deletetable("yjcode_taskhf where bh='".$nb[$i]."'");
  49. deletetable("yjcode_tasklog where bh='".$nb[$i]."'");
  50. }
  51. }
  52. break;
  53. case "3a": //删除单人接手,没有选中的可以删除
  54. $nb=preg_split("/,/",$bhid);
  55. for($i=0;$i<count($nb);$i++){
  56. while0("*","yjcode_taskhf where useridhf=".$userid." and bh='".$nb[$i]."' and taskty=0 and ifxz=0");if($row=mysql_fetch_array($res)){
  57. while1("bh,jsbao","yjcode_task where bh='".$row[bh]."'");$row1=mysql_fetch_array($res1);
  58. if(!empty($row1[jsbao])){
  59. PointIntoB($row[useridhf],"删除接手,退还保证金",$row1[jsbao],2);
  60. PointUpdateB($row[useridhf],$row1[jsbao]);
  61. }
  62. deletetable("yjcode_taskhf where id=".$row[id]);
  63. }
  64. }
  65. break;
  66. case "5": //删除卡密
  67. $nb=preg_split("/,/",$bhid);
  68. $pbh="";
  69. if(!empty($nb[0])){while0("id,probh,userid","yjcode_kc where userid=".$userid." and id=".$nb[0]);if($row=mysql_fetch_array($res)){$pbh=$row[probh];}}
  70. for($i=0;$i<count($nb);$i++){
  71. if(!is_numeric($nb[$i])){echo "ERR074";exit;}
  72. deletetable("yjcode_kc where userid=".$userid." and id=".$nb[$i]);
  73. }
  74. kamikc($pbh);
  75. break;
  76. case "5t": //删除套餐卡密
  77. $nb=preg_split("/,/",$bhid);
  78. $pbh="";
  79. if(!empty($nb[0])){while0("id,userid,probh,tcid","yjcode_taocan_kc where userid=".$userid." and id=".$nb[0]);
  80. if($row=mysql_fetch_array($res)){$pbh=$row[probh];$tcid=$row[tcid];}}
  81. for($i=0;$i<count($nb);$i++){
  82. if(!is_numeric($nb[$i])){echo "ERR074";exit;}
  83. deletetable("yjcode_taocan_kc where userid=".$userid." and id=".$nb[$i]);
  84. }
  85. kamikc_tc($pbh,$tcid);
  86. break;
  87. case "6": //删除卡密
  88. $nb=preg_split("/,/",$bhid);
  89. $pbh="";
  90. if(!empty($nb[0])){while0("id,probh,userid","yjcode_kc where userid=".$userid." and id=".$nb[0]);if($row=mysql_fetch_array($res)){$pbh=$row[probh];}}
  91. for($i=0;$i<count($nb);$i++){
  92. if(!is_numeric($nb[$i])){echo "ERR074";exit;}
  93. deletetable("yjcode_kc where userid=".$userid." and id=".$nb[$i]);
  94. }
  95. kamikc($pbh);
  96. break;
  97. case "7": //更新商品
  98. $nb=preg_split("/,/",$bhid);
  99. $syjf=$rowuser[jf];
  100. for($i=0;$i<count($nb);$i++){
  101. while1("*","yjcode_pro where userid=".$userid." and bh='".$nb[$i]."'");while($row1=mysql_fetch_array($res1)){
  102. if($syjf>=$rowcontrol[sxjf]){
  103. $syjf=$syjf-$rowcontrol[sxjf];
  104. updatetable("yjcode_pro","lastsj='".$sj."' where id=".$row1[id]);
  105. $jf=$rowcontrol[sxjf]*(-1);
  106. PointInto($rowuser[id],"刷新商品[".$row1[tit]."],消耗积分",$jf);PointUpdate($rowuser[id],$jf);
  107. }
  108. }
  109. }
  110. break;
  111. case "9": //删除套餐
  112. $nb=preg_split("/,/",$bhid);
  113. for($i=0;$i<count($nb);$i++){
  114. $a=preg_split("/xcf/",$nb[$i]); //$a[0]大类ID $a[1]小类ID
  115. if(intval($a[0])!=0){ //表示删除大类
  116. if(!is_numeric($a[0])){echo "ERR074";exit;}
  117. while0("*","yjcode_taocan where userid=".$userid." and id=".$a[0]);$row=mysql_fetch_array($res);
  118. if(panduan("*","yjcode_taocan where userid=".$userid." and admin=2 and probh='".$row[probh]."' and zt<>99 and tit='".$row[tit]."'")==1){echo "ERR1";exit;}
  119. deletetable("yjcode_taocan where userid=".$userid." and id=".$row[id]);
  120. deletetable("yjcode_taocan_kc where userid=".$userid." and tcid=".$row[id]." and probh='".$row[probh]."'");
  121. }elseif(intval($a[0])==0){ //表示删除小类
  122. if(!is_numeric($a[1])){echo "ERR074";exit;}
  123. deletetable("yjcode_taocan where userid=".$userid." and id=".$a[1]);
  124. deletetable("yjcode_taocan_kc where userid=".$userid." and tcid=".$a[1]);
  125. }
  126. }
  127. break;
  128. case "9a": //删除服务套餐
  129. $nb=preg_split("/,/",$bhid);
  130. for($i=0;$i<count($nb);$i++){
  131. $a=preg_split("/xcf/",$nb[$i]); //$a[0]大类ID $a[1]小类ID
  132. if(intval($a[0])!=0){ //表示删除大类
  133. if(!is_numeric($a[0])){echo "ERR074";exit;}
  134. while0("*","yjcode_servertaocan where userid=".$userid." and id=".$a[0]);$row=mysql_fetch_array($res);
  135. if(panduan("*","yjcode_servertaocan where userid=".$userid." and admin=2 and serverbh='".$row[serverbh]."' and zt<>99 and tit1='".$row[tit1]."'")==1){echo "ERR1";exit;}
  136. deletetable("yjcode_servertaocan where userid=".$userid." and id=".$row[id]);
  137. }elseif(intval($a[0])==0){ //表示删除小类
  138. if(!is_numeric($a[1])){echo "ERR074";exit;}
  139. deletetable("yjcode_servertaocan where userid=".$userid." and id=".$a[1]);
  140. }
  141. }
  142. break;
  143. case "10": //删除收货地址
  144. $nb=preg_split("/,/",$bhid);
  145. for($i=0;$i<count($nb);$i++){
  146. if(!is_numeric($nb[$i])){echo "ERR074";exit;}
  147. deletetable("yjcode_shdz where userid=".$userid." and id=".$nb[$i]);
  148. }
  149. break;
  150. case "11": //删除运费模板
  151. $nb=preg_split("/,/",$bhid);
  152. for($i=0;$i<count($nb);$i++){
  153. if(!is_numeric($nb[$i])){echo "ERR074";exit;}
  154. deletetable("yjcode_yunfei where id=".$nb[$i]." and userid=".$userid);
  155. }
  156. break;
  157. case "12": //删除资讯
  158. $nb=preg_split("/,/",$bhid);
  159. for($i=0;$i<count($nb);$i++){
  160. while0("id,bh,zt,userid,sj","yjcode_news where bh='".$nb[$i]."' and zt<>0 and userid=".$userid);while($row=mysql_fetch_array($res)){
  161. delDirAndFile("../upload/news/".dateYMDN($row[sj])."/".$row[bh]."/");
  162. deletetable("yjcode_news where id=".$row[id]);
  163. deletetable("yjcode_tp where type1='资讯' and bh='".$row[bh]."'");
  164. }
  165. }
  166. break;
  167. case "13": //删除评价图片
  168. $nb=preg_split("/,/",$bhid);
  169. for($i=0;$i<count($nb);$i++){
  170. if(!is_numeric($nb[$i])){echo "ERR074";exit;}
  171. while1("*","yjcode_tp where userid=".$userid." and id=".$nb[$i]);if($row1=mysql_fetch_array($res1)){
  172. if(!empty($row1[tp])){
  173. delFile("../".str_replace(".","-1.",$row1[tp]));
  174. delFile("../".$row1[tp]);
  175. }
  176. deletetable("yjcode_tp where id=".$nb[$i]);
  177. }
  178. }
  179. break;
  180. case "14": //删除商品视频
  181. $nb=preg_split("/,/",$bhid);
  182. for($i=0;$i<count($nb);$i++){
  183. while1("*","yjcode_provideo where bh='".$nb[$i]."' and userid=".$userid);if($row1=mysql_fetch_array($res1)){
  184. if($row1[admin]==2){delFile($row1["url"]);}
  185. delFile("../upload/".$row1[userid]."/".$row1[probh]."/".$row1[bh].".jpg");
  186. deletetable("yjcode_provideo where id=".$row1[id]);
  187. }
  188. }
  189. break;
  190. case "15": //删除自定义12级分组
  191. $nb=preg_split("/,/",$bhid);
  192. for($i=0;$i<count($nb);$i++){
  193. $a=preg_split("/xcf/",$nb[$i]); //$a[0]大类ID $a[1]小类ID
  194. if(intval($a[0])!=0){ //表示删除大类
  195. if(!is_numeric($a[0])){echo "ERR074";exit;}
  196. while0("*","yjcode_protype where id=".$a[0]." and userid=".$userid);if($row=mysql_fetch_array($res)){
  197. deletetable("yjcode_protype where name1='".$row[name1]."'");
  198. }
  199. }elseif(intval($a[0])==0){ //表示删除小类
  200. if(!is_numeric($a[1])){echo "ERR074";exit;}
  201. deletetable("yjcode_protype where id=".$a[1]." and userid=".$userid);
  202. }
  203. }
  204. break;
  205. case "16": //删除自定义店铺导航12级分组
  206. $nb=preg_split("/,/",$bhid);
  207. for($i=0;$i<count($nb);$i++){
  208. $a=preg_split("/xcf/",$nb[$i]); //$a[0]大类ID $a[1]小类ID
  209. if(intval($a[0])!=0){ //表示删除大类
  210. if(!is_numeric($a[0])){echo "ERR074";exit;}
  211. while0("*","yjcode_shopmenu where id=".$a[0]." and userid=".$userid);if($row=mysql_fetch_array($res)){
  212. deletetable("yjcode_shopmenu where tit1='".$row[tit1]."'");
  213. }
  214. }elseif(intval($a[0])==0){ //表示删除小类
  215. if(!is_numeric($a[1])){echo "ERR074";exit;}
  216. deletetable("yjcode_shopmenu where id=".$a[1]." and userid=".$userid);
  217. }
  218. }
  219. break;
  220. case "17": //删除店铺轮播图片
  221. $nb=preg_split("/,/",$bhid);
  222. for($i=0;$i<count($nb);$i++){
  223. while1("*","yjcode_shopbannar where bh='".$nb[$i]."' and userid=".$userid);if($row1=mysql_fetch_array($res1)){
  224. delFile("../upload/".$row1[userid]."/bannar_".$row1[bh].".jpg");
  225. deletetable("yjcode_shopbannar where id=".$row1[id]);
  226. }
  227. }
  228. break;
  229. case "18": //更新商品
  230. $nb=preg_split("/,/",$bhid);
  231. $syjf=$rowuser[jf];
  232. for($i=0;$i<count($nb);$i++){
  233. while1("*","yjcode_server where userid=".$userid." and bh='".$nb[$i]."'");while($row1=mysql_fetch_array($res1)){
  234. if($syjf>=$rowcontrol[sxjf]){
  235. $syjf=$syjf-$rowcontrol[sxjf];
  236. updatetable("yjcode_server","lastsj='".$sj."' where id=".$row1[id]);
  237. $jf=$rowcontrol[sxjf]*(-1);
  238. PointInto($rowuser[id],"刷新服务[".$row1[tit]."],消耗积分",$jf);PointUpdate($rowuser[id],$jf);
  239. }
  240. }
  241. }
  242. break;
  243. case "19": //删除服务
  244. $nb=preg_split("/,/",$bhid);
  245. for($i=0;$i<count($nb);$i++){
  246. while1("bh,userid","yjcode_server where bh='".$nb[$i]."' and userid=".$userid);if($row1=mysql_fetch_array($res1)){
  247. deletetable("yjcode_server where bh='".$nb[$i]."'");
  248. deletetable("yjcode_serverorderlog where orderbh='".$nb[$i]."'");
  249. delDirAndFile("../upload/".$row1[userid]."/".$row1[bh]."/");
  250. }
  251. }
  252. break;
  253. }
  254. echo "True";
  255. ?>