ok

Mini Shell

Direktori : /home2/selectio/public_html/y1jobportal.in/apps-api/
Upload File :
Current File : /home2/selectio/public_html/y1jobportal.in/apps-api/company-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'];
    $plan_id=$_POST['plan_id'];
    // $customer_id=$_POST['customer_id'];
    
    $statement = $pdo->prepare("UPDATE `client` SET transaction_id='".$transaction_id."',payment_status=1,plan_id='".$plan_id."',paid_amount='".$amount."' 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]);
    */
    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));
}

Zerion Mini Shell 1.0