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.116.28.79
<?php
function ExportApplicationStatus($aobj_context)
{
session_start();
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$status = trim($aobj_context->mobj_data["status"]);
$fromdate = trim($aobj_context->mobj_data["fromdate"]);
$todate = trim($aobj_context->mobj_data["todate"]);
$fromroll = trim($aobj_context->mobj_data["fromroll"]);
$toroll = trim($aobj_context->mobj_data["toroll"]);
$servcode = trim($aobj_context->mobj_data["servcode"]);
$paystatus = trim($aobj_context->mobj_data["paystatus"]);
$lstrserv = "and st.fservcode='$servcode'";
if($servcode=="all")
$lstrserv="";
$lstrstatus = "and st.fverifystatus='$status'";
if($status=="all")
$lstrstatus="";
$lstrpaystatus = "and st.fpaystatus='$paystatus'";
if($paystatus == "all")
$lstrpaystatus = "";
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$query = "SELECT st.fappno,DATE_FORMAT(fappdate,'%d/%m/%Y') AS fappdate, st.fregno, st.fname, st.fcategory, st.ftotal, st.fpaystatus,
s.fservname, st.fverifystatus, DATE_FORMAT(st.fverifydate,'%d/%m/%Y') as fverifydate FROM servtran st INNER JOIN servtype s ON
s.fservcode = st.fservcode
WHERE st.fappdate BETWEEN DATE_FORMAT(str_to_date('{$fromdate}','%d/%m/%Y'),'%Y-%m-%d')
AND DATE_FORMAT(str_to_date('{$todate}','%d/%m/%Y'),'%Y-%m-%d')
AND st.fregno BETWEEN '$fromroll' AND '$toroll' {$lstrserv} {$lstrstatus}
{$lstrpaystatus} order by st.fappno, st.fregno";
//var_dump($query);
$result = $aobj_context->mobj_db->GetAll($query);
$main_src_obj=(explode("/",$_SERVER["REQUEST_URI"]));
$main_src=$main_src_obj[1];
$pdf_writer_class=$aobj_context->main_src."/maya-pdf/fpdf.php";
$root_pdf_file_download=$aobj_context->main_src."/Report_details/output/report_general_list.pdf";
// global varibales
$p_count =1;
// end global varibales
//echo getnumber_to_word("001"); die();
include($pdf_writer_class);
$pdf= new FPDF();
$pdf->SetFont('Times','',10);
$pdf->SetMargins(10,8);
$pdf->AliasNbPages();
// query for the page header
$page_header_university = "select FUNIVNAME,FTOWN,FUNIVADD1, date_format(now(),'%d/%m/%Y') as date from control";
$lobj_page_header_university = $aobj_context->mobj_db->GetRow($page_header_university);
$pdf->FUNIVNAME = $lobj_page_header_university['FUNIVNAME'];
$pdf->FTOWN = $lobj_page_header_university['FTOWN'];
$pdf->FUNIVADD1 = $lobj_page_header_university['FUNIVADD1'];
$pdf->date_1 = $lobj_page_header_university['date'];
$pdf->aobj_context =$aobj_context ;
$pdf->WhichReport = 'Application Status Report';
/*$get_subject_data = " SELECT m.FREGNO, SUBSTRING(stu.FNAME,1,36) AS Name1,
{$fields} ROUND( ({$att}) * 100 /({$cond}),2) AS TOTPER,
CONCAT(s.FSUBCODE,' - ',s.FSUBNAME,',[',FSSUBNAME,']') AS sub_name
from attend m
left join collatt ct on m.fdegree = ct.fdegree and ct.fcollcode = m.fcollcode and m.fsubcode = ct.fsubcode
inner join student stu on m.fdegree = stu.fdegree and m.FREGNO=stu.FREGNO
inner join subject s on m.FSUBCODE=s.FCSUBCODE
where lpad(s.FCSUBCODE,5,'0')>='{$sublist_start}' and lpad(s.FCSUBCODE,5,'0')<='{$sublist_end}'
and m.FDEGREE='{$degree_code}'
and m.FEXAMNO='{$exam_code}'
and m.FCOLLCODE='{$college_code}' and s.FEXAMNO=m.FEXAMNO and m.FDEGREE=s.FDEGREE
group by FCSUBCODE,m.FREGNO order by FCSUBCODE,m.FREGNO";
$lobj_get_subject_data = $aobj_context->mobj_db->GetAll($get_subject_data);
var_dump($get_subject_data);*/
/* "SELECT
FDEGREE,
FEXAMNO,
FSUBCODE,
GROUP_CONCAT(IF(ifnull(FFREEZED,'') = 'T',concat('*',FPERIOD),FPERIOD )) as FREEZED_MONTHS,
FFREEZED
FROM
collatt
where FDEGREE = 'BA3'
and FEXAMNO = 'A'
and FCOLLCODE = '1001'
group by FSUBCODE" */
$pdf->AddPage();
$w = array(10,20,15,15,40,10,45,10,12,15);
writeHeaders($pdf, $w);
writeFooter($pdf);
$adm_ln_counter=0;
$slno = 1;
foreach($result as $key => $value)
{
$get_x1=$pdf->GetX();
$get_y1=$pdf->GetY();
$pdf->SetXY($get_x1+$w[0]+$w[1]+$w[2]+$w[3],$get_y1);
$pdf->MultiCell($w[4],6, $value['fname'] ,'LBT','L');
$get_y2=$pdf->GetY();
$height=$get_y2-$get_y1;
$pdf->SetXY($get_x1,$get_y1);
$pdf->Cell($w[0],$height, $slno,'LBT',0,'C');
$get_x1=$pdf->GetX();
$pdf->SetXY($get_x1,$get_y1);
$pdf->Cell($w[1],$height, $value['fappno'],'LBT',0,'C');
$pdf->SetXY($get_x1+$w[1],$get_y1);
$pdf->Cell($w[2],$height,$value['fappdate'],'LBT',0,'C');
$pdf->Cell($w[3],$height,$value['fregno'],'LBT',0,'C');
$get_x1=$pdf->GetX();
$pdf->SetXY($get_x1+$w[4],$get_y1);
$pdf->Cell($w[5],$height,$value['fcategory'],'LBT',0,'C');
$pdf->Cell($w[6],$height,$value['fservname'],'LBT',0,'L');
$pdf->Cell($w[7],$height,$value['ftotal'],'LBT',0,'R');
$pdf->Cell($w[8],$height,$value['fverifystatus'],'LBT',0,'C');
$pdf->Cell($w[9],$height,$value['fverifydate'],'LBRT',1,'C');
$get_y1=$pdf->GetY();
++$slno;
if($get_y1>=250)
{
$pdf->Ln(2);
$pdf->AddPage();
writeHeaders($pdf,$w);
writeFooter($pdf);
}
$adm_ln_counter++;
}
$pdf->Output("application_status_report.pdf","D");
}
function writeHeaders($pdf,$w)
{
$pdf->SetFont('Times','B',9);
$pdf->Cell($w[0],6,"Sl. No.",'LT',0,'C');
$pdf->Cell($w[1],6,"App. No.",'LT',0,'C');
$pdf->Cell($w[2],6,"App. Date.",'LT',0,'C');
$pdf->Cell($w[3],6,"Reg. No.",'LT',0,'C');
$pdf->Cell($w[4],6,"Student Name",'LT',0,'C');
$pdf->Cell($w[5],6,"Cat.",'LT',0,'C');
$pdf->Cell($w[6],6,"Service type",'LT',0,'C');
$pdf->Cell($w[7],6,"Amt.",'LRT',0,'C');
$pdf->Cell($w[8],6,"Status",'LRT',0,'C');
$pdf->Cell($w[9],6,"Ver. Date",'LRT',1,'C');
$pdf->SetFont('Times','',8);
}
function writeFooter($pdf)
{
$get_x1=$pdf->GetX();
$get_y1=$pdf->GetY();
$pdf->SetY(-30);
//$pdf->Cell(0,4,"Note : Attended / Conducted",'0',1,'L');
$new_y=$pdf->GetY();
$pdf->Line(10,$new_y, 220,$new_y);
$pdf->Line(10,$new_y+.5, 220,$new_y+.5);
//$pdf->Ln();
//$pdf->Cell(0,6,"Principal's Signature",'0',0,'R');
$pdf->SetXY($get_x1,$get_y1);
}
?>
|