-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathline_curr.php
More file actions
85 lines (77 loc) · 2.07 KB
/
line_curr.php
File metadata and controls
85 lines (77 loc) · 2.07 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
73
74
75
76
77
78
79
80
81
82
83
84
85
<!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.'_empl-current';
$query_linecurr = getLineCurr($db_link);
?>
<html>
<?PHP includeHead('Current Lines',1) ?>
<body>
<!-- MENU -->
<?PHP includeMenu(8); ?>
<div id="menu_main">
<!-- <a href="empl_search.php">Search</a> -->
<a href="line_new.php">New Line</a>
<a href="line_curr.php" id="item_selected">Current Lines</a>
</div>
<!-- TABLE: Current Lines -->
<table id="tb_table">
<colgroup>
<col width="6%" />
<col width="14%" />
<col width="14%" />
<col width="8%" />
</colgroup>
<tr>
<form class="export" action="rep_export.php" method="post">
<th class="title" colspan="9">Current Lines
<!-- Export Button -->
<input type="submit" name="export_rep" value="Export" />
</th>
</form>
</tr>
<tr>
<th>ID</th>
<th>Code</th>
<th>Name</th>
<th>Rider</th>
<th>Optional Rider</th>
<th>Status</th>
</tr>
<?PHP
$count = 0;
$status = "";
while ($row_linecurr = mysqli_fetch_assoc($query_linecurr)){
if($row_linecurr['status']==1)
$status = "Active";
else if($row_linecurr['status']==2)
$status = "Inactive";
echo '<tr>
<td><a href="line.php?line='.$row_linecurr['line_id'].'">'.$row_linecurr['line_id'].'</a></td>
<td>'.$row_linecurr['code'].'</td>
<td>'.$row_linecurr['name'].'</td>
<td>'.$row_linecurr['rider'].'</td>
<td>'.$row_linecurr['optrider'].'</td>
<td>'.$status.'</td>
</tr>';
array_push($_SESSION['rep_export'], array("Line ID" => $row_linecurr['line_id'], "Line Code" => $row_linecurr['code'], "Line Name" => $row_linecurr['name']));
$count++;
}
?>
<tr class="balance">
<td colspan="9*">
<?PHP
echo $count.' current Line';
if ($count != 1) echo 's';
?>
</td>
</tr>
</table>
</body>
</html>