<?php
/**
* @package LQM Component
* @subpackage Views
* @version $Id: dealership.html.php 328 2007-09-10 08:50:05Z tcp $
* @copyright Copyright (C) 2006 - 2007 Green Mountain Information Technology and Consulting. All rights reserved.
* @author [email protected]
*
* This is a sample file that demonstrates how to write a custom template that displays a single record
* Customize for more than one records.
*/
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
static $prepared;
// Important objects
$dispatch = LQMDispatch::getInstance();
$query = $dispatch->getQuery();
// Load the JS and CSS files associated with the lead application
$this->loadJavaScript();
$this->loadStyleSheet();
// Include the header file
$this->includeHeaderFile();
?>
<div class="lqmResultMessage"><?php echo $this->getMessage() ?></div>
<?php
// Sanity check - make sure that the query was configured correctly
if ( ! $query->expectsResults() )
{
throw new LQMException("The invoice template expects at least one record to be returned");
}
// Check if there are results to display
if ( $dispatch->hasResultsToDisplay() ) {
$result = $dispatch->getCurrentResultSet();
// We want the data from the first row, ie, index 0
$result->setRowIndex(0);
$name = $result->field('name');
$reference = $result->field('reference');
$nextRow =1;
$j = 1;
$n =1;
WHILE ($nextRow) {
$idinvoice[$j]= $result->field('idinvoice');
$invoice[$j] = $result->field('invoice');
$amount[$j] = $result->field('amount');
$idpayment[$j] = $result->field('idpayment');
$cheque_no[$j] = $result->field('cheque_no');
$pdatetime[$j] = $result->field('pdatetime');
$username[$j] = $result->field('username');
$balance[$j] = $result->field('balance');
$n++;
$j++;
$nextRow = $result->nextRow();
}
// for ($a=1;$a<=$j;$a++){$totalbalance = $totalbalance + $balance[$a];}
?>
<table width="725" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="391" rowspan="5"> </td>
<td width="74" rowspan="5"><img src="images/logo.jpg" alt="logo" width="72" height="73" /></td>
<td width="260"><font size="2">RANACO EDUCATION</font></td>
</tr>
<tr>
<td><font size="2">TRAINING INSTITUTE</font></td>
</tr>
<tr>
<td><font size="2">KP(JPS)5195/IPTS/1239(2)</font></td>
</tr>
<tr>
<td><font size="1"><i>(Wholly Owned By Ranaco Education </i></font></td>
</tr>
<tr>
<td><font size="1"><i>Training Institute Sdn.Bhd. - 624541-A) </i></font></td>
</tr>
</table>
<table width="725" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
</table>
<table width="725" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><br>
<br></td>
</tr>
</table>
<table width="725" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><div align="center"><font size="3"><b>STATEMENT OF ACCOUNT </b></font></div></td>
</tr>
</table>
<table width="725" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
</table>
<table width="725" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
</table>
<table width="725" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="90"><font size="2">NAME</font></td>
<td width="635">: <font size="2"><?php echo strtoupper ($name);?></font></td>
</tr>
</table>
<table width="725" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="90"><font size="2">REREFENCE</font></td>
<td width="634">: <font size="2"><?php echo $reference;?></font></td>
</tr>
</table>
<table width="725" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
</table>
<table width="725" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
</table>
<table width="650" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="119" bgcolor="#999999"><div align="center"><font size="2"><b>Invoice ID</b></font></div></td>
<td width="135" bgcolor="#999999"><div align="center"><font size="2"><b>Invoice</b></font></div></td>
<td width="123" bgcolor="#999999"><div align="center"><font size="2"><b>Amount (RM)</b></font></div></td>
<td width="138" bgcolor="#999999"><div align="center"><font size="2"><b>Payment ID</b></font></div></td>
<td width="135" bgcolor="#999999"><div align="right"><font size="2"><b>Cheque NO</b></font></div></td>
<td width="138" bgcolor="#999999"><div align="center"><font size="2"><b>Date</b></font></div></td>
<td width="135" bgcolor="#999999"><div align="right"><font size="2"><b>Received By</b></font></div></td>
<td width="135" bgcolor="#999999"><div align="right"><font size="2"><b>Balance</b></font></div></td>
</tr>
<?php
for ($j=1;$j<$n;$j++) {
?>
<tr>
<td><div align="center"><font size="2"><?php if($j > 1){
if($idinvoice[$j - 1] == $idinvoice[$j]){
echo ' ';
}else{
echo $idinvoice[$j];
}
}else{
echo $idinvoice[$j];
}?></font></div></td>
<td><div align="center"><font size="2"><?php if($j > 1){
if($idinvoice[$j - 1] == $idinvoice[$j]){
echo ' ';
}else{
echo $invoice[$j];
}
}else{
echo $invoice[$j];
}?></font></div></td>
<td><div align="center"><font size="2"><?php echo $amount[$j];?></font></div></td>
<td><div align="center"><font size="2"><?php echo $idpayment[$j]; ?></font></div></td>
<td><div align="center"><font size="2"><?php echo $cheque_no[$j]; ?></font></div></td>
<td><div align="right"><font size="2"><?php echo $pdatetime[$j];?></font></div></td>
<td><div align="right"><font size="2"><?php echo $username[$j];?></font></div></td>
<td><div align="right"><font size="2"><?php if($j > 1){
if($balance[$j - 1] == $balance[$j]){
echo ' ';
}else{
echo $balance[$j];
}
}else{
echo $balance[$j];
}?></font></div></td>
</tr>
<?php } ?>
</table>
<?php } ?>
|