Link to home
Start Free TrialLog in
Avatar of rcowen00
rcowen00Flag for United States of America

asked on

FPDF

I am building a report using fpdf.  I have criteria feeding from the last page open.  The fpdf gets the variable in lines 25 through 29.  The information is not reflected in the fields of fpdf document.  I have tested the query in my phpAdmin to verify my query (lines 34 through 38).  Can anyone tell me what I am doing wrong or how to test what is coming through?  Thank you.
<?php
require('../fpdf/html_table.php');
include "../../login-system/include/loginGlobals.php";
include "../../login-system/include/database.php";
include "../../include/userConnect.php";

//Page footer
function Footer()
{
    //Position at 1.5 cm from bottom
    $this->SetY(-15);
    //Arial italic 8
    $this->SetFont('Arial','I',12);    //Arial italic 8

    //Page number
    $this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C');
}

$pdf = new PDF();
$pdf->open();
$pdf->AddPage();
$pdf->AliasNbPages();   // necessary for x of y page numbers to appear in document
$pdf->SetAutoPageBreak(true);

  if (array_key_exists('brKey', $_POST)) {
          $reprocessingKey = $_POST['brKey'];
          } else {
          $brKey = $_GET['brKey'];
          }

           error_reporting(E_ALL);


$mgmtSummary_Title= "SELECT * FROM loan JOIN audit USING (loanKey) JOIN auditType USING (auditTypeKey) "
                    ."JOIN originationType USING (originationTypeKey) JOIN parent USING (parentKey) "
                    ."JOIN branch on branch.branchKey=loan.branchKey JOIN client USING (clientKey) "
                    ."JOIN lienPosition USING (lienPositionKey) "
                    ."WHERE branch.branchKey='$brKey' AND loan.active='1' ";
$mgmtSummary_TitleList = mysql_query($mgmtSummary_Title) or die(mysql_error());
$mgmtSummary_TitleRow = mysql_fetch_assoc($mgmtSummary_TitleList);
$branchName = $mgmtSummary_TitleRow['branchName'];


$pdf->SetLineWidth(0.4);
$pdf->Line($pdf->GetX()+10,$pdf->GetY(),$pdf->GetX()+185,$pdf->GetY());
$pdf->Ln(2);
$pdf->Line($pdf->GetX()+10,$pdf->GetY(),$pdf->GetX()+185,$pdf->GetY());
$pdf->SetLineWidth(0.2);
$pdf->Ln(80);
$pdf->setFont('Arial','',12);
$pdf->Image('../../images/large_new_logo.JPG',55,50,100,50);
$pdf->setXY($pdf->GetX(),$pdf->GetY()+15);
$pdf->Cell(190,5,'MORTGAGE QUALITY CONTROL',0,0,'C');
$pdf->Ln(7);
$pdf->setFont('Arial','I',10);
$pdf->Cell(190,5,'Findings Report to:',0,0,'C');
$pdf->setFont('Arial','',10);
$pdf->Ln(5);
$pdf->Cell(190,5,$mgmtSummary_TitleRow['branchName'],1,1,'C');
$pdf->Ln(5);
$pdf->setFont('Arial','I',10);
$pdf->Cell(190,5,'Sampling Period',0,0,'C');
$pdf->Ln(5);
$pdf->setFont('Arial','',10);
$pdf->Cell(190,5,$mgmtSummary_TitleRow['branchName'],1,1,'C');
$pdf->Ln(140);
$pdf->SetLineWidth(0.4);
$pdf->Line($pdf->GetX()+10,$pdf->GetY(),$pdf->GetX()+185,$pdf->GetY());
$pdf->Ln(2);
$pdf->Line($pdf->GetX()+10,$pdf->GetY(),$pdf->GetX()+185,$pdf->GetY());
$pdf->SetLineWidth(0.2);

