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


Current Path : /var/www/oasis/src_old/
Upload File :
Current File : /var/www/oasis/src_old/subshort.php

<?php
function saveSubjectwiseBlock($aobj_context)
{
    session_start();	
    include_once("/JSON.php"); 
	$json = new Services_JSON();
	
	$fdegree = ($aobj_context->mobj_data["fdegree"]);
	$fexamno = ($aobj_context->mobj_data["fexamno"]);
	
	$fsubcode = substr($aobj_context->mobj_data["fsubcode"],0,4);
	
	$College_Code = $_SESSION['collcode'];
	$funivcode = $_SESSION['FUNIVCODE'];
	$User_code = $_SESSION['usr']; 

	
	$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)
	{
	
		if($av->status == 'T')
		{
			$update = "INSERT INTO `attshort` (`FDEGREE`, `FEXAMNO`, `FSUBCODE`, `FREGNO`, `FREMARKS`)
			VALUES ('{$fdegree}', '{$fexamno}', '{$fsubcode}', '{$av->fregno}', '{$av->remarks}') 
			ON DUPLICATE KEY update FREMARKS = '{$av->remarks}'";
			$lobj_insert_qry = $aobj_context->mobj_db->Execute($update);

			$query = "update canddet set fpassmth = 'Short'
			where  fdegree = '{$fdegree}' and fcollcode = '{$College_Code}' and fsubcode = '{$fsubcode}' and fregno = '{$av->fregno}'";
			$res = $aobj_context->mobj_db->Execute($query);

		}else
		{
			$query = "delete from attshort where fregno = '{$av->fregno}' and fdegree = '{$fdegree}'
			and fexamno = '{$fexamno}' and fsubcode = '{$fsubcode}'";
			$lobj_insert_qry = $aobj_context->mobj_db->Execute($query);
			
			$query = "update canddet set fpassmth = ''
			where  fdegree = '{$fdegree}' and fcollcode = '{$College_Code}' and fsubcode = '{$fsubcode}' and fregno = '{$av->fregno}'";
			$res = $aobj_context->mobj_db->Execute($query);
		}
	}

	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;			
	}			
	 	
}

function GetSubShortRegisterNumbers($aobj_context)
{
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
	session_start();	
	$College_Code = $_SESSION['collcode'];	
 
	$fdegree = $aobj_context->mobj_data["fdegree"];
	$fexamno = $aobj_context->mobj_data["fexamno"];
	$fsubcode = $aobj_context->mobj_data["fsubcode"];


	$e_data.="<table  width='90%' cellspacing='0' class='tr_ventor_row' cellpadding='0' border='0' >";
	$e_data.="<th align='left' colspan='4' class='ui-jqgrid-titlebar ui-widget-header ui-corner-tl ui-corner-tr ui-helper' style='font-size:12px; padding-left:6px; height:24px;'>Subject Wise Block</th>";			
	$e_data.="<tr class='ui-state-default ui-jqgrid-hdiv'>";	
	$e_data.="<td  style='padding:2px; width:60px; border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'><center>Reg No</center></td>";
	$e_data.="<td  style='padding:2px; width:140px; border-left:0px solid #C5DBEC; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'><center>Student Name</center></td>";
	$e_data.="<td  style='padding:2px; width:20px; border-left:0px solid #C5DBEC; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'><center>Select to Block</center></td>";
	$e_data.="<td  style='padding:2px; width:20px; border-left:0px solid #C5DBEC; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'><center>Remarks</center></td>";
	$e_data.="</tr>";
	
	$get_records = "select cd.fregno,s.fname,cd.fsubcode,a.FREMARKS,if(ifnull(a.fregno,'') = '','F','T') as attsh 
	from canddet cd
    inner join student s on cd.fdegree = s.fdegree and  cd.fcollcode = s.fcollcode and 
    cd.fregno = s.fregno 
    left join attshort a on cd.fdegree = a.fdegree and cd.fexamno = a.fexamno 
    and cd.fsubcode = a.fsubcode and cd.fregno = a.fregno
    where cd.fdegree = '{$fdegree}' and cd.fsubcode = left('{$fsubcode}',4) and cd.fexamno = '{$fexamno}'
    and cd.fcollcode = '{$College_Code}'
	and (ifnull(fpassmth,'') = '' or ifnull(fpassmth,'') = 'Short')";	
//	var_dump($get_records);				
    $lobj_get_records = $aobj_context->mobj_db->GetAll($get_records);
    
    $k=1;
    $border_bottom="";
    
    foreach($lobj_get_records as $key=>$value)
    {
     
		$attsh=$value['attsh'];

		if($attsh == 'T')
			$cnd = "checked";
		else
			$cnd = "";

        if($k==count($lobj_get_records))
            $border_bottom="border-bottom:1px solid #C5DBEC;";	
        
        $e_data.="<tr class='ui-widget-content jqgrow'>";
        $e_data.="<td tabindex=-1   align='center' style='{$border_bottom}; border-left:1px solid #C5DBEC;border-right:1px solid #C5DBEC; padding:2px;'><input tabindex=-1  {$inp_class} type=text name='Regno' style='width:80px;border:none;' readonly id='reg_{$k}' value='{$value['fregno']}'> </td>";
        $e_data.="<td tabindex=-1  align='left' style='{$border_bottom};border-right:1px solid #C5DBEC; padding:2px;' id='mes_std_name_{$value['fregno']}' >  {$value['fname']} </td>";
        $e_data.="<td tabindex=1  align='center' style='{$border_bottom};border-right:1px solid #C5DBEC;  padding:2px;'> <input type='checkbox' name='vehicle1' value='{$value['fregno']}' {$cnd} id = '{$value['fregno']}' onchange = 'updatehiddenfiled(\"{$value['fregno']}\")'>
        <input type='hidden' value = '' id = 'h_{$value['fregno']}' >
        </td>";
        $e_data.="<td tabindex=2 align='center' style='{$border_bottom};border-right:1px solid #C5DBEC;  padding:2px;'>  <input type = 'text' value = '{$value['FREMARKS']}' style = 'width:95%' placeholder = 'Remarks' id = 'remarks_{$value['fregno']}'> </td>";
        $e_data.="</tr>";
        $k++;
    }
		
    if(empty($lobj_get_records))
    {	
        $e_data.="<tr style='height: 20'>";
        $e_data.="<td COLSPAN=4 align = 'center'>No Records Found For this Search</td>";
        $e_data.="</tr>";
    }
	
	$e_data.="</table><br>";		
	
	
	$arr['table']=$e_data;
	
	echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success"); 
	return; 
	
}
?>