Advertisement
Guest User

Untitled

a guest
Apr 19th, 2019
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.26 KB | None | 0 0
  1. <?php
  2. // Script By Aditama Gilang Farel
  3.  
  4. if(!$username) {
  5. header('location:../login.php');
  6. }
  7. function sosmedpedia($post) {
  8. $apiServer = 'http://sosmedpedia.com/api.php';
  9. $_post = Array();
  10. if (is_array($post)) {
  11. foreach ($post as $name => $value) {
  12. $_post[] = $name.'='.urlencode($value);
  13. }
  14. } else {
  15. $_post = FALSE;
  16. }
  17. $method = 'post';
  18. $ch = curl_init($apiServer);
  19. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  20. if($_post !== FALSE){
  21. curl_setopt($ch, CURLOPT_POST, 1);
  22. }
  23. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
  24. //curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1);
  25. curl_setopt($ch, CURLOPT_HEADER, 0);
  26. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
  27. if (is_array($post) AND $_post !== FALSE) {
  28. curl_setopt($ch, CURLOPT_POSTFIELDS, join('&', $_post));
  29. }
  30.  
  31. curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)');
  32. $result = curl_exec($ch);
  33. if (curl_errno($ch)) {
  34. $result = curl_error($ch);
  35. }
  36. curl_close($ch);
  37. return $result;
  38. }
  39. function sosmedpediapulsa($post) {
  40. $apiServer = 'http://sosmedpedia.com/apipulsa.php';
  41. $_post = Array();
  42. if (is_array($post)) {
  43. foreach ($post as $name => $value) {
  44. $_post[] = $name.'='.urlencode($value);
  45. }
  46. } else {
  47. $_post = FALSE;
  48. }
  49. $method = 'post';
  50. $ch = curl_init($apiServer);
  51. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  52. if($_post !== FALSE){
  53. curl_setopt($ch, CURLOPT_POST, 1);
  54. }
  55. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
  56. //curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1);
  57. curl_setopt($ch, CURLOPT_HEADER, 0);
  58. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
  59. if (is_array($post) AND $_post !== FALSE) {
  60. curl_setopt($ch, CURLOPT_POSTFIELDS, join('&', $_post));
  61. }
  62.  
  63. curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)');
  64. $result = curl_exec($ch);
  65. if (curl_errno($ch)) {
  66. $result = curl_error($ch);
  67. }
  68. curl_close($ch);
  69. return $result;
  70. }
  71. function sosmedpediapulsav2($post) {
  72. $apiServer = 'http://sosmedpedia.com/apipulsav2.php';
  73. $_post = Array();
  74. if (is_array($post)) {
  75. foreach ($post as $name => $value) {
  76. $_post[] = $name.'='.urlencode($value);
  77. }
  78. } else {
  79. $_post = FALSE;
  80. }
  81. $method = 'post';
  82. $ch = curl_init($apiServer);
  83. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  84. if($_post !== FALSE){
  85. curl_setopt($ch, CURLOPT_POST, 1);
  86. }
  87. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
  88. //curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1);
  89. curl_setopt($ch, CURLOPT_HEADER, 0);
  90. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
  91. if (is_array($post) AND $_post !== FALSE) {
  92. curl_setopt($ch, CURLOPT_POSTFIELDS, join('&', $_post));
  93. }
  94.  
  95. curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)');
  96. $result = curl_exec($ch);
  97. if (curl_errno($ch)) {
  98. $result = curl_error($ch);
  99. }
  100. curl_close($ch);
  101. return $result;
  102. }
  103. function peakerr($post) {
  104. $apiServer = 'http://peakerr.com/api/v2';
  105. $_post = Array();
  106. if (is_array($post)) {
  107. foreach ($post as $name => $value) {
  108. $_post[] = $name.'='.urlencode($value);
  109. }
  110. } else {
  111. $_post = FALSE;
  112. }
  113. $method = 'post';
  114. $ch = curl_init($apiServer);
  115. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  116. if($_post !== FALSE){
  117. curl_setopt($ch, CURLOPT_POST, 1);
  118. }
  119. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
  120. //curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1);
  121. curl_setopt($ch, CURLOPT_HEADER, 0);
  122. //curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
  123. if (is_array($post) AND $_post !== FALSE) {
  124. curl_setopt($ch, CURLOPT_POSTFIELDS, join('&', $_post));
  125. }
  126.  
  127. curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)');
  128. $result = curl_exec($ch);
  129. if (curl_errno($ch)) {
  130. $result = curl_error($ch);
  131. }
  132. curl_close($ch);
  133. return $result;
  134. } ?>
  135. <!-- Page-Title -->
  136. <div class="row title_bg">
  137. <div class="col-sm-12">
  138. <h4 class="page-title">Sintax Panel SMM Indonesia</h4>
  139. <ol class="breadcrumb">
  140. <li><a href="#">Home</a></li>
  141. <li class="active">Mulai Order</li>
  142. </ol>
  143. </div>
  144. </div>
  145. <!-- Page Title End -->
  146. <?php if (isset($_POST['order'])) {
  147. $link = $_POST['link'];
  148. $no = $_POST['service'];
  149. $quantity = $_POST['quantity'];
  150.  
  151. $dataservice = mysql_query("SELECT * FROM service WHERE no = '$no' AND status = 'Tersedia'");
  152. $sdata = mysql_fetch_array($dataservice);
  153. $scount = mysql_num_rows($dataservice);
  154.  
  155. $min = $sdata['min'];
  156. $max = $sdata['max'];
  157. $service = $sdata['service'];
  158. $rate = $sdata['rate'];
  159. $provider = $sdata['provider'];
  160. $providerid = $sdata['provider_id'];
  161.  
  162. $price = $quantity*$rate;
  163.  
  164. if ($scount == 0) { ?>
  165. <div class="alert alert-danger"> <strong>Error: </strong> Service tidak ditemukan. </div>
  166. <? } else if (!$quantity || !$link) { ?>
  167. <div class="alert alert-danger"> <strong>Error: </strong> Masih ada data yang kosong. </div>
  168. <? } else if ($quantity < $min) { ?>
  169. <div class="alert alert-danger"> <strong>Error: </strong> Quantity tidak sesuai. </div>
  170. <? } else if ($quantity > $max) { ?>
  171. <div class="alert alert-danger"> <strong>Error: </strong> Quantity tidak sesuai. </div>
  172. <? } else if ($balance < $price) { ?>
  173. <div class="alert alert-danger"> <strong>Error: </strong> Balance tidak mencukupi, silahkan topup. </div>
  174. <? } else {
  175.  
  176. if ($provider == "SOSPED"){
  177. $dataa = array('api' => 'SOSPED-895cc6cf45bfd57bfafc7ee9e44d1327','action' => 'tambah','linknya' => $link,'hasilnya' => $providerid,'quantitynya' => $quantity);
  178. $hasilnya = sosmedpedia($dataa);
  179. $order = json_decode($hasilnya);
  180. } else if ($provider == "SOSPEDPULSA"){
  181. $dataa = array('api' =>'SOSPED-895cc6cf45bfd57bfafc7ee9e44d1327','action' => 'tambah','link' => $link,'pulsa' => $providerid);
  182. $hasilnya = sosmedpediapulsa($dataa);
  183. $order = json_decode($hasilnya);
  184. } else if ($provider == "SOSPEDPULSAV2"){
  185. $dataa = array('api' => 'SOSPED-895cc6cf45bfd57bfafc7ee9e44d1327','action' => 'tambah','link' => $link,'pulsa' => $providerid,'nolistrik' => '31241212','jangandihapus' => 'listrik');
  186. $hasilnya = sosmedpediapulsav2($dataa);
  187. $order = json_decode($hasilnya);
  188. } else if ($provider == "PEAKERR") {
  189. $dataa = array('key' => 'xxxxxxxxxxx','action' => 'add','link' => $link,'service' => $providerid,'quantity' => $quantity);
  190. $hasilnya = creativemarket($dataa);
  191. $order = json_decode($hasilnya,true);
  192. }
  193.  
  194. if ($order->error == true) { ?>
  195. <div class="alert alert-danger"> <strong>Error: </strong> Please contact Admin. </div>
  196. <? } else {
  197. $order_id = rand(10000,1000000);
  198. $send = mysql_query("UPDATE user SET balance = balance-$price WHERE username = '$username'");
  199. $send = mysql_query("UPDATE user SET balance_used = balance_used+$price WHERE username = '$username'");
  200. $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','Processing','$date','$time')");
  201. $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')");
  202. if ($send) { ?>
  203. <div class="alert alert-info">
  204. <font color="black">
  205. <strong>Success :) </strong><br />
  206. Order ID: <?php echo $order_id; ?><br />
  207. Service: <?php echo $service; ?><br />
  208. Quantity: <?php echo $quantity; ?><br />
  209. Cut Balance: <?php echo "Rp. " . number_format($price,0,",","."); ?><br />
  210. Date: <?php echo $date; ?>
  211. </font>
  212. </div>
  213. <? } else { ?>
  214. Database error!
  215. <? } } } } else { ?>
  216. <div class="alert alert-info"> <strong>*INFO: </strong> Sebelum order mohon mebaca FAQ, agar tidak terjadi kesalahan saat melakukan order. Kami tidak akan merefund order yang error karena kesalahan user. </div>
  217. <? } ?>
  218. <!-- Row-->
  219. <div class="row">
  220. <!-- col -->
  221. <div class="col-md-12">
  222.  
  223. <div class="white-box">
  224. <h4><i class="fa fa-cart-plus"></i> Mulai Order</h4>
  225. <hr>
  226. <!-- start content -->
  227. <form class="form-horizontal" method="POST">
  228. <div class="form-group">
  229. <label class="col-md-12">Kategori</label>
  230. <div class="col-md-12">
  231. <select class="form-control" name="category" id="category">
  232. <option value="0">Pilih Kategori</option>
  233. <option value="IG">Instagram</option>
  234. <option value="TW">Twitter</option>
  235. <option value="FB">Facebook</option>
  236. <option value="YT">Youtube</option>
  237. <option value="GP">Google Plus</option>
  238. <option value="VINE">Vine</option>
  239. <option value="SC">Soundcloud</option>
  240.  
  241. </select>
  242. </div>
  243. </div>
  244. <div class="form-group">
  245. <label class="col-md-12">Server</label>
  246. <div class="col-md-12">
  247. <select class="form-control" name="service" id="service">
  248. <option value="0">Pilih Server</option>
  249. </select>
  250. </div>
  251. </div>
  252. <div class="form-group">
  253. <div class="col-md-4">
  254. <label>Harga/1000</label>
  255. <div class="input-group"><span class="input-group-addon">Rp.</span>
  256. <input type="text" class="form-control" id="price" value="0" readonly>
  257. </div>
  258. </div>
  259. <div class="col-md-4">
  260. <label>Min</label>
  261. <div>
  262. <input type="text" class="form-control" id="min" value="0" readonly>
  263. </div>
  264. </div>
  265. <div class="col-md-4">
  266. <label>Max</label>
  267. <div>
  268. <input type="text" class="form-control" id="max" value="0" readonly>
  269. </div>
  270. </div>
  271. </div>
  272. <div class="form-group">
  273. <div class="col-md-12">
  274. <label>Username/Link</label>
  275. <input type="text" class="form-control" name="link" placeholder="Username/Link" required>
  276. </div>
  277. </div>
  278. <div class="form-group">
  279. <div class="col-md-6">
  280. <label>Jumlah Order</label>
  281. <div>
  282. <input type="hidden" class="form-control" id="rate">
  283. <input type="number" class="form-control" name="quantity" id="quantity" placeholder="Jumlah Order" onkeyup="getcut(this.value).value;" required>
  284. </div>
  285. </div>
  286. <div class="col-md-6">
  287. <label>Total Harga</label>
  288. <div class="input-group"><span class="input-group-addon">Rp.</span>
  289. <input type="text" class="form-control" id="cutbalance" value="0" readonly>
  290. </div>
  291. </div>
  292. </div>
  293. <div class="form-group m-b-0">
  294. <div class="col-md-12">
  295. <button type="submit" class="btn btn-purple waves-effect waves-light" name="order">SUBMIT</button>
  296. </div>
  297. </div>
  298. </form>
  299. <!-- end content -->
  300. </div>
  301.  
  302. </div>
  303. <!-- col -->
  304. </div>
  305. <!-- Row-->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement