ok
Direktori : /home2/selectio/public_html/y1jobportal.in/apps-api/ |
Current File : /home2/selectio/public_html/y1jobportal.in/apps-api/update-transaction.php |
<?php include_once('config/config.php'); include_once('config/custom-functions.php'); include 'config/send-sms.php'; $fn = new custom_functions(); /*login*/ if ((isset($_POST['type']))) { if (empty(($_POST['pay_amount']))) { $response['error'] = true; $response['message'] = "amount id required!"; print_r(json_encode($response)); return false; exit(); } if (empty(($_POST['id']))) { $response['error'] = true; $response['message'] = "id required!"; print_r(json_encode($response)); return false; exit(); } if (empty(($_POST['transaction_id']))) { $response['error'] = true; $response['message'] = "transaction_id required!"; print_r(json_encode($response)); return false; exit(); } // $category_id=$_POST['category_id']; $id=$_POST['id']; $amount=$_POST['pay_amount']; $transaction_id=$_POST['transaction_id']; // $customer_id=$_POST['customer_id']; $statement = $pdo->prepare("UPDATE `customer` SET transaction_id='".$transaction_id."',process=4 where id=$id"); $result=$statement->execute(); $statement = $pdo->prepare("INSERT INTO tbl_transaction (customer_id, transaction_id, amount) VALUES (?,?,?);"); $result=$statement->execute([$id,$transaction_id,$amount]); $date = date("Y-m-d"); /*tbl subscription details*/ $statement = $pdo->prepare("INSERT INTO tbl_subscription_details (type,plan_id,no_of_interviews,date_of_activation,customer_id,status) VALUES (?,?,?,?,?,?);"); $result=$statement->execute([1,1,3,$date,$id,1]); if($result){ $response["error"] = false; $response["message"] = "Payment Successfully Completed"; }else{ $response['error'] = true; $response['message'] = "Something Went Wrong..."; } print_r(json_encode($response)); }else{ $response['error'] = true; $response['message'] = "Function not Call..."; print_r(json_encode($response)); }