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


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

<?php
class receive_adm_application
{
    
		function __construct($aobj_context)
		{
			session_start();
			$this->aobj_context=$aobj_context;
			$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
			$this->user_id=$_SESSION['user_id']	;		  
		 	$this->log_name = $_SESSION['usr'];			
		}

		function updateadmAdmissionStatus()
		{
			  
			 $checked_app_nos = ($this->aobj_context->mobj_data["arun"]);
			 $apprremarks = ($this->aobj_context->mobj_data["apprremarks"]);
			 $appr_flist = ($this->aobj_context->mobj_data["appr_flist"]);
				
			
			if(count($checked_app_nos) >= 1)
			{
				$exp_arr=explode(",",$checked_app_nos);
				foreach($exp_arr as $apk)
				{
					$college = explode('~',$apk);
					$appno .="'".$college[0]."',";
				}

				$appno = substr($appno,0,-1);

				$query ="update studadm set FAPPRSTATUS = 'APPROVED',
						FAPPRREMARKS = '{$apprremarks}', fadmrnd = '{$appr_flist}',
						FAPPRDATE =now(),FAPPRUSERNAME = '{$this->log_name}', 
						FAPPRUSERID = '{$this->user_id}' 
						where fappno in ({$appno}) and ifnull(fapprstatus,'') <> 'approved'";
				
				//var_dump($query);	

				$result = $this->aobj_context->mobj_db->Execute($query);	
			}else
			{	
				$sl_no = $this->aobj_context->mobj_data["slno"]; 
				$degree = $this->aobj_context->mobj_data["degree"]; 
				$appr_status = $this->aobj_context->mobj_data["appr_status"]; 
				
				$query ="update studadm set FAPPRSTATUS = ucase('{$appr_status}'),
						FAPPRDATE =now(),FAPPRUSERNAME = '{$this->log_name}', 
						FAPPRUSERID = '{$this->user_id}',FAPPRREMARKS = '{$apprremarks}',
						where FDEGREE = '{$degree}' and fappno = '{$sl_no}'";

				$result = $this->aobj_context->mobj_db->Execute($query);

			}

			if($result)
			{	
				$data="updated successfully.";
				echo $this->aobj_context->mobj_output->ToJSONEnvelope($data,0,"success"); 
			}
 		}	

