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


Current Path : /proc/thread-self/root/var/www/misc/public_html/live100/src/
Upload File :
Current File : //proc/thread-self/root/var/www/misc/public_html/live100/src/challan_preparation.php

<?php
class ack_rv_rt_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->collcode=$_SESSION['collcode'];	
		$this->college_code=$_SESSION['collcode'];	
		$this->log_name = $_SESSION['usr'];			
		}
		function GetNextNumber()
		{
		
				$get_prefix_running_number = "select last_number from res_reval_code_generator
								where college_code = '{$this->college_code}' and type='College' ";		
				$lobj_get_prefix_running_number = $this->aobj_context->mobj_db->GetRow($get_prefix_running_number); 
		
				if(!empty($lobj_get_prefix_running_number[last_number]))
				{			
				$next_number = $lobj_get_prefix_running_number[last_number]+1;
				$last_number = str_pad($next_number,5, "0", STR_PAD_LEFT);
					
					 
				}
				else
				{	
					$next_number=00001;			
					$insert_into="insert into 
								res_reval_code_generator(college_code,last_number,type)
								values
								(
								'{$this->college_code}',
								{$next_number},'College'
								)";
					$lobj_insert_into = $this->aobj_context->mobj_db->Execute($insert_into);
				 
				$last_number = str_pad($next_number,5, "0", STR_PAD_LEFT);		
				}
				return $this->college_code.$last_number;	
		}
		function UpdateNextNumber()
		{				 				
				 
		$update_code_generator = "update res_reval_code_generator set last_number = last_number+1
									where college_code = '{$this->college_code}' and type='College' ";
		$lobj_update_code_generator = $this->aobj_context->mobj_db->Execute($update_code_generator);
		}	
		
		function PrepareChallanDetailsForRvRT()
		{
			  
			 	$checked_app_nos = ($this->aobj_context->mobj_data["checked_app_nos"]);
				$FDOCNO=$this->GetNextNumber($this->aobj_context);
				$exp_arr=explode(",",$checked_app_nos);
				$no_of_app=count($exp_arr);
				$total_amt=0;
				foreach($exp_arr as $apk)
				{
					$update=" update res_stud 
								set FDOCNO='{$FDOCNO}',FDOCDATE=now()
								where APPNO='{$apk}'";
					$lobj_get_data = $this->aobj_context->mobj_db->Execute($update);
					$select="select sum(FAMOUNT) as  FAMOUNT from res_stud where APPNO='{$apk}' ";	
					$lobj_select = $this->aobj_context->mobj_db->GetRow($select);
					$total_amt+=$lobj_select['FAMOUNT'];
				}
			$this->UpdateNextNumber($this->aobj_context);
				$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>";		
				$str_reval.="<td class='tbl_row1' style='text-align:left; border-left:1px solid #C5DBEC;border-top:1px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px;' >Document No</td>";
				$str_reval.="<td class='tbl_row1' style='border-left:0px solid #C5DBEC; ;border-top:1px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px; font-size:11px;text-align:left; ' ><b>&nbsp;{$FDOCNO}</b></td>";
				$str_reval.="</tr>";
				$str_reval.="<tr>";		
				$str_reval.="<td class='tbl_row_alter' style='text-align:left; border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px;' >Total Amount</td>";
				$str_reval.="<td class='tbl_row_alter' style='border-left:0px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px; font-size:11px;text-align:left; ' ><b>&nbsp;{$total_amt}</b></td>";
				$str_reval.="</tr>";	
				$str_reval.="<tr>";		
				$str_reval.="<td class='tbl_row1' style='text-align:left; border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px;' >No of Applications</td>";
				$str_reval.="<td class='tbl_row1' style='border-left:0px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px; font-size:11px;text-align:left; ' ><b>&nbsp;{$no_of_app}</b></td>";
				$str_reval.="</tr>";	
				$str_reval.="</table>";	
				$str_reval.="<span style='color:red;'>Note:   Report is valid only on updating the challan / DD paid details against document number.</span> ";	
				$str_reval.='<br><div style="width:42px; margin: 0 auto;  ;float: none;" class="raval_submit">
								<span style="margin-top: 2px;float:left;margin-left:8px;cursor: pointer; color:#545345;line-height: 19px;font-size:14px;font-weight:bold;" onclick="CloseChallanDialog();">Ok</span>
								</div><br> ';	
				$arr['html']=$str_reval;
			echo $this->aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success"); 		
 		}
		function DeleteAckowledgedApplications()
		{
			  
			$APPNO = ($this->aobj_context->mobj_data["APPNO"]);
			 
				$update=" update res_stud 
							set FACKDATE=null,FACKUSER='{$this->log_name}'
							where APPNO='{$APPNO}'";
				$lobj_get_data = $this->aobj_context->mobj_db->Execute($update);			
			 
			$data="Application(s) has been acknowledged successfully.";
				
			echo $this->aobj_context->mobj_output->ToJSONEnvelope($data,0,"success"); 		
 		}	 
		function DisplayChallanPreparationDetails()
		{
			  
			  
			 	$up_to = ($aobj_context->mobj_data["up_to"]);
				$cond="";
				if($up_to!="0000-00-00")
				$cond=" and r.FACKDATE>='{$up_to}'";
				$get_data="  SELECT  r.APPNO,DATE_FORMAT(r.FAPPDATE,'%d/%m/%Y') AS FAPPDATE,r.FREGNO,s.FNAME,r.FDEGREE,sum(r.FAMOUNT) as FAMOUNT,
						DATE_FORMAT(r.FACKDATE,'%d/%m/%Y') AS FACKDATE
						FROM res_stud r INNER JOIN student s ON s.FREGNO=r.FREGNO 
						WHERE r.FCOLLCODE='{$this->collcode}' and  FACKDATE IS NOT NULL and FACKDATE!='' 
						{$cond}
						and ifnull(FDOCNO,'')=''
						group by r.APPNO
						  ";	
											
					$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:12px; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'>Sl. No.</td>";
		$str_reval.="<td align='center' style=' font-size:12px; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'>Application No</td>";
		$str_reval.="<td align='center' style=' font-size:12px; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'>Applied Date </td>";
		$str_reval.="<td align='center' style=' font-size:12px; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'>Reg No</td>";
		$str_reval.="<td align='center' style=' font-size:12px; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'>Student Name</td>";
		$str_reval.="<td align='center' style=' font-size:12px; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'>Degree</td>";
		$str_reval.="<td align='center' style=' font-size:12px; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'>Amount</td>";
		$str_reval.="<td align='center' style=' font-size:12px; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'> Acknowledged Date</td>";
		$str_reval.="<td align='center' style=' font-size:12px; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;  cursor:pointer;' onclick='SelectAllChallanPreparationCheckBox();' > Select All</td>";
		$str_reval.="<td align='center' style=' font-size:12px; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'>Delete</td>";
		$str_reval.="</tr>";
	 
			$k=0;
			$sl_no=1;
			foreach($lobj_get_data as $ak=>$av)
			{
				$APPNO=$av['APPNO'];
				$FREGNO=$av['FREGNO'];
				$FAPPDATE=$av['FAPPDATE'];
				$FNAME=$av['FNAME'];
				$FDEGREE=$av['FDEGREE'];
				$FACKDATE=$av['FACKDATE'];
				$FAMOUNT=$av['FAMOUNT'];
				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-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; ' >&nbsp;{$APPNO}</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;  ' >{$FAPPDATE}&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;  ' >&nbsp;{$FREGNO}</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; ' >{$FNAME}</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; ' >{$FDEGREE}</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; ' >{$FACKDATE}</td>";
				$str_reval.="<td class='{$class}' align='center' style='border-left:0px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px; ;font-weight:bold;text-align:center;' ><input type='checkbox' id='ack_check_box_{$APPNO}' /></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='DeleteAckowledgedApplications({$APPNO});' src='img/delete1.PNG' title='Delete Re-totaling College Acknowledged Application'  /></td>";
				$str_reval.="</tr>";
				$sl_no++;
				$k++;
			}			
		$str_reval.="</table>";
		$arr['html']=$str_reval;
		echo $this->aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success"); 	
			 
		}
		 
 }
	
function DisplayChallanPreparationDetails($aobj_context)
{
    $class_obj=new ack_rv_rt_application($aobj_context);
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC); 
	$class_obj->DisplayChallanPreparationDetails();
} function PrepareChallanDetailsForRvRT($aobj_context)
{
    $class_obj=new ack_rv_rt_application($aobj_context);
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC); 
	$class_obj->PrepareChallanDetailsForRvRT();
}  function DeleteAckowledgedApplications($aobj_context)
{
    $class_obj=new ack_rv_rt_application($aobj_context);
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC); 
	$class_obj->DeleteAckowledgedApplications();
} 
 

?>