Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include('config.php');
- session_start();
- $username = $_SESSION['username'];
- $check = mysqli_query($db, "SELECT * FROM users WHERE username = '$username'");
- $row = mysqli_fetch_array($check,MYSQLI_ASSOC);
- $count = mysqli_num_rows($check);
- $balance = $row['balance'];
- if(!isset($username)) {
- header("Location: ../home");
- } else if ($count == 0 || $row['status'] == "Not active") {
- header("Location: ../logout.php");
- } ?>
- <?php
- include('check.php');
- $subtitle = "Topup Otomatis Via Pulsa";
- if (isset($_POST['tikettelkomsel'])) {
- $licanse = "Masukkan Licansemu"; // Isi Licanse Web Mu
- $buyer = $_POST['buyer']; // Nomor Yang Ingin Di Cek Boleh Diubah
- $jumlah = $_POST['jumlah']; // Total Pulsa Yang Ingin Di Konfirmasi Boleh diubah
- $url = "http://mypanel.win/access/api/telkomsel.php?licanse=".$licanse."&jumlah=".$jumlah."&dari=".$buyer."&server=".$no;
- $get = file_get_contents($url);
- $hasil = json_decode($get);
- if ($hasil->result == "false") {
- $error = "Gagal";
- } else if ($hasil->result == "true") {
- $success = "Tiket Berhasil Dipesan.";
- }
- }
- if (isset($_POST['konfirmasitelkomsel'])) {
- $licanse = "Masukkan Licansemu"; // Isi Licanse Web Mu
- $dari = $_POST['buyer']; // Nomor Yang Ingin Di Cek Boleh Diubah
- $jumlah = $_POST['jumlah']; // Total Pulsa Yang Ingin Di Konfirmasi Boleh diubah
- $url = "http://mypanel.win/access/api/konfirmtsel.php?licanse=".$licanse."&dari=".$dari."&jumlah=".$jumlah;
- $get = file_get_contents($url);
- $hasil = json_decode($get);
- $quantity = ($jumlah * 0.8);
- if ($hasil->result == "false") {
- $error = "Konfirmasi Gagal Karna $hasil->msg";
- } else if ($hasil->result == "true") {
- $success = "Konfirmasi Sukses Karna $hasil->msg ";
- $update = mysqli_query($db,"UPDATE users SET balance = balance+$quantity WHERE username = '$username'");
- } }
- include('header.php');
- ?>
- <!-- Start content -->
- <div class="content">
- <div class="container">
- <!-- Page-Title -->
- <div class="row">
- <div class="col-sm-12">
- <h4 class="pull-left page-title"><?php echo $subtitle; ?></h4>
- <ol class="breadcrumb pull-right">
- <li><a href="#"><?php echo $title; ?></a>
- </li>
- <li class="active"><?php echo $subtitle; ?></li>
- </ol>
- </div>
- </div>
- <div class="row">
- <div class="col-lg-12">
- <?php if (isset($error)) { ?>
- <div class="alert alert-danger">
- <b>Gagal : </b><?php echo $error; ?>
- </div>
- <? } else if (isset($success)) { ?>
- <div class="alert alert-success">
- <b>Berhasil : </b><?php echo $success; ?>
- </div>
- <? } ?>
- <div class="panel panel-color panel-primary">
- <div class="panel-heading">
- <h3 class="panel-title"><i class="md md-settings"></i> <?php echo $subtitle; ?></h3>
- </div>
- <div class="panel-body">
- <form class="form-horizontal" role="form" method="POST" action="topuptelkomsel.php">
- <div class="form-group">
- <label class="col-sm-2 control-label">Nohp</label>
- <div class="col-sm-10">
- <input type="text" class="form-control" name="buyer" placeholder="Masukkan Nomer Hp Yang Kmu Buat Transfer">
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">Jumlah Pulsa</label>
- <div class="col-sm-10">
- <input type="number" class="form-control" name="jumlah" placeholder="Masukkan Jumlah Pulsa Yang Akan Kamu Transfer">
- </div>
- </div>
- <div class="form-group m-b-0">
- <div class="col-sm-offset-2 col-sm-10">
- <button name="tikettelkomsel" type="submit" class="btn btn-info waves-effect waves-light"><i class="md md-settings"></i> Pesan Tiket</button><button name="konfirmasitelkomsel" type="submit" class="btn btn-info waves-effect waves-light"><i class="md md-settings"></i> Konfirmasi Tiket</button>
- </div>
- </div>
- </form>
- </div>
- </div>
- </div>
- </div>
- <!-- end row -->
- </div>
- <!-- container -->
- </div>
- <!-- content -->
- <?php include('footer.php'); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement