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


Current Path : /var/www/html/sdu/src/
Upload File :
Current File : /var/www/html/sdu/src/college_degree_status.php

<?php
function saveCollegeDegreeStatus($aobj_context)
{
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
	include_once("/JSON.php"); 
	$json = new Services_JSON();
	$id = ($aobj_context->mobj_data["id"]);
	$coll_code = ($aobj_context->mobj_data["coll_code"]);
	$FMODULE = ($aobj_context->mobj_data["FMODULE"]);	
	$lstr_param = stripslashes($aobj_context->mobj_data["cds_details"]);
	$mobj_jsondata = $json->decode($lstr_param);
	$larr_cds_data = get_object_vars($mobj_jsondata);
	
	  
	    	
	for( $i = 0; $i < count($larr_cds_data); $i++ )
	{		
			$update_cond='';
			if($larr_cds_data[$i]->cds_reset==1 || $larr_cds_data[$i]->cds_reset=='1')
			{
			$update_cond=",FSTATUS= '' and FDATE='0000-00-00'";
			}
			$Update_into_cds_data="update colldeg set  			
			                      FYEAR='{$larr_cds_data[$i]->cds_year}',			                     
								  FACTIVE='{$larr_cds_data[$i]->is_active}'
								    {$update_cond}
								  where FDEGREE='{$larr_cds_data[$i]->cds_degree}'
								  and FCOLLCODE='{$coll_code}' and FMODULE='{$larr_cds_data[$i]->cds_module}'";										
							
		$lobj_update_into_cds_details = $aobj_context->mobj_db->Execute($Update_into_cds_data);  					
	}			
    if($lobj_update_into_cds_details)
	{
		$rdata = "Updated Successfully";
		print_r($aobj_context->mobj_output->ToJSONEnvelope($rdata,0,"success"));
		return $rdata;
	}
	else
	{
		$rdata = "Updation Failed.";
		print_r($aobj_context->mobj_output->ToJSONEnvelope($rdata,-1,"Failure"));  
		return $rdata;			
	} 		
} 

function getCollegeDegreeStatus($aobj_context)
{
	require_once(dirname(__FILE__)."\SalCompClass.php");
	$check_type_obj=new SalCompClass($aobj_context);
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
	$internal_code=$aobj_context->mobj_data["internal_code"];	
	$module_name=$aobj_context->mobj_data["module_name"];
	$college_code=trim($aobj_context->mobj_data["FCOLLCODE"]);		
    $degree_code=$aobj_context->mobj_data["FDEGREE"]; 		
	$College_data_header="<table align='center' cellspacing='0' cellpadding='0' border='0' width='97%'>";
	$College_data_header.=" <tr><td class='act_txtclr' colspan='7' style='background-color:#3D83CC; color:#fff; font-weight:700; width:222px; padding:3px 6px; letter-spacing:0.5pt;'>College Degree Status</td></tr>";
	$College_data_header.="<tr style='background-image:url(../jqGrid3/themes/tarka/images/grid-blue-hd.gif);border-bottom:1px solid #CBC7B8; color:#000; font-weight:700; padding:3px 6px; letter-spacing:0.5pt;'>";
	$College_data_header.="<td align=center style='padding:2px; width:140px; border-left:1px solid #ccc; border-right:1px solid #ccc;'>Degree</td>";
	$College_data_header.="<td align=center style='padding:2px; width:140px; border-left:1px solid #ccc; border-right:1px solid #ccc;'>Module</td>";
	$College_data_header.="<td align=center style='padding:2px; width:88px; border-left:0px solid #ccc; border-right:1px solid #ccc;'>Active</td>";
	$College_data_header.="<td align=center style='padding:2px; width:48px; border-left:0px solid #ccc; border-right:1px solid #ccc;'>Year</td>";
	$College_data_header.="<td align=center style='padding:2px; width:58px; border-left:0px solid #ccc; border-right:1px solid #ccc;'>Status</td>";
	$College_data_header.="<td align=center style='padding:2px; width:90px; border-left:0px solid #ccc; border-right:1px solid #ccc;'>Date</td>";
	$College_data_header.="<td align=center style='padding:2px; width:68px; border-left:0px solid #ccc; border-right:1px solid #ccc;'>Reset</td>";
	$College_data_header.="</tr>";
	$cond='';
	if($degree_code!='')
	$cond=  " and FDEGREE='{$degree_code}'";
	$get_names="select FDEGREE,FMODULE,FACTIVE,FYEAR,FEXAMTYPE,FSTATUS,FDATE from colldeg
	where FCOLLCODE='{$college_code}' {$cond} ";
	  
	$lobj_get_names = $aobj_context->mobj_db->getAll($get_names);
	 
	$k=0;	
	$id=1;	
	foreach($lobj_get_names as $key=>$val)
		{		 
			if($k%2==0)
				$class='tbl_row';
				else
				$class='tbl_row1';  
			 $cds_active_is_selected=($val['FACTIVE']==1)?'checked':'';							 				
			 $cds_year=$val['FYEAR'];			 
			 	 
			 $college_data_details.="<tr class={$class} >";
			 $college_data_details.="<td id='cds_degree_{$id}' align=center style='border-left:1px solid #ccc; padding:2px;'>{$val[FDEGREE]}</td>";			
			 $college_data_details.="<td 'id='cds_module_{$id}' align=center style='solid #ccc; padding:2px;'>{$val[FMODULE]}</td>";
			 $college_data_details.="<td align=center style='solid #ccc; padding:2px;'><input type=checkbox id='is_active_{$id}' {$cds_active_is_selected} >  </td>";
			 $college_data_details.="<td  align=center style='solid #ccc; padding:2px;'><input type=text value={$cds_year} id='cds_year_{$id}'></td>";
			 $college_data_details.="<td id=cds_status_{$id}' align=center style='solid #ccc; padding:2px;'> {$val['FSTATUS']}</td>";
			 $college_data_details.="<td id=cds_date_{$id}' align=center style='solid #ccc; padding:2px;'>{$val['FDATE']}</td>";
			 $college_data_details.="<td align=center style=' solid #ccc; padding:2px;'><input type=checkbox id='cds_reset_{$id}'> </td>";
 			 $college_data_details.="</tr>";
			 $k++;	
			 $id++;
		   } 	
		
		$arr['html']=$College_data_header.$college_data_details."</table>";
		$arr['table_data']=$lobj_get_names;
		echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");									
}
 function autocompletephp($aobj_context)
 {
			$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
			$q = $aobj_context->mobj_data["part"];	      				      
			//$lstr_qry = "select FCOLLNAME as value from college where FCOLLNAME like '%{$q}%'"; 			
			$lstr_qry = "select FCOLLCODE as value from college  where FCOLLCODE like '%{$q}%'"; 			
			$lobj_rs = $aobj_context->mobj_db->GetAll($lstr_qry);
			if(!empty($lobj_rs))			
			echo  json_encode($lobj_rs);
 } 
?>