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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
|
<!DOCTYPE html> <?php require_once 'PayRoll_Sql.php'; ?> <?php ($staff_array = Search_Staff_Name()->fetchAll(PDO::FETCH_ASSOC)); ?> <?php if (isset($_GET['search']['search_button'])) { $staff_name = $_GET['search']['staff_name']; $start_date = $_GET['search']['start_date']; $end_date = $_GET['search']['end_date']; } ?> <html> <head> <?php require_once '../include/head.php'; ?> <?php require_once '../include/checkuser.php'; ?> <?php require_once '../include/Nav_bar.php'; ?> <script> $(function(){ $("#staff_name").select2(); $("#start_date").datetimepicker({autoclose: true,pickTime: false, format: 'yyyy-MM-dd'}) $("#end_date").datetimepicker({autoclose: true,pickTime: false, format: 'yyyy-MM-dd'}) $('#start_date').datetimepicker().on('changeDate', function(ev){ date = new Date($('#start_date_input').val()); $('#end_date').datetimepicker('setStartDate',date); $('#end_date').datetimepicker('setDate',date); $('#end_date').datetimepicker('show'); $('#start_date').datetimepicker('hide'); $('#end_date').datetimepicker('remove'); }); $('#end_date').datetimepicker().on('changeDate', function(ev){ $('#end_date').datetimepicker('hide'); }); }) </script> <style> .div-search{ margin: 0; padding: 5px 10px; background-color: #F7F7F7; border: 1px solid #E6E6E6; border-radius: 5px; box-shadow: 0 1px 2px rgba(0,0,0,.05); } </style> </head> <body> <!-- line between nav bar and content --> <div class="text-right"> <ul class="breadcrumb"> <li class="active"></li> </ul> </div>
<div class="container-fluid pathways-container"> <h3>Payroll</h3> <form class="form-inline" action="" method="get" autocomplete="off"> <div class="div-search"> <table style="margin: 10px 10px 10px 10px;"> <tr>
<td>Staff Name</td> <td style="width: 10px;"></td> <td> <select id="staff_name" name="search[staff_name]" style="width: 300px;"> <option></option> <?php foreach ($staff_array as $arr) { ?> <option value="<?= $arr['root_id'] ?>"><?= $arr['name'] ?></option> <?php } ?> </select> </td>
<td style="width: 15px;"></td>
<td style="padding-top: 5px;">Start Date</td> <td style="width: 10px;"></td> <td> <div id="start_date" class="input-append date form_datetime datetime_picker"> <input type="text" id="start_date_input" name="search[start_date]" /> <span class="add-on"><i class="icon-calendar"></i></span> </div> </td>
<td style="width: 15px;"></td>
<td style="padding-top: 5px;">End Date</td> <td style="width: 10px;"></td> <td> <div id="end_date" class="input-append date form_datetime datetime_picker"> <input type="text" id="end_date_input" name="search[end_date]" /> <span class="add-on"><i class="icon-calendar"></i></span> </div> </td>
<td style="width: 20px;"></td>
<td><button type="submit" class="btn" name="search[search_button]">Search</button></td> </tr> </table> </div> </form> <?php if (isset($_GET['search']['search_button'])) { ?> <form action="" method="post"> <table class="table table-striped table-bordered table-hover table-condensed"> <thead> <tr> <th style="width: 50px;"></th> <th>Payroll No.</th> <th>Staff Name</th> <th>Payroll Period</th> <th>Total Amount</th> <th>Creation Date</th> </tr> </thead> <tbody> <?php $sth = Find_Payrollby_date_staffid($staff_name, $start_date, $end_date); ?> <?php if ($sth->rowCount() > 0) { ?> <?php while ($result = $sth->fetch(PDO::FETCH_ASSOC)) { ?> <tr> <td style="margin-left:auto;margin-right:auto;"> <div class="btn-group" data-toggle="buttons"> <a href="PayRoll_Generate_From.php?view=1&root_id=<?= $result['root_id'] ?>&startdate=<?= $result['start_date'] ?>&enddate=<?= $result['end_date'] ?>&payroll_id=<?= $result['payroll_id'] ?>" class="btn"><i class="icon-eye-open"></i> View</a> <a href="PayRoll_Generate_From.php?edit=1&root_id=<?= $result['root_id'] ?>&startdate=<?= $result['start_date'] ?>&enddate=<?= $result['end_date'] ?>&payroll_id=<?= $result['payroll_id'] ?>" class="btn">Edit</a> </div> </td> <td><?= $result['payroll_code'] ?></td> <td><?= $result['name'] ?></td> <td><?= $result['start_date'] . " - " . $result['end_date'] ?></td> <td>$ <?= number_format($result['total_amount'], 2) ?></td> <td><?= $result['payroll_date'] ?></td> </tr> <?php } ?> <?php } else { ?> <tr> <td colspan="6">No Payroll !!</td> </tr> <?php } ?> </tbody> </table> </form> <?php } ?> </div> <!-- /container --> </body> </html>
|