<table border=0 cellspacing=0 cellpadding=0 width=760>
<tr valign=top>
<td valign=top width=760px>

  <?
  $pubuserpkey=$_GET['userid'];

  //include_once('../includes.php');
  include_once('../dbincludes.php');
  include_once('../lib/lib_general.php');

  define('FPDF_FONTPATH','../lib/fpdf/font/');
  require('../lib/fpdf/fpdf.php');

  include_once('../models/userModel.php');
  $myuserModel=new userModel;

  $user_data = $myuserModel->getdata_user($pubuserpkey);

  include_once('../models/reportModel.php');
  $myreportModel=new reportModel;

  $header_data = $myreportModel->loadheader_supplierlist($pubuserpkey);
  $report_data = $myreportModel->loaddata_supplierlist($pubuserpkey);
  ?>

  <table border=0 cellspacing=2 cellpadding=0 width=1350>
  <tr valign=top>
  <!--<td valign=top width=1250 class=rptzikayheader style="text-decoration: none;"><img src="../gfx/zikay.png" width=45px height=56px align=left><br><span style="font-size: 14px;"><u>KEMBANG SERANTAU SDN. BHD.</u></span></td>-->
  <td valign=top width=1350 class=rptzikayheader style="text-decoration: none; text-align: center;"><img src="../gfx/zikayheader.png" style="width: 311px; height: 69px;"></td>
  <!--
  <td valign=top width=100>
    <table border=0 cellspacing=0 cellpadding=2 width=100>
    <tr valign=top><td valign=top width=100 class=rptzikayconfidential style="font-size: 10px; text-align: left;">NA</td></tr>
    <tr valign=top><td valign=top width=100 class=rptzikayconfidential style="font-size: 10px; text-align: left; border-top: 0px;">Rev : 0</td></tr>
    </table>
  </td>
  -->
  </tr>
  <tr valign=top>
  <td valign=top width=1350 class=rptzikayheader style="text-decoration: none; text-align: center;"><br><span style="font-size: 12px;"><u>SUPPLIER REGISTERED LIST</u></span></td>
  </tr>
  </table>
  
  <span class="noprint">
