i am new to this
wanting to be able to pull various info from selected tables based on the client (CustomerNumber) that is logged in..
the session and login are working now.. the statement below will bring up a workorder and the date it was performed
it shows list of date / workorders now.
want to show a list of tables that contain:
date / workorder / summary
per client
this is the code my page currently uses::
<?
require_once("../define.php");
$query = "
SELECT
*, UNIX_TIMESTAMP(DateAdded) as the_date
FROM
Workorder W
WHERE
LEFT(W.Ref, " . (strlen($_SESSION['Client']['CustomerNumber'])+1) . ") = '" . $_SESSION['Client']['CustomerNumber'] . "-'
AND W.Closed = 1
ORDER BY
W.Ref DESC
LIMIT
0,125";
$cnt = db_apull($query, $w_data);
?>
<?php
include("header.php");
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr> <td width="15%" rowspan="2"> </td>
</tr>
<tr>
<td align="center" valign="middle" width="700"><p>Blank Page<br />
<!--- TABLE HEADERS --->
<table class="table305" cellpadding=0 cellspacing=0>
<tr style="height:27px">
<td width="41" align="left" valign="top" bgcolor="#B5BFCC"><img src="standard/spacer.gif" width="41" height="1" border="0" ALT=""></td>
<td width="52" align="left" valign="top" bgcolor="#B5BFCC" class="tableheader"><img src="standard/spacer.gif" width="52" height="10" border="0" ALT=""><br>Date</td>
<td width="39" align="left" valign="top" bgcolor="#B5BFCC"><img src="standard/spacer.gif" width="39" height="1" border="0" ALT=""></td>
<td width="48" align="left" valign="top" bgcolor="#C0CAD7"><img src="standard/spacer.gif" width="48" height="1" border="0" ALT=""></td>
<td width="78" align="left" valign="top" bgcolor="#C0CAD7" class="tableheader"><img src="standard/spacer.gif" width="78" height="10" border="0" ALT=""><br>Order#</td>
<td width="47" align="left" valign="top" bgcolor="#C0CAD7"><img src="standard/spacer.gif" width="47" height="1" border="0" ALT=""></td>
</tr>
<tr><td width="305" align="left" valign="top" colspan="6"><img src="standard/spacer.gif" width="305" height="2" border="0" ALT=""></td></tr>
<!--- FIRST ROW --->
<?
for($i=0; $i<$cnt; $i++) {
?>
<tr style="height:17px">
<td width="41" align="left" valign="top" bgcolor="#B5BFCC"><img src="standard/spacer.gif" width="41" height="1" border="0" ALT=""></td>
<td width="52" align="left" valign="top" bgcolor="#B5BFCC" class="standard"><?=date("m/d/Y", $w_data[$i]['the_date'])?></td>
<td width="39" align="left" valign="top" bgcolor="#B5BFCC"><img src="standard/spacer.gif" width="39" height="1" border="0" ALT=""></td>
<td width="48" align="left" valign="top" bgcolor="#C0CAD7"><img src="standard/spacer.gif" width="48" height="1" border="0" ALT=""></td>
<td width="138" align="left" valign="top" bgcolor="#C0CAD7" class="order"><a class="order" target="_blank" href="workorder.html?id=<?=r3e($w_data[$i]['WorkorderID'])?>&f=workorder.pdf"><?=$w_data[$i]['CustomerNo']?>.pdf</a></td>
<td width="47" align="left" valign="top" bgcolor="#C0CAD7"><img src="standard/spacer.gif" width="47" height="1" border="0" ALT=""></td>
</tr>
<?
}
?>
</td>
<td width="15%" rowspan="3"> </td>
</tr>
</table>
<?php
include("footer.php");
?>
also where are these comming from:
W.Ref
W.Closed
r3e
in the table workorder we have =
WorkorderID TechID EmailFrom EmailTo Subject WorkOrder Original CustomerName Address Address2 Phone CustomerNo WorkNotes Ref Start End Summary Status TaskCode Material Labor Other WorkDescription Notes CustomerPO InvoiceTo InvoiceAddress CustomerContractNo ServiceType TechComments SuggestedRepairs RefRec WeldSold RigEquip RefOil CompGas OtherTool StatusID Closed DateAdded LastUpdated