Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(isset($_GET['action']) {
- $panelUrl = "http://51.254.45.5/api.php";
- if($_GET['action'] == "newline" && isset($_GET['id']) && isset($_GET['package'])) {
- if($_GET['package'] == 1) {
- $price = 8;
- $time = strtotime("+1 month");
- } else if($_GET['package'] == 2) {
- $price = 14;
- $time = strtotime("+2 month");
- } else if($_GET['package'] == 3) {
- $price = 20;
- $time = strtotime("+3 month");
- }
- $api_result = json_decode(file_get_contents($pannelUrl."?action=req_user&sub=credits&amount=-".$price."&id=".$_GET['id'], false, $context));
- if($api_result['result']) {
- $username = isset($_GET['user']) ? $_GET['user'] : "";
- $password = isset($_GET['pw']) ? $_GET['pw'] : "";
- $max_connections = 1;
- $reseller = $_GET['id'];
- $bouquet_ids = array(1, 2, 3);
- $expire_date = strtotime($_GET['package']);
- $post_data = array( 'user_data' => array(
- 'username' => $username,
- 'password' => $password,
- 'max_connections' => $max_connections,
- 'is_restreamer' => $reseller,
- 'exp_date' => $expire_date,
- 'bouquet' => json_encode( $bouquet_ids ) ) );
- $opts = array( 'http' => array(
- 'method' => 'POST',
- 'header' => 'Content-type: application/x-www-form-urlencoded',
- 'content' => http_build_query( $post_data ) ) );
- $context = stream_context_create($opts);
- $api_result = json_decode( file_get_contents($pannelUrl."?action=user&sub=create", false, $context));
- if($api_result['result'] == false) {
- echo "Error occurred: ".$api_result['error'];
- $api_result = json_decode(file_get_contents($pannelUrl."?action=req_user&sub=credits&amount=".$price."&id=".$_GET['id'], false, $context));
- }
- } else {
- echo "Error occurred: ".$api_result['error'];
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement