-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathorders.php
More file actions
72 lines (54 loc) · 2.36 KB
/
Copy pathorders.php
File metadata and controls
72 lines (54 loc) · 2.36 KB
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
<?php
/**********************************************************************/
/* RESUME THE SESSION
/**********************************************************************/
session_start();
/**********************************************************************/
/* FILE NAME & ACCESS RULE FOR PAGE
/**********************************************************************/
$CURRENT_PAGE_NAME = basename(__FILE__, '.php');
$USER_TYPE_REQUIREMENT = "user"; // used by redirect
/**********************************************************************/
/* REUIREMENTS
/**********************************************************************/
require('php/sql-config.php');
require('php/global.php');
require('php/retrieve_orders_tickets.php');
/**********************************************************************/
// MAIN
/**********************************************************************/
redirect();
if(admin())
displayPage("orders", array("orders_admin.js"));
else
displayPage("orders");
/**********************************************************************/
// DISPLAY PAGE
function orders()
{
// get the error string ready (if there was one)
$error = getError();
// retrieve the orders
$html = retrieveOrdersOrTickets("orders");
$tableHtml = $error . $html["dataHtml"];
$paginationHtml = $html["paginationHtml"];
// display
$info =
[
"row" => [ "id" => "ordersRow", "extraClasses" => ["blue"] ],
"rowColumn" => [ [] ],
"blockContent" => [$tableHtml]
];
createRow($info);
if($tableHtml != "<p>No data</p>") // dont display pagination if no orders
{
$info =
[
"row" => [ "id" => "pagination", "extraClasses" => ["blue"] ],
"rowColumn" => [ [] ],
"blockContent" => [$paginationHtml]
];
createRow($info);
}
}
?>