format("Y-m-d");
$count = 0;
require ('./fpdf.php');
class PDF extends FPDF{
function Header(){
$this->Image('../images/ahg_logo.png',10,5, 25,10, 'PNG','wwww.autohubgroup.com');
}
/* function Footer(){
$this->SetY(-25);
$this->Image('../images/ahg_logo.png');
} */
}
include_once("../../../cfg/conn.php");
$sql ="SELECT * FROM pms_employee_data WHERE deleted=0 ORDER BY last_name ASC";
$sourceID = $_GET['source'];
$pcpIDpdf = $_GET['pcpIDpdf'];
$getName = "SELECT * FROM pms_users WHERE id = $sourceID LIMIT 1";
$getMyName = mysqli_query($conn,$getName);
while($nRow = mysqli_fetch_array($getMyName)){
$fname=$nRow['f_name'];
$lname=$nRow['l_name'];
$myFName = $fname ." ". $lname;
}
//+++++++++++++++++++
//START OF CHECKPOINT===============================================================================
//START OF CHECKPOINT===============================================================================
//==========CHECK IF USER EXIST IN THE RECORD AND MATCH ALL INFORMATION IN THE LICNK =========
$chkUser = "SELECT * FROM `pms_employee_data` WHERE `id`='$sourceID' AND `deleted` = 0";
$qCU=mysqli_query($conn,$chkUser);
$countUser = mysqli_num_rows($qCU);
if($countUser == 0){
echo "

";
echo " Access Denied
";
echo "
Sorry, you are not authorized to access this page.
Please contact your system support for assistance.
Thank you!
";
exit();
}else{
while($uow=mysqli_fetch_array($qCU)){
$uowaccStat = $uow['account_status'];
$uowdeleted = $uow['deleted'];
}
}
if($uowaccStat == 0){
echo " 
";
echo " Access Denied
";
echo "
Sorry, you are not authorized to access this page.
Please contact your system support for assistance.
Thank you!
";
exit();
}
if($uowdeleted == 1){
echo " 
";
echo " Access Denied
";
echo "
Sorry, you are not authorized to access this page.
Please contact your system support for assistance.
Thank you!
";
exit();
}
//==========CHECK IF EMPLOYEE EXIST IN RECORD AND MATCH ALL INFORMATION IN THE LICNK =========
$chkPoint = "SELECT `employee_id`,`year`,`period`,`pcp_name`,`period_count` FROM `pcp_headers` WHERE `id`='$pcpIDpdf'";
$qChk=mysqli_query($conn,$chkPoint);
$ckhRow = mysqli_num_rows($qChk);
If($ckhRow > 0){
while($row=mysqli_fetch_array($qChk)){
$employeeID = $row['employee_id'];
$period = $row['period'];
$pcpYear = $row['year'];
$periodCount = $row['period_count'];
}
}else{
echo " 
";
echo " Access Denied
";
echo "
Sorry, you are not authorized to access this page.
Please contact your system support for assistance.
Thank you!
";
exit();
}
$periodText ="PERFORMANCE EVALUATION (" . $period. " Semester of ". $pcpYear .")";
if($employeeID != $pcpIDpdf){
echo " 
";
echo " Access Denied
";
echo "
Sorry, you are not authorized to access this page.
Please contact your system support for assistance.
Thank you!
";
exit();
}
//END OF CHECKPOINT===============================================================================
//END OF CHECKPOINT===============================================================================
$pdf = new PDF();
//set margins
$pdf->SetMargins(10,20,10);
$pdf->AddPage('p'); //SET
//set column size in array format
$width_cell = array(10,15,20,20,20,35,40,30); //Portrait = 190 Landscape =
//$width_cell = array(20,40,85,140);
//set Image
//$pdf->Image('../images/ahg_logo.png',10,5, 25,10, 'PNG','wwww.autohubgroup.com');
//background color
$pdf->SetFillColor(255,255,255); //use for report title bgcolor
$pdf->SetFont('Arial','B',12);
$pdf->MultiCell(0,10,"EMPLOYEE SUMMARY LIST",0,0,'C',true);
$pdf->SetFont('Arial','',8);
$pdf->SetFillColor(255,229,252,90); //use for header bgcolor
$pdf->SetTextColor(0,0,0,90);
$pdf->SetLineWidth(0);
$pdf->SetDrawColor(0,0,25);
//header start
$pdf->Cell($width_cell[0],5,'NO',1,0,'L',true);
$pdf->Cell($width_cell[1],5,'EMP.ID',1,0,'L',true);
$pdf->Cell($width_cell[2],5,'COMPANY',1,0,'L',true);
$pdf->Cell($width_cell[3],5,'BRANCH',1,0,'L',true);
$pdf->Cell($width_cell[4],5,'DEPT.',1,0,'L',true);
$pdf->Cell($width_cell[5],5,'FIRST NAME',1,0,'L',true);
$pdf->Cell($width_cell[6],5,'LAST NAME',1,0,'L',true);
$pdf->Cell($width_cell[7],5,'POSITION',1,0,'L',true);
$pdf->SetFillColor(255,255,255); //use for body bgcolor
$fill=false;
//$pdf->Cell(400,200,'Hello Arnel');
$getArea = mysqli_query($conn,$sql);
$statRow = mysqli_num_rows($getArea);
if($statRow > 0){
while($row = mysqli_fetch_array($getArea)){
$count =$count + 1;
$pdf->MultiCell(0,5,"",1,0,'L',$fill); //setup row padding
$pdf->Cell($width_cell[0],5,$count,1,0,'L',$fill);
$pdf->Cell($width_cell[1],5,$row['emp_id'],1,0,'L',$fill);
$pdf->Cell($width_cell[2],5,$row['comp_id'],1,0,'L',$fill);
$pdf->Cell($width_cell[3],5,$row['branch_id'],1,0,'L',$fill);
$pdf->Cell($width_cell[4],5,$row['department_id'],1,0,'L',$fill);
$pdf->Cell($width_cell[5],5,$row['first_name'],1,0,'L',$fill);
$pdf->Cell($width_cell[6],5,$row['last_name'],1,0,'L',$fill);
$pdf->Cell($width_cell[7],5,$row['position'],1,0,'L',$fill);
$fill =!$fill; // use code to put alternate color between rows
}
$pdf->MultiCell(1,25,"",0,0,'L',false); //setup row padding
$pdf->Cell(100,0,"_____________________________",0,1,'L',false);
$pdf->Cell(100,8,$myFName .' / '. $prfDateX ,0,0,'L',false);
}
$pdf->Output('my_file.php','I');
?>