ok

Mini Shell

Direktori : /home2/selectio/public_html/tnpsctestbatch.com/
Upload File :
Current File : /home2/selectio/public_html/tnpsctestbatch.com/order-complete.php

<?php include "header.php";

ob_start();


    $encryptionKey = 'TNPSC';
    $decodedUrl = base64_decode(urldecode($_GET['code']));
    $iv = substr($decodedUrl, 0, 16);
    $encryptedUrl = substr($decodedUrl, 16);
    $decryptedUrl = openssl_decrypt($encryptedUrl, 'aes-256-cbc', $encryptionKey, 0, $iv);


    $order_id = $_GET['code'];
    $amount = $_GET['amount'];

    
    if ($_SERVER["REQUEST_METHOD"] == "POST") {
    $payment_status = $_POST["code"];
     if($payment_status == 'PAYMENT_ERROR'){
         
         ?>
         
        <div classs="container">
            <div class="row">
                <div class="col-md-12" style="display: flex;justify-content: center;">
                    <h3> Payment Faild </h3>
                </div>
            </div>
        </div>

<?php 
         
     } else{
         
          // 3) Order Items - Update Here
    $query = $pdo->prepare("UPDATE tbl_payment SET status=?,payment_type =? WHERE id=?");
    $query->execute(array(1,1,$order_id));






if(isset($_GET['user_id'])) {
    $user_id = $_GET['user_id'];

                    	$statement = $pdo->prepare("SELECT * FROM tbl_students WHERE id=?");
                    	$statement->execute(array($user_id));
                        $result = $statement->fetchAll(PDO::FETCH_ASSOC);
                    	$total = $statement->rowCount();   
               		    $_SESSION['user_exam'] = $result[0];
               		    
               		    
               		    if(!isset($_SESSION['page_reload'])){
               		        $_SESSION['page_reload'] = 1;
               		       
               		    }else{
               		         $_SESSION['page_reload']++;
               		    }
               		   

                              
                    }



$currentDate = new DateTime();
$currentDate->modify('+30 days'); 
$futureDate = $currentDate->format('Y-m-d');

?>


<div class="col-md-12" style="display: flex;justify-content: center;">


    <img src="icons/payment_completed.gif" alt="Completed">
</div>
<div class="col-md-12" >
    <div class="row" style="display: flex;justify-content: center;">
        <div class="col-md-8">

 
            <h3> Congrats! <?= $_SESSION['user_exam']['name'] ?> have successfully purchased the purchased the General Studies and Test Batch Series. Hence forth, you can successfully access the all 
            the questions in General Studies and Test Batch Series till <b> <?= $futureDate ?> </b> </h3>
        </div>
    </div>
    



</div>

<?php

         
     }
}
 
?>



 

<?php include "footer.php";
if(isset($_SESSION['page_reload'])&&$_SESSION['page_reload']==1){
               		        
               		   ?>
<script>
    $(document).ready(function(){
        location.reload();
    })
</script>

<?php } ?>



Zerion Mini Shell 1.0