<?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);
$operation = isset($_REQUEST['operation']) ? $_REQUEST['operation']:'';
$operation2 = isset($_REQUEST['operation2']) ? $_REQUEST['operation2']:'';

if($operation=='save_atd'){
	
	
	// if($homework_message_status == 1 ){
		$column = '_section_id='.$section_id.', _std_id='.$std_id.', _homework_message_status='.$homework_message_status.', _homework_topics="'.$homework_topics.'", _entry_by='.$_SESSION['LOGIN_USERID'].', _entry_date="'.date("Y:m:d h:i:s").'" , _homework_common_topics= "'.$_homework_common_topics.'"';
	   $cond = '_std_id='.$std_id.' AND DATE(_entry_date)="'.$today_date.'"';
		$table_name = '_homework_daily_by_class';
	 //   echo $sql = "UPDATE _homework_daily_by_class SET ".$column." WHERE ".$cond; 
	   echo  $sql = "UPDATE ".$table_name." SET ".$column." WHERE ".$cond;
		$last_id = $obj->Update_Or_Insert_Data_By_Check_Duplicate("_homework_daily_by_class", $column,$cond);
	//}
}


if($operation2=='up_status'){

$form_data = array(
'_homework_status'=>'1',
'_homework_by'=>$_SESSION['LOGIN_USERID'],
'_homework_time'=>$home_work_time,
'_homework_comments'=>$remarks,
'_update_by'=>$_SESSION['LOGIN_USERID']
);

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

?>