-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathveiw_work.php
180 lines (172 loc) · 8.65 KB
/
veiw_work.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
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
<!-- header -->
<?php
require_once("./pdo_helpers.php");
include("./designs/header.php");
$id = $_SESSION['UserID'];
function get_customer_id($id) {
$dbh = connection();
$sql = "SELECT CustomerID FROM customers WHERE UserID=?";
$stmt = $dbh->prepare($sql);
$parameters = array($id);
$stmt->execute($parameters);
$res = $stmt->rowCount();
if($res > 0) {
$result = $stmt->fetch()[0];
return $result;
}
}
// All Work to add
$cid = get_customer_id($id);
$result = get_cus($cid);
// All Work to Pending
$cid = get_customer_id($id);
$result1 = get_cus_pending($cid);
//All Work Compeleted
$cid = get_customer_id($id);
$result2 = get_cus_compelete($cid);
?>
<!-- main -->
<div class="main-container teal lighten-5">
<div class="row"></div>
<div class="row"></div>
<!-- card -->
<div class="row">
<div class="col l10 offset-l1 m10 offset-m1 s10 offset-s1">
<div class="card white" style="margin:0%; padding:1%;" id="card-hover">
<div class="card-content teal darken-3 white-text">
<span class="card-title"><strong>Work History</strong></span>
</div>
<div class="row"></div>
<div class="card-content" style="color : #00695c;">
<!-- Work History Content Will be Here -->
<ul class="collapsible">
<li>
<div class="collapsible-header"><i class="material-icons">assignment</i>All Work</div>
<div class="collapsible-body">
<table class="highlight responsive-table" id="ck_tb">
<thead>
<tr>
<th>Date</th>
<th>Category</th>
<th>Charge</th>
<th>Paid Amount</th>
<th>Due Amount</th>
<th>Status</th>
</tr>
</thead>
<tbody>
<?php foreach ($result as $row) { ?>
<?php
$status = "Processing";
if ($row["WorkStatus"] == 1)
$status = "Pending";
elseif ($row["WorkStatus"] == 2)
$status = "Complete";
?>
<tr>
<td><?= $row["WorkTakenOn"] ?></td>
<td><?= $row["CategoryName"] ?></td>
<td><?= $row["TotalCharges"] ?></td>
<td><?= $row["PaidAmount"] ?></td>
<td><?= $row["DueAmount"] ?></td>
<td><?= $status ?></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</li>
<!-- 2nd <LI> Starts -->
<li>
<div class="collapsible-header"><i class="material-icons">assignment_late</i>Pending</div>
<div class="collapsible-body">
<table class="highlight responsive-table" id="employee_table">
<thead>
<tr>
<th>Date</th>
<th>Category</th>
<th>Charge</th>
<th>Paid Amount</th>
<th>Due Amount</th>
<th>Amount</th>
</tr>
</thead>
<tbody>
<?php try{
foreach ($result1 as $row1)
{ ?>
<?php
$status = "Processing";
if ($row1["WorkStatus"] == 1)
$status = "Pending";
elseif ($row1["WorkStatus"] == 2)
$status = "Complete";
?>
<tr>
<td> <?= $row1["WorkTakenOn"]?> </td>
<td> <?= $row1["CategoryName"]?> </td>
<td> <?= $row1["TotalCharges"]?> </td>
<td> <?= $row1["PaidAmount"]?> </td>
<td> <?= $row1["DueAmount"]?> </td>
<td> <?= $status ?> </td>
</tr>
<?php }
}
catch(exception $e){
} ?>
</tbody>
</table>
</div>
</li>
<!-- 3rd li starts -->
<li>
<div class="collapsible-header"><i class="material-icons">assignment_turned_in</i>Complete</div>
<div class="collapsible-body">
<table class="highlight responsive-table" id="employee_table">
<thead>
<tr>
<th>Date</th>
<th>Category</th>
<th>Charge</th>
<th>Paid Amount</th>
<th>Due Amount</th>
<th>Status</th>
<th>Employee Name</th>
</tr>
</thead>
<tbody>
<?php
foreach ($result2 as $row2) { ?>
<?php
$status = "Processing";
if ($row2["WorkStatus"] == 1)
$status = "Pending";
elseif ($row2["WorkStatus"] == 2)
$status = "Complete";
?>
<tr>
<td> <?= $row2["WorkTakenOn"]?> </td>
<td> <?= $row2["CategoryName"]?> </td>
<td> <?= $row2["TotalCharges"]?> </td>
<td> <?= $row2["PaidAmount"]?> </td>
<td> <?= $row2["DueAmount"]?> </td>
<td> <?= $status ?> </td>
<td> <?= $row2["FullName"]?> </td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</li>
</ul>
</div>
<!-- card close -->
</div>
</div>
</div>
<!-- Body Close -->
</div>
<!-- footer -->
<?php
include("./designs/footer.php");
?>