Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- try{
- $db = new PDO ("mysql:host=localhost;dbname=;","","");
- }catch(PDOException $e){
- echo $e->getmessage();
- }
- ?>
- <html>
- <head>
- <meta charset="utf-8">
- <meta http-equiv="x-ua-compatible" content="ie=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>GONIT - Billing batal auto</title>
- <link rel="icon" href="../../id/images/icon.ico">
- <link rel="stylesheet" href="../../id/css/foundation.css">
- <link rel="stylesheet" href="../../id/css/app.css">
- <script type="text/javascript" src="http://code.jquery.com/jquery-2.0.2.js"></script>
- </head>
- <body>
- <?php
- if ($_POST['submit']) {
- $billing_deskripsi = $_POST['billing_deskripsi'];
- $billing_status = $_POST['billing_status'];
- $nourut = $_POST['nourut'];
- $tw_billing = $db->prepare("UPDATE tw_billing SET billing_status = :billing_status, billing_deskripsi = :billing_deskripsi WHERE nourut = :nourut");
- $tw_billing->BindParam(':nourut',$nourut);
- $tw_billing->BindParam(':billing_deskripsi',$billing_deskripsi);
- $tw_billing->BindParam(':billing_status',$billing_status);
- $tw_billing->execute();
- $tw_user_vpn_deleted = $db->prepare("DELETE FROM tw_user_vpn WHERE nourut = :nourut");
- $tw_user_vpn_deleted->BindParam(':nourut',$nourut);
- $tw_user_vpn_deleted->execute();
- }
- ?>
- <?php
- $tw_billing = $db->prepare("SELECT * FROM tw_billing ORDER BY billing_id");
- $tw_billing->execute();
- while($data = $tw_billing->fetch(PDO::FETCH_ASSOC)){
- ?>
- <?php
- if ($data["billing_status"] == "Belum dibayar") { ?>
- <?php
- $mulai = date($data['billing_tanggal']); // waktu mulai
- $exp = date($data['expiredpay']); // batas waktu
- if (!(strtotime($mulai) <= time() AND time() >= strtotime($exp))) {
- } else {
- echo '<form method="post" name="form" action="">';
- echo '<input type="submit" id="submit" name="submit" value="submit">';
- echo '<input type="hidden" name="nourut" value='.$data["nourut"].'>';
- echo '<input type="hidden" name="billing_deskripsi" value='.$data["billing_deskripsi"].'>';
- echo '<input type="hidden" name="billing_status" value="Batal">';
- echo '</form>';
- }
- ?>
- <?php }
- else if ($data["billing_status"] == "Dibayar") { ?>
- <?php }
- else if ($data["billing_status"] == "Ditangguhkan") { ?>
- <?php }
- else if ($data["billing_status"] == "Batal") { ?>
- <?php } ?>
- <?php } ?>
- <script type="text/javascript">
- window.setTimeout(function() {
- document.getElementById("submit").click();
- }, 1); // 1200000 = seconds*1000
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement