tpdel.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. <?
  2. include("../../config/conn.php");
  3. include("../../config/function.php");
  4. $admin=intval($_GET[admin]);
  5. $sqluser="select * from yjcode_user where uid='".$_SESSION[SHOPUSER]."'";mysql_query("SET NAMES 'GBK'");$resuser=mysql_query($sqluser);
  6. if(!$rowuser=mysql_fetch_array($resuser)){Audit_alert("登录超时","../reg/","parent.");}
  7. $userid=$rowuser[id];
  8. if($admin==6){
  9. $id=$_GET[id];
  10. if(!is_numeric($id)){exit;}
  11. while1("*","yjcode_tp where userid=".$userid." and id=".$id);if($row1=mysql_fetch_array($res1)){
  12. if(!empty($row1[tp])){
  13. delFile("../../".str_replace(".","-1.",$row1[tp]));
  14. delFile("../../".str_replace(".","-2.",$row1[tp]));
  15. delFile("../../".$row1[tp]);
  16. }
  17. deletetable("yjcode_tp where id=".$id);
  18. }
  19. }elseif($admin==7){
  20. $id=$_GET[id];
  21. if(!is_numeric($id)){exit;}
  22. while1("*","yjcode_tp where userid=".$userid." and id=".$id);if($row1=mysql_fetch_array($res1)){
  23. if(!empty($row1[tp])){
  24. delFile("../../".str_replace(".","-1.",$row1[tp]));
  25. delFile("../../".$row1[tp]);
  26. }
  27. deletetable("yjcode_tp where id=".$id);
  28. }
  29. }
  30. ?>