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


Current Path : /var/www/html/nitte/src/
Upload File :
Current File : /var/www/html/nitte/src/download_misc_files_19062014.php

<?php
class download_misc_files
 {
  
    function __construct($aobj_context)
    {
	$this->aobj_context=$aobj_context;
	$this->college_code = $_SESSION['collcode'];
	}
	function GetDegreeNames()
	{
		$get_data="select distinct FDEGREE,FDESCPN from degree ";
		$lobj_get_data= $this->aobj_context->mobj_db->GetAll($get_data);
		$this->degree_arr=array();
		foreach($lobj_get_data as $ak=>$av)
		{
			$this->degree_arr[$av['FDEGREE']]=$av['FDESCPN'];
		}
	}
	 function DownloadMiscFiles()
	 {
	 
		$dir=$this->aobj_context->main_src."/misc_files/";
	
		$this->file_names_arr=array();	 
			$file_names="";
			if (is_dir($dir)) 
			{
		
				if ($dh = opendir($dir)) {
					$cnt=0;
					 
						while (($file = readdir($dh)) !== false) {
						if(!empty($file) && $file!="." && $file!=".." && $file!="Thumbs.db")
						{
						$arr=explode("-",$file);
						$coll_code=$arr[0];
						$degree=$arr[1];
						$file1=$arr[2];
						 $this->file_names_arr[$coll_code][$cnt]['full_file_name']=$file;
						 $this->file_names_arr[$coll_code][$cnt]['degree']=$degree;
						 $this->file_names_arr[$coll_code][$cnt]['file']=$file1;
						  $cnt++;
						 }	
					}						 
					}				
					closedir($dh);
			}
			 
	 }
	 function FormHtml()
	 {
		$str_reval="<table style='padding:3px 4px 3px 3px;' align='center' class='tr_ventor_row' id='reval_table_data' width='60%' border='0' cellspacing='0' cellpadding='0'>";
		$str_reval.="<th align='left' colspan='6' class='ui-jqgrid-titlebar ui-widget-header ui-corner-tl ui-corner-tr ui-helper' style='font-size:12px; padding-left:6px; height:24px;'>Download List</th>";
		$str_reval.="<tr class='ui-state-default ui-jqgrid-hdiv'>";
		$str_reval.="<td align='center' style=' font-size:12px; border-left:1px solid #C5DBEC; 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;'>File Names</td>";
		$str_reval.="</tr>";
		$print_arr=$this->file_names_arr[$this->college_code];
		foreach($print_arr as $ak=>$av)
		{
		$degree_name=$this->degree_arr[$av['degree']];	
		$file=$av['file'];
		$full_file_name=$av['full_file_name'];
		$str_reval.="<tr class='ui-widget-content jqgrow'>";		
		$str_reval.="<td class='tbl_row_new' style='text-align:center; border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px; font-size:12px;  ' >{$degree_name}</td>";
		$str_reval.="<td class='tbl_row_new' style='border-left:0px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px; font-size:12px;text-align:center;'  ><a style='color:blue;cursor:pointer;text-decoration:none;' target='_new' href='misc_files/{$full_file_name}'>{$file}</a></td>";
 
		$str_reval.="</tr>";
		}
		$str_reval.="</html>";
		$data=$str_reval;
		$data1="No Data Found";
		if(count($print_arr)>0)
		echo $this->aobj_context->mobj_output->ToJSONEnvelope($data,0,"success"); 
		else
		echo $this->aobj_context->mobj_output->ToJSONEnvelope($data1,0,"success"); 
	
	 }
	 
	function __destruct() {  }
}
function DownloadMiscFiles($aobj_context)
{
		ini_set("memory_limit",-1);
		ini_set('max_execution_time',2900);
		$class_obj=new download_misc_files($aobj_context);	
		$class_obj->GetDegreeNames();
		$class_obj->DownloadMiscFiles();
		$class_obj->FormHtml();
}		
?>