-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdo_ajaxrequest.php
More file actions
36 lines (30 loc) · 1.27 KB
/
do_ajaxrequest.php
File metadata and controls
36 lines (30 loc) · 1.27 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
<?php
require_once(dirname(__FILE__) . '/lib/tbs_class.php');
require_once(dirname(__FILE__) . '/classes/order.class.php');
if (!defined('W2P_BASE_DIR')) {
die('You should not access this file directly');
}
// Parse data to determine the page to create
$offset = w2PgetConfig('page_size', 50) * (w2pgetParam($_POST, 'page')-1);
$filter = w2PgetCleanParam($_POST, 'filter', 'open');
// Load list based on selected filter
switch($filter) {
case 'open':
$ol = COrder::listOfOpenOrders($offset, w2PgetConfig('page_size', 50));
break;
case 'all':
$ol = COrder::createListFromDatabase($offset, w2PgetConfig('page_size', 50));
break;
default:
$ol = COrder::listOfOpenOrders($offset, w2PgetConfig('page_size', 50));
break;
}
$tbs = & new clsTinyButStrong();
$tbs->LoadTemplate(dirname(__FILE__) . '/templates/order_list_core.html');
$tbs->MergeBlock('order', $ol);
$tbs->MergeField('deliveryIcon', w2PfindImage('/lorry_go.png', 'ordermgmt'));
$tbs->MergeField('recievedIcon', w2pfindImage('/thumb_up.png', 'ordermgmt'));
$tbs->MergeField('deliveryOverdueIcon', w2PfindImage('/lorry_error.png', 'ordermgmt'));
$tbs->Show(TBS_OUTPUT);
// This controller is designed to handle ajax requests, so the hack below prevents unwanted output...
die;