forked from mangoO-Microfinance/mangoO-Microfinance
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathempl_past.php
94 lines (87 loc) · 2.78 KB
/
empl_past.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
92
93
94
<!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-former';
$query_emplpast = getEmplPast($db_link);
?>
<html>
<?PHP includeHead('Former Employees',1) ?>
<body>
<!-- MENU -->
<?PHP includeMenu(7); ?>
<div id="menu_main">
<!-- <a href="empl_search.php">Search</a> -->
<a href="empl_new.php">New Employee</a>
<a href="empl_curr.php">Current Employees</a>
<a href="empl_past.php" id="item_selected">Former Employees</a>
</div>
<!-- TABLE: Former Employees -->
<table id="tb_table">
<colgroup>
<col width="7%" />
<col width="13%" />
<col width="13%" />
<col width="7%" />
<col width="7%" />
<col width="13%" />
<col width="13%" />
<col width="13%" />
<col width="7%" />
<col width="7%" />
</colgroup>
<tr>
<form class="export" action="rep_export.php" method="post">
<th class="title" colspan="10">Former Employees
<!-- Export Button -->
<input type="submit" name="export_rep" value="Export" />
</th>
</form>
</tr>
<tr>
<th>Empl. No.</th>
<th>Name</th>
<th>Position</th>
<th>Gender</th>
<th>DoB</th>
<th>Address</th>
<th>Phone No.</th>
<th>E-Mail</th>
<th>In</th>
<th>Out</th>
</tr>
<?PHP
$count = 0;
while ($row_emplpast = mysqli_fetch_assoc($query_emplpast)){
echo '<tr>
<td><a href="employee.php?empl='.$row_emplpast['empl_id'].'">'.$row_emplpast['empl_no'].'</a></td>
<td>'.$row_emplpast['empl_name'].'</td>
<td>'.$row_emplpast['empl_position'].'</td>
<td>'.$row_emplpast['emplsex_name'].'</td>
<td>'.date("d.m.Y",$row_emplpast['empl_dob']).'</td>
<td>'.$row_emplpast['empl_address'].'</td>
<td>'.$row_emplpast['empl_phone'].'</td>
<td>'.$row_emplpast['empl_email'].'</td>
<td>'.date("d.m.Y",$row_emplpast['empl_in']).'</td>
<td>'.date("d.m.Y",$row_emplpast['empl_out']).'</td>
</tr>';
array_push($_SESSION['rep_export'], array("Empl. No." => $row_emplpast['empl_no'], "Employee Name" => $row_emplpast['empl_name'], "DoB" => date("d.m.Y",$row_emplpast['empl_dob']), "Gender" => $row_emplpast['emplsex_name'], "Address" => $row_emplpast['empl_address'], "Phone No." => $row_emplpast['empl_phone'], "Email" => $row_emplpast['empl_email'], "Empl. In" => date("d.m.Y",$row_emplpast['empl_in']), "Empl. Out" => date("d.m.Y",$row_emplpast['empl_out'])));
$count++;
}
?>
<tr class="balance">
<td colspan="10">
<?PHP
echo $count.' former employee';
if ($count != 1) echo 's';
?>
</td>
</tr>
</table>
</body>
</html>