-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinvoicelist.php
80 lines (71 loc) · 3.1 KB
/
invoicelist.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Items to invoice</title>
<style type="text/css">
hr.pme-hr { border: 0px solid; padding: 0px; margin: 0px; border-top-width: 1px; height: 1px; }
table.pme-main { border: #004d9c 1px solid; border-collapse: collapse; border-spacing: 0px; width: 100%; }
table.pme-navigation { border: #004d9c 0px solid; border-collapse: collapse; border-spacing: 0px; width: 100%; }
td.pme-navigation-0, td.pme-navigation-1 { white-space: nowrap; }
th.pme-header { border: #004d9c 1px solid; padding: 4px; background: #add8e6; }
td.pme-key-0, td.pme-value-0, td.pme-help-0, td.pme-navigation-0, td.pme-cell-0,
td.pme-key-1, td.pme-value-1, td.pme-help-0, td.pme-navigation-1, td.pme-cell-1,
td.pme-sortinfo, td.pme-filter { border: #004d9c 1px solid; padding: 3px; }
td.pme-buttons { text-align: left; }
td.pme-message { text-align: center; }
td.pme-stats { text-align: right; }
</style>
</head>
<body>
<h3>Recent invoices</h3>
<?php
/*
* IMPORTANT NOTE: This generated file contains only a subset of huge amount
* of options that can be used with phpMyEdit. To get information about all
* features offered by phpMyEdit, check official documentation. It is available
* online and also for download on phpMyEdit project management page:
*
* http://platon.sk/projects/main_page.php?project_id=5
*
* This file was generated by:
*
* phpMyEdit version: 5.7.1
* phpMyEdit.class.php core class: 1.204
* phpMyEditSetup.php script: 1.50
* generating setup script: 1.50
*/
// MySQL host name, user name, password, database, and table
require_once("service-admin.inc.php");
$opts['tb'] = 'invoicelines';
$opts['cu'] = 'customers';
// Connect to database
mysql_connect($opts['hn'], $opts['un'], $opts['pw']);
mysql_select_db($opts['db']);
// Get the last 20 generated invoices
$qry = "SELECT distinct(invoiceid), customername, invoicelinedate FROM ".$opts['tb']." LEFT JOIN ".$opts['cu']." ";
$qry .= "ON (".$opts['tb'].".customerid = ".$opts['cu'].".customerid) where invoiceid IS NOT NULL ORDER BY invoiceid DESC LIMIT 20";
$result = mysql_query($qry) or die("<b>A fatal MySQL error occured</b>.\n<br />Query: " . $qry . "<br />\nError: (" . mysql_errno() . ") " . mysql_error());
?>
<form class="pme-form" method="post" action="createinvoice.php" name="createinvoice">
<table class="pme-main" summary="invoicelines">
<tr class="pme-header">
<th class="pme-header" colspan="1">Invoice</th>
<th class="pme-header">Customer</th>
<th class="pme-header">Date</th>
</tr>
<?
// Loop through them
while ($invoice = mysql_fetch_array($result)) {
echo "<tr class=\"pme-row-0\">";
echo "<td class=\"pme-navigation-1\"><a href=\"invoice.php?id=".$invoice["invoiceid"]."\">".$invoice["invoiceid"]."</a></td>";
echo "<td class=\"pme-cell-1\">".$invoice["customername"]."</td>";
echo "<td class=\"pme-cell-1\">".$invoice["invoicelinedate"]."</td>";
echo "</tr>\n";
}
?>
</table>
<form>
</body>
</html>