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


Current Path : /proc/thread-self/root/var/www/html/jssu/custom_src/
Upload File :
Current File : //proc/thread-self/root/var/www/html/jssu/custom_src/batch_wise_details.php

<?php
class batch_wise_details
 {
public $aobj_context;
public $college_name;	
public $town;	
public $address;	
public $Degree_name;	

	function __construct($aobj_context)
	{
		 require_once($aobj_context->main_src.'src/format.php');
		$this->aobj_context=$aobj_context;
		$this->collcode=$_SESSION['collcode'];		 
	}
	function GetBatchWiseRegNos()
	{
		$College_Code = $_SESSION['collcode'];	
		$range = $this->aobj_context->mobj_data["range"];
		$type = $this->aobj_context->mobj_data["type"];
		$limit = $this->aobj_context->mobj_data["limit"];
		$Subcode = $this->aobj_context->mobj_data["Subcode"];
		$Degcode = $this->aobj_context->mobj_data["Degcode"];
		$Examno = $this->aobj_context->mobj_data["Examno"];
		$valuataion = $this->aobj_context->mobj_data["valuataion"];
		$condition_name = trim($this->aobj_context->mobj_data["condition_name"]);
		$condition_val = stripcslashes($this->aobj_context->mobj_data["condition_val"]);
		$mycondition = ($condition_name=='like')?$condition_name." '%{$condition_val}%' ":$condition_name.$condition_val;
		
		
		$path = $this->aobj_context->main_src.'/imported_files/';
		$path_name = "imported_files/bat_{$College_Code}_{$_SESSION['user_id']}.html";
		$filename = "{$path}bat_{$College_Code}_{$_SESSION['user_id']}.html";
		
		unlink($filename);  
		$fp = fopen($filename, 'w+');		
			
		$e_data.="<table  width='80%' 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;'>Marks List</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>Batch</center></td>";
		$e_data.="</tr>";
		
		
		
		$get_records = "select stu.FREGNO, stu.FNAME, 
						IFNULL(mak.FMARKS11, -1) as FMARKS, 
						IFNULL(lpad(mak.FBATCH,2,'0'), '') AS FBATCH  
						FROM student stu inner join marks_pr mak ON stu.fdegree=mak.fdegree and stu.FREGNO=mak.FREGNO 
						and mak.Fdegree='{$Degcode}' and mak.Fexamno='{$Examno}' and mak.FCOLLCODE='{$College_Code}'
						inner join subject sub on sub.FCSUBCODE = mak.FSUBCODE 
						and sub.FCSUBCODE='{$Subcode}' and sub.FDEGREE='{$Degcode}' and sub.FEXAMNO='{$Examno}'
						WHERE stu.FREGNO != ''  and stu.FREGNO {$mycondition} 
						
						group by stu.FREGNO  order by stu.FREGNO limit   1000";					
		 
		$lobj_get_records = $this->aobj_context->mobj_db->GetAll($get_records);
		//echo $get_records;
		 $k=1;
		 $border_bottom="";
		foreach($lobj_get_records as $key=>$value)
		{
			if($k==count($lobj_get_records))
			$border_bottom="border-bottom:1px solid #C5DBEC;";	
			 $FBATCH=$value[FBATCH];
			 if($FBATCH=="00")
			 $FBATCH="";
			$e_data.="<tr class='ui-widget-content jqgrow'>";
			$e_data.="<td tabindex=-1   align='center'  onclick=\"AssignBatchNo('{$value[FREGNO]}')\" style='cursor:pointer;{$border_bottom};  border-left:1px solid #C5DBEC;border-right:1px solid #C5DBEC; padding:2px;'> {$value[FREGNO]}  </td>";
			$e_data.="<td tabindex=-1   onclick=\"AssignBatchNo('{$value[FREGNO]}')\"   align='left' style='cursor:pointer;{$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   {$inp_class} name=marks type=text style='width:30px;{$border}' {$read_only} id='mes_marks_{$value[FREGNO]}'  onkeypress='return acceptNumbersOnlyForModule(event);' maxlength=3  onfocus='if(!empty(this.value)) \$g_entered_batch=this.value;' onblur='if(!empty(this.value)) this.value=LPad(this.value,2,0); if(!empty(this.value)) \$g_entered_batch=this.value; CheckBatchmaxNo(this);CalculateBatchDetails();' value='{$FBATCH}' > </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>";		
		fwrite($fp, $e_data);
		
		$arr['filenme']=$path_name;
		//$arr['table_data']=$lobj_get_records;
		
		fclose($fp); 
		
		echo $this->aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success"); 
		return; 
	}
	function SaveBatchWiseDetails()
	{
		session_start();	
		include_once($this->aobj_context."/src/JSON.php"); 
		$json = new Services_JSON();
		
	 
		$College_Code = $_SESSION['collcode'];	
		$VivaSubcode = $this->aobj_context->mobj_data["VivaSubcode"];
		$Subcode = $this->aobj_context->mobj_data["Subcode"];
		$Degcode = $this->aobj_context->mobj_data["Degcode"];
		$Examno = $this->aobj_context->mobj_data["Examno"];
		$User_code = $_SESSION['usr']; 
		 
		
		$lstr_param = stripslashes($this->aobj_context->mobj_data["output_details"]);
		$mobj_jsondata = $json->decode($lstr_param);
		$Markentry_details = get_object_vars($mobj_jsondata);	
		 
		$total_marks_entry = count($Markentry_details);	
		
		 
			for( $i = 0; $i<$total_marks_entry; $i++ )
			{
				 
				 if(!empty($VivaSubcode))
					{
					$update_record = " update marks_pr set FBATCH='{$Markentry_details[$i]->batch_no}' 
										where FCOLLCODE = '{$College_Code}' and 
												FDEGREE = '{$Degcode}' and
												FEXAMNO = '{$Examno}' and
												FREGNO = '{$Markentry_details[$i]->reg_no}' and
												FSUBCODE = '{$VivaSubcode}' ";
					 							
					$lobj_insert_qry = $this->aobj_context->mobj_db->Execute($update_record);	
					}
					
					$update_record = " update marks_pr set FBATCH='{$Markentry_details[$i]->batch_no}' 
										where FCOLLCODE = '{$College_Code}' and 
												FDEGREE = '{$Degcode}' and
												FEXAMNO = '{$Examno}' and
												FREGNO = '{$Markentry_details[$i]->reg_no}' and
												FSUBCODE = '{$Subcode}' ";
					//echo $delete_record;							
					$lobj_insert_qry = $this->aobj_context->mobj_db->Execute($update_record);	
						 
					 			
			}		
			 
			if($lobj_insert_qry)
			{
				$rdata = "Inserted Successfully.";
				print_r($this->aobj_context->mobj_output->ToJSONEnvelope($rdata,0,"success"));
				return $rdata;
			 }
			else
			{
				$rdata = "No Updation / Add..!";
				print_r($this->aobj_context->mobj_output->ToJSONEnvelope($rdata,-1,"Failure"));  
				return $rdata;			
			}			
		 	
	}
}	
	

function GetBatchWiseRegNos($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$class_obj=new batch_wise_details($aobj_context);  
$class_obj->GetBatchWiseRegNos(); 
}
function SaveBatchWiseDetails($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$class_obj=new batch_wise_details($aobj_context);  
$class_obj->SaveBatchWiseDetails();
 
}
?>