<?php
include("../../db.php");
error_reporting(E_ALL);
header("Access-Control-Allow-Origin: * ");

    $id = $_POST['id'];

    $status = 0;
    $msg    = '';

    $aryData=array(
            "name"      =>  "$_POST[name]",
            "mobile"    =>  "$_POST[mobile]",
            "address"   =>  "$_POST[address]",
            "image"     =>  "$_POST[image]",
        );

    if($id!="" && $_POST['name']!="")
    {
 	    $flgUp = $db->updateAry("security", $aryData, "where id='$id' ");
  	    
  	    if($flgUp > 0){
	        $status = 1;
  	        $msg    = "Data updated successfully.";
  	    }
  	    else {
  	        $msg    = "Something went wrong. Please try again.";
  	    }
    }
    else {
            $msg = "Name and id cant be blank.";
    }


    echo json_encode(array('status' => $status, 'msg'=>$msg));
?>