<?php
include '../connect/cms-config.php' ;
include '../requires/session.php' ;
include '../requires/function.php' ;

$result = 'failed' ;

// set value in variable
$list_id       	= escapeString($_POST['list_id']) ;
$list_work_day 	= escapeString($_POST['list_work_day']) ;
$list_ot_day   	= escapeString($_POST['list_ot_day']) ;
$list_min   	= escapeString($_POST['list_min']) ;
$list_wt   		= escapeString($_POST['list_wt']) ;
$list_remark   	= escapeString($_POST['list_remark']) ;

if ( $list_id != '' ){
	$mysqli->query( "UPDATE staff_attendance_list SET
					 list_late = '".$list_min."',
					 list_type_remark = '".$list_wt."',
					 list_work_day = '".$list_work_day."',
					 list_ot_day   = '".$list_ot_day."',
					 list_attendance_remark = '".$list_remark."'
					 WHERE list_id = '".$list_id."'" ) ;

	$result = 'success' ;
}

// set in array
$array['result'] = $result ;

// echo array
echo json_encode($array) ;

?>