File manager - Edit - /home/autoph/public_html/ltms-upload/plugins/dropzone/min/pdfViewer.zip
Back
PK �|�Zu{;1- - RPTDivision_list.phpnu �[��� <?php ob_start(); $prfDateX = date_create() ->format("Y-m-d"); //https://www.youtube.com/watch?v=gNH6NNyhJLk //https://www.youtube.com/watch?v=EYYZFRRdR6A PDF with MySQL database $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"); include ("../functions/users.php"); $sql ="SELECT * FROM pms_division_tbl WHERE deleted=0 ORDER BY division_code ASC"; $myUID = $_GET['id']; $getName = "SELECT * FROM pms_users WHERE id = $myUID LIMIT 1"; $getMyName = mysqli_query($conn,$getName); while($nRow = mysqli_fetch_array($getMyName)){ $fname=$nRow['f_name']; $lname=$nRow['l_name']; $myFName = $fname ." ". $lname; } $pdf = new PDF(); //set margins $pdf->SetMargins(10,20,10); $pdf->AddPage('P'); //SET //set column size in array format $width_cell = array(20,20,20,50,80); //=190 $height_cell= 7; //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,6,"LIST OF DIVISIONS",0,0,'L',true); $pdf->SetFont('Arial','',8, 'landscape'); $pdf->SetFillColor(70, 70, 68 ,0); //use for header bgcolor $pdf->SetTextColor(255,255,255,90); $pdf->SetLineWidth(0); $pdf->SetDrawColor(0,0,25); //header start $pdf->Cell($width_cell[0],$height_cell,'ID',1,0,'L',true); $pdf->Cell($width_cell[1],$height_cell,'GROUP',1,0,'L',true); $pdf->Cell($width_cell[2],$height_cell,'DIV. CODE',1,0,'L',true); $pdf->Cell($width_cell[3],$height_cell,'NAME',1,0,'L',true); $pdf->Cell($width_cell[4],$height_cell,'DESCRIPTION',1,0,'L',true); $pdf->SetFillColor(255,255,255,0); //use for header bgcolor $pdf->SetTextColor(0,0,0,90); $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,$height_cell,"",1,0,'L',$fill); //setup row padding $pdf->Cell($width_cell[0],$height_cell,$count,1,0,'L',$fill); $pdf->Cell($width_cell[1],$height_cell,getMainDivision($row['sub_grp_id'])[0],1,0,'L',$fill); $pdf->Cell($width_cell[2],$height_cell,$row['division_code'],1,0,'L',$fill); $pdf->Cell($width_cell[3],$height_cell,$row['division_name'],1,0,'L',$fill); $pdf->Cell($width_cell[4],$height_cell,$row['division_desc'],1,0,'L',$fill); $fill =!$fill; // use code to put alternate color between rows } $pdf->MultiCell(1,25,"",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'); ?>PK �|�Z�T�P�* �* FAQ.htmnu �[��� <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>FAQ</title> <link type="text/css" rel="stylesheet" href="fpdf.css"> <style type="text/css"> ul {list-style-type:none; margin:0; padding:0} ul#answers li {margin-top:1.8em} .question {font-weight:bold; color:#900000} </style> </head> <body> <h1>FAQ</h1> <ul> <li><b>1.</b> <a href='#q1'>What's exactly the license of FPDF? Are there any usage restrictions?</a></li> <li><b>2.</b> <a href='#q2'>I get the following error when I try to generate a PDF: Some data has already been output, can't send PDF file</a></li> <li><b>3.</b> <a href='#q3'>Accented letters are replaced with some strange characters like é.</a></li> <li><b>4.</b> <a href='#q4'>I try to display the Euro symbol but it doesn't work.</a></li> <li><b>5.</b> <a href='#q5'>I try to display a variable in the Header method but nothing prints.</a></li> <li><b>6.</b> <a href='#q6'>I have defined the Header and Footer methods in my PDF class but nothing shows.</a></li> <li><b>7.</b> <a href='#q7'>I can't make line breaks work. I put \n in the string printed by MultiCell but it doesn't work.</a></li> <li><b>8.</b> <a href='#q8'>I use jQuery to generate the PDF but it doesn't show.</a></li> <li><b>9.</b> <a href='#q9'>I draw a frame with very precise dimensions, but when printed I notice some differences.</a></li> <li><b>10.</b> <a href='#q10'>I'd like to use the whole surface of the page, but when printed I always have some margins. How can I get rid of them?</a></li> <li><b>11.</b> <a href='#q11'>How can I put a background in my PDF?</a></li> <li><b>12.</b> <a href='#q12'>How can I set a specific header or footer on the first page?</a></li> <li><b>13.</b> <a href='#q13'>I'd like to use extensions provided by different scripts. How can I combine them?</a></li> <li><b>14.</b> <a href='#q14'>How can I open the PDF in a new tab?</a></li> <li><b>15.</b> <a href='#q15'>How can I send the PDF by email?</a></li> <li><b>16.</b> <a href='#q16'>What's the limit of the file sizes I can generate with FPDF?</a></li> <li><b>17.</b> <a href='#q17'>Can I modify a PDF with FPDF?</a></li> <li><b>18.</b> <a href='#q18'>I'd like to make a search engine in PHP and index PDF files. Can I do it with FPDF?</a></li> <li><b>19.</b> <a href='#q19'>Can I convert an HTML page to PDF with FPDF?</a></li> <li><b>20.</b> <a href='#q20'>Can I concatenate PDF files with FPDF?</a></li> </ul> <ul id='answers'> <li id='q1'> <p><b>1.</b> <span class='question'>What's exactly the license of FPDF? Are there any usage restrictions?</span></p> FPDF is released under a permissive license: there is no usage restriction. You may embed it freely in your application (commercial or not), with or without modifications. </li> <li id='q2'> <p><b>2.</b> <span class='question'>I get the following error when I try to generate a PDF: Some data has already been output, can't send PDF file</span></p> You must send nothing to the browser except the PDF itself: no HTML, no space, no carriage return. A common case is having extra blank at the end of an included script file.<br> <br> The message may be followed by this indication:<br> <br> (output started at script.php:X)<br> <br> which gives you exactly the script and line number responsible for the output. If you don't see it, try adding this line at the very beginning of your script: <div class="doc-source"> <pre><code>ob_end_clean();</code></pre> </div> </li> <li id='q3'> <p><b>3.</b> <span class='question'>Accented letters are replaced with some strange characters like é.</span></p> Don't use UTF-8 with the standard fonts; they expect text encoded in windows-1252. You can perform a conversion with iconv: <div class="doc-source"> <pre><code>$str = iconv('UTF-8', 'windows-1252', $str);</code></pre> </div> Or with mbstring: <div class="doc-source"> <pre><code>$str = mb_convert_encoding($str, 'windows-1252', 'UTF-8');</code></pre> </div> In case you need characters outside windows-1252, take a look at tutorial #7 or <a href="http://www.fpdf.org/?go=script&id=92" target="_blank">tFPDF</a>. </li> <li id='q4'> <p><b>4.</b> <span class='question'>I try to display the Euro symbol but it doesn't work.</span></p> The standard fonts have the Euro character at position 128. You can define a constant like this for convenience: <div class="doc-source"> <pre><code>define('EURO', chr(128));</code></pre> </div> </li> <li id='q5'> <p><b>5.</b> <span class='question'>I try to display a variable in the Header method but nothing prints.</span></p> You have to use the <code>global</code> keyword to access global variables, for example: <div class="doc-source"> <pre><code>function Header() { global $title; $this->SetFont('Arial', 'B', 15); $this->Cell(0, 10, $title, 1, 1, 'C'); } $title = 'My title';</code></pre> </div> Alternatively, you can use an object property: <div class="doc-source"> <pre><code>function Header() { $this->SetFont('Arial', 'B', 15); $this->Cell(0, 10, $this->title, 1, 1, 'C'); } $pdf->title = 'My title';</code></pre> </div> </li> <li id='q6'> <p><b>6.</b> <span class='question'>I have defined the Header and Footer methods in my PDF class but nothing shows.</span></p> You have to create an object from the PDF class, not FPDF: <div class="doc-source"> <pre><code>$pdf = new PDF();</code></pre> </div> </li> <li id='q7'> <p><b>7.</b> <span class='question'>I can't make line breaks work. I put \n in the string printed by MultiCell but it doesn't work.</span></p> You have to enclose your string with double quotes, not single ones. </li> <li id='q8'> <p><b>8.</b> <span class='question'>I use jQuery to generate the PDF but it doesn't show.</span></p> Don't use an AJAX request to retrieve the PDF. </li> <li id='q9'> <p><b>9.</b> <span class='question'>I draw a frame with very precise dimensions, but when printed I notice some differences.</span></p> To respect dimensions, select "None" for the Page Scaling setting instead of "Shrink to Printable Area" in the print dialog box. </li> <li id='q10'> <p><b>10.</b> <span class='question'>I'd like to use the whole surface of the page, but when printed I always have some margins. How can I get rid of them?</span></p> Printers have physical margins (different depending on the models); it is therefore impossible to remove them and print on the whole surface of the paper. </li> <li id='q11'> <p><b>11.</b> <span class='question'>How can I put a background in my PDF?</span></p> For a picture, call Image() in the Header() method, before any other output. To set a background color, use Rect(). </li> <li id='q12'> <p><b>12.</b> <span class='question'>How can I set a specific header or footer on the first page?</span></p> Just test the page number: <div class="doc-source"> <pre><code>function Header() { if($this->PageNo()==1) { //First page ... } else { //Other pages ... } }</code></pre> </div> </li> <li id='q13'> <p><b>13.</b> <span class='question'>I'd like to use extensions provided by different scripts. How can I combine them?</span></p> Use an inheritance chain. If you have two classes, say A in a.php: <div class="doc-source"> <pre><code>require('fpdf.php'); class A extends FPDF { ... }</code></pre> </div> and B in b.php: <div class="doc-source"> <pre><code>require('fpdf.php'); class B extends FPDF { ... }</code></pre> </div> then make B extend A: <div class="doc-source"> <pre><code>require('a.php'); class B extends A { ... }</code></pre> </div> and make your own class extend B: <div class="doc-source"> <pre><code>require('b.php'); class PDF extends B { ... } $pdf = new PDF();</code></pre> </div> </li> <li id='q14'> <p><b>14.</b> <span class='question'>How can I open the PDF in a new tab?</span></p> Just do the same as you would for an HTML page or anything else: add a target="_blank" to your link or form. </li> <li id='q15'> <p><b>15.</b> <span class='question'>How can I send the PDF by email?</span></p> As for any other file, but an easy way is to use <a href="https://github.com/PHPMailer/PHPMailer" target="_blank">PHPMailer</a> and its in-memory attachment: <div class="doc-source"> <pre><code>$mail = new PHPMailer(); ... $doc = $pdf->Output('S'); $mail->AddStringAttachment($doc, 'doc.pdf', 'base64', 'application/pdf'); $mail->Send();</code></pre> </div> </li> <li id='q16'> <p><b>16.</b> <span class='question'>What's the limit of the file sizes I can generate with FPDF?</span></p> There is no particular limit. There are some constraints, however: <br> <br> - There is usually a maximum memory size allocated to PHP scripts. For very big documents, especially with images, the limit may be reached (the file being built in memory). The parameter is configured in the php.ini file. <br> <br> - The maximum execution time allocated to scripts defaults to 30 seconds. This limit can of course be easily reached. It is configured in php.ini and may be altered dynamically with set_time_limit(). <br> <br> You can work around the memory limit with <a href="http://www.fpdf.org/?go=script&id=76" target="_blank">this script</a>. </li> <li id='q17'> <p><b>17.</b> <span class='question'>Can I modify a PDF with FPDF?</span></p> It's possible to import pages from an existing PDF document thanks to the <a href="https://www.setasign.com/products/fpdi/about/" target="_blank">FPDI</a> extension. Then you can add some content to them. </li> <li id='q18'> <p><b>18.</b> <span class='question'>I'd like to make a search engine in PHP and index PDF files. Can I do it with FPDF?</span></p> No. But a GPL C utility does exist, pdftotext, which is able to extract the textual content from a PDF. It's provided with the <a href="https://www.xpdfreader.com" target="_blank">Xpdf</a> package. </li> <li id='q19'> <p><b>19.</b> <span class='question'>Can I convert an HTML page to PDF with FPDF?</span></p> Not real-world pages. But a GPL C utility does exist, <a href="https://www.msweet.org/htmldoc/" target="_blank">HTMLDOC</a>, which allows to do it and gives good results. </li> <li id='q20'> <p><b>20.</b> <span class='question'>Can I concatenate PDF files with FPDF?</span></p> Not directly, but it's possible to use <a href="https://www.setasign.com/products/fpdi/demos/concatenate-fake/" target="_blank">FPDI</a> to perform that task. Some free command-line tools also exist: <a href="https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/" target="_blank">pdftk</a> and <a href="http://thierry.schmit.free.fr/spip/spip.php?article15" target="_blank">mbtPdfAsm</a>. </li> </ul> </body> </html> PK �|�Zݧ C compliance_pcpByBranch.phpnu �[��� <?php ob_start(); $prfDateX = date_create() ->format("Y-m-d"); //https://www.youtube.com/watch?v=gNH6NNyhJLk //https://www.youtube.com/watch?v=EYYZFRRdR6A PDF with MySQL database $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'); } */ } $myUID = $_GET['userID']; $branchID = $_GET['branchID']; $sourceID = $_GET['userID']; $sem = $_GET['sem']; $branchName = $_GET['branchName']; $rptYear = $_GET['year']; if($sem == 1){ $semester = "1st Semester"; }else if($sem == 2){ $semester = "2nd Semester"; }else{ $semester = "1st & 2nd Semester"; } $branchName = $branchName . " - PCP Compliance Report" ." (". $rptYear .")"; include_once("../../../cfg/conn.php"); include ("../functions/users.php"); $roleID=0; if(isset($_GET['s'])){ //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){ include '../accessDenied.php'; exit(); }else{ while($uow=mysqli_fetch_array($qCU)){ $uowaccStat = $uow['account_status']; $uowdeleted = $uow['deleted']; } } if($uowaccStat == 0){ include '../accessDenied.php'; exit(); } if($uowdeleted == 1){ include '../accessDenied.php'; exit(); } //==========CHECK IF EMPLOYEE EXIST IN RECORD AND MATCH ALL INFORMATION IN THE LICNK ========= $chkPoint = "SELECT `last_name`, `first_name`,`account_status`,`deleted` FROM `pms_employee_data` WHERE `id`='$empID'"; $qChk=mysqli_query($conn,$chkPoint); $ckhRow = mysqli_num_rows($qChk); If($ckhRow > 0){ while($row=mysqli_fetch_array($qChk)){ $lastName = $row['last_name']; $firstName = $row['first_name']; $accStat = $row['account_status']; $deleted = $row['deleted']; } }else{ include '../accessDenied.php'; exit(); } //END OF CHECKPOINT=============================================================================== //END OF CHECKPOINT=============================================================================== } $getName = "SELECT * FROM pms_employee_data WHERE id = $myUID LIMIT 1"; $getMyName = mysqli_query($conn,$getName); while($nRow = mysqli_fetch_array($getMyName)){ $fname=$nRow['first_name']; $lname=$nRow['last_name']; $compID=$nRow['comp_id']; $myFName = $fname ." ". $lname; } $compName = getCompanyNameSub($compID)[0]; $sql ="SELECT * FROM `pms_employee_data` WHERE `branch_id`='$branchID' AND `deleted`=0 ORDER BY `last_name` ASC"; $pdf = new PDF(); //set margins $pdf->SetMargins(10,20,10); $pdf->AddPage('P'); //L = Land Scape, P = Portrait //set column size in array format $width_cell = array(20,110,30,30); //275 $height_cell= 7; //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',10 ); $pdf->MultiCell(0,5,$compName,0,1,0,true); $pdf->SetFont('Arial','',10 ); $pdf->MultiCell(0,5,$branchName,0,1,0,true); $pdf->MultiCell(0,5,"",0,0,true); $pdf->SetFont('Arial','',8); $pdf->SetFillColor(0,0,0,90); //use for header bgcolor $pdf->SetTextColor(255,255,255,90); $pdf->SetLineWidth(0); $pdf->SetDrawColor(0,0,25); //header start $pdf->Cell($width_cell[0],$height_cell,'NO',1,0,'L',true); $pdf->Cell($width_cell[1],$height_cell,'EMPLOYEE NAME',1,0,'L',true); $pdf->Cell($width_cell[2],$height_cell,'1ST SEM',1,0,'C',true); $pdf->Cell($width_cell[3],$height_cell,'2ND SEM',1,0,'C',true); $pdf->SetFillColor(255,255,255,0); //use for header bgcolor $pdf->SetTextColor(0,0,0,90); $fill=false; //$pdf->Cell(400,200,'Hello Arnel'); $getData = mysqli_query($conn,$sql); $statRow = mysqli_num_rows($getData); $semA = 0; $semB = 0; $count = 0; $achvRateTotal=0; $wPointTotal =0; $kraWeightTotal=0; $kraWeightT=0; while($row = mysqli_fetch_array($getData)){ $marCount = 0; $janMarData=""; $count = $count + 1; $pdf->MultiCell(0,$height_cell,"",0,'P',false); //setup row padding $activeEmp = $row['id']; $pdf->Cell($width_cell[0],$height_cell,$count,1,0,'C',$fill); $pdf->Cell($width_cell[1],$height_cell,$row['last_name'].", ".$row['first_name'],1,0,'L',$fill); //getEmployeeKRAName($kraID)[0] for($x = 1; $x <=2; $x++){ //$myNewX = str_pad($x, 2, "0", STR_PAD_LEFT); if($x == 1){ $myPeriod='1ST'; }else{ $myPeriod='2ND'; } $pcp = "SELECT `date_posted` FROM `pcp_headers` WHERE `year`='$rptYear' AND `employee_id`='$activeEmp' AND `date_posted`!='' AND `period`='$myPeriod' LIMIT 1"; $qPcp = mysqli_query($conn,$pcp); $qRow = mysqli_num_rows($qPcp); if($qRow > 0){ while($mar = mysqli_fetch_array($qPcp)){ $janMar = explode(" ",$mar['date_posted']); $janMarData = $janMar[0]; $pdf->Cell($width_cell[3],$height_cell,$janMarData,1,0,'C',$fill); if($x == 1){ $semA = $semA + 1; }else{ $semB = $semB + 1; } } }else{ $pdf->Cell($width_cell[3],$height_cell,"-",1,0,'C',$fill); } } } if($count > 0 ){ $semAS = number_format((($semA/$count) * 100),2,'.','')."%"; $semBS = number_format((($semB/$count) * 100),2,'.','')."%"; $semBY = number_format(((($semA + $semB) / $count) * 100),2,'.','')."%"; }else{ $semAS ="0.0%"; $semBS = "0.0%"; $semBY = "0.0%"; } $pdf->MultiCell(0,$height_cell,"",0,'P',false); $pdf->Cell(130,$height_cell,"COMPLIANCE PER SEMESTER ",0,0,'R',$fill); $pdf->Cell($width_cell[2],$height_cell,$semAS,1,0,'C',$fill); $pdf->Cell($width_cell[3],$height_cell,$semBS,1,0,'C',$fill); $pdf->MultiCell(0,$height_cell,"",0,'P',false); $pdf->Cell(130,$height_cell,"COMPLIANCE RATE PER YEARLY ",0,0,'R',$fill); $pdf->Cell(60,$height_cell,$semBY ,1,0,'C',$fill); $pdf->SetFillColor(255,255,255,10); //use for header bgcolor $pdf->SetTextColor(0,0,0,90); $pdf->MultiCell(1,25,"",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('pcpCompliance_'.$branchName.'.pdf','I'); ?>PK �|�Z@��xd d RPTGroup_list.phpnu �[��� <?php ob_start(); //include_once('./fpdf.php'); $prfDateX = date_create() ->format("Y-m-d"); //https://www.youtube.com/watch?v=gNH6NNyhJLk //https://stackoverflow.com/questions/3179429/why-fpdf-library-fail-to-work-on-production-server //https://www.youtube.com/watch?v=EYYZFRRdR6A PDF with MySQL database $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'); // } */ // } class PDF extends FPDF{ function Header() { $this->Image('../images/ahg_logo.png',10,5, 25,10, 'PNG','wwww.autohubgroup.com'); // Select Arial bold 15 $this->SetFont('Arial','B',15); // Move to the right $this->Cell(80); // Framed title //$this->Cell(50,10,'Dokumen ini sah',1,0,'C'); // Line break $this->Ln(20); } } $myUID = $_GET['id']; include_once("../../../cfg/conn.php"); include ("../functions/users.php"); $sql ="SELECT * FROM pms_group_tbl WHERE deleted=0 ORDER BY name ASC"; $getName = "SELECT * FROM pms_users WHERE id = $myUID LIMIT 1"; $getMyName = mysqli_query($conn,$getName); while($nRow = mysqli_fetch_array($getMyName)){ $fname=$nRow['f_name']; $lname=$nRow['l_name']; $myFName = $fname ." ". $lname; } $pdf = new PDF(); //set margins $pdf->SetMargins(10,20,10); $pdf->AddPage(); //set column size in array format $width_cell = array(20,40,50,80); $height_cell= 7; //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,6,"GROUP SUMMARY LIST",0,0,'C',true); $pdf->SetFont('Arial','',8, 'landscape'); $pdf->SetFillColor(70, 70, 68 ,0); //use for header bgcolor $pdf->SetTextColor(255,255,255,90); $pdf->SetLineWidth(0); $pdf->SetDrawColor(0,0,25); //header start $pdf->Cell($width_cell[0],$height_cell,'ID',1,0,'L',true); $pdf->Cell($width_cell[1],$height_cell,'CODE',1,0,'L',true); $pdf->Cell($width_cell[2],$height_cell,'NAME',1,0,'L',true); $pdf->Cell($width_cell[3],$height_cell,'DESCRIPTION',1,0,'L',true); $pdf->SetFillColor(255,255,255,0); //use for header bgcolor $pdf->SetTextColor(0,0,0,90); $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,$height_cell,"",1,'L',$fill); //setup row padding $pdf->Cell($width_cell[0],$height_cell,$count,1,0,'L',$fill); $pdf->Cell($width_cell[1],$height_cell,$row['code'],1,0,'L',$fill); $pdf->Cell($width_cell[2],$height_cell,$row['name'],1,0,'L',$fill); $pdf->Cell($width_cell[3],$height_cell,$row['description'],1,0,'L',$fill); $fill =!$fill; // use code to put alternate color between rows } $pdf->MultiCell(1,25,"",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'); ?>PK �|�Z�cG� � ops_pdfAutohubView.phpnu �[��� <?php ob_start(); $prfDateX = date_create() ->format("Y-m-d"); //https://www.youtube.com/watch?v=gNH6NNyhJLk //https://www.youtube.com/watch?v=EYYZFRRdR6A PDF with MySQL database $count = 0; require ('./fpdf.php'); class PDF extends FPDF{ function Header(){ $this->Image('../images/ahg_logo.png',10,5, 30,10, 'PNG','wwww.autohubgroup.com'); } /* function Footer(){ $this->SetY(-25); $this->Image('../images/ahg_logo.png'); } */ } $compID = $_GET['compID']; $recordID = $_GET['recordID']; include_once("../../../cfg/conn.php"); include ("../functions/users.php"); if(isset($_GET['compID'])){ $sourceID = $_GET['source']; $opsIDpdf = $_GET['compID']; //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){ include '../accessDenied.php'; exit(); }else{ while($uow=mysqli_fetch_array($qCU)){ $uowaccStat = $uow['account_status']; $uowdeleted = $uow['deleted']; $uFName = $uow['first_name']; $uLName = $uow['last_name']; } } $userFName = $uFName . " " . $uLName; if($uowaccStat == 0){ include '../accessDenied.php'; exit(); } if($uowdeleted == 1){ include '../accessDenied.php'; exit(); } //==========CHECK IF EMPLOYEE EXIST IN RECORD AND MATCH ALL INFORMATION IN THE LICNK ========= $chkPoint = "SELECT `ops_name`,`coverage_year`, `record_id`,`description` FROM `ops_company_level` WHERE `id`='$opsIDpdf'"; $qChk=mysqli_query($conn,$chkPoint); $ckhRow = mysqli_num_rows($qChk); If($ckhRow > 0){ while($row=mysqli_fetch_array($qChk)){ $deptID = $row['record_id']; $opsName = $row['ops_name']; $opsYear = $row['coverage_year']; $opsDesc = $row['description']; } }else{ include '../accessDenied.php'; exit(); } $periodText ="OPERATIONAL PLAN FOR (".$opsYear.")"; //echo $deptID ."-". $opsIDpdf; //END OF CHECKPOINT=============================================================================== //END OF CHECKPOINT=============================================================================== } $getName = "SELECT * FROM pms_group_tbl WHERE id = $sourceID LIMIT 1"; $getMyName = mysqli_query($conn,$getName); while($nRow = mysqli_fetch_array($getMyName)){ $compName=$nRow['name']; } //$sql ="SELECT * FROM `kra_position_tbl` WHERE `pms_unit_id`='$unitID' AND `deleted`=0 ORDER BY `kra_name` ASC"; $sql = "SELECT * FROM `ops_data_autohub` WHERE `deleted`=0 AND `ops_title_id` ='$sourceID' ORDER BY `ops_kra` ASC"; $pdf = new PDF('L','mm',array(350,230)); //$pdf = new FPDF('L','mm',array(350,230)); //set margins $pdf->SetMargins(10,20,10); $pdf->AddPage('L'); //L = Land Scape, P = Portrait //set column size in array format $width_cell = array(10,70,70,15,15,60,45,15,30); //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',10); $pdf->MultiCell(0,3,'',0,0,true); $pdf->MultiCell(0,4,$compName,0,0,true); $pdf->SetFont('Arial','',7); $pdf->MultiCell(0,4,$periodText,0,0,true); $pdf->MultiCell(0,5,$opsDesc,0,0,true); $pdf->SetFillColor(240, 240, 240,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],6,'NO',1,0,'C',true); $pdf->Cell($width_cell[1],6,'KRA NAME',1,0,'L',true); $pdf->Cell($width_cell[2],6,'KPI NAME',1,0,'L',true); $pdf->Cell($width_cell[3],6,'WEIGHT',1,0,'C',true); $pdf->Cell($width_cell[4],6,'B.MARK',1,0,'C',true); $pdf->Cell($width_cell[5],6,'TARGET (%) /DESCRIPTION',1,0,'C',true); $pdf->Cell($width_cell[6],6,'STRATEGY / MAJOR ACTIVITIES',1,0,'C',true); $pdf->Cell($width_cell[7],6,'TIMELINE',1,0,'C',true); $pdf->Cell($width_cell[8],6,'RESPONSIBILITY',1,0,'C',true); $pdf->SetFillColor(255,255,255); //use for body bgcolor $fill=false; //$pdf->Cell(400,200,'Hello Arnel'); $getData = mysqli_query($conn,$sql); $statRow = mysqli_num_rows($getData); $kraTitle = ''; $count=0; if($statRow > 0){ while($drow = mysqli_fetch_array($getData)){ //$pcpID= $drow['id']; $kraID = $drow['ops_kra']; $kpiID = $drow['ops_kpi']; $kraWeight = getAutohubKRAName($kraID)[1]; $kraExWeight = explode("%",$kraWeight); $kraWeightPercentage = $kraExWeight[0] / 100; $kraAVGWP = ''; $pdf->MultiCell(0,6,"",0,'P',false); //setup row padding if($kraTitle == $kraID){ $pdf->Cell($width_cell[0],6,"",1,0,'C',$fill); $kraAVGWP=''; }else{ $count = $count + 1; $kraAVGWP = $drow['ops_weight']; $pdf->Cell($width_cell[0],6,$count,1,0,'C',$fill); } $targetAndDesc = $drow['ops_target'] . " ". $drow['ops_target_desc']; $pdf->Cell($width_cell[1],6,getAutohubKRAName($kraID)[0],1,0,'L',$fill); $pdf->Cell($width_cell[2],6,getAutohubKPIName($kpiID)[0],1,0,'L',$fill); $pdf->Cell($width_cell[3],6,$kraAVGWP,1,0,'C',$fill); $pdf->Cell($width_cell[4],6,$drow['ops_benchmark'],1,0,'C',$fill); $pdf->Cell($width_cell[5],6,$targetAndDesc,1,0,'C',$fill); $pdf->Cell($width_cell[6],6,$drow['ops_strategy'],1,0,'C',$fill); $pdf->Cell($width_cell[7],6,$drow['ops_timeline_to'],1,0,'C',$fill); $pdf->Cell($width_cell[8],6,$drow['ops_responsibility'],1,0,'C',$fill); $fill =!$fill; // use code to put alternate color between rows $kraTitle=$kraID; } $pdf->MultiCell(1,20,"",0,0,'L',false); //setup row padding (border, padding top,) $pdf->Cell(100,0,"_____________________________",0,1,'L',false); $pdf->Cell(100,8,$userFName.' / '. $prfDateX ,0,0,'L',false); } $pdf->Output('my_file.php','I'); ?>PK �|�Z�F��R- R- score_cardEmployeeLevel.phpnu �[��� <?php ob_start(); $prfDateX = date_create() ->format("Y-m-d"); //https://www.youtube.com/watch?v=gNH6NNyhJLk //https://www.youtube.com/watch?v=EYYZFRRdR6A PDF with MySQL database $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'); } */ } $myUID = $_GET['s']; $unitID = $_GET['e']; $sourceID = $_GET['s']; $sem = $_GET['sm']; $nme = $_GET['n']; $rptYear = $_GET['ye']; if($sem == 1){ $semester = "1st Semester"; }else if($sem == 2){ $semester = "2nd Semester"; }else{ $semester = "1st & 2nd Semester"; } $unitNamen = $nme . " - Scorecard" ." (". $semester." of ". $rptYear .")"; include_once("../../../cfg/conn.php"); include ("../functions/users.php"); $roleID=0; if(isset($_GET['s'])){ $empID = $_GET['e']; $sourceID = $_GET['s']; $sem = $_GET['sm']; $nme = $_GET['n']; $rptYear = $_GET['ye']; $fN = explode(" ", $nme); $fName = $fN[0]; $lName = $fN[1]; //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 " <center><img src='../images/locked_out_icon.png' width='100' style='margin-top:100px'><img>"; echo "<h4 class='text-center text-danger align-middle pt-5'> Access Denied </h4>"; echo "<p class='display-5 text-center text-danger'> Sorry, you are not authorized to access this page. <br>Please contact your system support for assistance. <br><br>Thank you! <br><br> </p></center> "; exit(); }else{ while($uow=mysqli_fetch_array($qCU)){ $uowaccStat = $uow['account_status']; $uowdeleted = $uow['deleted']; } } if($uowaccStat == 0){ echo " <center><img src='../images/locked_out_icon.png' width='100' style='margin-top:100px'><img>"; echo "<h4 class='text-center text-danger align-middle pt-5'> Access Denied </h4>"; echo "<p class='display-5 text-center text-danger'> Sorry, you are not authorized to access this page. <br>Please contact your system support for assistance. <br><br>Thank you! <br><br> </p></center> "; exit(); } if($uowdeleted == 1){ echo " <center><img src='../images/locked_out_icon.png' width='100' style='margin-top:100px'><img>"; echo "<h4 class='text-center text-danger align-middle pt-5'> Access Denied </h4>"; echo "<p class='display-5 text-center text-danger'> Sorry, you are not authorized to access this page. <br>Please contact your system support for assistance. <br><br>Thank you! <br><br> </p></center> "; exit(); } //==========CHECK IF EMPLOYEE EXIST IN RECORD AND MATCH ALL INFORMATION IN THE LICNK ========= $chkPoint = "SELECT `last_name`, `first_name`,`account_status`,`deleted` FROM `pms_employee_data` WHERE `id`='$empID'"; $qChk=mysqli_query($conn,$chkPoint); $ckhRow = mysqli_num_rows($qChk); If($ckhRow > 0){ while($row=mysqli_fetch_array($qChk)){ $lastName = $row['last_name']; $firstName = $row['first_name']; $accStat = $row['account_status']; $deleted = $row['deleted']; } }else{ echo " <center><img src='../images/locked_out_icon.png' width='100' style='margin-top:100px'><img>"; echo "<h4 class='text-center text-danger align-middle pt-5'> Access Denied </h4>"; echo "<p class='display-5 text-center text-danger'> Sorry, you are not authorized to access this page. <br>Please contact your system support for assistance. <br><br>Thank you! <br><br> </p></center> "; exit(); } //END OF CHECKPOINT=============================================================================== //END OF CHECKPOINT=============================================================================== } $getName = "SELECT * FROM pms_employee_data WHERE id = $myUID LIMIT 1"; $getMyName = mysqli_query($conn,$getName); while($nRow = mysqli_fetch_array($getMyName)){ $fname=$nRow['first_name']; $lname=$nRow['last_name']; $compID=$nRow['comp_id']; $myFName = $fname ." ". $lname; } $compName = getCompanyNameSub($compID)[0]; $sql ="SELECT * FROM `pcp_employee_data` WHERE `employee_id`='$empID' AND `deleted`=0 GROUP BY `pcp_kpi_id`"; $pdf = new PDF(); //set margins $pdf->SetMargins(10,20,10); $pdf->AddPage('L'); //L = Land Scape, P = Portrait //set column size in array format $width_cell = array(91,15,85,15,15,18,18,18); $height_cell= 7; //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',10 ); $pdf->MultiCell(0,5,$compName,0,1,0,true); $pdf->SetFont('Arial','',10 ); $pdf->MultiCell(0,5,$unitNamen,0,1,0,true); $pdf->MultiCell(0,5,"",0,0,true); $pdf->SetFont('Arial','',8); $pdf->SetFillColor(0,0,0,90); //use for header bgcolor $pdf->SetTextColor(255,255,255,90); $pdf->SetLineWidth(0); $pdf->SetDrawColor(0,0,25); //header start $pdf->Cell($width_cell[0],$height_cell,'KRA NAME',1,0,'L',true); $pdf->Cell($width_cell[1],$height_cell,'WEIGHT',1,0,'L',true); $pdf->Cell($width_cell[2],$height_cell,'KPI NAME',1,0,'L',true); $pdf->Cell($width_cell[3],$height_cell,'TARGET',1,0,'L',true); $pdf->Cell($width_cell[4],$height_cell,'ACTUAL',1,0,'L',true); $pdf->Cell($width_cell[5],$height_cell,'ACHV. RATE',1,0,'L',true); $pdf->Cell($width_cell[6],$height_cell,'AVG. SCORE',1,0,'L',true); $pdf->Cell($width_cell[7],$height_cell,'W. POINTS',1,0,'L',true); $pdf->SetFillColor(255,255,255,0); //use for header bgcolor $pdf->SetTextColor(0,0,0,90); $fill=false; //$pdf->Cell(400,200,'Hello Arnel'); $getData = mysqli_query($conn,$sql); $statRow = mysqli_num_rows($getData); $kraCode = 0; $kpiCount = 0; $count = 0; $achvRateTotal=0; $wPointTotal =0; $kraWeightTotal=0; $kraWeightT=0; while($row = mysqli_fetch_array($getData)){ $kpiRow = 0; $count = $count + 1; $empKRAid = $row['pcp_kra_id']; $empKPIid = $row['pcp_kpi_id']; $empKRAName = getEmployeeKRAName($empKRAid)[0]; $empkpiName = getEmployeeKPIName($empKPIid)[0]; //GET ACTUAL SCORE $gKpiCount = "SELECT * FROM `pcp_employee_data` WHERE `employee_id`='$empID' AND `pcp_kra_id`='$empKRAid' AND `deleted`=0 GROUP BY `pcp_kpi_id`"; if($sem == 0){ // Sen 1 & 2 combined $gKpi = "SELECT AVG(`mar_actual`) AS 'marActual' FROM `mar_emp_data` WHERE `kra_id`='$empKRAid' AND `kpi_id`='$empKPIid' AND `mar_year_data`='$rptYear' AND `deleted`=0 LIMIT 1"; }else{ $gKpi = "SELECT AVG(`mar_actual`) AS 'marActual' FROM `mar_emp_data` WHERE `kra_id`='$empKRAid' AND `kpi_id`='$empKPIid' AND `mar_year_data`='$rptYear' AND `mar_semester_data`='$sem' AND `deleted`=0 LIMIT 1"; } $qKpiC = mysqli_query($conn,$gKpiCount); while($nt = mysqli_fetch_array($qKpiC)){ $kpiRow = $kpiRow + 1; } $qKpi = mysqli_query($conn,$gKpi); while($row = mysqli_fetch_array($qKpi)){ $myActualDataPrint = number_format($row['marActual'],2,'.',''); $myActualData = $row['marActual']; } if (preg_match("/%/",getEmployeeKPIName($empKPIid)[2])) { $percent ="%"; $pcpKPITargetEx = explode("%",getEmployeeKPIName($empKPIid)[2]); $pcpKPITargetPercent = $pcpKPITargetEx[0]; }else{ $percent =""; $pcpKPITargetPercent = getEmployeeKPIName($empKPIid)[2]; } if (preg_match("/%/",getEmployeeKRAName($empKRAid)[1])) { $kraWeightpercent = explode("%",getEmployeeKRAName($empKRAid)[1]); $kraWeight = $kraWeightpercent[0] /100; $kraWeightT = $kraWeightpercent[0]; }else{ $kraWeight = getEmployeeKPIName($empKPIid)[1] / 100; $kraWeightT = $kraWeightpercent[0]; } $achvRate = (($myActualData/$pcpKPITargetPercent) * 100); $achvRatePrint= number_format((($myActualData/$pcpKPITargetPercent)* 100),2,'.',''); $achvRateTotal = $achvRateTotal + $achvRate; $pdf->MultiCell(0,$height_cell,"",0,'P',false); //setup row padding if($empKRAid == $kraCode){ $pdf->Cell($width_cell[0],$height_cell,"" ,1,0,'L',$fill); //getEmployeeKRAName($kraID)[0] $pdf->Cell($width_cell[1],$height_cell,"" ,1,0,'L',$fill); }else{ $pdf->Cell($width_cell[0],$height_cell,$empKRAName,1,0,'L',$fill); //getEmployeeKRAName($kraID)[0] $pdf->Cell($width_cell[1],$height_cell,getEmployeeKRAName($empKRAid)[1],1,0,'C',$fill); $kraWeightTotal = $kraWeightTotal + $kraWeightT; } $pdf->Cell($width_cell[2],$height_cell,$empkpiName,1,0,'L',$fill); $pdf->Cell($width_cell[3],$height_cell,getEmployeeKPIName($empKPIid)[2],1,0,'C',$fill); $pdf->Cell($width_cell[4],$height_cell,$myActualDataPrint."".$percent,1,0,'C',$fill); $pdf->Cell($width_cell[5],$height_cell,$achvRatePrint."%",1,0,'C',$fill); if($count == $kpiRow){ $achvRateTotalFinal = number_format(($achvRateTotal / $kpiRow),2,'.',''); $wPoint = number_format(($kraWeight * $achvRateTotalFinal ),2,'.',''); $pdf->Cell($width_cell[6],$height_cell,$achvRateTotalFinal."%",1,0,'C',$fill); $pdf->Cell($width_cell[7],$height_cell,$wPoint."%",1,0,'C',$fill); $wPointTotal = number_format(($wPointTotal + $wPoint),2,'.',''); $count =0; $kpiRow = 0; $achvRateTotal=0; }else{ $pdf->Cell($width_cell[6],$height_cell,"",1,0,'C',$fill); $pdf->Cell($width_cell[7],$height_cell,"",1,0,'C',$fill); } $kraCode = $empKRAid ; } $fill =!$fill; // use code to put alternate color between rows //$kraTitle=$kraID; $pdf->SetFillColor(0,0,0,90); //use for header bgcolor $pdf->SetTextColor(255,255,255,10); $pdf->MultiCell(1,$height_cell,"",0,'L',false); //setup row padding $pdf->Cell($width_cell[0],$height_cell,'TOTAL',1,0,'L',true); $pdf->Cell($width_cell[1],$height_cell,$kraWeightTotal."%",1,0,'C',true); $pdf->Cell($width_cell[2],$height_cell,'',1,0,'L',true); $pdf->Cell($width_cell[3],$height_cell,'',1,0,'L',true); $pdf->Cell($width_cell[4],$height_cell,'',1,0,'L',true); $pdf->Cell($width_cell[5],$height_cell,'',1,0,'L',true); $pdf->Cell($width_cell[6],$height_cell,'',1,0,'L',true); $pdf->Cell($width_cell[7],$height_cell,$wPointTotal,1,0,'C',true); $pdf->SetFillColor(255,255,255,10); //use for header bgcolor $pdf->SetTextColor(0,0,0,90); $pdf->MultiCell(1,25,"",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'); ?>PK �|�ZAF>e2 2 install.txtnu �[��� The FPDF library is made up of the following elements: - the main file, fpdf.php, which contains the class - the font definition files located in the font directory The font definition files are necessary as soon as you want to output some text in a document. If they are not accessible, the SetFont() method will produce the following error: FPDF error: Could not include font definition file Remarks: - Only the files corresponding to the fonts actually used are necessary - The tutorials provided in this package are ready to be executed PK �|�Z�qX�E E tutorial/logo.pngnu �[��� �PNG IHDR h G �8�p �PLTE���KY�Xg�r��ev���tHQm������{�ij�T���;Ec_K5fq�������/6M!%2�|LÓZ�pG�����ۯ��Zd�OJM������٣c�hO]������jjsl}������rX;��zeR������l���c>��pL=/_n�~��T]y���xp|�ϛ^�wkN\������\W[Ra�=JxES����m tRNS @��f bKGD �H &IDATx��ks�H�#L!,�m�J"�U�\S�Ƣ�F����`<f?�=�2&*�NO����h����d��������v���1�=��c�ף)�,�7�k6��9���q���w��K �ևGc��l��V�n �'�!�!�Lo��±�5}���grq[��M|�Ě�i��n]Ł�<ơ�PJO���`7q,�MCtS��/�HL�ܼ?쉙�Ȥ�������e"I���J���n^>l�gl������(��A@�2ق��[H����oEL�]���ܤ�U�m�K��� ����+��b�F()4i����R h�Sb���KUDL��ZӴ3������g1pGbۻ���%���Q1���vH�J� }⡐H��G�_}B�� �&MG���&��#Uʚ��>�H�E�P��(��Ei���ǯGj�8Q$�W_'P @L�,�d�t���z~��ٍT�X�$��� d)���V���m�X�Sf���Dgr/$�Ql]�T���Mm�:ف,�7#�B�A�J� ��Z�H�V���a#0���ً{��Iڧ�#-�� ɞt�pǩ�Gm)74�i� ��/��� #]G�.;,ڡ*�FV8rC� D^:�T<����95���м�Tc�ߝd�*����"r��;��+'