Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include 'koneksi.php';
- include 'navbar.php';
- $lapid = $_GET['id'];
- $id = $_SESSION['id'];
- $sql2 = "SELECT customer.nama, customer.email, customer.notelp, lapangan.namalap, lapangan.tarif, booking.mulai, booking.beres, booking.id, lapangan.open, lapangan.close, lapangan.id
- FROM booking
- INNER JOIN customer on booking.cust_id=customer.id
- INNER JOIN lapangan on booking.lap_id=lapangan.id
- WHERE cust_id = $id AND lap_id=$lapid";
- $hasil1 = $pdo->query($sql2);
- $row = $hasil1->fetch();
- $main = date("h", strtotime($row['mulai']));
- $udahan = date("h", strtotime($row['beres']));
- $main1 = idate("h", $main);
- $udahan1 = idate("h", $udahan);
- $q = $udahan1 - $main1;
- require_once(dirname(__FILE__) . '../Veritrans.php');
- //Set Your server key
- Veritrans_Config::$serverKey = "SB-Mid-server-ZX5_Q628ETGoodcnP9TC5669";
- // Uncomment for production environment
- // Veritrans_Config::$isProduction = true;
- // Enable sanitization
- Veritrans_Config::$isSanitized = true;
- // Enable 3D-Secure
- Veritrans_Config::$is3ds = true;
- // Required
- $transaction_details = array(
- 'order_id' => rand(),
- 'gross_amount' => 1000000, // no decimal allowed for creditcard
- );
- // Optional
- $item1_details = array(
- 'id' => $row['id'],
- 'quantity' => 2,
- 'price' => 2000,
- 'name' => $row['namalap'],
- );
- // Optional
- $item_details = array ($item1_details);
- // Optional
- $customer_details = array(
- 'first_name' => $row['nama'],
- 'last_name' => "",
- 'phone' => $row['notelp'],
- );
- // Optional, remove this to display all available payment methods
- $enable_payments = array('credit_card','gopay', 'cimb_clicks','mandiri_clickpay','echannel');
- // Fill transaction details
- $transaction = array(
- 'enabled_payments' => $enable_payments,
- 'transaction_details' => $transaction_details,
- 'customer_details' => $customer_details,
- 'item_details' => $item_details,
- );
- $snapToken = Veritrans_Snap::getSnapToken($transaction);
- ?>
- <body style="width: 100%;">
- <div class="container" style="margin-top: 20px;">
- <?php
- if($_SESSION['user_id']==null){
- ?>
- <h1 style='text-align:center'>Silahkan login terlebih dahulu.</h1>
- <form action="verifikasi.php" method="post">
- <div class="form-group">
- <label for="exampleDropdownFormEmail1">Email address</label>
- <input type="email" class="form-control" id="exampleDropdownFormEmail1" name="email" placeholder="[email protected]">
- </div>
- <div class="form-group">
- <label for="exampleDropdownFormPassword1">Password</label>
- <input type="password" name="pw" class="form-control" id="exampleDropdownFormPassword1" placeholder="Password">
- </div>
- <button type="submit" class="btn btn-primary">Sign in</button>
- </form>
- <?php
- }else{ ?>
- <?php include 'liatjadwal.php';
- ?>
- <br/>
- <br/>
- <br/>
- <br/>
- <br/>
- <form action="jadwal.php?id=<?php echo $_GET['id']; ?>" method="post" enctype="multipart/form-data">
- <div class="row">
- <div class="form-group col-md-6">
- <label for="exampleInputDate1">Silakan pilih tanggal</label>
- <input type="date" class="form-control" id="exampleInputDate1" name="tgl">
- </div>
- <div class="form-group col-md-3">
- <label for="exampleInputTime1">Waktu mulai</label>
- <br>
- <select class="form-control" name="mulai">
- <option>00:00</option>
- <option>01:00</option>
- <option>02:00</option>
- <option>03:00</option>
- <option>04:00</option>
- <option>05:00</option>
- <option>06:00</option>
- <option>07:00</option>
- <option>08:00</option>
- <option>09:00</option>
- <option>10:00</option>
- <option>11:00</option>
- <option>12:00</option>
- <option>13:00</option>
- <option>14:00</option>
- <option>15:00</option>
- <option>16:00</option>
- <option>17:00</option>
- <option>18:00</option>
- <option>19:00</option>
- <option>20:00</option>
- <option>21:00</option>
- <option>22:00</option>
- <option>23:00</option>
- <option>24:00</option>
- </select>
- </div>
- <div class="form-group col-md-3">
- <label for="exampleInputTime2">Waktu selesai</label>
- <br>
- <select class="form-control" name="beres">
- <option>00:00</option>
- <option>01:00</option>
- <option>02:00</option>
- <option>03:00</option>
- <option>04:00</option>
- <option>05:00</option>
- <option>06:00</option>
- <option>07:00</option>
- <option>08:00</option>
- <option>09:00</option>
- <option>10:00</option>
- <option>11:00</option>
- <option>12:00</option>
- <option>13:00</option>
- <option>14:00</option>
- <option>15:00</option>
- <option>16:00</option>
- <option>17:00</option>
- <option>18:00</option>
- <option>19:00</option>
- <option>20:00</option>
- <option>21:00</option>
- <option>22:00</option>
- <option>23:00</option>
- <option>24:00</option>
- </select>
- </div>
- </div>
- <div class="input-group mb-3">
- <div class="custom-file">
- <input type="file" id="inputGroupFile02" name="bukti">
- </div>
- </div>
- <div class="form-group notif col-md-4"><h4>NOTICE</h4><p>Please transfer your payment to <b>917398219 a/n Rio Alexander</b> to book this field, then we will confirm your booking in maximum 24 hours. Down payment is accepted 40% from the actual tariff.<br/><br/>Thank you and have a nice day! :)</p>
- </div>
- <input class="btn btn-primary" type="submit" name="submit" value="Book!">
- </form>
- <br><button class="btn btn-success" id="pay-button">Other Payments</button>
- <?php } ?>
- </div>
- <!-- TODO: Remove ".sandbox" from script src URL for production environment. Also input your client key in "data-client-key" -->
- <script src="https://app.sandbox.midtrans.com/snap/snap.js" data-client-key="SB-Mid-client-P5eDYUVOJcQHU5DR"></script>
- <script type="text/javascript">
- document.getElementById('pay-button').onclick = function(){
- // SnapToken acquired from previous step
- snap.pay('<?= $snapToken ?>', {
- // Optional
- onSuccess: function(result){
- /* You may add your own js here, this is just example */
- },
- // Optional
- onPending: function(result){
- /* You may add your own js here, this is just example */
- },
- // Optional
- onError: function(result){
- /* You may add your own js here, this is just example */
- }
- });
- };
- </script>
- <?php include 'footer.php' ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement