ok

Mini Shell

Direktori : /proc/self/root/home2/selectio/www/y1jobportal.in/apps-api/
Upload File :
Current File : //proc/self/root/home2/selectio/www/y1jobportal.in/apps-api/update-category.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'])) && ($_POST['type'] == 'update_category')) {
    if (empty(($_POST['category_id']))) {
        $response['error'] = true;
        $response['message'] = "category 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();
    }
    $category_id=$_POST['category_id'];
    $id=$_POST['id'];
    $statement = $pdo->prepare("UPDATE `customer` SET category_id='".$category_id."' where id=$id");
    $result=$statement->execute();
    
    if($result){
        $response["error"]   = false;
        $response["message"] = "Category Selected Updated";
    }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