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.22.79.165
<?php
function Generateprmarkspendingreport($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$coll_from = $aobj_context->mobj_data["coll_from"];
$coll_to = $aobj_context->mobj_data["coll_to"];
$degree_code_from = $aobj_context->mobj_data["degree_code_from"];
$degree_code_to = $aobj_context->mobj_data["degree_code_to"];
$Examno_from = $aobj_context->mobj_data["Examno_from"];
$Examno_to = $aobj_context->mobj_data["Examno_to"];
$reg_from = $aobj_context->mobj_data["reg_from"];
$reg_to = $aobj_context->mobj_data["reg_to"];
$iapennding = $aobj_context->mobj_data["iapennding"];
$FCODEorSHRTNAME = $aobj_context->mobj_data["search_field"];
$Reglist_start = substr("00000000".$aobj_context->mobj_data["subwise_start"],-8);
$Reglist_end = substr("zzzzzzzz".$aobj_context->mobj_data["subwise_end"],-8);
$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_me_student_list.pdf";
$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);
// global varibales
$p_count =1;
// end global varibales
include($pdf_writer_class);
$pdf= new FPDF();
//$pdf->$title='20000 Leagues Under the Seas';
//$pdf->selectFont('./fonts/Helvetica.afm');
$pdf->SetFont('Times','',10);
$pdf->SetMargins(6,13);
$pdf->AliasNbPages();
// query for the page header
if($iapennding === true)
{ //var_dump($iapennding);
$query = "SELECT CONCAT(mk.fcollcode,' - ',c.fcollname,', ',c.ftown) as fcollcode, mk.fdegree, mk.fexamno, mk.fsubcode,
CONCAT(s.fsubname, ', ', s.fssubname) AS fsubname,
COUNT(cs.fregno) AS ftotcnt, SUM(CASE WHEN IFNULL(mk.fmarks11,-1) = -1 THEN 1 ELSE 0 END) AS fpend
FROM marks_pr mk, canddet cd, candsum cs, subject s,college c WHERE mk.fdegree = s.fdegree AND mk.fexamno = s.fexamno
AND mk.fsubcode = s.fcsubcode AND mk.fdegree = cd.fdegree AND mk.fexamno = cd.fexamno
and c.fcollcode = mk.fcollcode
AND mk.fregno = cd.fregno AND cd.fdegree = s.fdegree AND cd.fexamno = s.fexamno AND cd.fsubcode = s.fsubcode
AND cd.fdegree = cs.fdegree AND cd.fregno = cs.fregno
AND IFNULL(cd.fpassmth,'') = '' AND s.fintass = 'F'
AND s.FTHEORY='F' AND s.FINTASS='F'
AND mk.fcollcode BETWEEN '{$coll_from}' AND '{$coll_to}'
AND cs.frecptdate IS NOT NULL AND cs.ftotalfee > '0' AND cd.fpresent = 'P' AND IFNULL(cd.FPASSMTH,'') = ''
AND mk.fdegree BETWEEN '{$degree_code_from}' AND '{$degree_code_to}'
AND mk.fexamno BETWEEN '{$Examno_from}' AND '{$Examno_to}' AND mk.fregno BETWEEN '{$reg_from}' AND '{$reg_to}'
GROUP BY mk.fcollcode, mk.fdegree, mk.fexamno, mk.fsubcode, s.fsubname, s.fssubname
HAVING SUM(CASE WHEN IFNULL(mk.fmarks11,-1) = -1 THEN 1 ELSE 0 END) > 0
ORDER BY mk.fcollcode, mk.fdegree, mk.fexamno, mk.fsubcode";
}else
{
$query = "SELECT CONCAT(mk.fcollcode,' - ',c.fcollname,', ',c.ftown) as fcollcode, mk.fdegree, mk.fexamno, mk.fsubcode,
CONCAT(s.fsubname, ', ', s.fssubname) AS fsubname,
COUNT(cs.fregno) AS ftotcnt, SUM(CASE WHEN IFNULL(mk.fmarks11,-1) = -1 THEN 1 ELSE 0 END) AS fpend
FROM marks_pr mk, canddet cd, candsum cs, subject s,college c WHERE mk.fdegree = s.fdegree AND mk.fexamno = s.fexamno
AND mk.fsubcode = s.fcsubcode AND mk.fdegree = cd.fdegree AND mk.fexamno = cd.fexamno
and c.fcollcode = mk.fcollcode
AND mk.fregno = cd.fregno AND cd.fdegree = s.fdegree AND cd.fexamno = s.fexamno AND cd.fsubcode = s.fsubcode
AND cd.fdegree = cs.fdegree AND cd.fregno = cs.fregno
AND IFNULL(cd.fpassmth,'') = '' AND s.fintass = 'F'
AND s.FTHEORY='F' AND s.FINTASS='F'
AND mk.fcollcode BETWEEN '{$coll_from}' AND '{$coll_to}'
AND cs.frecptdate IS NOT NULL AND cs.ftotalfee > '0' AND cd.fpresent = 'P' AND IFNULL(cd.FPASSMTH,'') = ''
AND mk.fdegree BETWEEN '{$degree_code_from}' AND '{$degree_code_to}'
AND mk.fexamno BETWEEN '{$Examno_from}' AND '{$Examno_to}' AND mk.fregno BETWEEN '{$reg_from}' AND '{$reg_to}'
GROUP BY mk.fcollcode, mk.fdegree, mk.fexamno, mk.fsubcode, s.fsubname, s.fssubname
HAVING SUM(CASE WHEN IFNULL(mk.fmarks11,-1) = -1 THEN 1 ELSE 0 END) > 0
ORDER BY mk.fcollcode, mk.fdegree, mk.fexamno, mk.fsubcode";
}
$pdf->SetFont('Times','B',14);
$pdf->aobj_context =$aobj_context;
$pdf->WhichReport = 'Practical Marks Pending';
$pdf->FUNIVNAME = $lobj_page_header_university[FUNIVNAME];
$pdf->coll_from = $coll_from;
$pdf->coll_to = $coll_to;
$pdf->deg_from = $degree_code_from;
$pdf->deg_to = $degree_code_to;
$pdf->Examno_from = $Examno_from;
$pdf->Examno_to = $Examno_to;
$pdf->reg_from = $reg_from;
$pdf->reg_to = $reg_to;
$pdf->FTOWN = $lobj_page_header_university[FTOWN]; //$
$pdf->date_1 = $lobj_page_header_university['date'];
$pdf->SetFont('Times','B',9);
$lobj_get_student_data = $aobj_context->mobj_db->GetAll($query);
$first = true;
$count=1;
foreach($lobj_get_student_data as $key => $value)
{
$linewidth = 205;
$lleftmargin = 6;
$lrightmargin = 8;
if($first)
{
$pdf->AddPage();
$pdf->SetFont('Courier','B',10);
$Count_subject=1;
$DUP_FCSUBCODE='';
$pdf->Cell(0,4,"Practical Marks Pending" ,0,1,'C');
$pdf->Ln(2);
$pdf->SetFont('Courier','B',9);
$lreprange1 = "College Range : ".$coll_from." - ".$coll_to;
$lreprange2 = "Degree Range : ".$degree_code_from." - ".$degree_code_to;
$lreprange3 = "Exam Range : ".$Examno_from." - ".$Examno_to;
$lreprange4 = "Register No. Range : ".$reg_from." - ".$reg_to;
$pdf->Cell(0,4,$lreprange1,0,1,'C');
$pdf->Cell(0,4,$lreprange2,0,1,'C');
$pdf->Cell(0,4,$lreprange3,0,1,'C');
$pdf->Cell(0,4,$lreprange4,0,1,'C');
$lhead1=" Sl. College Name Deg. Exam Subject Total PR";
$lhead2=" No. code No. Code Count Pending ";
$new_y=$pdf->GetY();
$pdf->SetFont('Courier','',9);
$pdf->Line($lleftmargin,$new_y, $linewidth,$new_y);
$pdf->Line($lleftmargin,$new_y+.5, $linewidth,$new_y+.5);
$pdf->SetFont('Courier','B',9);
$pdf->Cell(200,5,$lhead1,"0",1,'L');
$pdf->Cell(200,5,$lhead2,"0",1,'L');
$pdf->SetFont('Courier','',9);
$new_y=$pdf->GetY();
$pdf->Line($lleftmargin,$new_y, $linewidth,$new_y);
$pdf->Line($lleftmargin,$new_y+.5, $linewidth,$new_y+.5);
}
$line1 = substr(str_repeat(' ', 4).$count,-4);
$line1.= " ".substr($value['fcollcode'].str_repeat(' ', 60),0,60);
$line1.= " ".substr($value['fdegree'].str_repeat(' ',5),0,6);
$line1.= " ".substr($value['fexamno'].str_repeat(' ', 5),0,8);
$line1.= " ".substr($value['fsubcode'].str_repeat(' ', 10),0,10);
//$line1.= " ".substr($value['fsubname'].str_repeat(' ', 55),0,55);
$line1.= " ".substr($value['ftotcnt'].str_repeat(' ', 7),0,7);
$line1.= " ".substr($value['fpend'].str_repeat(' ', 8),0,8);
$count++;
$pdf->Cell(200,5,$line1,"0",1,'L');
$first = false;
if($count%45==0)
{
$first = true;
$new_y=$pdf->GetY();
$pdf->Line($lleftmargin,$new_y, $linewidth,$new_y);
$pdf->Line($lleftmargin,$new_y+.5, $linewidth,$new_y+.5);
}
}
$new_y=$pdf->GetY();
$pdf->Line($lleftmargin,$new_y, $linewidth,$new_y);
$pdf->Line($lleftmargin,$new_y+.5, $linewidth,$new_y+.5);
$pdf->Output("Practical_Marks_pending.pdf","I");
}
?>
|