Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- key=$key&action=add_order&service=$service&link=$link&quantity=$quantity";
- class Api
- {
- public $api_url = 'https://andremedia.co/api.php'; // API URL
- public $api_key = 'KOyhuoE68pWzWOl7gIpT'; // Your API key
- public function order($link, $type, $quantity) { // Add order
- return json_decode($this->connect(array(
- 'api' => $this->api_key,
- 'action' => 'add',
- 'link' => $link,
- 'service' => $type,
- 'quantity' => $quantity
- )));
- }
- public function status($order_id) { // Get status, remains
- return json_decode($this->connect(array(
- 'api' => $this->api_key,
- 'action' => 'status',
- 'order_id' => $order_id
- )));
- }
- private function connect($post) {
- $_post = Array();
- if (is_array($post)) {
- foreach ($post as $name => $value) {
- $_post[] = $name.'='.urlencode($value);
- }
- }
- $ch = curl_init($this->api_url);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch, CURLOPT_HEADER, 0);
- curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
- if (is_array($post)) {
- curl_setopt($ch, CURLOPT_POSTFIELDS, join('&', $_post));
- }
- curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)');
- $result = curl_exec($ch);
- echo $result;
- if (curl_errno($ch) != 0 && empty($result)) {
- $result = false;
- }
- curl_close($ch);
- return $result;
- }
- }
- // Examples
- $api = new Api();
- $order = $api->order('https://www.instagram.com/dhifoaksa/', '272', '100'); // $link, $type - service type, $quantity: return order id or Error
- $status = $api->status($order->data->order_id);
- if ($provider == "ERMEDIA" AND $order->error) { ?>
- <div class="alert alert-danger"> <strong>Fiture Sedang Perbaikan.</strong></div>
- <? } else if ($order->result == "error") { ?>
- <div class="alert alert-danger"> <strong>Gagal: </strong> Fiture Maintenance </div>
- <? } else {
- if ($provider == "ERMEDIA") {
- $order_id = $order->data->order_id;
- } else if($provider == "MANUAL") {
- $order_id = rand(00000,9999);
- } else {
- $order_id = rand(0000,9999);
- }
- $send = mysql_query("UPDATE user SET balance = balance-$price WHERE username = '$username'");
- $send = mysql_query("UPDATE user SET balance_used = balance_used+$price WHERE username = '$username'");
- $send = mysql_query("INSERT INTO order_history(order_id,provider,buyer,service,link,quantity,price,status,date,time) VALUES ('$order_id','$provider','$username','$service','$link','$quantity','$price','Pending','$date','$time')");
- $send = mysql_query("INSERT INTO balance_history(username, action, quantity, msg, date, time) VALUES ('$username','Cut Balance','$price','User buy service. Order ID : $order_id','$date','$time')");
- if ($send) { ?>
- <div class="alert bg-danger">
- <font color="black">
- <strong>Order Request telah Berhasil, Silahkan cek riwayat history/orderan!: </strong><br />
- Order ID : ER-MEDIA-> <?php echo $order_id; ?><br />
- Service: <?php echo $service; ?><br />
- Target : <?php echo $link; ?><br />
- Quantity: <?php echo $quantity; ?><br />
- Cut Balance: <?php echo "Rp. " . number_format($price,0,",","."); ?><br />
- </font>
- </div>
- <? } else { ?>
- Database error!
- <? } } } } else { ?>
- <div class="alert bg-info"> <button type="button" class="close" data-dismiss="alert">
- <span aria-hidden="true">×</span>
- </button><div> <strong>*INFO: </strong> Sebelum order dimohon membaca peraturan yang ada, agar tidak terjadi kesalahan saat melakukan order. Kami tidak akan merefund order yang error karena kesalahan user. </div></div>
- <? } ?>
- <!-- Row-->
- <div class="row">
- <div class="col-sm-6">
- <div class="card">
- <div class="card-header bgm-cyan">
- <h2>New Order
- </h2>
- <ul class="actions actions-alt">
- <li class="dropdown">
- <a href="" data-toggle="dropdown" aria-expanded="false">
- <i class="zmdi zmdi-more-vert"></i>
- </a>
- <ul class="dropdown-menu dropdown-menu-right">
- <li>
- <a href="">Refresh</a>
- </li>
- <li>
- <a href="">Manage Widgets</a>
- </li>
- <li>
- <a href="">Widgets Settings</a>
- </li>
- </ul>
- </li>
- </ul>
- </div>
- <script type="text/javascript" src="https://code.jquery.com/jquery-1.11.3.js"></script>
- <script type="text/javascript">
- var htmlobjek;
- $(document).ready(function(){
- $("#category").change(function(){
- var category = $("#category").val();
- $.ajax({
- url : 'include/service.php',
- data : 'category='+category,
- type : 'POST',
- dataType: 'html',
- success : function(msg){
- $("#service").html(msg);
- }
- });
- });
- $("#service").change(function(){
- var service = $("#service").val();
- $.ajax({
- url : 'include/min.php',
- data : 'service='+service,
- type : 'POST',
- dataType: 'html',
- success : function(msg){
- $("#min").val(msg);
- }
- });
- $.ajax({
- url : 'include/max.php',
- data : 'service='+service,
- type : 'POST',
- dataType: 'html',
- success : function(msg){
- $("#max").val(msg);
- }
- });
- $.ajax({
- url : 'include/rate.php',
- data : 'service='+service,
- type : 'POST',
- dataType: 'html',
- success : function(msg){
- $("#rate").val(msg);
- }
- });
- $.ajax({
- url : 'include/price.php',
- data : 'service='+service,
- type : 'POST',
- dataType: 'html',
- success : function(msg){
- $("#price").val(msg);
- }
- });
- });
- });
- </script>
- <div class="card-body card-padding">
- <!-- start content -->
- <form class="form-horizontal" method="POST">
- <div class="form-group">
- <label class="col-md-12">Category</label>
- <div class="col-md-12">
- <select class="form-control" name="category" id="category">
- <option value="0">Pilih salah satu</option>
- <option value="IGF">Instagram Followers</option>
- <option value="IGL">Instagram Likes</option>
- <option value="IGV">Instagram Views</option>
- <option value="TW">Twitter</option>
- <option value="FB">Facebook</option>
- <option value="YT">Youtube</option>
- <option value="GP">Google Plus</option>
- <option value="VINE">Vine</option>
- <option value="SC">Soundcloud</option>
- <option value="WEB">Website</option>
- </select>
- </div>
- </div>
- <div class="form-group">
- <label class="col-md-12">Service</label>
- <div class="col-md-12">
- <select class="form-control" name="service" id="service">
- <option value="0">Pilih salah satu</option>
- </select>
- </div>
- </div>
- <div class="alert alert-icon alert-info alert-dismissible fade in" role="alert">
- <button type="button" class="close" data-dismiss="alert" aria-label="Close">
- <span aria-hidden="true"><font color="red"><b>×</b></span></font>
- </button>
- <div class="form-group">
- <div class="col-md-4">
- <label>Price/1000</label>
- <div class="input-group"><span class="input-group-addon">Rp.</span>
- <input type="text" class="form-control" id="price" value="0" readonly>
- </div>
- </div>
- <div class="col-md-4">
- <label>Min</label>
- <div>
- <input type="text" class="form-control" id="min" value="0" readonly>
- </div>
- </div>
- <div class="col-md-4">
- <label>Max</label>
- <div>
- <input type="text" class="form-control" id="max" value="0" readonly>
- </div>
- </div>
- </div>
- </div>
- <div class="form-group">
- <div class="col-md-12">
- <label>Username/Link</label>
- <input type="text" class="form-control" name="link" placeholder="Username/Link" required>
- </div>
- </div>
- <div class="f
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement