SHOW:
|
|
- or go back to the newest paste.
| 1 | class Api | |
| 2 | {
| |
| 3 | public $api_url = 'https://andremedia.co/api.php'; // API URL | |
| 4 | ||
| 5 | public $api_key = 'KOyhuoE68pWzWOl7gIpT'; // Your API key | |
| 6 | ||
| 7 | public function order($link, $type, $quantity) { // Add order
| |
| 8 | return json_decode($this->connect(array( | |
| 9 | 'api' => $this->api_key, | |
| 10 | 'action' => 'add', | |
| 11 | 'link' => $link, | |
| 12 | 'service' => $type, | |
| 13 | 'quantity' => $quantity | |
| 14 | ))); | |
| 15 | } | |
| 16 | ||
| 17 | public function status($order_id) { // Get status, remains
| |
| 18 | return json_decode($this->connect(array( | |
| 19 | 'api' => $this->api_key, | |
| 20 | 'action' => 'status', | |
| 21 | 'order_id' => $order_id | |
| 22 | ))); | |
| 23 | } | |
| 24 | ||
| 25 | ||
| 26 | private function connect($post) {
| |
| 27 | $_post = Array(); | |
| 28 | if (is_array($post)) {
| |
| 29 | foreach ($post as $name => $value) {
| |
| 30 | $_post[] = $name.'='.urlencode($value); | |
| 31 | } | |
| 32 | } | |
| 33 | $ch = curl_init($this->api_url); | |
| 34 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
| 35 | curl_setopt($ch, CURLOPT_POST, 1); | |
| 36 | curl_setopt($ch, CURLOPT_HEADER, 0); | |
| 37 | curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); | |
| 38 | if (is_array($post)) {
| |
| 39 | curl_setopt($ch, CURLOPT_POSTFIELDS, join('&', $_post));
| |
| 40 | } | |
| 41 | curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)'); | |
| 42 | $result = curl_exec($ch); | |
| 43 | echo $result; | |
| 44 | if (curl_errno($ch) != 0 && empty($result)) {
| |
| 45 | $result = false; | |
| 46 | } | |
| 47 | curl_close($ch); | |
| 48 | return $result; | |
| 49 | } | |
| 50 | } | |
| 51 | ||
| 52 | // Examples | |
| 53 | ||
| 54 | $api = new Api(); | |
| 55 | ||
| 56 | $order = $api->order('https://www.instagram.com/dhifoaksa/', '272', '100'); // $link, $type - service type, $quantity: return order id or Error
| |
| 57 | ||
| 58 | $status = $api->status($order->data->order_id); | |
| 59 | ||
| 60 | ||
| 61 | if ($provider == "ERMEDIA" AND $order->error) { ?>
| |
| 62 | <div class="alert alert-danger"> <strong>Fiture Sedang Perbaikan.</strong></div> | |
| 63 | <? } else if ($order->result == "error") { ?>
| |
| 64 | <div class="alert alert-danger"> <strong>Gagal: </strong> Fiture Maintenance </div> | |
| 65 | <? } else {
| |
| 66 | if ($provider == "ERMEDIA") {
| |
| 67 | $order_id = $order->data->order_id; | |
| 68 | } else if($provider == "MANUAL") {
| |
| 69 | $order_id = rand(00000,9999); | |
| 70 | } else {
| |
| 71 | $order_id = rand(0000,9999); | |
| 72 | } | |
| 73 | $send = mysql_query("UPDATE user SET balance = balance-$price WHERE username = '$username'");
| |
| 74 | $send = mysql_query("UPDATE user SET balance_used = balance_used+$price WHERE username = '$username'");
| |
| 75 | $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')");
| |
| 76 | $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')");
| |
| 77 | if ($send) { ?>
| |
| 78 | <div class="alert bg-danger"> | |
| 79 | <font color="black"> | |
| 80 | <strong>Order Request telah Berhasil, Silahkan cek riwayat history/orderan!: </strong><br /> | |
| 81 | Order ID : ER-MEDIA-> <?php echo $order_id; ?><br /> | |
| 82 | Service: <?php echo $service; ?><br /> | |
| 83 | Target : <?php echo $link; ?><br /> | |
| 84 | Quantity: <?php echo $quantity; ?><br /> | |
| 85 | Cut Balance: <?php echo "Rp. " . number_format($price,0,",","."); ?><br /> | |
| 86 | </font> | |
| 87 | </div> | |
| 88 | <? } else { ?>
| |
| 89 | Database error! | |
| 90 | <? } } } } else { ?>
| |
| 91 | <div class="alert bg-info"> <button type="button" class="close" data-dismiss="alert"> | |
| 92 | <span aria-hidden="true">×</span> | |
| 93 | </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> | |
| 94 | <? } ?> | |
| 95 | <!-- Row--> | |
| 96 | <div class="row"> | |
| 97 | <div class="col-sm-6"> | |
| 98 | <div class="card"> | |
| 99 | <div class="card-header bgm-cyan"> | |
| 100 | <h2>New Order | |
| 101 | </h2> | |
| 102 | ||
| 103 | <ul class="actions actions-alt"> | |
| 104 | <li class="dropdown"> | |
| 105 | <a href="" data-toggle="dropdown" aria-expanded="false"> | |
| 106 | <i class="zmdi zmdi-more-vert"></i> | |
| 107 | </a> | |
| 108 | ||
| 109 | <ul class="dropdown-menu dropdown-menu-right"> | |
| 110 | <li> | |
| 111 | <a href="">Refresh</a> | |
| 112 | </li> | |
| 113 | <li> | |
| 114 | <a href="">Manage Widgets</a> | |
| 115 | </li> | |
| 116 | <li> | |
| 117 | <a href="">Widgets Settings</a> | |
| 118 | </li> | |
| 119 | </ul> | |
| 120 | </li> | |
| 121 | </ul> | |
| 122 | </div> | |
| 123 | ||
| 124 | <script type="text/javascript" src="https://code.jquery.com/jquery-1.11.3.js"></script> | |
| 125 | <script type="text/javascript"> | |
| 126 | var htmlobjek; | |
| 127 | $(document).ready(function(){
| |
| 128 | ||
| 129 | $("#category").change(function(){
| |
| 130 | var category = $("#category").val();
| |
| 131 | ||
| 132 | $.ajax({
| |
| 133 | url : 'include/service.php', | |
| 134 | data : 'category='+category, | |
| 135 | type : 'POST', | |
| 136 | dataType: 'html', | |
| 137 | success : function(msg){
| |
| 138 | $("#service").html(msg);
| |
| 139 | } | |
| 140 | }); | |
| 141 | }); | |
| 142 | ||
| 143 | $("#service").change(function(){
| |
| 144 | var service = $("#service").val();
| |
| 145 | ||
| 146 | $.ajax({
| |
| 147 | url : 'include/min.php', | |
| 148 | data : 'service='+service, | |
| 149 | type : 'POST', | |
| 150 | dataType: 'html', | |
| 151 | success : function(msg){
| |
| 152 | $("#min").val(msg);
| |
| 153 | } | |
| 154 | }); | |
| 155 | ||
| 156 | $.ajax({
| |
| 157 | url : 'include/max.php', | |
| 158 | data : 'service='+service, | |
| 159 | type : 'POST', | |
| 160 | dataType: 'html', | |
| 161 | success : function(msg){
| |
| 162 | $("#max").val(msg);
| |
| 163 | } | |
| 164 | }); | |
| 165 | ||
| 166 | $.ajax({
| |
| 167 | url : 'include/rate.php', | |
| 168 | data : 'service='+service, | |
| 169 | type : 'POST', | |
| 170 | dataType: 'html', | |
| 171 | success : function(msg){
| |
| 172 | $("#rate").val(msg);
| |
| 173 | } | |
| 174 | }); | |
| 175 | ||
| 176 | $.ajax({
| |
| 177 | url : 'include/price.php', | |
| 178 | data : 'service='+service, | |
| 179 | type : 'POST', | |
| 180 | dataType: 'html', | |
| 181 | success : function(msg){
| |
| 182 | $("#price").val(msg);
| |
| 183 | } | |
| 184 | }); | |
| 185 | }); | |
| 186 | ||
| 187 | }); | |
| 188 | </script> | |
| 189 | <div class="card-body card-padding"> | |
| 190 | <!-- start content --> | |
| 191 | <form class="form-horizontal" method="POST"> | |
| 192 | <div class="form-group"> | |
| 193 | <label class="col-md-12">Category</label> | |
| 194 | <div class="col-md-12"> | |
| 195 | <select class="form-control" name="category" id="category"> | |
| 196 | <option value="0">Pilih salah satu</option> | |
| 197 | <option value="IGF">Instagram Followers</option> | |
| 198 | <option value="IGL">Instagram Likes</option> | |
| 199 | <option value="IGV">Instagram Views</option> | |
| 200 | <option value="TW">Twitter</option> | |
| 201 | <option value="FB">Facebook</option> | |
| 202 | <option value="YT">Youtube</option> | |
| 203 | <option value="GP">Google Plus</option> | |
| 204 | <option value="VINE">Vine</option> | |
| 205 | <option value="SC">Soundcloud</option> | |
| 206 | <option value="WEB">Website</option> | |
| 207 | </select> | |
| 208 | </div> | |
| 209 | </div> | |
| 210 | <div class="form-group"> | |
| 211 | <label class="col-md-12">Service</label> | |
| 212 | <div class="col-md-12"> | |
| 213 | <select class="form-control" name="service" id="service"> | |
| 214 | <option value="0">Pilih salah satu</option> | |
| 215 | </select> | |
| 216 | </div> | |
| 217 | </div> | |
| 218 | ||
| 219 | <div class="alert alert-icon alert-info alert-dismissible fade in" role="alert"> | |
| 220 | <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | |
| 221 | <span aria-hidden="true"><font color="red"><b>×</b></span></font> | |
| 222 | </button> | |
| 223 | ||
| 224 | ||
| 225 | <div class="form-group"> | |
| 226 | <div class="col-md-4"> | |
| 227 | <label>Price/1000</label> | |
| 228 | <div class="input-group"><span class="input-group-addon">Rp.</span> | |
| 229 | <input type="text" class="form-control" id="price" value="0" readonly> | |
| 230 | </div> | |
| 231 | </div> | |
| 232 | <div class="col-md-4"> | |
| 233 | <label>Min</label> | |
| 234 | <div> | |
| 235 | <input type="text" class="form-control" id="min" value="0" readonly> | |
| 236 | </div> | |
| 237 | </div> | |
| 238 | <div class="col-md-4"> | |
| 239 | <label>Max</label> | |
| 240 | <div> | |
| 241 | <input type="text" class="form-control" id="max" value="0" readonly> | |
| 242 | </div> | |
| 243 | </div> | |
| 244 | </div> | |
| 245 | ||
| 246 | </div> | |
| 247 | ||
| 248 | <div class="form-group"> | |
| 249 | <div class="col-md-12"> | |
| 250 | <label>Username/Link</label> | |
| 251 | <input type="text" class="form-control" name="link" placeholder="Username/Link" required> | |
| 252 | </div> | |
| 253 | </div> | |
| 254 | <div class="f |