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.220.227.250
<?php
function generateAllStudentPhotosreport($aobj_context)
{
session_start();
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$college_code = $_SESSION['collcode'];
$FUNIVCODE = $_SESSION['FUNIVCODE'];
$college_from = trim($aobj_context->mobj_data["college_from"]);
$college_to = trim($aobj_context->mobj_data["college_to"]);
$degree_from = trim($aobj_context->mobj_data["degree_from"]);
// var_dump($degree_from );
$degree_to = trim($aobj_context->mobj_data["degree_to"]);
$type = trim($aobj_context->mobj_data["type"]);
$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";
$getnumword=$aobj_context->main_src."/src/getnumword.php";
include($getnumword);
// 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(20,13);
$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);
$pdf->aobj_context =$aobj_context ;
//$pdf->WhichReport = 'MARKS_SUBJECTWISE';
$pdf->FUNIVNAME = $lobj_page_header_university['FUNIVNAME'];
$pdf->FTOWN = $lobj_page_header_university['FTOWN'];
/* $query = "select fdegree,fregno,fname,fcaste,fsex,fphotopath,concat(fregno,'.jpg')as fhphotopath from student
where fdegree between '{$degree_from}' and '{$degree_to}' and
fcollcode between '{$college_from}' and '{$college_to}' and ifnull(fdeleted,'') <> 'T' order by fdegree,fregno,fcollcode";
*/
$query = " select distinct CONCAT(student.fdegree,' - ',FDESCPN) as fdegree,fregno,fname,fcaste,fsex,fphotopath from student,degree
where student.fdegree between '{$degree_from}' and '{$degree_to}' and student.`FDEGREE` = degree.`FDEGREE` and
fcollcode between '{$college_from}' and '{$college_to}' order by fdegree,fregno,fcollcode";
$lobj_get_subject_data = $aobj_context->mobj_db->GetAll($query);
$get_date_time="SELECT DATE_FORMAT(now(),'%d-%b-%Y %H:%m %r') as dt";
$ob_dt = $aobj_context->mobj_db->GetRow($get_date_time);
$date_timef=$ob_dt['dt'];
$first=true;
$sl_no=1;
$k=0;
$n=0;
$pdf->SetFont('Times','',10);
$olddeg ="";
$newdeg ="";
$fbatchold = "";
//$pdf->Rect(5,09,200,280);
$j = 1;
foreach($lobj_get_subject_data as $key => $value)
{
$newdeg = $value['fdegree'];
if($newdeg != $olddeg)
{ $pdf->AddPage();
$pdf->SetMargins(20,13);
$pdf->SetFont('Times','B',10);
$pdf->Cell(175,5,'Student Photo List','0',1,'C');
$pdf->Cell(175,5,'Degree : '.$newdeg,'0',1,'C');
$olddeg = $newdeg;
$j=1;
}
$fbatchnew = $value['fbatch'];
if($pdf->GetY() > 260)
{
$pdf->AddPage();
//$pdf->SetMargins(20,15);
$pdf->Cell(175,5,'Student Photo List','0',1,'C');
$pdf->Cell(175,5,$newdeg,'0',1,'C');
$pdf->SetFont('Times','B',10);
$pdf->Cell(10,7,'Sl. No.','1',0,'C');
$pdf->Cell(30,7,'Register No.','1',0,'C');
$pdf->Cell(55,7,'Name','1',0,'C');
$pdf->Cell(20,7,'Caste','1',0,'C');
$pdf->Cell(20,7,'Gender','1',0,'C');
$pdf->Cell(35,7,'Photo','1',1,'C');
//$pdf->SetMargins(28.35,17);
//$pdf->Rect(5,09,200,280);
}
if($first)
{
$pdf->SetFont('Times','B',10);
$pdf->Cell(10,7,'Sl. No.','1',0,'c');
$pdf->Cell(30,7,'Register No.','1',0,'c');
$pdf->Cell(55,7,'Name','1',0,'c');
$pdf->Cell(20,7,'Caste','1',0,'C');
$pdf->Cell(20,7,'Gender','1',0,'C');
$pdf->Cell(35,7,'Photo','1',1,'C');
$first = false;
}
$pdf->SetFont('Times','',10);
$i = 33;
$x = $pdf->GetX();
$y = $pdf->GetY();
$pdf->Cell(10,30,$j,'1',0,'C');
$pdf->Cell(30,30,$value['fregno'],'1',0,'C');
$pdf->Cell(55,30,$value['fname'],'1',0,'L');
$pdf->Cell(20,30,$value['fcaste'],'1',0,'L');
$pdf->Cell(20,30,$value['fsex'],'1',0,'L');
$pdf->Cell(35,30,'','1',1,'L');
$full_photo_path=trim($aobj_context->main_src."/".$value['fphotopath']);
//var_dump($value['fphotopath']);
if(file_exists($full_photo_path) && !empty($value['fphotopath']))
{
$pdf->Image($full_photo_path,160,$y+2,25,25);
}
else
{
$pdf->Image($aobj_context->main_src."/img/nophotoborder.jpg",160,$y+2,25,25);
}
$j++;
$i= $i+10;
}
$pdf->Ln(5);
$pdf->Output("report_top_sheet.pdf","D");
}
?>
|