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
|
<!DOCTYPE html> <?php include_once '../include/DBConnect.php'; ?> <html> <head> <?php require_once '../include/head.php'; ?> <?php require_once '../include/checkuser.php'; ?> <?php require_once '../include/Nav_bar.php'; ?> </head> <body> <!-- line between nav bar and content --> <div class="text-right"> <ul class="breadcrumb"> <li class="active">Payroll Detail</li> </ul> </div>
<div class="container-fluid pathways-container"> <h3>Payroll Detail</h3> <form action="" method="post"> <table> <tr> <!-- Payroll Code --> <td style="width: 200px;text-align: right;"><label for="Payroll_code">Payroll Code</label></td> <td style="width: 30px"></td> <td><input id="Payroll_code" autocomplete="off" type="text" disabled value="<?= (isset($_GET)) ? $_GET['code'] : '' ?>" name="Payroll_code"/></td>
<!-- Staff Name --> <td style="width: 200px;text-align: right;"><label for="Staff_nzme">Staff Name</label></td> <td style="width: 30px"></td> <td><input id="Staff_nzme" autocomplete="off" type="text" disabled value="<?= (isset($_GET)) ? $_GET['name'] : '' ?>" name="Staff_nzme" /></td> </tr> <tr style="height: 15px;"></tr> <tr> <td style="width: 200px;text-align: right;"><label for="Creation Date">Creation Date</label></td> <td style="width: 30px"></td> <td><input id="Creation_Date" autocomplete="off" type="text" disabled value="<?= (isset($_GET)) ? $_GET['cdate'] : '' ?>" name="Creation_Date"/></td> </tr> </table> <hr/> </form> <table class="table table-striped table-bordered table-hover table-condensed"> <thead> <tr> <th>Lesson Date</th> <th>Rate</th> <th>price</th> <th>Hour</th> <th>Amount</th> </tr> </thead> <tbody> <?php $sth = $dbh->query("SELECT la.date,la.staff_id s,CEIL(TIME_TO_SEC(TIMEDIFF(l.end_time,l.start_time))/3600) hour, la.rate,s.salary,s.rate1,s.rate2,s.rate3,s.rate4,s.rate5,s.rate6 FROM lesson_attendance la,lesson l,staff s WHERE la.lesson_id in (Select lesson_id from lesson where date >='" . $_GET['startdate'] . "' and date <= '" . $_GET['enddate'] . "' and deleted = 0 and actived = 1) and la.actived = 1 and la.deleted = 0 and la.staff_id <> 0 and l.actived = 1 and l.deleted = 0 and l.lesson_id = la.lesson_id and s.actived = 1 and s.deleted = 0 and la.staff_id = s.staff_id"); $sum = 0; while ($ResultSet = $sth->fetch(PDO::FETCH_ASSOC)) { switch ((int) $ResultSet['rate']) { case 0: $rate = $ResultSet['salary']; $amount = $ResultSet['salary'] * $ResultSet["hour"]; $hour = $ResultSet['hour']; break; case 1: $rate = $ResultSet['rate1']; $amount = $ResultSet['rate1'] * $ResultSet["hour"]; $hour = $ResultSet['hour']; break; case 2: $rate = $ResultSet['rate2']; $amount = $ResultSet['rate2'] * $ResultSet["hour"]; $hour = $ResultSet['hour']; break; case 3: $rate = $ResultSet['rate3']; $amount = $ResultSet['rate3'] * $ResultSet["hour"]; $hour = $ResultSet['hour']; break; case 4: $rate = $ResultSet['rate4']; $amount = $ResultSet['rate4'] * $ResultSet["hour"]; $hour = $ResultSet['hour']; break; case 5: $rate = $ResultSet['rate5']; $amount = $ResultSet['rate5'] * $ResultSet["hour"]; $hour = $ResultSet['hour']; break; case 6: $rate = $ResultSet['rate6']; $amount = $ResultSet['rate6'] * $ResultSet["hour"]; $hour = $ResultSet['hour']; break; } if ($ResultSet['s'] == $_GET['staffid']) { $sum+=$amount; ?> <tr> <td><?= $ResultSet['date'] ?></td> <td><?= explode(".", $ResultSet['rate'])[0] ?></td> <td><?= $rate ?></td> <td><?= $hour ?></td> <td><?= $amount ?></td> </tr> <?php } ?> <?php } ?> </tbody> </table> <label class="pull-right">Total Amount : <input type="text" disabled value="$ <?= number_format($sum) ?>"></label> </div> <!-- /container --> </body> </html>
|