25 lines
730 B
PHP
25 lines
730 B
PHP
<?php
|
|
include('includes/config/config.php');
|
|
include('log_entry.php');
|
|
$subject_id= $_POST['subject_id'];
|
|
$subject_name= $_POST['subject_name'];
|
|
|
|
|
|
$ohc_type_id = $_SESSION['current_ohcttype'];
|
|
|
|
|
|
if($subject_id > 0){
|
|
$query = "update subjects set subject_name = '$subject_name',ohc_type_id = '$ohc_type_id',modified_by = '".$_SESSION['user_id']."' where subject_id = '".$subject_id."'";
|
|
|
|
error_log("update subjects: ".$query);
|
|
}
|
|
else {
|
|
$query = "insert into subjects set subject_id='$subject_id' ,subject_name = '$subject_name',ohc_type_id='$ohc_type_id',modified_by = '".$_SESSION['user_id']."'";
|
|
|
|
error_log("insert subjects".$query);
|
|
|
|
}
|
|
if (!$result = @mysqli_query($conn,$query)) {
|
|
exit(mysqli_error($conn));
|
|
}
|
|
?>
|