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.195.79
<?php
function GenerateRevalutionReport($aobj_context)
{
session_start();
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$college_code = $_SESSION['collcode'];
$reval_degree_code = $aobj_context->mobj_data["reval_degree_code"];
$reval_from_Exam_no = $aobj_context->mobj_data["reval_from_Exam_no"];
$reval_to_Exam_no = $aobj_context->mobj_data["reval_to_Exam_no"];
$reval_from_reg_no = $aobj_context->mobj_data["reval_from_reg_no"];
$reval_to_reg_no = $aobj_context->mobj_data["reval_to_reg_no"];
$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=$_SERVER["DOCUMENT_ROOT"]."/".$main_src."/Report_details/output/report_general_list.pdf";
$p_count =1;
include($pdf_writer_class);
$pdf= new FPDF();
$pdf->SetFont('Times','',10);
$pdf->SetMargins(28,20);
$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);
$page_header_degree = "select concat('[',FDEGREE,'] - ', FDESCPN) as Degree_name,
concat(' ( ',FEXAMNAME,' ) ') as Exam, FADYEAR
from degree where FDEGREE = '{$reval_degree_code}' and
FEXAMNO>='{$reval_from_Exam_no}' and FEXAMNO<='{$reval_to_Exam_no}'";
$lobj_page_header_degree = $aobj_context->mobj_db->GetAll($page_header_degree);
$pdf->aobj_context =$aobj_context ;
$pdf->WhichReport = 'Revaluation Report';
$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->Degree_name = $lobj_page_header_degree[0]['Degree_name'];
$pdf->Exam = $lobj_page_header_degree[0]['Exam'];
$pdf->AddPage();
$pdf->SetFont('Times','',10);
$get_data="select mr.FREGNO,date_format(current_date(),'%d/%m/%Y') as curr_date, s.FDEGREE,FCSUBCODE ,s.FSUBNAME as FSUBNAME,
mr.FFEE,mr.FPASS,st.FNAME,
mr.is_selected as is_selected,mr.internal_code from
mresult mr left join subject s on mr.FSUBCODE=s.FCSUBCODE
left join student st on st.FREGNO=mr.FREGNO
where mr.FDEGREE='{$reval_degree_code}' and mr.FREGNO >='{$reval_from_reg_no}' and mr.FREGNO<='{$reval_to_reg_no}'
and mr.FEXAMNO >='{$reval_from_Exam_no}' and mr.FEXAMNO <='{$reval_to_Exam_no}'
and mr.FCOLLCODE={$college_code} and s.FDEGREE=mr.FDEGREE and s.FEXAMNO=mr.FEXAMNO
and ifnull(FAPPDATE,'0000-00-00')!='0000-00-00'
and is_selected=1
group by mr.FREGNO,FCSUBCODE";
//echo $get_data; die();
$lobj_get_data = $aobj_context->mobj_db->GetAll($get_data);
$pdf->Cell(12,6,'Sl.No.','1',0,'C');
$pdf->Cell(20,6,'Reg.No','1',0,'C');
$pdf->Cell(22,6,'Subject Code ','1',0,'C');
$pdf->Cell(85,6,'Subject Name ','1',0,'C');
$pdf->Cell(22,6,'Fee Paid','1',1,'C');
$sl_no=1;
$arr=array();
$cnt=0;
foreach($lobj_get_data as $key => $val)
{
$arr[$val[FREGNO]][$cnt][FCSUBCODE]=$val[FCSUBCODE];
$arr[$val[FREGNO]][$cnt][FSUBNAME]=$val[FSUBNAME];
$arr[$val[FREGNO]][$cnt][FFEE]=$val[FFEE]; $cnt++;
}
$total_val=0;
foreach($arr as $rk=>$rv)
{
$reg_no=$rk;
$r_cnt=0;
foreach($rv as $sk=>$sv)
{
$FCSUBCODE=$sv[FCSUBCODE];
$FSUBNAME=$sv[FSUBNAME];
$FFEE=$sv[FFEE];
if($r_cnt==0)
{
$pdf->Cell(12,6,$sl_no,'1',0,'C');
$pdf->Cell(20,6,$reg_no,'1',0,'C');
$sl_no++;
}
else
{
$pdf->Cell(12,6,"",'1',0,'C');
$pdf->Cell(20,6,"",'1',0,'C');
}
$pdf->Cell(22,6,$FCSUBCODE,'1',0,'C');
$pdf->Cell(85,6,$FSUBNAME,'1',0,'L');
$pdf->Cell(22,6,$FFEE,'1',1,'C');
$total_val+=$FFEE;
$r_cnt++;
}
}
$pdf->Cell(12,6,"",'1',0,'L');
$pdf->Cell(20,6,"",'1',0,'L');
$pdf->Cell(22,6,"",'1',0,'L');
$pdf->SetFont('Times','B',10);
$pdf->Cell(85,6,"Total",'1',0,'R');
$pdf->Cell(22,6,$total_val.'/-','1',1,'C');
$pdf->Ln(18);
$pdf->Cell(0,4,"Head of the Institution",'0',1,'R');
$pdf->Output("report_revaluation.pdf","D");
}
?>
|