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


Current Path : /var/www/oasis/custom_src/
Upload File :
Current File : /var/www/oasis/custom_src/practical_entry_freezing.php

<?php 
function getPracticalEntryFreezeDetails($aobj_context)
{
	session_start();	
	$college_code = $_SESSION['collcode'];
	$user_type = $_SESSION['user_type'];
	 
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);  
	$subject_code = $aobj_context->mobj_data["subject_code"]; 	
    $degree = trim($aobj_context->mobj_data["degree_code"]); 	
    $exam_no = trim($aobj_context->mobj_data["exam_no"]);     
    $subject = trim($aobj_context->mobj_data["subject"]);     
    $g_freeze_time = trim($aobj_context->mobj_data["g_freeze_time"]);  
	
	
	$query = "select fteachcode,fteachname from masteach
	where fcollcode = '{$college_code}'
	order by fteachname"; 
	$res = $aobj_context->mobj_db->GetAll($query);
	


	$get_subject = " select  s.FDEGREE,s.FEXAMNO,s.FSUBCODE,s.FBATCH,
				ifnull(FFREEZED,'F') as FFREEZED,
				ifnull(PRINTFREEZED,'F') as PRINTFREEZED,
				count(s.fregno) as bcnt,
				pf.froomname,
				ifnull(pf.fexaminer1,'') as fexaminer1,
				ifnull(pf.fexaminer2,'') as fexaminer2,
				ifnull(pf.fexaminer3,'') as fexaminer3,
				ifnull(pf.fexaminer4,'') as fexaminer4,
				ifnull(pf.fexaminer5,'') as fexaminer5,
				ifnull(pf.fexaminer6,'') as fexaminer6,
				GROUP_CONCAT(distinct  if(abs(FMarks11)<1,0,abs(FMarks11)) separator '') as tot_marks,
				sum(case when s.fmarks11 = -1 then 0 else 1 end) as marks_entered,	
				pf.FBATCH as freezed_batch,date_format(ifnull(pf.FEXAMDATE,'00/00/0000'),'%d/%m/%Y') as FEXAMDATE,pf.FEXAMTIME 
				from marks_pr  s  inner join  subject sub 
				on s.FDEGREE=sub.FDEGREE and s.FEXAMNO=sub.FEXAMNO and s.FSUBCODE=sub.FCSUBCODE
				left join practical_entry_freeze pf
				on pf.FDEGREE=s.FDEGREE and pf.FEXAM=s.FEXAMNO and pf.FCSUBCODE=s.FSUBCODE 
				and pf.FCOLLCODE=s.FCOLLCODE and s.fyear = pf.fyear and s.fexamtype = pf.fexamtype
				and lpad(s.FBATCH,2,'0')=lpad(pf.FBATCH,2,'0')
				where  s.fdegree =  '{$degree}'				   
				and  s.fexamno='{$exam_no}'
				and  s.FSUBCODE='{$subject}'
				and s.FCOLLCODE='{$college_code}' and s.FBATCH>0
				group by s.FDEGREE,s.FEXAMNO,s.FSUBCODE,s.FBATCH ";

	$obj_get_details = $aobj_context->mobj_db->GetAll($get_subject);	
	$col_span=14;
    if($g_freeze_time=='TIMETABLE')
	$col_span=12;
	 
	   	$e_data.="<table  width='90%'  class='tr_ventor_row' align='center' cellspacing='0' cellpadding='0' border='0' >";
		$e_data.="<th align='left' colspan='{$col_span}' class='ui-jqgrid-titlebar ui-widget-header ui-corner-tl ui-corner-tr ui-helper' style='font-size:12px; padding-left:6px; height:22px;'>Practical Entry Freeze Details </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:60px; border-bottom:1px solid #C5DBEC;border-left:0px solid #C5DBEC; border-right:1px solid #C5DBEC;  border-bottom:1px solid #C5DBEC;'>Batch</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;'>Stud. Cnt.</td>";
		$e_data.="<td  align=center style='padding:2px; width:20px; border-bottom:1px solid #C5DBEC; border-left:0px solid #C5DBEC; border-right:1px solid #C5DBEC;  border-bottom:1px solid #C5DBEC;'>Exam Date</td>"; 
		$e_data.="<td  align=center style='padding:2px; width:20px; border-bottom:1px solid #C5DBEC; border-left:0px solid #C5DBEC; border-right:1px solid #C5DBEC;  border-bottom:1px solid #C5DBEC;'>Exam Time</td>";
		$e_data.="<td  align=center style='padding:2px; width:20px; border-bottom:1px solid #C5DBEC; border-left:0px solid #C5DBEC; border-right:1px solid #C5DBEC;  border-bottom:1px solid #C5DBEC;'>Room Name</td>";
		if($g_freeze_time !='FREEZE')
		{
			$e_data.="<td  align=center style='padding:2px; width:20px; border-bottom:1px solid #C5DBEC; border-left:0px solid #C5DBEC; border-right:1px solid #C5DBEC;  border-bottom:1px solid #C5DBEC;'>Examiner 1</td>";
			$e_data.="<td  align=center style='padding:2px; width:20px; border-bottom:1px solid #C5DBEC; border-left:0px solid #C5DBEC; border-right:1px solid #C5DBEC;  border-bottom:1px solid #C5DBEC;'>Examiner 2</td>"; 
			$e_data.="<td  align=center style='padding:2px; width:20px; border-bottom:1px solid #C5DBEC; border-left:0px solid #C5DBEC; border-right:1px solid #C5DBEC;  border-bottom:1px solid #C5DBEC;'>Examiner 3</td>"; 
			$e_data.="<td  align=center style='padding:2px; width:20px; border-bottom:1px solid #C5DBEC; border-left:0px solid #C5DBEC; border-right:1px solid #C5DBEC;  border-bottom:1px solid #C5DBEC;'>Examiner 4</td>";
			$e_data.="<td  align=center style='padding:2px; width:20px; border-bottom:1px solid #C5DBEC; border-left:0px solid #C5DBEC; border-right:1px solid #C5DBEC;  border-bottom:1px solid #C5DBEC;'>Examiner 5</td>"; 
			$e_data.="<td  align=center style='padding:2px; width:20px; border-bottom:1px solid #C5DBEC; border-left:0px solid #C5DBEC; border-right:1px solid #C5DBEC;  border-bottom:1px solid #C5DBEC;'>Examiner 6</td>"; 
		}
		if($g_freeze_time=='FREEZE')
		{
			$e_data.="<td  align=center style='padding:2px; width:20px; border-bottom:1px solid #C5DBEC; border-left:0px solid #C5DBEC; border-right:1px solid #C5DBEC;  border-bottom:1px solid #C5DBEC;'>Freeze Entry</td>"; 
			$e_data.="<td  align=center style='padding:2px; width:20px; border-bottom:1px solid #C5DBEC; border-left:0px solid #C5DBEC; border-right:1px solid #C5DBEC;  border-bottom:1px solid #C5DBEC;'>Freeze Print</td>"; 
			
			$e_data.="<td  align=center style='padding:2px; width:20px; border-bottom:1px solid #C5DBEC; border-left:0px solid #C5DBEC; border-right:1px solid #C5DBEC;  border-bottom:1px solid #C5DBEC;'>Print</td>"; 
		}
		$e_data.="</tr>";		
		$sl_no=1;
		for($m=0;$m<count($obj_get_details);$m++)
		{		
			$FSUBCODE=$obj_get_details[$m]['FCSUBCODE']; 
			$FBATCH=$obj_get_details[$m]['FBATCH']; 
			$bcnt=$obj_get_details[$m]['bcnt']; 
			$FEXAMDATE=$obj_get_details[$m]['FEXAMDATE']; 
			$tot_marks=$obj_get_details[$m]['tot_marks'];
			$marks_entered=$obj_get_details[$m]['marks_entered']; 
			$FFREEZED=$obj_get_details[$m]['FFREEZED']; 
			$PRINTFREEZED=$obj_get_details[$m]['PRINTFREEZED']; 
			$froomname=$obj_get_details[$m]['froomname'];

			$fexaminer1=$obj_get_details[$m]['fexaminer1'];
			$fexaminer2=$obj_get_details[$m]['fexaminer2'];
			$fexaminer3=$obj_get_details[$m]['fexaminer3'];
			$fexaminer4=$obj_get_details[$m]['fexaminer4']; 
			$fexaminer5=$obj_get_details[$m]['fexaminer5']; 
			$fexaminer6=$obj_get_details[$m]['fexaminer6']; 

			$FEXAMTIME=$obj_get_details[$m]['FEXAMTIME']; 
			$freezed_batch=$obj_get_details[$m]['freezed_batch']; 
			 
			$report_link="GeneratePracticalMarksReportsFromLink({$m});"; 
			$fc_checked="";
			
			$fc_print_checked="";
			$diasable = "";
			$fc_print_disabled="disabled=true;";
			
			if($FFREEZED=="T")
			{
				$report_link="GeneratePracticalMarksReportsFromLink({$m});"; 
				$fc_checked = "checked  disabled=true;";
				$diasable = "disabled";
				if(strtolower($user_type)=='superuser')	
				$fc_checked=" checked";
				if($PRINTFREEZED=="T")
				{
					 
					$fc_print_disabled="disabled=true;";
					if(strtolower($user_type)=='superuser')	
					$fc_print_disabled = "";
				 	$fc_print_checked=" checked";
				}
				else
				{
					$fc_print_disabled = "";
				}
			
			}
				
			if($k%2==0)
			{
				$class='tbl_row';
			}
			else
			{
				$class='tbl_row1'; 
			}  

			 $e_data.="<tr class='ui-widget-content jqgrow'>";
			 $e_data.="<td class='tbl_row_new' align='center' style='width:20px; border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px;' id='batch_sl_no_{$m}'>{$sl_no} </td>";
			 $e_data.="<td class='tbl_row_new' align='center' style='width:50px; border-left:0px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px;' id='batch_{$m}'>{$FBATCH} </td>";
			 $e_data.="<td class='tbl_row_new' align='center' style='width:50px; border-left:0px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px;' id='batch_{$m}'>{$bcnt} </td>";
			 
			 if($g_freeze_time=='FREEZE')
			 {
				$e_data.="<td class='tbl_row_new' align='center'  style='width:100px; border-left:0px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px;' id='date_{$m}'>";			
				$e_data.=" <div id='input_div_97' class=' imageInputWrapperDate' style='width:120px;'>
						 <input id='practical_entry_freeze_exam_date_{$m}'  class='inputWithImge ElementCount'  type='text' style='background-color:#e1e1e1; width:100px; border:0px;' value='{$FEXAMDATE}' />
						 <script>$('#practical_entry_freeze_exam_date_{$m}').datepicker({showOn: 'button',showButtonPanel: true, changeMonth: true,	changeYear: true,dateFormat:'dd/mm/yy',buttonImage: 'images/date.gif', buttonImageOnly: true});</script>
						 </div></td>";
			 }	
			else
			{
			 $e_data.="<td class='tbl_row_new' align='center'  style='width:100px; border-left:0px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px;' id='date_{$m}'>";			
			 $e_data.=" <div id='input_div_97' class=' imageInputWrapperDate' style='width:120px;'>
						 <input id='practical_entry_freeze_exam_date_{$m}' {$diasable} class='inputWithImge ElementCount' onkeydown = 'dmydateformat(event,this.id)' maxlength = 10 type='text' style='width:100px; border:0px;' value='{$FEXAMDATE}' />
						 <script>$('#practical_entry_freeze_exam_date_{$m}').datepicker({showOn: 'button',showButtonPanel: true, changeMonth: true,	changeYear: true,dateFormat:'dd/mm/yy',buttonImage: 'images/date.gif', buttonImageOnly: true});</script>
						 </div></td>";
			}
			 
			if($g_freeze_time=='FREEZE')
			 {
				$e_data.="<td class='tbl_row_new' align='center'   style=' width:100px; border-right:1px solid #C5DBEC;  padding:2px;'><input type='text'  style='background-color:#e1e1e1;' value='{$FEXAMTIME}' id='time_{$m}'></td>";
			 }
			 else
			 {
			   $e_data.="<td class='tbl_row_new' align='center'  style='width:100px; border-right:1px solid #C5DBEC;  padding:2px;'><input type='text' {$diasable} value='{$FEXAMTIME}'  id='time_{$m}'></td>";
			 }
			 $e_data.="<td class='tbl_row_new' align='center'  style='width:100px; border-right:1px solid #C5DBEC;  padding:2px;'><input type='text' value='{$froomname}'  id='roomname_{$m}'></td>";
			 $univcode = $_SESSION['FUNIVCODE'];
			 if($g_freeze_time !='FREEZE')
			 {
				if($univcode == '040' || $univcode == '098' || $univcode == '055')  
				{
					
					$optteach1 = '<option value="">--Select--</option>';
					$optteach2 = '<option value="">--Select--</option>';
					$optteach3 = '<option value="">--Select--</option>';
					$optteach4 = '<option value="">--Select--</option>';
					$optteach5 = '<option value="">--Select--</option>';
					$optteach6 = '<option value="">--Select--</option>';
		
					foreach($res as $val)
					{
						if($fexaminer1 == $val['fteachcode'])
						{
							$optteach1 .= '
							<option value="'.$val['fteachcode'].'" selected>'.$val['fteachname'].' ['.$val['fteachcode'].']</option>';	
						}else
						{
							$optteach1 .= '
							<option value="'.$val['fteachcode'].'">'.$val['fteachname'].' ['.$val['fteachcode'].']</option>';	
						}

						if($fexaminer2 == $val['fteachcode'])
						{
							$optteach2 .= '
							<option value="'.$val['fteachcode'].'" selected>'.$val['fteachname'].' ['.$val['fteachcode'].']</option>';	
						}else
						{
							$optteach2 .= '
							<option value="'.$val['fteachcode'].'">'.$val['fteachname'].' ['.$val['fteachcode'].']</option>';	
						}

						if($fexaminer3 == $val['fteachcode'])
						{
							$optteach3 .= '
							<option value="'.$val['fteachcode'].'" selected>'.$val['fteachname'].' ['.$val['fteachcode'].']</option>';	
						}else
						{
							$optteach3 .= '
							<option value="'.$val['fteachcode'].'">'.$val['fteachname'].' ['.$val['fteachcode'].']</option>';	
						}

						if($fexaminer4 == $val['fteachcode'])
						{
							$optteach4 .= '
							<option value="'.$val['fteachcode'].'" selected>'.$val['fteachname'].' ['.$val['fteachcode'].']</option>';	
						}else
						{
							$optteach4 .= '
							<option value="'.$val['fteachcode'].'">'.$val['fteachname'].' ['.$val['fteachcode'].']</option>';	
						}

						if($fexaminer5 == $val['fteachcode'])
						{
							$optteach5 .= '
							<option value="'.$val['fteachcode'].'" selected>'.$val['fteachname'].' ['.$val['fteachcode'].']</option>';	
						}else
						{
							$optteach5 .= '
							<option value="'.$val['fteachcode'].'">'.$val['fteachname'].' ['.$val['fteachcode'].']</option>';	
						}

						if($fexaminer6 == $val['fteachcode'])
						{
							$optteach6 .= '
							<option value="'.$val['fteachcode'].'" selected>'.$val['fteachname'].' ['.$val['fteachcode'].']</option>';	
						}else
						{
							$optteach6 .= '
							<option value="'.$val['fteachcode'].'">'.$val['fteachname'].' ['.$val['fteachcode'].']</option>';	
						}
						
					}

					$e_data.="<td class='tbl_row_new' align='center'  style='width:100px; border-right:1px solid #C5DBEC;  padding:2px;'><select id='fexaminer1_{$m}'>{$optteach1}</select></td>";
					$e_data.="<td class='tbl_row_new' align='center'  style='width:100px; border-right:1px solid #C5DBEC;  padding:2px;'><select id='fexaminer2_{$m}'>{$optteach2}</select></td>";
					$e_data.="<td class='tbl_row_new' align='center'  style='width:100px; border-right:1px solid #C5DBEC;  padding:2px;'><select id='fexaminer3_{$m}'>{$optteach3}</select></td>";
					$e_data.="<td class='tbl_row_new' align='center'  style='width:100px; border-right:1px solid #C5DBEC;  padding:2px;'><select id='fexaminer4_{$m}'>{$optteach4}</select></td>";
					$e_data.="<td class='tbl_row_new' align='center'  style='width:100px; border-right:1px solid #C5DBEC;  padding:2px;'><select id='fexaminer5_{$m}'>{$optteach5}</select></td>";
					$e_data.="<td class='tbl_row_new' align='center'  style='width:100px; border-right:1px solid #C5DBEC;  padding:2px;'><select id='fexaminer6_{$m}'>{$optteach6}</select></td>";

				}else
				{
					$e_data.="<td class='tbl_row_new' align='center'  style='width:100px; border-right:1px solid #C5DBEC;  padding:2px;'><input type='text' value='{$fexaminer1}'  id='fexaminer1_{$m}'></td>";
					$e_data.="<td class='tbl_row_new' align='center'  style='width:100px; border-right:1px solid #C5DBEC;  padding:2px;'><input type='text' value='{$fexaminer2}'  id='fexaminer2_{$m}'></td>";
					$e_data.="<td class='tbl_row_new' align='center'  style='width:100px; border-right:1px solid #C5DBEC;  padding:2px;'><input type='text' value='{$fexaminer3}'  id='fexaminer3_{$m}'></td>";
					$e_data.="<td class='tbl_row_new' align='center'  style='width:100px; border-right:1px solid #C5DBEC;  padding:2px;'><input type='text' value='{$fexaminer4}'  id='fexaminer4_{$m}'></td>";
					$e_data.="<td class='tbl_row_new' align='center'  style='width:100px; border-right:1px solid #C5DBEC;  padding:2px;'><input type='text' value='{$fexaminer5}'  id='fexaminer5_{$m}'></td>";
					$e_data.="<td class='tbl_row_new' align='center'  style='width:100px; border-right:1px solid #C5DBEC;  padding:2px;'><input type='text' value='{$fexaminer6}'  id='fexaminer6_{$m}'></td>";
				}
			}
			$freeze_dis="";
			 if($g_freeze_time=='TIMETABLE' || $tot_marks<0 )
			  $freeze_dis=" disabled=true; ";
			$hide_freeze="";
			 if($g_freeze_time=='TIMETABLE' )
			  $hide_freeze=" display:none; ";
			  $pending = "";
			 if($g_freeze_time=='FREEZE' && $marks_entered == 0)
			 {
			  	$freeze_dis=" disabled=true; ";
			  	$pending = "<span style='color:red;'>pending</span>";
			}

			 $e_data.="<td class='tbl_row_new' align='center' style='{$hide_freeze};width:100px; border-right:1px solid #C5DBEC;  padding:2px;'><input  id='fmacas_FCSTATUS_check_{$m}' type='checkbox' {$fc_checked} {$freeze_dis}  >{$pending}</td>"; 
			 $e_data.="<td class='tbl_row_new' align='center' style='{$hide_freeze};width:100px; border-right:1px solid #C5DBEC;  padding:2px;'><input  id='fmacas_print_check_{$m}' type='checkbox' {$fc_print_checked} {$fc_print_disabled}  ></td>"; 
			 
			  if($g_freeze_time=='FREEZE')
			 $e_data.="<td class='tbl_row_new' align='center' style='width:100px; border-left:0px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px;' id='report_{$m}'><a href='#'  style='cursor:pointer;color:blue;' onclick='{$report_link}'>Report</a></td>";			 
			 $e_data.="</tr>";   
			 $k++;
			 $sl_no++;
		}	

		$arr['html_data']=$e_data;
		$arr['freeze_data']=$obj_get_details;
		$arr['total_count']=$m;

		$arr['examiner1']=$fexaminer1;
		$arr['examiner2']=$fexaminer2;
		$arr['examiner3']=$fexaminer3;
		$arr['examiner4']=$fexaminer4;
	 
		
		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 FreezePracticalMaks($aobj_context)
{
    include_once("/JSON.php"); 
	$json = new Services_JSON();
	session_start();
	$college_code = $_SESSION['collcode'];
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
	$format_file= $aobj_context->main_src."/src/format.php";
	include($format_file);
	//include("../src/error_log.php");
	
	$degree=trim($aobj_context->mobj_data["degree_code"]);
	$examno=trim($aobj_context->mobj_data["exam_no"]);
	$subject=trim($aobj_context->mobj_data["subject"]);
	
    $lstr_param = stripslashes($aobj_context->mobj_data["output_details"]);
	$mobj_jsondata = $json->decode($lstr_param);
	$larr_output_details = get_object_vars($mobj_jsondata);	 
//    var_dump($lstr_param,$mobj_jsondata,$larr_output_details);die();

	$query = "select fyear,fexamtype from marks_pr where fdegree ='{$degree}'
	and fexamno = '{$examno}'
	and fcollcode = '{$college_code}'
	and fsubcode = '{$subject}'";
	$resuts1 = $aobj_context->mobj_db->GetRow($query);
	$fyear = $resuts1['fyear'];
	$fexamtype = $resuts1['fexamtype'];
	// var_dump($larr_output_details);die();
    // $del="delete from practical_entry_freeze 
	//               where 
	// 			        FCOLLCODE='{$college_code}'
	// 					and
	// 			        FDEGREE='{$degree}'
	// 					and
	// 					FEXAM='{$examno}' and
	// 					FCSUBCODE='{$subject}'
	// 					 ";	
	// //echo  $del; die();				
	// $obj_del = $aobj_context->mobj_db->Execute($del); 
	
	
	for( $i = 0; $i < count($larr_output_details); $i++ )
	{
		$query = "select * from practical_entry_freeze where fcollcode = '{$college_code}'
		and fdegree = '{$degree}' and FEXAM = '{$examno}'
		and FBATCH = '{$larr_output_details[$i]->batch}'
		and FCSUBCODE = '{$subject}'";
		
		$resuts1 = $aobj_context->mobj_db->GetRow($query);
		if($resuts1)
		{
			if($larr_output_details[$i]->fexaminer1 == NULL || $larr_output_details[$i]->fexaminer1 == '')
			{
				$upd = "update practical_entry_freeze set FFREEZED = '{$larr_output_details[$i]->checked}',
				PRINTFREEZED = '{$larr_output_details[$i]->p_checked}',
				FFREEZEDATE = now(),
				FEXAMTIME = '{$larr_output_details[$i]->time}',
				froomname = '{$larr_output_details[$i]->roomname}',
				
	
				FEXAMDATE = '{$larr_output_details[$i]->date}',
				FEXAMTIME = '{$larr_output_details[$i]->time}'
				where fcollcode = '{$college_code}'
				and fdegree = '{$degree}' and FEXAM = '{$examno}'
				and FBATCH = '{$larr_output_details[$i]->batch}'
				and FCSUBCODE = '{$subject}'";
			}else
			{
				$upd = "update practical_entry_freeze set FFREEZED = '{$larr_output_details[$i]->checked}',
				PRINTFREEZED = '{$larr_output_details[$i]->p_checked}',
				FFREEZEDATE = now(),
				FEXAMTIME = '{$larr_output_details[$i]->time}',
				froomname = '{$larr_output_details[$i]->roomname}',
				
				fexaminer1 = '{$larr_output_details[$i]->fexaminer1}',
				fexaminer2 = '{$larr_output_details[$i]->fexaminer2}',
				fexaminer3 = '{$larr_output_details[$i]->fexaminer3}',
				fexaminer4 = '{$larr_output_details[$i]->fexaminer4}',
				fexaminer5 = '{$larr_output_details[$i]->fexaminer5}',
				fexaminer6 = '{$larr_output_details[$i]->fexaminer6}',
	
				FEXAMDATE = '{$larr_output_details[$i]->date}',
				FEXAMTIME = '{$larr_output_details[$i]->time}'
				where fcollcode = '{$college_code}'
				and fdegree = '{$degree}' and FEXAM = '{$examno}'
				and FBATCH = '{$larr_output_details[$i]->batch}'
				and FCSUBCODE = '{$subject}'";
			}
			
			$lobj_insert_qty = $aobj_context->mobj_db->Execute($upd);
		}else
		{

			$insert_qty = "insert into practical_entry_freeze(
				FCOLLCODE,
				FDEGREE,
				FEXAM,
				FBATCH,
				FCSUBCODE, FEXAMDATE,FEXAMTIME,FFREEZED,PRINTFREEZED,FFREEZEDATE,
				fyear,fexamtype,froomname,fexaminer1,fexaminer2,fexaminer3,fexaminer4,fexaminer5,fexaminer6
				)
				values(
				 '{$college_code}',
				 '{$degree}',
				 '{$examno}',
				 '{$larr_output_details[$i]->batch}',
				 '{$subject}',									
				 '{$larr_output_details[$i]->date}',
				 '{$larr_output_details[$i]->time}',
				 '{$larr_output_details[$i]->checked}',
				 '{$larr_output_details[$i]->p_checked}',
				 now(),
				 '{$fyear}',
				 '{$fexamtype}',
				 '{$larr_output_details[$i]->roomname}',
				 '{$larr_output_details[$i]->fexaminer1}',
				 '{$larr_output_details[$i]->fexaminer2}',
				 '{$larr_output_details[$i]->fexaminer3}',
				 '{$larr_output_details[$i]->fexaminer4}',
				 '{$larr_output_details[$i]->fexaminer5}',
				 '{$larr_output_details[$i]->fexaminer6}')";
				 
				 //var_dump($insert_qty);
				 $lobj_insert_qty = $aobj_context->mobj_db->Execute($insert_qty);

		}
		
		
		$upd = "update canddet cd, marks_pr m, practical_entry_freeze p set cd.fsdoe = date_format(p.fexamdate,'%d/%m/%Y'),
		cd.fssession = p.fexamtime
		where cd.fdegree = m.fdegree 
		and cd.fexamno = m.fexamno and cd.fsubcode = left(m.fsubcode,4)
		and cd.fregno = m.fregno
		and p.fdegree = m.fdegree and p.fexam = m.fexamno
		and p.fcsubcode = m.fsubcode
		and p.FBATCH = m.FBATCH
		and p.fyear = cd.fyear
		and p.fexamtype = cd.fexamtype
		and m.fdegree = '{$degree}' and m.fexamno = '{$examno}' and m.fsubcode = '{$subject}'
		and m.fcollcode = '{$college_code}'";
		$res1 = $aobj_context->mobj_db->Execute($upd);

		// var_dump($insert_qty);
		// die();								
	//	$lobj_insert_qty = $aobj_context->mobj_db->Execute($insert_qty);
	
		// $univcode = $_SESSION['FUNIVCODE'];
		// $mob = $_SESSION['FMOBILE'];
		// $usr = $_SESSION['usr'];
		// $college_code = $_SESSION['collcode'];
		
		// if($larr_output_details[$i]->checked == 'T')
		// 	$remark = "MEN - PR Marks Entry - $degree, $examno, $subject, $college_code, Freezed";
		// else 
		// 	$remark = "MEN - PR Marks Entry - $degree, $examno, $subject, $college_code, Unfreezed";

		// $enttype = "MEN";
		// $res = error_logs($aobj_context,$univcode,$remark,$college_code,$enttype,$usr,$mob);


	}
	
	//print_r($insert_qty);
	//echo mysql_error();	  die();
	if($lobj_insert_qty) 
	{
			 $arr='Data inserted Successfully';
			 echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success"); 
			 return;
	}	
	else
	{
			$arr='insertion Failed';
			echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"Failure");
		   return;
	}	
}
?>