50 lines
1.4 KiB
PHP
50 lines
1.4 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,'Shift Details','SAVE','save_shift_details.php');
|
|
error_reporting(E_ALL & ~E_WARNING & ~E_NOTICE);
|
|
begin();
|
|
|
|
|
|
$shift_id=$_POST['shift_id'];
|
|
|
|
|
|
|
|
$emp_id=$_POST['emp_id'];
|
|
|
|
$shift_status= implode(',',$_POST['shift_status']);
|
|
|
|
|
|
|
|
$query_initial="";
|
|
$endquery="";
|
|
if(!empty($shift_id)){
|
|
$sql_del = "delete from shift_details where shift_id='$shift_id'";
|
|
mysqli_query($conn,$sql_del);
|
|
}
|
|
|
|
|
|
|
|
$query="insert into shift_details set shift_date=STR_TO_DATE('".$_POST['shift_date']."','%d-%m-%Y'), emp_id='".$emp_id."',
|
|
shift_status='".$shift_status."',ohc_type_id = '".$_SESSION['current_ohcttype']."' ,modified_by = '".$_SESSION['user_id']."' ".$endquery;
|
|
error_log("shifting query details".$query);
|
|
//echo $query;
|
|
|
|
if (!$result = mysqli_query($conn,$query)) {
|
|
error_log ( "Exception:" . mysqli_error($conn) );
|
|
error_log ( "Failed to Execute the Personal info Query::: " . $query );
|
|
rollback();
|
|
exit(mysqli_error($conn));
|
|
}
|
|
|
|
commit();
|
|
?>
|
|
|