Advertisement
Guest User

Untitled

a guest
Apr 7th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1. <?php
  2.  
  3. if(isset($_GET['action']) {
  4.  
  5. $panelUrl = "http://51.254.45.5/api.php";
  6.  
  7. if($_GET['action'] == "newline" && isset($_GET['id']) && isset($_GET['package'])) {
  8.  
  9. if($_GET['package'] == 1) {
  10. $price = 8;
  11. $time = strtotime("+1 month");
  12. }
  13.  
  14. $api_result = json_decode(file_get_contents($pannelUrl."?action=req_user&sub=credits&amount=-".$price."&id=".$_GET['id'], false, $context));
  15.  
  16. if($api_result['result']) {
  17. $username = isset($_GET['user']) ? $_GET['user'] : "";
  18. $password = isset($_GET['pw']) ? $_GET['pw'] : "";
  19. $max_connections = 1;
  20. $reseller = 1;
  21. $bouquet_ids = array(1, 2, 3);
  22. $expire_date = strtotime($_GET['package']);
  23.  
  24. $post_data = array( 'user_data' => array(
  25. 'username' => $username,
  26. 'password' => $password,
  27. 'max_connections' => $max_connections,
  28. 'is_restreamer' => $reseller,
  29. 'exp_date' => $expire_date,
  30. 'bouquet' => json_encode( $bouquet_ids ) ) );
  31.  
  32. $opts = array( 'http' => array(
  33. 'method' => 'POST',
  34. 'header' => 'Content-type: application/x-www-form-urlencoded',
  35. 'content' => http_build_query( $post_data ) ) );
  36.  
  37. $context = stream_context_create($opts);
  38. $api_result = json_decode( file_get_contents($pannelUrl."?action=user&sub=create", false, $context));
  39.  
  40. if($api_result['result'] == false) {
  41. echo "Error occurred: ".$api_result['error'];
  42.  
  43. }
  44.  
  45. } else {
  46. echo "Error occurred: ".$api_result['error'];
  47. $api_result = json_decode(file_get_contents($pannelUrl."?action=req_user&sub=credits&amount=".$price."&id=".$_GET['id'], false, $context));
  48. }
  49.  
  50. }
  51. }
  52. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement