0xV3NOMx
Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64



Your IP : 18.191.67.90


Current Path : /proc/thread-self/root/var/www/oasis/src_old/
Upload File :
Current File : //proc/thread-self/root/var/www/oasis/src_old/colldesp_ack.php

<?php

function getcolldespackdetails($aobj_context)
{
	$examdate = trim($aobj_context->mobj_data["examdate"]);
	
	session_start();
	$collcode=$_SESSION['collcode'];
	
	$fileds = ",DATE_FORMAT({$fdaterange}FROM,'%d/%m/%Y'),DATE_FORMAT({$fdaterange}TO,'%d/%m/%Y')";
	
	$query = "select f,fdegree,fexamno {$fileds} from collexam 
			where fcollcode between '{$college_code_from}' and '{$college_code_to}'
			and fdegree between '{$degree_code_from}' and '{$degree_code_to}'
			and fexamno between '{$Examno_from}' and '{$Examno_to}'
			order by fcollcode,fdegree,fexamno";

	$query = "SELECT fqpcode,DATE_FORMAT(fdoe,'%d/%m/%Y') AS fexamdate,FTOTSCRIPT as scriptcnt,fbuno,IFNULL(fackno,'') AS fackno,DATE_FORMAT(fackdate,'%d/%m/%Y') AS fackdate 
	FROM colldesp WHERE fdoe = DATE_FORMAT(STR_TO_DATE('{$examdate}','%d/%m/%Y'),'%Y-%m-%d') and fcollcode = '{$collcode}'
	ORDER BY fqpcode";	
	$result = $aobj_context->mobj_db->getAll($query);
	//var_dump($query);
	
	$i = 1;
	$table.="<table id ='ftable1' align='left'  cellpadding='1' cellspacing='1'  border='1' style='overflow:auto;width:350px;margin:0px;padding:0px;'>";
	foreach($result as $key => $value)
	{      
		$table.="<tr>";
		$table.="<b><td  align='center'  ><input type = 'text' tabindex = '-1' id = '{$i}qpcode' style='width:100px;height:20px' disabled onchange = 'getid(this.id)' value = '{$value['fqpcode']}' name = 'date'/></td></b>";			
		$table.="<td  align='center'  ><input type = 'text' tabindex = '-1'  id = '{$i}examdate' style='width:100px;height:20px' disabled  onchange = 'getid(this.id)' value = '{$value['fexamdate']}' /></td>";
		$table.="<td  align='center' ><input type = 'text' tabindex = '-1' id = '{$i}scriptcnt' style='width:55px;height:20px'   disabled onchange = 'getid(this.id)' value = '{$value['scriptcnt']}' /></td>";
		$table.="<td  align='center' ><input type = 'text' tabindex = '-1' id = '{$i}fbuno' style='width:105px;height:20px'   disabled onchange = 'getid(this.id)' value = '{$value['fbuno']}' /></td>";
		$table.="<td  align='center'  ><input type = 'text' id = '{$i}ackno' style='width:110px;height:20px' onchange = 'getid(this.id)' value = '{$value['fackno']}'/> 
			<input type = 'hidden' id = '{$i}acknoh' value = 'E' /></td>";
		$table.="<td  align='center'  ><input type = 'text' style='width:110px;height:20px' id = '{$i}ackdate' onchange = 'getid('{$i}ackno')' onkeypress='return acceptNumbersOnlyForModule(event);' onkeydown = 'dmydateformat(event,this.id)' placeholder = 'dd/mm/yyyy' maxlength = 10 onchange = 'getid(this.id)' value = '{$value['fackdate']}'  />
		<script>$('#{$i}ackdate').datepicker({showOn: 'button',showButtonPanel: true, changeMonth: true,	changeYear: true,dateFormat:'dd/mm/yy',buttonImage: 'images/cal.jpg', buttonImageOnly: true})</script><input type = 'hidden' id = '{$i}date2h' value = 'E'/></td>";
		$table.="</tr>";
		
		$i++;
	//	var_dump($table);
	}
	$table.="</table>";
	
	if($result)
	{
		$arr['table'] = $table;
		echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");	
		return; 
	}else
	{
		$arr = '';
		echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"Failur");	
		return; 
	}
	
}

function Savecolldespack($aobj_context)
{
	include_once($aobj_context."/src/JSON.php");
	session_start();
	$collcode=$_SESSION['collcode'];	
	$json = new Services_JSON();
	$date_arr = stripslashes($aobj_context->mobj_data["date_arr"]);
	$mobj_jsondata = $json->decode($date_arr);
	$date_arr = get_object_vars($mobj_jsondata);	
	
	$examdate = trim($aobj_context->mobj_data["examdate"]);
	//var_dump($date_arr);
	for($k=1;$k<=count($date_arr);$k++)
	{
		$query = "update colldesp set
				fackno = '{$date_arr[$k]->ackno}',
				fackdate = DATE_FORMAT(str_to_date('{$date_arr[$k]->ackdate}','%d/%m/%Y'),'%Y-%m-%d')
				where fqpcode = '{$date_arr[$k]->fqpcode}' 
				and   fbuno = '{$date_arr[$k]->fbuno}'  
				and   fcollcode = '{$collcode}'";
				
		$lobj_update = $aobj_context->mobj_db->Execute($query);
	}
	
	if($lobj_update)	
	{	
		$arr = "updated successfully";
		echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success"); 
	}
	
}


?>