ok

Mini Shell

Direktori : /home2/selectio/public_html/y1jobportal.in/apps-api/
Upload File :
Current File : /home2/selectio/public_html/y1jobportal.in/apps-api/update-customer-fcm.php

<?php
include_once('config/config.php');
include_once('config/custom-functions.php');
include 'config/send-sms.php';
$fn = new custom_functions();

/*update fcm*/
if ((isset($_POST['type'])) && ($_POST['type'] == 'update_fcm_id')) {
    if (empty(($_POST['id']))) {
        $response['error'] = true;
        $response['message'] = "id required!";
        print_r(json_encode($response));
        return false;
        exit();
    }
    
    $fcm_id = (isset($_POST['fcm_id']) && !empty(trim($_POST['fcm_id']))) ? trim($fn->xss_clean($_POST['fcm_id'])) : '';
    
    $id=$_POST['id'];
    $statement = $pdo->prepare("UPDATE `customer` SET fcm_id='".$fcm_id."' where id=$id");
    $result=$statement->execute();
    
    if($result){
        $response["error"]   = false;
        $response["message"] = "FCM ID 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