-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathcustomer_list.php
66 lines (50 loc) · 2.11 KB
/
customer_list.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
<?php
ob_start();
session_start();
if(! isset($_SESSION['details']) )
{ $details[1]['customers_id'] = 1;
$details[1]['customer_name'] = 'Avery Airconditioning Sucks Wind';
$details[1]['address'] = '10635 King William Dr';
$details[1]['city'] = 'Dallas';
$details[1]['state'] = 'TX';
$details[1]['zip'] = '75070';
$details[2]['customers_id'] = 2;
$details[2]['customer_name'] = 'Trial N Error';
$details[2]['address'] = '123 Main St.';
$details[2]['city'] = 'Frisco';
$details[2]['state'] = 'TX';
$details[2]['zip'] = '75034';
$details[3]['customers_id'] = 3;
$details[3]['customer_name'] = 'In N Out Burger';
$details[3]['address'] = '9999 Big Street';
$details[3]['city'] = 'Allen';
$details[3]['state'] = 'TX';
$details[3]['zip'] = '70389';
$details[4]['customers_id'] = 4;
$details[4]['customer_name'] = 'Lousy Co.';
$details[4]['address'] = '3283 Stinky st.';
$details[4]['city'] = 'Plano';
$details[4]['state'] = 'TX';
$details[4]['zip'] = '75003';
$_SESSION['details'] = $details;
$_SESSION['max_id'] = count( $_SESSION['details'] ) + 1;
}
if( isset($_SESSION['customers']) )
{
$customers = $_SESSION['customers'];
} else
{
$customers[] = array('customers_id' => 1, 'customer_name' => 'Avery Airconditioning Sucks Wind', 'start_date' => '2011-05-01', 'last_order' => '2011-05-01');
$customers[] = array('customers_id' => 2, 'customer_name' => 'Trial N Error', 'start_date' => '2009-11-21', 'last_order' => '2010-12-18');
$customers[] = array('customers_id' => 3, 'customer_name' => 'In N Out Burger', 'start_date' => '2010-03-19', 'last_order' => '2010-03-19');
$customers[] = array('customers_id' => 4, 'customer_name' => 'Lousy Co.', 'start_date' => '1998-10-03', 'last_order' => '2011-06-21');
$_SESSION['customers'] = $customers;
$_SESSION['max_customers_id'] = 4;
}
$customer_list = array();
$customer_list['success'] = true;
$customer_list['customers'] = $customers;
$customer_list['totalCount'] = count( $customer_list['customers'] );
echo json_encode($customer_list);
ob_flush();
?>