Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // script API By Yoga Wahyu Firmansyah
- include_once "koneksi.php";
- $api_key = $_POST['api_key']; // kode API pembeli / yang submit
- $query = mysql_query("SELECT * FROM user WHERE api_key = '$api_key'");
- $jumlah = mysql_num_rows($query);
- $hasilnya = mysql_fetch_array($query);
- $username = $hasilnya['username']; // username pembeli
- $key = "4xp6rg9riypd012f5qd0s5ef9d15j9ed"; // kode api panelpedia
- $link = $_POST['link']; // username waktu proses
- $type = $_POST['type']; // jenis packet
- $jumlah = $_POST['jumlah']; // Jumlah yang di submit
- $tanggal = date("Y-m-d"); // tanggal
- if ($type == 1) { // kode layanan di panel pedia harus sama
- $harga = 16; // harga paket nya
- $paket = "Instagram Followers Very Fast WP Server 1"; // keterangan paket
- } else if ($type == 69) {
- $harga = 85;
- $paket = "Instagram Followers Aktif Indonesia";
- } else if ($type == 2) {
- $harga = 15;
- $paket = "Instagram Followers USA HQ Slow Server 2";
- } else if ($type == 3) {
- $harga = 19;
- $paket = "Instagram Followers Fast Big Server 3";
- } else if ($type == 4) {
- $harga = 15;
- $paket = "Instagram Followers HQ Slow Server 4";
- } else if ($type == 5) {
- $harga = 11;
- $paket = "Instagram Likes Very Fast Server 1";
- } else if ($type == 20) {
- $harga = 12;
- $paket = "Instagram Likes Very Fast Server 2";
- } else if ($type == 30) {
- $harga = 15;
- $paket = "Instagram Video Views Fast Server 1";
- } else if ($type == 31) {
- $harga = 16;
- $paket = "Instagram Video Views Server 2";
- } else if ($type == 6) {
- $harga = 20;
- $paket = "Twitter Followers Instant (Kirim username saja)";
- } else if ($type == 7) {
- $harga = 19;
- $paket = "Twitter Retweets Instant | Max 10000";
- } else if ($type == 8) {
- $harga = 19;
- $paket = "Twitter Favorites Instant | Max 10000";
- } else if ($type == 9) {
- $harga = 10;
- $paket = "Youtube Views Super Fast";
- } else if ($type == 21) {
- $harga = 190;
- $paket = "Youtube Video Likes";
- } else if ($type == 22) {
- $harga = 280;
- $paket = "Youtube Video Dislikes";
- } else if ($type == 23) {
- $harga = 100;
- $paket = "Youtube Video Reshare";
- } else if ($type == 18) {
- $harga = 15;
- $paket = "Facebook Video Views";
- } else if ($type == 17) {
- $harga = 10;
- $paket = "Soundcloud Downloads";
- } else if ($type == 27) {
- $harga = 130;
- $paket = "Soundcloud Followers";
- } else if ($type == 10) {
- $harga = 90;
- $paket = "Facebook Fanspage Likes Start 24jam";
- } else if ($type == 11) {
- $harga = 11;
- $paket = "Soundcloud Plays";
- } else if ($type == 12) {
- $harga = 15;
- $paket = "Facebook Photo/Post Likes Fast";
- } else if ($type == 13) {
- $harga = 16;
- $paket = "Vine Followers";
- } else if ($type == 14) {
- $harga = 16;
- $paket = "Vine Likes";
- } else if ($type == 15) {
- $harga = 16;
- $paket = "Vine Revines Super Fast | Max Order 200000";
- } else if ($type == 16) {
- $harga = 16;
- $paket = "Vine Loops";
- } else if ($type == 19) {
- $harga = 10;
- $paket = "Website Traffic Fast";
- } else if ($type == 29) {
- $harga = 750;
- $paket = "Snapchat Followers";
- } else {
- $type1 = "ERROR";
- }
- $hargatotal = $jumlah * $harga; // jumlah ditotal $harga contoh 16 x 100 Jumlah = 1600 Saldo
- if(mysql_num_rows($query) == 0) { // buat cek kode API web kamu
- $result = array(
- 'hasilnya' => 'error',
- 'alasan' => 'Kode API Salah'
- );
- echo json_encode($result);
- } else if ($jumlah < 100) {
- $result = array(
- 'hasilnya' => 'error',
- 'alasan' => 'Min Order 100'
- );
- echo json_encode($result);
- } else if (!$link) {
- $result = array(
- 'hasilnya' => 'error',
- 'alasan' => 'Data Masih Kosong'
- );
- echo json_encode($result);
- } else if (!$jumlah) {
- $result = array(
- 'hasilnya' => 'error',
- 'alasan' => 'Data Masih Kosong'
- );
- echo json_encode($result);
- } else if ($hasilnya['saldo'] < $hargatotal) {
- $result = array(
- 'hasilnya' => 'error',
- 'alasan' => 'Saldo kurang'
- );
- echo json_encode($result);
- } else {
- $postdata = 'api_key='.$key.'&link='.$link.'&type='.$type.'&jumlah='.$jumlah.'';
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, 'http://panelpedia.id/api.php');
- curl_setopt ($ch, CURLOPT_POST, 1);
- curl_setopt ($ch, CURLOPT_POSTFIELDS, $postdata);
- curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, false);
- $store = curl_exec ($ch);
- curl_close ($ch);
- $json = json_decode($store,true);
- $id = $json['id'];
- if ($json['result'] == "error") {
- $result = array(
- 'hasilnya' => 'error',
- 'alasan' => ''.$json['reason'].''
- );
- echo json_encode($result);;
- } else {
- $simpan = mysql_query("INSERT INTO historyall VALUES('', '$id', '$username', '$paket', '$hargatotal', 'Sukses', 'Url/Username : $link', '$tanggal')");
- $simpan = mysql_query("UPDATE user SET saldo=saldo-$hargatotal WHERE api_key = '$api_key'");
- if ($simpan) {
- $result = array(
- 'hasilnya' => 'sukses',
- 'orderid' => ''.$id.''
- );
- echo json_encode($result);;
- } else {
- echo 'ERROR..
- ';
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement