  <br>
  <table border=1 cellspacing=1 cellpadding=2 width=760 style="border: 1px inset;">
  <form action="controllers/inputController.php" method="post" name="supplierform" id="supplierform">
  <input name="supplier_pkey" id="supplier_pkey" type="hidden" value="<?=$supplier_data['supplier_pkey'];?>">
  <tr valign=top>
  <td valign=top width=150 class=formlabel>Registration ID</td>
  <td valign=top width=610 class=formvalue><? if ($supplier_data['supplier_regid']!="0") { ?><?=idstr($supplier_data['supplier_regid']);?><? } else { echo "<b>NA</b> (Not Yet Approved)"; } ?>&nbsp;</td>
  </tr>
  <tr valign=top>
  <td valign=top width=150 class=formlabel>Registration No</td>
  <td valign=top width=610 class=formvalue><?=$supplier_data['supplier_regno'];?>&nbsp;</td>
  </tr>
  <tr valign=top>
  <td valign=top width=150 class=formlabel>Registration Date</td>
  <td valign=top width=610 class=formvalue><?=unconverttounixslash($supplier_data['supplier_regdate']);?></td>
  </tr>
  <tr valign=top>
  <td valign=top width=150 class=formlabel>Supplier Name</td>
  <td valign=top width=610 class=formvalue><?=$supplier_data['supplier_name'];?>&nbsp;</td>
  </tr>
  <tr valign=top>
  <td valign=top width=150 class=formlabel>Address</td>
  <td valign=top width=610 class=formvalue><?=$supplier_data['supplier_address'];?>&nbsp;</td>
  </tr>
  <tr valign=top>
  <td valign=top width=150 class=formlabel>Phone No</td>
  <td valign=top width=610 class=formvalue><?=$supplier_data['supplier_phone'];?>&nbsp;</td>
  </tr>
  <tr valign=top>
  <td valign=top width=150 class=formlabel>Fax</td>
  <td valign=top width=610 class=formvalue><?=$supplier_data['supplier_fax'];?>&nbsp;</td>
  </tr>
  <tr valign=top>
  <td valign=top width=150 class=formlabel>Email</td>
  <td valign=top width=610 class=formvalue><?=$supplier_data['supplier_email'];?>&nbsp;</td>
  </tr>
  <tr valign=top>
  <td valign=top width=150 class=formlabel>Company Directors</td>
  <td valign=top width=610 class=formvalue><?=$supplier_data['supplier_directors'];?>&nbsp;</td>
  </tr>
  </table>

  <br>
  <table border=1 cellspacing=1 cellpadding=2 width=760 style="border: 1px inset;">
  <tr valign=top>
  <td valign=top width=150 class=formlabel>Credit Terms</td>
  <td valign=top width=610 class=formvalue><?=$supplier_data['supplier_ct'];?>&nbsp;</td>
  </tr>
  <tr valign=top>
  <td valign=top width=150 class=formlabel>Nature of Business</td>
  <td valign=top width=610 class=formvalue><?=$supplier_data['supplier_nob'];?>&nbsp;</td>
  </tr>
  <tr valign=top>
  <td valign=top width=150 class=formlabel>Products</td>
  <td valign=top width=610 class=formvalue><?=$supplier_data['supplier_products'];?>&nbsp;</td>
  </tr>
  <tr valign=top>
  <td valign=top width=150 class=formlabel>Bank Guarantee Ratio</td>
  <td valign=top width=610 class=formvalue>1:<?=$supplier_data['supplier_bgratio'];?>&nbsp;</td>
  </tr>
  <tr valign=top>
  <td valign=top width=150 class=formlabel>Personal Guarantee</td>
  <td valign=top width=610 class=formvalue><?=number_format($supplier_data['supplier_personalamount'],2);?></td>
  </tr>
  </table>

  <br>
  <table border=1 cellspacing=1 cellpadding=2 width=760 style="border: 1px inset;">
  <tr valign=top>
  <td valign=top width=760 colspan=6 class=formvalue><b>Contact Information</b></td>
  </tr>
  <tr valign=top>
  <td valign=top width=240 class=formlabel>Name</td>
  <td valign=top width=180 class=formlabel>Designation</td>
  <td valign=top width=130 class=formlabel>Contact No</td>
  <td valign=top width=170 class=formlabel>Email</td>
  <td valign=top width=40 class=formlabel>Main</td>
  </tr>

  <? foreach ($contact_list as $contact_data) { ?>

    <tr valign=top>
    <td valign=top width=240 class=formvalue><?=$contact_data['contact_name'];?>&nbsp;</td>
    <td valign=top width=180 class=formvalue><?=$contact_data['contact_designation'];?>&nbsp;</td>
    <td valign=top width=130 class=formvalue><?=$contact_data['contact_phone'];?>&nbsp;</td>
    <td valign=top width=170 class=formvalue><?=$contact_data['contact_email'];?>&nbsp;</td>
    <td valign=top width=40 class=formvalue style="text-align: center;"><? if ($contact_data['contact_main']==1) { echo "<img src='gfx/options/b_approve.png' class='actionbutton' title='Primary Contact'>"; } else { echo "&nbsp;"; } ?></td>
    </tr>

  <? } ?>

  </table>

  <br>
  <table border=1 cellspacing=1 cellpadding=2 width=760 style="border: 1px inset;">
  <tr valign=top>
  <td valign=top width=760 colspan=5 class=formvalue><b>Bank Guarantees</b></td>
  </tr>
  <tr valign=top>
  <td valign=top width=190 class=formlabel>Project Name</td>
  <td valign=top width=150 class=formlabel>Amount</td>
  <td valign=top width=130 class=formlabel>Start Date</td>
  <td valign=top width=130 class=formlabel>End Date</td>
  <td valign=top width=160 class=formlabel>Bank Name</td>
  </tr>

  <? foreach ($bg_list as $bg_data) { ?>

    <? $mystyle=""; ?>
    <? 
    if (($bg_data['bg_enddate']-5184000)<=getdatestamp()) {
      if ($bg_data['bg_enddate']<=getdatestamp()) {
        $mystyle = " style='color=#ff0000;'";
      } else {
        $mystyle = " style='color=#ff0000;'";
      }
    }
    ?>

    <tr valign=top>
    <td valign=top width=190 class=formvalue <?=$mystyle;?>><?=$bg_data['bg_projectname'];?>&nbsp;</td>
    <td valign=top width=150 class=formvalue <?=$mystyle;?> style="text-align: right;"><?=number_format($bg_data['bg_bankamount'],2);?>&nbsp;</td>
    <td valign=top width=130 class=formvalue <?=$mystyle;?>><?=unconverttounixslash($bg_data['bg_startdate']);?>&nbsp;</td>
    <td valign=top width=130 class=formvalue <?=$mystyle;?>><?=unconverttounixslash($bg_data['bg_enddate']);?>&nbsp;</td>
    <td valign=top width=160 class=formvalue <?=$mystyle;?>><?=$bg_data['bg_bankname'];?>&nbsp;</td>
    </tr>

  <? } ?>

  </table>

  <br>
  <table border=1 cellspacing=1 cellpadding=2 width=760 style="border: 1px inset;">
  <tr valign=top>
  <td valign=top width=150 class=formlabel>Approved?</td>
  <td valign=top width=610 class=formvalue><b><? if ($supplier_data['supplier_approved']==1) { echo "Yes"; } else { echo "No"; } ?></b>&nbsp;</td>
  </tr>
  <tr valign=top>
  <td valign=top width=150 class=formlabel>Status</td>
  <td valign=top width=610 class=formvalue><b><? if ($supplier_data['supplier_status']==1) { echo "Active"; } else { echo "Inactive"; } ?></b>&nbsp;</td>
  </tr>
  <input name="job" id="job" type="hidden" value="">
  </form>
  </table>
