<?php
session_start();
// ============
include("../../asset/theme/css/myfunc.php");
include("../../php_crud/my_class.php");
$obj=new my_class();
// ============

//$today_date = date("Y-m-d");
extract($_POST);
$today_date;
$update_date = $today_date.' 00:00:00';

/*if($operation=='save_atd'){

	$form_data = array(
	'_section_id'=>$section_id,
	'_std_id'=>$std_id,
	'_atd_status'=>$atd_status,
	'_late_time'=>$late_time,
	'_comments'=>$comments,
	'_entry_by'=>$_SESSION['LOGIN_USERID'],
	'_entry_date'=>date("Y:m:d h:i:s")
	);
	
$last_id = $obj->Insert_Data_By_Cond("_atd_daily_by_class", $form_data,"_std_id='$std_id' AND DATE(_entry_date)='$today_date'");

}*/

if($operation=='update_atd'){
	$form_data = array(
	'_section_id'=>$section_id,
	'_std_id'=>$std_id,
	'_atd_status'=>$atd_status,
	'_late_time'=>$late_time,
	'_comments'=>$comments,
	'_update_by'=>$_SESSION['LOGIN_USERID'],
	'_last_update'=>$today_date
	);
$upresult2 = $obj->Update_Data("_atd_daily_by_class", $form_data,"WHERE _std_id='$std_id' AND _entry_date='$update_date'");
	
//$last_id = $obj->Insert_Data_By_Cond("_atd_daily_by_class", $form_data,"_std_id='$std_id' AND DATE(_entry_date)='$today_date'");

}
echo $msg ='1';

if($operation2=='up_status'){

$form_data = array(
'_atd_status'=>'1',
'_atd_by'=>$_SESSION['LOGIN_USERID'],
'_atd_time'=>$atd_time,
'_comments'=>$remarks,
'_update_by'=>$_SESSION['LOGIN_USERID']
);

$upresult = $obj->Update_Data("_atd_daily_status_class", $form_data,"WHERE _id='$atd_status_id'");
}

?>