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.137.177.116
<?php
function generateDegreeReport($aobj_context)
{
session_start();
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$college_code = $_SESSION['collcode'];
$degree_types = $aobj_context->mobj_data["degree_types"];
$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".$_SESSION['user_id']."_".$report_id.".pdf";
// global varibales
$p_count =1;
// end global varibales
//echo $pdf_writer_class;
include($pdf_writer_class);
$pdf= new FPDF();
$pdf->SetFont('Times','',10);
$pdf->SetMargins(32,10);
$pdf->AliasNbPages();
// query for the page header
$page_header_university = "select FUNIVNAME,FTOWN, date_format(now(),'%d/%m/%Y') as date from control";
$lobj_page_header_university = $aobj_context->mobj_db->GetRow($page_header_university);
$page_header_college ="select concat('[',FCOLLCODE,'] ',FCOLLNAME,', ',FTOWN) as college_name
from college where FCOLLCODE='{$college_code}'";
$lobj_page_header_college = $aobj_context->mobj_db->GetRow($page_header_college);
$pdf->aobj_context =$aobj_context ;
$pdf->WhichReport = 'CollegeDegree';
$pdf->FUNIVNAME = $lobj_page_header_university[FUNIVNAME];
$pdf->FTOWN = $lobj_page_header_university[FTOWN];
$pdf->date_1 = $lobj_page_header_university['date'];
$pdf->college_name = $lobj_page_header_college['college_name'];
$pdf->AddPage();
$pdf->Ln();
$pdf->SetFont('Times','',10);
if($degree_types =='SELECTED')
{
$get_data= " select distinct c.FDEGREE as 'Degree Code', d.FDESCPN as 'Degree Description' from colldeg c inner join degree d
on c.FDEGREE = d.FDEGREE and c.FCOLLCODE='{$college_code}'
and c.FDELETED='F'";
}
else
{
$get_data=" select distinct FDEGREE as 'Degree Code', FDESCPN as 'Degree Description' from degree";
}
$lobj_details = $aobj_context->mobj_db->GetAll($get_data);
//echo "<pre>"; print_r($lobj_details); die();
$header_row=(array_keys($lobj_details[0]));
foreach($header_row as $key1 => $value1)
$pdf->Cell(75,6,$value1,1,'LR','C');
$pdf->Ln();
foreach($lobj_details as $key => $value)
{
foreach($value as $key2 => $value2)
{
if($key2 == 'Degree Description')
$align = "L";
else
$align = "C";
$pdf->Cell(75,6,$value2,1,'LR',"{$align}");
}
$pdf->Ln();
}
$pdf->Output("degree_lists.pdf","D");
}
?>
|