<br>
<button name="printreport" id="printreport" onClick="javascript:print_report();">&nbsp;Print&nbsp;</button>
</span>

  <br>

  <table border=1 cellspacing=0 cellpadding=2 width=1350 style="border: 1px solid black; border-collapse: collapse;">

  <tr valign=top>
  <td valign=top width=30 rowspan=2 class=rptlistheader style="text-transform: none;">No</td>
  <td valign=top width=70 rowspan=2 class=rptlistheader style="text-transform: none;">Register Date</td>
  <td valign=top width=70 rowspan=2 class=rptlistheader style="text-transform: none;">Approved Date</td>
  <td valign=top width=60 rowspan=2 class=rptlistheader style="text-transform: none;">Supplier Reg No</td>
  <td valign=top width=200 rowspan=2 class=rptlistheader style="text-transform: none; text-align: center;">Supplier Name<br>Address/Tel/Fax/Email</td>
  <td valign=top width=100 rowspan=2 class=rptlistheader style="text-transform: none;">Contact Person</td>
  <td valign=top width=100 rowspan=2 class=rptlistheader style="text-transform: none;">Contact Number (PIC)</td>
  <td valign=top width=60 rowspan=2 class=rptlistheader style="text-transform: none;">Credit Terms</td>
  <td valign=top width=100 rowspan=2 class=rptlistheader style="text-transform: none;">Nature of Business</td>
  <td valign=top width=100 rowspan=2 class=rptlistheader style="text-transform: none;">Products</td>
  <td valign=top width=60 rowspan=2 class=rptlistheader style="text-transform: none;">Status</td>
  <td valign=top width=400 colspan=4 class=rptlistheader style="text-transform: none;">Credit Facilities</td>
  </tr>
  <tr valign=top>
  <td valign=top width=100 class=rptlistheader style="text-transform: none;">Ratio</td>
  <td valign=top width=100 class=rptlistheader style="text-transform: none;">Bank Guarantee</td>
  <td valign=top width=100 class=rptlistheader style="text-transform: none;">Personal Guarantee</td>
  <td valign=top width=100 class=rptlistheader style="text-transform: none;">Grand Total</td>
  <td valign=top width=100 class=rptlistheader style="text-transform: none;">Remarks</td>
  </tr>

  <? $cindex=0; ?>

 <?php foreach($report_data as $row) { ?>

    <tr valign=top>
    <td valign=top width=30 class=rptlistnumber-leftrightbottom><?php echo $row['data_no'];?></td>
    <td valign=top width=70 class=rptlistcontent-leftrightbottom><?php echo $row['data_regdate']; ?>&nbsp;</td>
    <td valign=top width=70 class=rptlistcontent-leftrightbottom><?php echo $row['data_approvedate']; ?>&nbsp;</td>
    <td valign=top width=60 class=rptlistcontent-leftrightbottom><?php echo $row['data_regid']; ?>&nbsp;</td>
    <td valign=top width=200 class=rptlistcontent-leftrightbottom><?php echo $row['data_fullname'];?>&nbsp;</td>
    <td valign=top width=100 class=rptlistcontent-leftrightbottom><?php echo $row['data_contactperson'];?>&nbsp;</td>
    <td valign=top width=100 class=rptlistcontent-leftrightbottom><?php echo $row['data_contactno'];?>&nbsp;</td>
    <td valign=top width=60 class=rptlistcontent-leftrightbottom><?php echo $row['data_ct'];?>&nbsp;</td>
    <td valign=top width=100 class=rptlistcontent-leftrightbottom><?php echo $row['data_nob']; ?>&nbsp;</td>
    <td valign=top width=100 class=rptlistcontent-leftrightbottom><?php echo $row['data_products']; ?>&nbsp;</td>
    <td valign=top width=60 class=rptlistcontent-leftrightbottom><?php echo $row['data_status']; ?>&nbsp;</td>
	<td valign=top width=100 class=rptlistcontentnumeric-leftrightbottom style="font-size: 11px;"><?php echo $row['data_bgratio']; ?>&nbsp;</td>
    <td valign=top width=100 class=rptlistcontentnumeric-leftrightbottom style="font-size: 11px;"><?php echo number_format($row['data_bgamount'],2);?>&nbsp;</td>
    <td valign=top width=100 class=rptlistcontentnumeric-leftrightbottom style="font-size: 11px;"><?php echo number_format($row['data_pgamount'],2);?>&nbsp;</td>
    <td valign=top width=100 class=rptlistcontentnumeric-leftrightbottom style="font-size: 11px;"><?php echo number_format($row['data_totalamount'],2);?>&nbsp;</td>
    <td valign=top width=100 class=rptlistcontent-leftrightbottom><?php echo $row['data_bgremarks']; ?>&nbsp;</td>
    </tr>

    <? $cindex++; ?>

  <? } ?>

  </table>

 <!-- 
<span class="noprint">
<br>
<button name="printreport" id="printreport" onClick="javascript:print_report();">&nbsp;Print&nbsp;</button>
</span>
-->
</td>
</tr>
</table>
</body>
</html>

<!-- MeadCo ScriptX -->
<!-- For IE 7 only (not using MeadCo's scale-to-fit)
<object id="factory" viewastext style="display:none"
   classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814"
   codebase="http://[your_path]/smsx.cab#Version=6,4,438,06">
</object>
-->

<!-- MeadCo ScriptX -->
<object id="factory" viewastext style="display:none"
   classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814"
   codebase="../lib/smsx.cab#Version=6,4,438,06">
   <param name="template" value="MeadCo://IE7" />
</object>

<script type="text/javascript">
function print_report() {
  //window.print();
  // save before meadco
  var h=factory.printing.header;
  var f=factory.printing.footer;
  var o=factory.printing.portrait;
  var lm=factory.printing.leftMargin;
  var tm=factory.printing.topMargin;
  var rm=factory.printing.rightMargin;
  var bm=factory.printing.bottomMargin;
  // set and print (&b for tab)
  factory.printing.header = "";
  factory.printing.footer = "";
  factory.printing.portrait = false;
  factory.printing.leftMargin = 0.45;
  factory.printing.topMargin = 0.25;
  factory.printing.rightMargin = 0.45;
  factory.printing.bottomMargin = 0.45;
  factory.printing.Print(true);
  // restore..
  factory.printing.header=h;
  factory.printing.footer=f;
  factory.printing.portrait=o;
  factory.printing.leftMargin=lm;
  factory.printing.topMargin=tm;
  factory.printing.rightMargin=rm;
  factory.printing.bottomMargin=bm;
}
</script>