		function DisplayAllReceivceDocs()
		{
			  
			  
			 	$doc_no_from = ($this->aobj_context->mobj_data["doc_no_from"]);
			 	$doc_no_to = ($this->aobj_context->mobj_data["doc_no_to"]);
			 	$college_code_from = ($this->aobj_context->mobj_data["college_code_from"]);
			 	$college_code_to = ($this->aobj_context->mobj_data["college_code_to"]);
				$searchType = ($this->aobj_context->mobj_data["ackType"]);
				$degreelike = ($this->aobj_context->mobj_data["degreelike"]); 
				$cond="";
	
				if($searchType == 'REUNIV')
				{
					$search_cond="and IFNULL(FDOCDATE,'') <>'' and IFNULL(FUNIVRECDATE,'')<>'' ";
				} 
				else if($searchType == 'NOTREUNIV')
				{
					$search_cond="and IFNULL(FDOCDATE,'') <>'' and IFNULL(FUNIVRECDATE,'')='' ";
				}
				else if($searchType == 'ALL')
				{
					$search_cond="and IFNULL(FDOCDATE,'') <>''";
				}
				if($degreelike == '')
				{
					$degree = '';
				}else
				{
					$degree = "and fdegree like '{$degreelike}%'";
				}		
				$get_data=" SELECT  IF(IFNULL(FUNIVRECDATE,'')='','Not Received','Received') AS doc_status,
							FDOCNO, DATE_FORMAT(IFNULL(FDOCDATE,'0000-00-00'),'%d/%m/%Y') AS FDOCDATE,
							FCOLLCODE,FCHALLANNO,DATE_FORMAT(IFNULL(FCHALLANDATE,'0000-00-00'),'%d/%m/%Y') AS FCHALLANDATE,
							SUM(FAMOUNT) AS FAMOUNT,COUNT(DISTINCT APPNO) AS no_of_app,
							DATE_FORMAT(IFNULL(FDOCDATE,'0000-00-00'),'%d/%m/%Y') AS challan_prepared_date
							FROM res_stud 	 
							WHERE IFNULL(FDOCNO,'') <>'' {$degree}
							and FCHALLANDATE IS NOT NULL 
							AND FCOLLCODE>='{$college_code_from}' AND FCOLLCODE<='{$college_code_to}'
							AND FDOCNO>='{$doc_no_from}' AND FDOCNO<='{$doc_no_to}' {$search_cond}
							 GROUP BY FDOCNO	 ";	
											
					$lobj_get_data = $this->aobj_context->mobj_db->GetAll($get_data);
 		 
		$str_reval.="<table style='padding:3px 4px 3px 3px;' class='tr_ventor_row' id='reval_table_data' width='100%' border='0' cellspacing='0' cellpadding='0'>";
		$str_reval.="<tr class='tr_bg1'>";
		$str_reval.="<td align='center' style=' font-size:11px; border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'>Sl No</td>";
		$str_reval.="<td align='center' style=' font-size:11px; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'>Doc. No</td>";
		$str_reval.="<td align='center' style=' font-size:11px; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'>Doc. Date</td>";
		$str_reval.="<td align='center' style=' font-size:11px; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'>College</td>";
		$str_reval.="<td align='center' style=' font-size:11px; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'>Challan No </td>";
		$str_reval.="<td align='center' style=' font-size:11px; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'>Challan Date</td>";
		$str_reval.="<td align='center' style=' font-size:11px; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'>Amount</td>";
		$str_reval.="<td align='center' style=' font-size:11px; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'>No of Appl.</td>";
		$str_reval.="<td align='center' style=' font-size:11px; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'>Challan Date</td>";
		$str_reval.="<td align='center' style=' font-size:11px; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'>Status</td>";
		$str_reval.="<td align='center' style=' font-size:11px; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'>Print</td>";
		$str_reval.="<td align='center' style=' font-size:11px; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'> Receive<input type='checkbox' onclick='Checkallrvapplication(this.id);' id=arun></td>"; 
		$str_reval.="</tr>";
	 
			$k=0;
			$sl_no=1;
			foreach($lobj_get_data as $ak=>$av)
			{
				$FDOCNO=$av['FDOCNO'];
				$FDOCDATE=$av['FDOCDATE'];
				$FCOLLCODE=$av['FCOLLCODE'];
				$doc_status=$av['doc_status'];
				$challan_prepared_date=$av['challan_prepared_date'];
				$no_of_app=$av['no_of_app'];
				$FAMOUNT=$av['FAMOUNT'];
				$FCHALLANDATE=$av['FCHALLANDATE'];
				$FCHALLANNO=$av['FCHALLANNO'];
				$div_class="red_corner_div";
				 $receive_checkbox="<input type='checkbox'  id='receive_check_box_{$FDOCNO}'><input type = 'hidden' id = 'ack_hidden{$sl_no}' value = '{$FDOCNO}'>";
				if($doc_status=="Received")
				{
					$receive_checkbox="<input type='checkbox' checked id='receive_check_box_{$FDOCNO}' disabled=true><input type = 'hidden' id = 'ack_hidden{$sl_no}' value = '{$FDOCNO}'>";
					$div_class="green_corner_div";
				}
				$new_doc_status='<div style=  margin: 0 auto; " class="'.$div_class.'">
								<span style="  color:#FFFFFF;line-height: 19px;font-size:11px;font-weight:bold;"  >'.$doc_status.'</span>
								</div>'; 
				if($k%2==0)
				$class='tbl_row1';
				else
				$class='tbl_row_alter1';
				$str_reval.="<tr>";		
				$str_reval.="<td class='{$class}' style='text-align:center; border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px;' >{$sl_no}</td>";
				$str_reval.="<td class='{$class}' style='border-left:0px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px; font-size:11px;text-align:center; ' > {$FDOCNO}</td>";
				$str_reval.="<td class='{$class}' style='border-left:0px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px; font-size:11px;text-align:center; ' > {$FDOCDATE}</td>";
				$str_reval.="<td class='{$class}' style='border-left:0px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px; font-size:11px;text-align:center; ' > {$FCOLLCODE}</td>";
				$str_reval.="<td class='{$class}' style='text-align:left; border-left:0px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px;  ;text-align:center;  ' >{$FCHALLANNO}&nbsp;</td>";
				$str_reval.="<td class='{$class}' style='text-align:left; border-left:0px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px;  ;text-align:center;  ' > {$FCHALLANDATE}</td>";
				$str_reval.="<td class='{$class}' style='text-align:left; border-left:0px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px; ;  ;text-align:center; ' >{$FAMOUNT}</td>";
				$str_reval.="<td class='{$class}' style='text-align:left; border-left:0px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px; ;  ;text-align:center; ' >{$no_of_app}</td>";
				$str_reval.="<td class='{$class}' style='text-align:left; border-left:0px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px; ;  ;text-align:center; ' >{$challan_prepared_date}</td>";
				$str_reval.="<td class='{$class}' style='text-align:left; border-left:0px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px; ;  ;text-align:center; ' >{$new_doc_status}</td>";
				$str_reval.="<td class='{$class}' style='text-align:left; border-left:0px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px;text-align:center; cursor:pointer; ' ><img  onclick='PrintChallanEntryDetailsFromUniLogin(\"{$FDOCNO}\",\"{$searchType}\")'  src='img/Print_New.jpg'    /> </td>";
			
				$str_reval.="<td class='{$class}' style='text-align:left; border-left:0px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px;text-align:center; cursor:pointer; ' >{$receive_checkbox}</td>";
				$str_reval.="</tr>";
				$sl_no++;
				$k++;
			}			
		$str_reval.="</table>";
		//var_dump($str_reval);
		$arr['html']=$str_reval;
		$arr['count']=$sl_no;
		echo $this->aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success"); 	
			 
		}
		 
 }
	

function updateadmAdmissionStatus($aobj_context)
{
    $class_obj=new receive_adm_application($aobj_context);
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC); 
	$class_obj->updateadmAdmissionStatus();
}  
 
?>