<?php include("cn.php");?>
<?php $title = "Pay Now";?>
<!DOCTYPE html>
<html lang="en">
<?php include("../admin/head-tag.php");?>
<?php 
       $sql_1 = mysqli_query($connect,"select * from app_users where
        Id = '".$_SESSION["userid"]."' ");
        $data_1 = mysqli_fetch_assoc($sql_1);
?>


<body>

<div class="inner-wrapper">

<?php include("../admin/pre-loader.php");?>

<?php include("header.php");?>

<?php 

if (isset($_POST['id']))
{
    $_SESSION['carid']=$_POST['id'];
}
?>
     	 
<div class="container" style="margin-top: 65px;" >
    <div class="col-md-7" style="float: none; margin: 0 auto;">
      <div class="form-area">


        <?php
        // echo $verify;
        $bookingnumber = $_GET["id"];
        $sql1 = "SELECT * FROM rentedcars WHERE BookingNumber = '$bookingnumber'";
        $result1 = mysqli_query($connect, $sql1);
        $url="../admin/";

        if(mysqli_num_rows($result1)){
            while($row1 = mysqli_fetch_assoc($result1)){
                $amount = $row1["total_amount"];
    //             $car_nameplate = $row1["car_nameplate"];
    //             $ac_price = $row1["ac_price"];
    //             $non_ac_price = $row1["non_ac_price"];
    //             $ac_price_per_day = $row1["ac_price_per_day"];
    //             $non_ac_price_per_day = $row1["non_ac_price_per_day"];
				// $carimg= $url.$row1["car_img"];
            }
        }

        ?>


<script src="https://secure.paytabs.com/payment/js/paylib.js"></script>

<form action="https://yourserver.com/payment" id="payform" method="post">
  <span id="paymentErrors"></span>
  <div class="row">
    <label>Card Number</label>
    <input type="text" data-paylib="number" size="20">
  </div>
  <div class="row">
    <label>Expiry Date (MM/YYYY)</label>
    <input type="text" data-paylib="expmonth" size="2">
    <input type="text" data-paylib="expyear" size="4">
  </div>
  <div class="row">
    <label>Security Code</label>
    <input type="text" data-paylib="cvv" size="4">
  </div>
  <input type="submit" value="Pay Now">
</form>

<script type="text/javascript">
var myform = document.getElementById('payform');
paylib.inlineForm({
  'key': 'C6KMBP-B9PM6D-HVNMV7-2V2GRM',
  'form': myform,
  'autoSubmit': true,
  'callback': function(response) {
    document.getElementById('paymentErrors').innerHTML = '';
    if (response.error) {             
      paylib.handleError(document.getElementById('paymentErrors'), response); 
    }
  }
});
</script>

</div>
</div>
    <?php include("../admin/scripts.php");?>
    
<div class="sidebar-overlay" id="sidebar_overlay"></div>
</body>
</html>