

<?php
include('header.php');
if(isset($_GET['txn_status']) && $_GET['txn_status'] =='SUCCESS'){
    ?>
    <script>
            $(function(){
                Swal.fire(
                 'Success',
                        'Recharge Successfull',
                        'success'
                )
            });
        </script>
    <?php
}
if(isset($_GET['txn_status']) && $_GET['txn_status'] =='FAILED'){
    ?>
    <script>
        alert('Recharge Failed!');
    </script>
    <?php
}
if(isset($_GET['txn_status']) && $_GET['txn_status'] =='TXN_FAILED'){
    ?>
    <script>
        alert('Recharge Failed by bank!');
    </script>
    <?php
}
?>
<style>
/* ===================== PAGE BACKGROUND ===================== */
body{
    background:linear-gradient(135deg,#0f2027,#203a43,#2c5364);
    font-family:"Poppins",sans-serif;
}

/* ===================== PAYMENT CARD ===================== */
.payment-form{
    max-width:1400px;
    margin:40px auto;
    background:linear-gradient(135deg,#ffffff,#f4f7ff);
    padding:25px 30px;
    border-radius:18px;
    box-shadow:0 20px 50px rgba(0,0,0,.35);
    position:relative;
}

/* TOP BORDER GLOW */
.payment-form::before{
    content:'';
    position:absolute;
    top:0;
    left:0;
    right:0;
    height:6px;
    background:linear-gradient(135deg,#11998e,#38ef7d);
    border-radius:18px 18px 0 0;
}

/* ===================== HEADING ===================== */
.payment-form h1{
    text-align:center;
    font-weight:800;
    color:#1e3c72;
    margin-bottom:25px;
    letter-spacing:1px;
}

/* ===================== INPUT ===================== */
.payment-form input[type="text"]{
    width:100%;
    padding:14px 16px;
    margin-bottom:15px;
    border-radius:30px;
    border:1px solid #d0d7ff;
    font-size:15px;
    transition:.3s;
    box-shadow:inset 0 2px 6px rgba(0,0,0,.08);
}

.payment-form input[type="text"]:focus{
    outline:none;
    border-color:#396afc;
    box-shadow:0 0 0 3px rgba(57,106,252,.25);
}

/* ===================== SUBMIT BUTTON ===================== */
.payment-form input[type="submit"],
.payment-form button{
    width:100%;
    padding:14px;
    border-radius:30px;
    font-weight:700;
    font-size:16px;
    border:none;
    cursor:pointer;
    background:linear-gradient(135deg,#11998e,#38ef7d);
    color:#fff;
    box-shadow:0 6px 18px rgba(0,0,0,.35);
    transition:.25s;
}

.payment-form input[type="submit"]:hover,
.payment-form button:hover{
    transform:translateY(-2px);
    box-shadow:0 10px 28px rgba(0,0,0,.45);
}

/* ===================== NOTE HEADER ===================== */
.bg-info{
    background:linear-gradient(135deg,#396afc,#2948ff)!important;
    color:#fff;
    font-weight:700;
    padding:10px;
    border-radius:10px 0 0 10px;
}

.bg-danger{
    background:linear-gradient(135deg,#ff416c,#ff4b2b)!important;
    color:#fff;
    padding:10px;
    border-radius:0 10px 10px 0;
}

/* ===================== MARQUEE ===================== */
.marquee{
    font-weight:600;
    letter-spacing:.5px;
}

/* ===================== TEXT INFO ===================== */
.payment-form p,
.payment-form br{
    color:#2c3e50;
    font-size:14px;
}

/* ===================== QR POPUP ===================== */
.qr-popup{
    display:none;
    position:fixed;
    top:80px;
    left:50%;
    transform:translateX(-50%);
    width:320px;
    background:#ffffff;
    padding:20px;
    border-radius:18px;
    text-align:center;
    border:4px solid #38ef7d;
    box-shadow:0 15px 40px rgba(0,0,0,.45);
    z-index:9999;
}

.qr-popup img{
    max-width:220px;
    margin:15px auto;
}

.qr-popup button{
    background:linear-gradient(135deg,#ff416c,#ff4b2b);
    border-radius:25px;
}

/* ===================== MOBILE ===================== */
@media(max-width:768px){
    .payment-form{
        margin:20px;
        padding:20px;
    }
}
</style>
	<?php
if(isset($_POST['submit'])){
    $user = $_SESSION['userid'];
    $number = $_SESSION['phone'];
    $gmail = $_SESSION['emailid'];
     date_default_timezone_set('Asia/Kolkata');
   $datetime = date('d/m/Y h:i:s a', time());
   $amount = intval($_POST['remark']);
   if ($amount <= 24) {
     echo "<script>
        alert('❌ Minimum recharge amount is 25');
        window.location.href = window.location.href;
    </script>";
    exit;
    }

   $order_id = "" . rand(10000000,99999999);
    $query ="INSERT INTO `onlinepay`(`or id`, `user id`, `amount`, `date_time`) VALUES ('$order_id','$user','$amount','$datetime')";
   $run = mysqli_query($conn ,$query);
   if ($run == TRUE){
       
 ?><form method="post" action="Gatway/index.php" name="f1">
 <input type="hidden" id="ORDER_ID" tabindex="1" maxlength="24" size="20"
name="ORDER_ID" autocomplete="off"
                        value="<?php echo $order_id; ?>">
                        <input type="hidden" name="gateway_type" autocomplete="off" value="Robotics">
                        <input type="hidden" name="txnNote" autocomplete="off" value="<?php echo $user; ?>">
                        <input  type="hidden" name="cust_Mobile" autocomplete="off" value="<?php echo $number; ?>">
                        <input  type="hidden" name="cust_Email" autocomplete="off" value="<?php echo $gmail; ?>">
                        <input type="hidden" name="txnAmount"
                        value="<?php echo $amount; ?>">
                       
                       </form> 
                       <script type="text/javascript">
            document.f1.submit();
        </script>
    <?php	

}
}
?> 

    <div class="payment-form">
         
        <h1>Recharge</h1>
   
         <form class="user" action="" method="POST">

				  <div class="form-group row">
                  <div class="col-sm-6 mb-3 mb-sm-0">
                    <input required="required" type="text" class="form-control"  placeholder="Amount" min="25" name="remark" value="" onkeyup="this.value = this.value.toUpperCase();" onblur="this.value = this.value.toUpperCase();">
                  </div>
                  <br>
                  <div class="col-sm-6 mb-3 mb-sm-0">       
                    <input required="required" type="submit" name="submit" class="btn btn-primary" value="Submit">
                  </div>
				  </div> 
				  
				  
				 </form>
				  <br>   <br> 
				    <div class="  col-lg-10 col-9 bg-danger">
          <marquee class="marquee" onmouseover="this.stop();" onmouseout="this.start();">
           Note:-&nbsp;         Keep some things in mind while recharging                                </marquee>
        </div>  <br>  
     
				
 <div class="col-lg-2 col-3 bg-info text-center"><br>
1.
Now online recharge will be done and after payment success, money will automatically come into your wallet. <br>  <br>
2.If you refresh or close the page while recharging, money will not come into the wallet.
<br> <br>
3. Do not close the QR code page while recharging.
<br> <br></div>        

    </div>


    