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

extract($_REQUEST);

$today = date('Y-m-d');

	
	


		

	$section = str_replace('\\','',$p);
	$data= json_decode($section);
	$error = 0;
	$row = 0;
	if(!empty($data)){
		$module_id = $data->module_id ;
		$AllSection = isset($data->AllSection)?$data->AllSection:'';
		$i = 0;
		
		
		
		foreach($AllSection as $product)
		{
			//print_r($product); 
			if(!empty($product)){
				$section_id =  $product->section_id;
				
				
				
				$table_name =  "_homework_daily_status_class ";
				$COLUMN = '_approve_satus';
				$where_cond = '	_section_id='.$section_id.'  &&  DATE(_entry_date) ="'.$today.'"'  ;
				//$SEND_STATUS=$obj->View_colmn_By_Cond($table_name,$COLUMN,$where_cond);
				
			//	 print_r($SEND_STATUS);
				
			
				$table_name=" _homework_daily_status_class";
				$column="_approve_satus = 1";
				$where_cond='_homework_status = 1 AND  DATE(_entry_date) = "'.$today.'" AND _section_id = '.$section_id.' ';
				$row=$obj->Update_Data2($table_name,$column,$where_cond);		
		} 
	}
}//echo $i;
	$MSG = array('msg' => 'Added Successfuly');
	
	echo json_encode($MSG);	
	
	
	
	
	