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 : 3.137.177.116


Current Path : /var/www/oasis/src/
Upload File :
Current File : /var/www/oasis/src/updateSection.php

<?php

session_start();
function GetUpdateSectionStudentList($aobj_context)
{
	include_once("/JSON.php"); 
	$json = new Services_JSON();
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
	$degree_code = ($aobj_context->mobj_data["degree"]);
	$exam_no = ($aobj_context->mobj_data["examno"]);
	$batchNo = ($aobj_context->mobj_data["batchNo"]);
	$College_Code = $_SESSION['collcode'];
	// if()
	$Table_Header.="<table  width='95%' cellspacing='0' class='tr_ventor_row' cellpadding='0' border='0'>";
	$Table_Header.="<th align='left' colspan='5' class='ui-jqgrid-titlebar ui-widget-header ui-corner-tl ui-corner-tr ui-helper' style='font-size:12px; padding-left:6px; height:24px;'>Section List</th>";			
	$Table_Header.="<tr class='ui-state-default ui-jqgrid-hdiv'>";	
	$Table_Header.="<td  style='padding:2px; width:100px; border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'><center>Sl. No.</center></td>";
	$Table_Header.="<td  style='padding:2px; width:10px; border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'><center>Reg No</center></td>";
	$Table_Header.="<td  style='padding:2px; width:300px; border-left:0px solid #C5DBEC; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'><center>Student Name</center></td>";
	$Table_Header.="<td  style='padding:2px; width:50px; border-left:0px solid #C5DBEC; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'><center>Section</center></td>";
	$Table_Header.="</tr>";
	
	$get_studentInfo = "select FREGNO as fstudid,FREGNO,FNAME,ifnull(FSECTION, '') as  FSECTION from student 
   	where fcollcode = '{$College_Code}' and fdegree ='{$degree_code}'
	and fexamno='{$exam_no}'
	and ifnull(fdeleted,'') <> 'T'
	order by FREGNO";

	$lobj_get_studentInfo = $aobj_context->mobj_db->getAll($get_studentInfo);
	 
	$sl =1;
	$i = 0;
	$batchNew = "A";
	foreach($lobj_get_studentInfo as $key=>$value)
	{
		$batch = $value['FSECTION'];

		if($batch == "" && $batchNo!== ""){
			if($i == $batchNo){
				$batchNew++;
				$i=0;
			}
			$curBatch = $batchNew;
		}else if($batch !== "") {
			 $curBatch = $batch;
		}else{
			$curBatch = "";
		}
		
		$id = $value['fstudid'];
		$Table_Header.="<tr class='tbl_row'>";	
		$Table_Header.="<td  class='tbl_row_new' style='border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px; font-size:12px;text-align:center;  background-color: #fff;' ><input tabindex=-1   type=text name='Regno' style='width:5px;text-align:center;border:none' readonly>{$sl} </td>";
		$Table_Header.="<td  class='tbl_row_new' style='border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px; font-size:12px;text-align:center;  background-color: #fff;' ><input tabindex=-1   type=text name='Regno' style='width:150px;text-align:center;border:none' readonly id='regno_{$id}' value='{$value[FREGNO]}'> </td>";
		$Table_Header.="<td  class='tbl_row_new' style='border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px; font-size:12px;text-align:left;padding-left:20px;  background-color: #fff;' ><input tabindex=-1   type=text name='Regno' style='width:300px;border:none;' readonly id='name_{$id}' value='{$value[FNAME]}'> </td>";
		$Table_Header.="<td  class='tbl_row_new' style='border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px; font-size:12px;text-align:center;  background-color: #fff;' ><input type='text' id='section_{$id}' value='{$curBatch}' style='width:50px;text-align:center;' onblur='this.value=this.value.toUpperCase();'></td>";
		$Table_Header.="</tr>";
		$i++;
		$sl++;
	}
	
	if(empty($lobj_get_studentInfo))
	{	
		$Table_Header.="<tr style='height: 20'>";
		$Table_Header.="<td COLSPAN=4 align = 'center'>No Records Found For this Search</td>";
		$Table_Header.="</tr>";
	}
	$Table_Header.="</table>";
	$arr['html']=$Table_Header;
	echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");	
	return;
}

function SaveStudentSectionDetails($aobj_context)
{
	session_start();	
    include_once("/JSON.php"); 
	$json = new Services_JSON();

	$College_Code = $_SESSION['collcode'];
	$lstr_param = stripslashes($aobj_context->mobj_data["output_details"]);
	$mobj_jsondata = $json->decode($lstr_param);
	$att_details = get_object_vars($mobj_jsondata);	

	foreach($att_details as $ak=>$av)
	{ 
		$lquery="update student set
		FSECTION='{$av->c}'
		where fcollcode='{$College_Code}' and fregno = '{$ak}'" ;
		
		$lobj_insert_qry = $aobj_context->mobj_db->Execute($lquery);
	}
 
	 
	if($lobj_insert_qry)
	{
		$rdata = "Updated Successfully.";
		print_r($aobj_context->mobj_output->ToJSONEnvelope($rdata,0,"success"));
		return $rdata;
	}
	else
	{
		$rdata = "No Updation / Add..!";
		print_r($aobj_context->mobj_output->ToJSONEnvelope($rdata,-1,"Failure"));  
		return $rdata;			
	}			
	 	
}	

?>