Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64
Your IP : 3.141.19.115
Current Path : /var/www/html/oums/api/ |
| Current File : /var/www/html/oums/api/updsalary.php |
<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');
// var_dump($_POST);
include("sys_connect.php");
if(!isset($_POST["femplcode"]) || !isset($_POST["fmonth"]) || !isset($_POST["fstatus"])
|| $_POST["femplcode"] == "" || $_POST["fmonth"] == "" || $_POST["fstatus"] == ""){
echo json_encode(array("msg" => "Invalid Params", "error_code" => -1));
die();
}
$femplcode = $_POST["femplcode"];
$fmonth = $_POST["fmonth"];
$status = $_POST["fstatus"];
$query = "update saldet set fcredited = '{$status}',
fupddate = now() where fmonth = '{$fmonth}' and femplcode = '{$femplcode}'";
$res = mysqli_query($mycon, $query);
if($res) {
echo json_encode(array("error_code" => 0, 'msg' => "Updated Successfully." ));
} else {
echo json_encode(array("error_code" => -1, 'msg' => "Error While Updating" ));
}
?>
|