Advertisement
Guest User

Untitled

a guest
Dec 11th, 2019
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. $sql = mysql_query("SELECT * FROM api_orders_shakes WHERE out_order_id = '$_GET[out_order_id]' LIMIT 1");
  2. $record = mysql_fetch_array($sql);
  3.  
  4. $time = date('Y-m-d H:i:s', $record[order_date]);
  5.  
  6. $data = array(
  7. "name" => "$record[fio]",
  8. "phone" => "$record[phone]",
  9. "countryCode" => "$record[country]",
  10. "comment" => "",
  11. "number" => "$record[number]",
  12. "offerId" => "$record[offerId]",
  13. "landingUrl" => "$record[referer]",
  14. "createdAt" => "$time",
  15. "sub1" => "$record[utm_source]",
  16. "sub2" => "$record[utm_content]",
  17. "sub3" => "$record[utm_medium]",
  18. "sub4" => "$record[utm_term]",
  19. "userAgent" => "$record[ua]",
  20. "ip" => "$record[ip]"
  21. );
  22.  
  23.  
  24.  
  25.  
  26. if ($curl = curl_init()){
  27. curl_setopt($curl, CURLOPT_URL, 'http://shakes.pro/index.php?r=api/order/in&key=082ff121d6892acfcc61345ff71acb88');
  28. curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
  29. curl_setopt($curl, CURLOPT_POST, true);
  30. curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data));
  31. $result = curl_exec($curl);
  32. }
  33.  
  34.  
  35. $json = json_decode($result);
  36.  
  37.  
  38. $shakes_result = $json->{'status'};
  39. $shakes_message = $json->{'response'};
  40. echo "<br><br>";
  41. echo $shakes_result;
  42. echo "<br><br>";
  43. echo $shakes_message;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement