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.224.60.19


Current Path : /var/www/html/reva/src/
Upload File :
Current File : /var/www/html/reva/src/iaabsententry.php

<?php
function getIaAESession($aobj_context)
	{
		$collcode=$_SESSION['collcode'];
		$date     = $aobj_context->mobj_data["date"];

		$query = "SELECT DISTINCT  FSESSION,fdegree,fcollcode FROM iatimetable WHERE FCOLLCODE ='{$collcode}'
                  AND fdoe = DATE_FORMAT(STR_TO_DATE('{$date}','%d/%m/%Y'),'%Y-%m-%d')";

		$results = $aobj_context->mobj_db->GetAll($query);
        // var_dump($results);
        // die();
		if($results)
		{	
			echo $aobj_context->mobj_output->ToJSONEnvelope($results,0,"success"); 
			return;
		}else{
			$results = "Room Allotment not done";
			echo $aobj_context->mobj_output->ToJSONEnvelope($results,-1,"failure"); 
			return;
		}	
	}
    function getRoomsAllotmnt($aobj_context)
	{
		$collcode=$_SESSION['collcode'];
		$date     = $aobj_context->mobj_data["date"];
        $session = $aobj_context->mobj_data["session"];
       
		$query = "SELECT DISTINCT froomno,fcollcode,froomname FROM iamasroom WHERE fcollcode='{$collcode}'";

		$results = $aobj_context->mobj_db->GetAll($query);
        // var_dump($results);
        // die();
		if($results)
		{	
			echo $aobj_context->mobj_output->ToJSONEnvelope($results,0,"success"); 
			return;
		}else{
			$results = "Room Number Not Available";
			echo $aobj_context->mobj_output->ToJSONEnvelope($results,-1,"failure"); 
			return;
		}	
	}

    function viewIAAbsentEntryDet($aobj_context)
	{
		$collcode=$_SESSION['collcode'];
		$date     = $aobj_context->mobj_data["date"];
        $session = $aobj_context->mobj_data["session"];
        $room = $aobj_context->mobj_data["room"];
        // var_dump($collcode,$date,$session,$room,"yoo");
        // die();

		$query = "SELECT DISTINCT marks.FCOLLCODE,marks.fregno,marks.fhallno, student.fname,
        ifnull(marks.FLMID,'')as FLMID, ifnull(marks.FDUMMYNO,'')as FDUMMYNO
                 FROM marks JOIN student ON student.fregno = marks.fregno WHERE fhallno='{$room}' 
                 GROUP BY fregno;";
		$results = $aobj_context->mobj_db->GetAll($query);
        // var_dump($results);
        // die();
		if($results)
		{	
			echo $aobj_context->mobj_output->ToJSONEnvelope($results,0,"success"); 
			return;
		}else{
			$results = "Room Number Not Available";
			echo $aobj_context->mobj_output->ToJSONEnvelope($results,-1,"failure"); 
			return;
		}	
	}

    function saveIAAbsentEntry($aobj_context){
		$collcode=$_SESSION['collcode'];
        $data = json_decode($aobj_context->mobj_data["data"], true);
        // var_dump($data);
        // die();
		foreach($data as $key =>  $value)
		{
			$query = "UPDATE marks SET FLMID='{$value['tabno']}' , FDUMMYNO='{$value['dummyno']}' WHERE 
            fregno='{$value['regno']}' AND fhallno='{$value['hallno']}'";

			$results = $aobj_context->mobj_db->Execute($query);
		}

		if($results)
		{	
            $arr['msg']="Updated Successfully.";
			echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success"); 
			return;
		}else{ 
			$results['msg'] = "Something Went Wrong";
			echo $aobj_context->mobj_output->ToJSONEnvelope($results,-1,"failure"); 
			return;
		}	
	}
    ?>