$pdf->AddPage();
$pdf->AliasNbPages();
$pdf->setXY($pdf->GetX(),$pdf->GetY()+15);
$pdf->setFont('Arial','',12);
$pdf->Cell(190,5,'The Compliance Group',0,0,'C');
$pdf->Ln(7);
$pdf->setFont('Arial','I',10);
$pdf->Cell(190,5,'Mortgage Quality Control',0,0,'C');
$pdf->Ln(15);
$pdf->setFont('Arial','B','U',12);
$pdf->Cell(190,5,'How to Understand QC Reports',0,0,'C');
$pdf->Ln(10);
$pdf->setFont('Arial','B',10);
$pdf->Write(5,'Section 1 - Borrower\'s File Characteristic',0,'L');
$pdf->Ln(7);
$pdf->Write(5,'Section 2 - QC Findings',0,'L');
$pdf->setFont('Arial','B',9);
$pdf->Ln(7);
$pdf->Write(5,'Important Issues Noted',0,'L');
$pdf->Ln(5);
$pdf->setFont('Arial','',8);
$pdf->Write(5,'An exception with a quality weight within this range contains significant underwriting, data disparity, documentation, or appraisal exceptions.  These exceptions may affect the saleability of the mortgage, its performance, or the property value.  In addition, the loan may be subject to repurchase if inadvertently delivered to a particular investor.  Other areas to consider are:  the loan being uninsurable by FHA or not guaranteed by VA, indemnification exposure by investor or HUD, TILA rescission exposure, licensing suspension or revocation exposure, agency approval suspension or revocation and significant regulatory compliance and /or legal exposure.  These findings are reported in a separate management report for resolutions.  ',0,'L');
$pdf->setFont('Arial','B',9);
$pdf->Ln(7);
$pdf->Write(5,'Moderate Issues Noted',0,'L');
$pdf->Ln(5);
$pdf->setFont('Arial','',8);
$pdf->Write(5,'An exception with a quality weight within this range are verifying possible policy, process or procedural weaknesses.  The level of reoccurrence of moderate exceptions will determine a pattern of proactive that could result in increased risk exposure.',0,'L');
$pdf->setFont('Arial','B',9);
$pdf->Ln(7);
$pdf->Write(5,'Minor Issues Noted',0,'L');
$pdf->Ln(5);
$pdf->setFont('Arial','',8);
$pdf->Write(5,'Acceptable 5mortgage that conforms to relevant lending standards but has relatively minor processing, data entry, underwriting documentation, or appraisal exceptions.  The saleability of this mortgage is unimpaired.  However, the mortgage is reported to management for resolution and training purposes.',0,'L');
$pdf->Ln(7);
$pdf->setFont('Arial','B',10);
$pdf->Write(5,'Section 3 - Comments',0,'L');
$pdf->setFont('Arial','',8);
$pdf->Ln(5);
$pdf->Write(5,'Auditor will list specific issues that have been noted but are not severe enough to elicite a finding.',0,'L');
$pdf->Ln(7);
$pdf->setFont('Arial','B',10);
$pdf->Write(5,'Section 4 - Notes',0,'L');
$pdf->Ln(5);
$pdf->setFont('Arial','',8);
$pdf->Write(5,'Auditor will enter notes that are associated with the loan file as a whole.',0,'L');
$pdf->Ln(7);
$pdf->setFont('Arial','B','U',12);
$pdf->Cell(190,5,'Your Follow-up (QC Management Response',0,0,'C');
$pdf->Ln(5);
$pdf->setFont('Arial','',8);
$pdf->Write(5,'HUD and most investors will ask you what your \"managemnet reponse\" or \"remediation\" was in regard to Quality Control.  This is a follow-up step to QC and generally involves the issuance of a memorandum to the responsible party.  For example, if the QC notes an originator did not sign or date the 1003, you may issue a memo to the loan oproduction manager that states \"ensure that all 1003\'s are fully signed and dated.\"  Another example is where the QC finding concers an appraisal which may requirea letter to the appraiser to correct recurring errors.  Any correspondence, including copies of E-mails, should be dated and noted as a remediation to a specific QC sampling period.   These responses should be placed in the file folder called \"QC Management Response\" and be made available to a HUD examiner upon request.',0,'L');

$pdf->AddPage();

$pdf->setFont('Arial','',12);

