forked from mangoO-Microfinance/mangoO-Microfinance
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cust_act.php
91 lines (84 loc) · 2.58 KB
/
cust_act.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
81
82
83
84
85
86
87
88
89
90
91
<!DOCTYPE HTML>
<?PHP
require 'functions.php';
checkLogin();
$db_link = connect();
//Make array for exporting data
$rep_year = date("Y",time());
$rep_month = date("m",time());
$_SESSION['rep_export'] = array();
$_SESSION['rep_exp_title'] = $rep_year.'-'.$rep_month.'_cust-active';
//Select active customers from CUSTOMER
$query_custact = getCustAct($db_link);
?>
<html>
<?PHP includeHead('Active Customers',1) ?>
<body>
<!-- MENU -->
<?PHP includeMenu(2); ?>
<div id="menu_main">
<a href="cust_search.php">Search</a>
<a href="cust_new.php">New Customer</a>
<a href="cust_act.php" id="item_selected">Active Customers</a>
<a href="cust_inact.php">Inactive Customers</a>
</div>
<!-- TABLE: Active Customers -->
<table id="tb_table">
<colgroup>
<col width="8%" />
<col width="17%" />
<col width="8%" />
<col width="8%" />
<col width="17%" />
<col width="17%" />
<col width="17%" />
<col width="8%" />
</colgroup>
<tr>
<form class="export" action="rep_export.php" method="post">
<th class="title" colspan="8">Active Customers
<!-- Export Button -->
<input type="submit" name="export_rep" value="Export" />
</th>
</form>
</tr>
<tr>
<th>Cust. No.</th>
<th>Name</th>
<th>Gender</th>
<th>DoB</th>
<th>Occupation</th>
<th>Address</th>
<th>Phone No.</th>
<th>Memb. since</th>
</tr>
<?PHP
$count = 0;
while ($row_custact = mysqli_fetch_assoc($query_custact)){
echo '<tr>
<td>
<a href="customer.php?cust='.$row_custact['cust_id'].'">'.$row_custact['cust_no'].'</a>
</td>
<td>'.$row_custact['cust_name'].'</td>
<td>'.$row_custact['custsex_name'].'</td>
<td>'.date("d.m.Y",$row_custact['cust_dob']).'</td>
<td>'.$row_custact['cust_occup'].'</td>
<td>'.$row_custact['cust_address'].'</td>
<td>'.$row_custact['cust_phone'].'</td>
<td>'.date("d.m.Y",$row_custact['cust_since']).'</td>
</tr>';
array_push($_SESSION['rep_export'], array("Cust. No." => $row_custact['cust_no'], "Customer Name" => $row_custact['cust_name'], "DoB" => date("d.m.Y",$row_custact['cust_dob']), "Gender" => $row_custact['custsex_name'], "Occupation" => $row_custact['cust_occup'], "Address" => $row_custact['cust_address'], "Phone No." => $row_custact['cust_phone'], "Member since" => date("d.m.Y",$row_custact['cust_since'])));
$count++;
}
?>
<tr class="balance">
<td colspan="8">
<?PHP
echo $count.' active customer';
if ($count != 1) echo 's';
?>
</td>
</tr>
</table>
</body>
</html>