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.117.184.236
<?php
function GenerateTeacherReport($aobj_context)
{
session_start();
include_once("/JSON.php");
$json = new Services_JSON();
$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}'";
}
*/
$ltech_param = stripslashes($aobj_context->mobj_data["delete_arr"]);
$mobj_jsondata = $json->decode($ltech_param);
$delete_arr_data = get_object_vars($mobj_jsondata);
$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(6,8);
$pdf->AliasNbPages();
// query for the page header
$page_header_university = "select FUNIVNAME,FTOWN,FUNIVADD1, 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);
$page_footer_date = "select now() as now_date ";
$lobj_page_footer_date = $aobj_context->mobj_db->GetRow($page_footer_date);
$pdf->date_time = $lobj_page_footer_date['now_date'];
$pdf->aobj_context =$aobj_context ;
$pdf->WhichReport = 'Teachers Report';
$pdf->FUNIVNAME = $lobj_page_header_university[FUNIVNAME];
$pdf->FTOWN = $lobj_page_header_university[FTOWN];
$pdf->FUNIVADD1 = $lobj_page_header_university[FUNIVADD1];
$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->FromDept=$from_dept;
$pdf->ToDept=$to_dept;
$pdf->FromDes=$from_des;
$pdf->ToDes=$to_des;
//$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}'
"; */
$get_data="select FTEACHCODE,FTEACHNAME,FDEGNDESC,
CONCAT(FADDR1,' ',FADDR2,' ',FADDR3,' ',FADDR4) as address,
d.FDEPTNAME,FFULLTIME,FPERMANENT,FEXP,FPHOTO,
DATE_FORMAT(FDOA,'%d/%m/%Y') as doj,
s1.fsubname as s1,FUGPG1,FEXAMWORK1,
s2.fsubname as s2,FUGPG2,FEXAMWORK2,
s3.fsubname as s3,FUGPG3,FEXAMWORK3,
s4.fsubname as s4,FUGPG4,FEXAMWORK4,
s5.fsubname as s5,FUGPG5,FEXAMWORK5
from masteach t inner join masdept d on t.FDEPTCODE=d.FDEPTCODE
inner join masdegn des on des.FDEGNCODE=t.FDEGNCODE
left join massub s1 on s1.fsubcode=FSUBCODE1
left join massub s2 on s2.fsubcode=FSUBCODE2
left join massub s3 on s3.fsubcode=FSUBCODE3
left join massub s4 on s4.fsubcode=FSUBCODE4
left join massub s5 on s5.fsubcode=FSUBCODE5
where t.FCOLLCODE='{$college_code}'
";
$lobj_get_data= $aobj_context->mobj_db->GetAll($get_data);
$app_height=6;
$width_x=160;
$height=35;
$st_height=0;
$ed_height=0;
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'];
$s4=$apv['s4'];
$FUGPG4=$apv['FUGPG4'];
$FEXAMWORK4=$apv['FEXAMWORK4'];
$s5=$apv['s5'];
$FUGPG5=$apv['FUGPG5'];
$FEXAMWORK5=$apv['FEXAMWORK5'];
$address=$apv['address'];
$cut_height=1;
$XY=$pdf->GetY();
if($i%3==0 || $XY > 210)
{
$pdf->AddPage();PrintFooter($pdf);
$width_x=160;
$height=34;
//$st_height=$pdf->GetY();
$XY=$pdf->GetY();
}
$st_height=$pdf->GetY();
$height_y=$height;
$pdf->Cell(20,"6","",'0',0,'C');
$pdf->Cell(25,"6",$XY."Teacher Code",'0',0,'L');$pdf->Cell(2,6,' : ',0,0,'C');
$pdf->Cell(50,"6",$FTEACHCODE,'0',0,'L');
$pdf->Cell(25,"6","Teacher Name",'0',0,'L');$pdf->Cell(2,6,' : ',0,0,'C');
$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(2,6,' : ',0,0,'C');
$pdf->Cell(50,"6",$FDEPTNAME,'0',0,'L');
$pdf->Cell(25,"6","Designation ",'0',0,'L');$pdf->Cell(2,6,' : ',0,0,'C');
$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(2,6,' : ',0,0,'C');
$pdf->Cell(50,"6",$FFULLTIME,'0',0,'L');
$pdf->Cell(25,"6","Permanent ",'0',0,'L');$pdf->Cell(2,6,' : ',0,0,'C');
$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(2,6,' : ',0,0,'C');
$pdf->Cell(50,"6",$doj,'0',0,'L');
$pdf->Cell(25,"6","Exp ",'0',0,'L');$pdf->Cell(2,6,' : ',0,0,'C');
$pdf->Cell(80,"6",$FEXP,'0',1,'L');
$pdf->Cell(20,"6","",'0',0,'C');
$pdf->Cell(25,"6","Address",'0',0,'L');$pdf->Cell(2,6,' : ',0,0,'C');
$pdf->MultiCell(120,6, $address,'0','L');
$photo_path=$apv[FPHOTO];
if(!empty($photo_path) && file_exists($photo_path))
{
$pdf->Image($photo_path,$width_x,$height_y,25);
}
$height=$height+75;
$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);
WriteHeadersDetails($pdf,$s4,$FUGPG4,$FEXAMWORK4);
WriteHeadersDetails($pdf,$s5,$FUGPG5,$FEXAMWORK5);
$ed_height=$pdf->GetY();
$pdf->ln(5);
$i++;
}
$pdf->ln(10);
$pdf->Cell(25,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";
$w = array(20,50,20,20,20,20,20,20);
$x = $pdf->GetX();
$y = $pdf->GetY();
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,5,'','0',0,'C');
$pdf->Cell(50,5,$s1,'1',0,'C');
$pdf->Cell(20,5,$FUGPG1,'1',0,'C');
$pdf->Cell(20,5,$examinar,'1',0,'C');
$pdf->Cell(20,5,$qp,'1',0,'C');
$pdf->Cell(20,5,$sqad,'1',0,'C');
$pdf->Cell(20,5,$cheif_sup,'1',0,'C');
$pdf->Cell(20,5,$cust,'1',1,'C'); */
$y1 = $pdf->GetY();
$X1 = $pdf->GetX();
$pdf->SetXY($X1+20,$y1);
$pdf->MultiCell($w[1], 5, $s1, '1',1);
$y2 = $pdf->GetY();
$yH = $y2 - $y1;
$pdf->SetXY($x + $w[1]+20, $pdf->GetY() - $yH);
$pdf->Cell($w[2], $yH, $FUGPG1, '1',0,'C');
$pdf->Cell($w[3], $yH, $examinar, '1',0,'C');
$pdf->Cell($w[4],$yH,$qp,'1',0,'C');
$pdf->Cell($w[5],$yH,$sqad,'1',0,'C');
$pdf->Cell($w[6],$yH,$cheif_sup,'1',0,'C');
$pdf->Cell($w[7],$yH,$cust,'1',0,'C');
$pdf->Ln();
}
function PrintFooter($pdf)
{
$new_x=$pdf->GetX();
$new_y=$pdf->GetY();
$ip=$_SERVER["REMOTE_ADDR"];
$pdf->SetY(-15);
$pdf->SetFont('Times','',8);
$pdf->Cell(140,4,'Printed : IP Address : '.$ip.", Date : ".$pdf->date_time,'0',0,'L');
$pdf->SetXY($new_x,$new_y);
}
?>
|