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 : 52.14.7.103
<?php
function GenerateTeacherReport($aobj_context)
{
session_start();
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$college_code = $_SESSION['collcode'];
$from_dept = $aobj_context->mobj_data["from_dept"];
$to_dept = $aobj_context->mobj_data["to_dept"];
$from_des = $aobj_context->mobj_data["from_des"];
$to_des = $aobj_context->mobj_data["to_des"];
$dept_cond="";
$des_cond="";
if($from_dept!='0' && $to_dept!="0")
{
$dept_cond=" and t.FDEPTCODE>='{$from_dept}' and t.FDEPTCODE<='{$from_dept}'";
}
if($from_des!='0' && $to_des!="0")
{
$des_cond=" and t.FDEGNCODE>='{$from_des}' and t.FDEGNCODE<='{$to_des}'";
}
$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(5,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,FEXAMDATE
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 = 'Teachers 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->FEXAMDATE = $lobj_page_header_degree[0]['FEXAMDATE'];
$pdf->AddPage();
$pdf->SetFont('Times','',10);
$get_data="select FTEACHCODE,FTEACHNAME,FDEGNDESC,
CONCAT(FADDR1,' ',FADDR2,' ',FADDR3,' ',FADDR4) as address,
d.FDEPTNAME,FFULLTIME,FPERMANENT,FEXP,
DATE_FORMAT(FDOA,'%d/%m/%Y') as doj,
s1.FDEPTNAME as s1,FUGPG1,FEXAMWORK1,
s2.FDEPTNAME as s2,FUGPG2,FEXAMWORK2,
s3.FDEPTNAME as s3,FUGPG3,FEXAMWORK3
from masteach t inner join masdept d on t.FDEPTCODE=d.FDEPTCODE
inner join masdegn des on des.FDEGNCODE=t.FDEGNCODE
left join masdept s1 on s1.FDEPTCODE=FSUBCODE1
left join masdept s2 on s2.FDEPTCODE=FSUBCODE2
left join masdept s3 on s3.FDEPTCODE=FSUBCODE3
where t.FCOLLCODE='{$college_code}'
";
$lobj_get_data= $aobj_context->mobj_db->GetAll($get_data);
$i=1;
$app_height=6;
foreach($lobj_get_data as $apk=>$apv)
{
$FTEACHCODE=$apv['FTEACHCODE'];
$FTEACHNAME=$apv['FTEACHNAME'];
$FDEGNDESC=$apv['FDEGNDESC'];
$FDEPTNAME=$apv['FDEPTNAME'];
$FFULLTIME=$apv['FFULLTIME'];
$FPERMANENT=$apv['FPERMANENT'];
$FEXP=$apv['FEXP'];
$doj=$apv['doj'];
$s1=$apv['s1'];
$FUGPG1=$apv['FUGPG1'];
$FEXAMWORK1=$apv['FEXAMWORK1'];
$s2=$apv['s2'];
$FUGPG2=$apv['FUGPG2'];
$FEXAMWORK2=$apv['FEXAMWORK2'];
$s3=$apv['s3'];
$FUGPG3=$apv['FUGPG3'];
$FEXAMWORK3=$apv['FEXAMWORK3'];
$address=$apv['address'];
$pdf->Cell(20,"6","",'0',0,'C');
$pdf->Cell(25,"6","Teacher Code",'0',0,'L');
$pdf->Cell(50,"6",$FTEACHCODE,'0',0,'L');
$pdf->Cell(25,"6","Teacher Name",'0',0,'L');
$pdf->Cell(80,"6",$FTEACHNAME,'0',1,'L');
$pdf->Cell(20,"6","",'0',0,'C');
$pdf->Cell(25,"6","Dept",'0',0,'L');
$pdf->Cell(50,"6",$FDEPTNAME,'0',0,'L');
$pdf->Cell(25,"6","Designation ",'0',0,'L');
$pdf->Cell(80,"6",$FDEGNDESC,'0',1,'L');
$pdf->Cell(20,"6","",'0',0,'C');
$pdf->Cell(25,"6","Full Time",'0',0,'L');
$pdf->Cell(50,"6",$FFULLTIME,'0',0,'L');
$pdf->Cell(25,"6","Permanent ",'0',0,'L');
$pdf->Cell(80,"6",$FPERMANENT,'0',1,'L');
$pdf->Cell(20,"6","",'0',0,'C');
$pdf->Cell(25,"6","DOJ",'0',0,'L');
$pdf->Cell(50,"6",$doj,'0',0,'L');
$pdf->Cell(25,"6","Exp ",'0',0,'L');
$pdf->Cell(80,"6",$FEXP,'0',1,'L');
$pdf->Cell(20,"6","",'0',0,'C');
$pdf->Cell(25,"6","Address",'0',0,'L');
$pdf->MultiCell(120,6, $address,'0','L');
$pdf->SetFont('Times','B',12);
$pdf->Cell(20,"6","",'0',0,'C');
$pdf->Cell(25,"6","Specialization ",'0',1,'L');
$pdf->SetFont('Times','',10);
$pdf->ln(2);
WriteHeaders($pdf);
WriteHeadersDetails($pdf,$s1,$FUGPG1,$FEXAMWORK1);
WriteHeadersDetails($pdf,$s2,$FUGPG2,$FEXAMWORK2);
WriteHeadersDetails($pdf,$s3,$FUGPG2,$FEXAMWORK3);
$pdf->ln(15);
if($i%3==0)
{
$pdf->AddPage();
}
$i++;
}
$pdf->Ln(18);
$pdf->Cell(20,4,"Date :",'0',0,'C');
$pdf->Cell(170,4,"Signature of the Principal with Seal",'0',1,'R');
$pdf->Output("teachers_checklist.pdf","D");
}
function WriteHeaders($pdf)
{
$pdf->SetFont('Times','B',10);
$pdf->Cell(20,6,'','0',0,'C');
$pdf->Cell(50,6,'Subject','1',0,'C');
$pdf->Cell(20,6,'UG / PG','1',0,'C');
$pdf->Cell(20,6,'Examiner','1',0,'C');
$pdf->Cell(20,6,'QP Setter','1',0,'C');
$pdf->Cell(20,6,'Squad','1',0,'C');
$pdf->Cell(20,6,'Chief Sup','1',0,'C');
$pdf->Cell(20,6,'Custodian','1',1,'C');
$pdf->SetFont('Times','',10);
}function WriteHeadersDetails($pdf,$s1,$FUGPG1,$FEXAMWORK1)
{
$exp_arr=explode("|",$FEXAMWORK1);
$examinar="No";
$qp="No";
$sqad="No";
$cheif_sup="No";
$cust="No";
for($i=0;$i<=count($exp_arr);$i++)
{
$val=trim($exp_arr[$i]);
if($val=="EXAMINER")
$examinar="Yes";
else if($val=="QP SETTER")
$qp="Yes";
else if($val=="SQUAD")
$sqad="Yes";
else if($val=="CHIEF SUP")
$cheif_sup="Yes";
else if($val=="CUSTODIAN")
$cust="Yes";
}
$pdf->Cell(20,6,'','0',0,'C');
$pdf->Cell(50,6,$s1,'1',0,'C');
$pdf->Cell(20,6,$FUGPG1,'1',0,'C');
$pdf->Cell(20,6,$examinar,'1',0,'C');
$pdf->Cell(20,6,$qp,'1',0,'C');
$pdf->Cell(20,6,$sqad,'1',0,'C');
$pdf->Cell(20,6,$cheif_sup,'1',0,'C');
$pdf->Cell(20,6,$cust,'1',1,'C');
}
?>
|