sms_sell_chk.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?
  2. include("../config/conn.php");
  3. include("../config/function.php");
  4. if($_GET[id]=="" || empty($_SESSION[SHOPUSER])){echo "err1";exit;}
  5. $id=intval($_GET[id]);
  6. $userid=returnuserid($_SESSION["SHOPUSER"]);
  7. while0("*","yjcode_smsmail where userid=".$userid." and id=".$id);if(!$row=mysql_fetch_array($res)){echo "err1";exit;}
  8. if($row[admin]==1){ //发送邮件
  9. require("../config/mailphp/sendmail.php");
  10. @yjsendmail($row[tit],$row[fa],$row[txt]);
  11. }elseif($row[admin]==2){ //发送手机短信
  12. while3("*","yjcode_smsmb where mybh='004'");
  13. if($row3=mysql_fetch_array($res3)){$txt=$row3[txt];}else{$txt=$row[txt];}
  14. if(empty($rowcontrol[smsmode])){
  15. include("../config/mobphp/mysendsms.php");
  16. $str=str_replace("\${tit}",$row[tit],$txt);
  17. @yjsendsms($row[fa],$str);
  18. }else{
  19. $sms_txt="{tit:'".$row[tit]."'}";
  20. if(1==$rowcontrol[smsmode]){$sms_txt="{tit:'".$row[tit]."'}";}else{$sms_txt="{\"tit\":\"".$row[tit]."\"}";}
  21. $sms_mot=$row[fa];
  22. $sms_id=$row3[mbid];
  23. include("../config/mobphp/mysendsms.php");
  24. }
  25. updatetable("yjcode_control","smskc=smskc-1");
  26. intotable("yjcode_smsmaillog","admin,fa,userid,txt,sj,uip","2,'".$row[fa]."',".$userid.",'订单发货提醒',".strtotime(getsj()).",'".getuip()."'");
  27. }
  28. deletetable("yjcode_smsmail where id=".$id." and userid=".$userid);
  29. echo "ok";
  30. ?>