$pdf->SetFillColor(156,156,156);
$pdf->Cell(190,5,'Underwriter Analysis',0,0,'C',TRUE);
//Underwriter Results
          
          $pdf->SetFont('Arial','B',12);
          $pdf->Ln(10);
          $pdf->SetLineWidth(0.3);
          $x=$pdf->GetX();
          $y=$pdf->GetY();
          $pdf->MultiCell(40,6,'Underwriter',1,'C');
          $pdf->SetXY($x+40,$y);
          $x1=$pdf->GetX();
          $y1=$pdf->GetY();
          $pdf->MultiCell(40,6,'Account in the Name of',1,'C');
          $pdf->SetXY($x1+40,$y1);
          $x2=$pdf->GetX();
          $y2=$pdf->GetY();
          $pdf->MultiCell(70,6,'Provide account balance as of the date of attached document',1,'C');
          $pdf->SetXY($x2+70,$y2);
          $x3=$pdf->GetX();
          $y3=$pdf->GetY();
          $pdf->MultiCell(40,6,'Date closed if applicable',1,'C');
          $pdf->SetXY($x3+40,$y3);
          $pdf->Ln(12);
          $x4=$pdf->GetX();
          $y4=$pdf->GetY();
          $pdf->MultiCell(40,6,'    /  /    ',1,'C');
          $pdf->SetXY($x4+40,$y4);
          $x5=$pdf->GetX();
          $y5=$pdf->GetY();
          $pdf->MultiCell(40,6,'',1,'C');
          $pdf->SetXY($x5+40,$y5);
          $x6=$pdf->GetX();
          $y6=$pdf->GetY();
          $pdf->MultiCell(70,6,'',1,'C');
          $pdf->SetXY($x6+70,$y6);
          $x7=$pdf->GetX();
          $y7=$pdf->GetY();
          $pdf->MultiCell(40,6,'    /  /    ',1,'C');
          $pdf->SetXY($x7+40,$y7);
          $pdf->Ln(6);
          $x8=$pdf->GetX();
          $y8=$pdf->GetY();
          $pdf->MultiCell(40,6,'    /  /    ',1,'C');
          $pdf->SetXY($x8+40,$y8);
          $x9=$pdf->GetX();
          $y9=$pdf->GetY();
          $pdf->MultiCell(40,6,'',1,'C');
          $pdf->SetXY($x9+40,$y9);
          $x10=$pdf->GetX();
          $y10=$pdf->GetY();
          $pdf->MultiCell(70,6,'',1,'C');
          $pdf->SetXY($x10+70,$y10);
          $x11=$pdf->GetX();
          $y11=$pdf->GetY();
          $pdf->MultiCell(40,6,'    /  /    ',1,'C');
          $pdf->SetXY($x11+40,$y11);
          $pdf->Ln(6);
          $x12=$pdf->GetX();
          $y12=$pdf->GetY();
          $pdf->MultiCell(40,6,'    /  /    ',1,'C');
          $pdf->SetXY($x12+40,$y12);
          $x13=$pdf->GetX();
          $y13=$pdf->GetY();
          $pdf->MultiCell(40,6,'',1,'C');
          $pdf->SetXY($x13+40,$y13);
          $x14=$pdf->GetX();
          $y14=$pdf->GetY();
          $pdf->MultiCell(70,6,'',1,'C');
          $pdf->SetXY($x14+70,$y14);
          $x15=$pdf->GetX();
          $y15=$pdf->GetY();
          $pdf->MultiCell(40,6,'    /  /    ',1,'C');
          $pdf->SetXY($x15+40,$y15);
          $pdf->Ln(10);

          $currUW= "SELECT * FROM loan JOIN audit USING (loanKey) JOIN auditType USING (auditTypeKey) "
                    ."JOIN originationType USING (originationTypeKey) JOIN parent USING (parentKey) "
                    ."JOIN branch on branch.branchKey=loan.branchKey JOIN client USING (clientKey) "
                    ."JOIN lienPosition USING (lienPositionKey)  "
                    ."WHERE branch.branchKey='$brKey' AND loan.active='1' ";
$currUWList = mysql_query($currUW) or die(mysql_error());

while ($currUWRow = mysql_fetch_array($currUWList))
      {
$uwFirstName = $currUWRow['uwFirstName'];
$uwLastName = $currUWRow['uwLastName'];

$pdf->Cell( 10, 4,$currUWRow['uwLastName'],1,'L');
      }
$pdf->Output();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN http: //www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
 </head>
  <body>
   <form enctype="multipart/form-data" method="POST" action="<?php echo $_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING']; ?>">
   </form>
  </body>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rcowen00

ASKER

The query is supposed to return only one result so I added LIMIT 1.  I did the var_dump and received the following response.


bool(false)
Does that mean that I'm not getting any results returned?
Yes, it means the query got nothing.  It would have died if it failed, but apparently it succeeded and found no results that matched.  Suggest you print out the fully-resolved query string and try to visually match that to your data base.  phpMyAdmin is really helpful here.
Thank you, I will give try.  One more question.  If the query runs correctly in phpMyAdmin, then the problem is getting the variable from the former page to the current page, correct?
Maybe.  The best answer will come when you see the query string.  If some of the fields are not what you expect then you are onto a clue!