50 lines
1.8 KiB
PHP
50 lines
1.8 KiB
PHP
|
|
<?php
|
||
|
|
include('includes/config/config.php');
|
||
|
|
include('includes/functions.php');
|
||
|
|
include('log_entry.php');
|
||
|
|
|
||
|
|
error_log("Start Printing Request Attributes");
|
||
|
|
$requestStr = "";
|
||
|
|
foreach ($_REQUEST as $key => $value) {
|
||
|
|
$requestStr .= $key . " : " . $value . "\n";
|
||
|
|
error_log($key . " : " . $value . "<br />\r\n");
|
||
|
|
}
|
||
|
|
error_log("End Printing Request Attributes");
|
||
|
|
|
||
|
|
save_log($requestStr, 'Schedule', 'SAVE', 'save_schedule.php');
|
||
|
|
$ohc_type_id =$_SESSION['current_ohcttype'];
|
||
|
|
|
||
|
|
$fee_schedule_id = isset($_POST['fee_schedule_id']) ? $_POST['fee_schedule_id'] : '';
|
||
|
|
$batch = isset($_POST['batch']) ? $_POST['batch'] : "DFS".$ohc_type_id;
|
||
|
|
$schedule_name = isset($_POST['schedule_name']) ? $_POST['schedule_name'] : '';
|
||
|
|
$due_date = isset($_POST['due_date']) ? $_POST['due_date'] : '';
|
||
|
|
$amount_due = isset($_POST['amount_due']) ? $_POST['amount_due'] : '';
|
||
|
|
$ohc_type_id = $_SESSION['current_ohcttype'];
|
||
|
|
|
||
|
|
|
||
|
|
if (!empty($fee_schedule_id)) {
|
||
|
|
$query = "UPDATE batch_fee_schedule SET
|
||
|
|
schedule_name = '$schedule_name',
|
||
|
|
batch = '$batch',
|
||
|
|
due_date = '$due_date',
|
||
|
|
amount_due = '$amount_due',
|
||
|
|
modified_by = 'username_placeholder', -- Replace with actual username variable
|
||
|
|
ohc_type_id ='$ohc_type_id'
|
||
|
|
WHERE fee_schedule_id = '$fee_schedule_id'";
|
||
|
|
} else {
|
||
|
|
$query = "INSERT INTO batch_fee_schedule(
|
||
|
|
fee_schedule_id, schedule_name, batch, due_date, amount_due,ohc_type_id, modified_by
|
||
|
|
) VALUES (
|
||
|
|
'$fee_schedule_id', '$schedule_name', '$batch', '$due_date', '$amount_due','$ohc_type_id', 'username_placeholder' -- Replace with actual username variable
|
||
|
|
)";
|
||
|
|
}
|
||
|
|
|
||
|
|
error_log($query);
|
||
|
|
|
||
|
|
if (!$result = mysqli_query($conn, $query)) {
|
||
|
|
error_log(mysqli_error($conn));
|
||
|
|
exit(mysqli_error($conn));
|
||
|
|
}
|
||
|
|
?>
|
||
|
|
|