/
label-cust-save.php
executable file
·65 lines (53 loc) · 1.05 KB
/
label-cust-save.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
<?
#This program is copyright by Andre Coetzee email: ac@main.me
#and is licensed under the GPL v3
#
#
#
#
#Please add yourself to: http://www.accounting-123.com
#Developers, Software Vendors, Support, Accountants, Users
#
#
#The full software license can be found here:
#http://www.accounting-123.com/a.php?a=153/GPLv3
#
#
#
#
#
#
#
#
#
#
#
require ("settings.php");
require ("core-settings.php");
$OUTPUT = print_labels ();
//require ("tmpl-print.php");
function print_labels ()
{
db_connect ();
#get list of customers
$get_cust = "SELECT * FROM customers WHERE div = '".USER_DIV."'";
$run_cust = db_exec($get_cust) or errDie("Unable to get customer information");
if(pg_numrows($run_cust) < 1){
return "No customers were found.";
}else {
$listing = "";
while ($arr = pg_fetch_array($run_cust)){
$listing .= "
$arr[surname]
$arr[paddr1]
\n
\n";
}
}
header("Content-Type: application/octet-stream");
header("Content-Disposition: atachment; filename=labels-customer.txt");
header("Pragma: no-cache");
header("Expires: 0");
print $listing;
}
?>