ESH/save_app_indent.php
2024-10-23 18:28:06 +05:30

24 lines
879 B
PHP

<?php
include('includes/config/config.php');
$indent_id = $_POST['indent_id'];
$status = $_POST['status'];
$remarks = $_POST['app_remarks'];
$app_date = $_POST['approval_date'];
$rolecode = $_SESSION['RoleCode'];
if ($rolecode == 'DOC') {
$sql = "update indent_master set status='" . $status . "',approval_date=STR_TO_DATE('" . $app_date . "','%d/%m/%Y'),approving_doc_id='" . $_SESSION['user_id'] . "',approval_remarks='" . $remarks . "' where indent_id='" . $indent_id . "' and ohc_type_id = '" . $_SESSION['current_ohcttype'] . "' ";
} else {
$sql = "update indent_master set status='" . $status . "' and ohc_type_id = '" . $_SESSION['current_ohcttype'] . "' where indent_id='" . $indent_id . "'";
}
error_log("sql " . $sql);
if (!$result = @mysqli_query($conn, $sql)) {
exit(mysqli_error($conn));
} else {
$data = "success";
}
echo json_encode($data);
?>