@@ -6,50 +6,50 @@ discard block |
||
6 | 6 | $id = $_GET['id']; |
7 | 7 | $ticket = $tickets->ticket_data($id); |
8 | 8 | if ($ticket['ticketstatus'] == 'Closed') { |
9 | - header("Location: ticketread.php?id=$id"); |
|
10 | - exit(); |
|
9 | + header("Location: ticketread.php?id=$id"); |
|
10 | + exit(); |
|
11 | 11 | } |
12 | 12 | if (isset($_POST['submit'])) { |
13 | - $sla = $_POST['sla']; |
|
14 | - $reporteddate = strtotime($_POST['reporteddate']); |
|
15 | - $reportedby = $_POST['reportedby']; |
|
16 | - $telp = $_POST['telp']; |
|
17 | - $email = $_POST['email']; |
|
18 | - $problemsummary = $_POST['problemsummary']; |
|
19 | - $problemdetail = $_POST['problemdetail']; |
|
20 | - $assignee = $_POST['idassignee']; |
|
21 | - $type = $_POST['pro']; |
|
22 | - $ticketstatus = $_POST['ticketstatus']; |
|
23 | - $resolution = $_POST['resolution']; |
|
24 | - $pendingby = $_POST['pendingby']; |
|
25 | - $pendingdate = $_POST['pendingdate']; |
|
26 | - $resolvedby = $_POST['resolvedby']; |
|
27 | - $resolveddate = $_POST['resolveddate']; |
|
28 | - $closedby = $_POST['closedby']; |
|
29 | - $closeddate = $_POST['closeddate']; |
|
30 | - $changes = 'Re-assigned the ticket.'; |
|
31 | - if ($ticketstatus == 'Pending') { |
|
32 | - $pendingby = $user['username']; |
|
33 | - $pendingdate = strtotime(now); |
|
34 | - $changes = 'Change Status to Pending.'; |
|
35 | - } |
|
36 | - if ($ticketstatus == 'Resolved') { |
|
37 | - $resolvedby = $user['username']; |
|
38 | - $resolveddate = strtotime(now); |
|
39 | - $changes = 'Change Status to Resolved.'; |
|
40 | - } |
|
41 | - if ($ticketstatus == 'Closed') { |
|
42 | - $closedby = $user['username']; |
|
43 | - $closeddate = strtotime(now); |
|
44 | - $changes = 'Change Status to Closed.'; |
|
45 | - } |
|
46 | - $tickets->update_ticket($id, $sla, $reporteddate, $reportedby, $telp, $email, $problemsummary, $problemdetail, $ticketstatus, $assignee, $assigneddate, $pendingby, $pendingdate, $resolution, $resolvedby, $resolveddate, $closedby, $closeddate); |
|
47 | - $tickets->log_tickets($id, $sla, $reporteddate, $reportedby, $telp, $email, $problemsummary, $problemdetail, $ticketstatus, $assignee, $assigneddate, $pendingby, $pendingdate, $resolution, $resolvedby, $resolveddate, $closedby, $closeddate, $changes, $changeby); |
|
48 | - if ($user['level'] == 'Admin') { |
|
49 | - header('Location: ticketlist.php'); |
|
50 | - } else { |
|
51 | - header('Location: myticketbyassignee.php'); |
|
52 | - } |
|
13 | + $sla = $_POST['sla']; |
|
14 | + $reporteddate = strtotime($_POST['reporteddate']); |
|
15 | + $reportedby = $_POST['reportedby']; |
|
16 | + $telp = $_POST['telp']; |
|
17 | + $email = $_POST['email']; |
|
18 | + $problemsummary = $_POST['problemsummary']; |
|
19 | + $problemdetail = $_POST['problemdetail']; |
|
20 | + $assignee = $_POST['idassignee']; |
|
21 | + $type = $_POST['pro']; |
|
22 | + $ticketstatus = $_POST['ticketstatus']; |
|
23 | + $resolution = $_POST['resolution']; |
|
24 | + $pendingby = $_POST['pendingby']; |
|
25 | + $pendingdate = $_POST['pendingdate']; |
|
26 | + $resolvedby = $_POST['resolvedby']; |
|
27 | + $resolveddate = $_POST['resolveddate']; |
|
28 | + $closedby = $_POST['closedby']; |
|
29 | + $closeddate = $_POST['closeddate']; |
|
30 | + $changes = 'Re-assigned the ticket.'; |
|
31 | + if ($ticketstatus == 'Pending') { |
|
32 | + $pendingby = $user['username']; |
|
33 | + $pendingdate = strtotime(now); |
|
34 | + $changes = 'Change Status to Pending.'; |
|
35 | + } |
|
36 | + if ($ticketstatus == 'Resolved') { |
|
37 | + $resolvedby = $user['username']; |
|
38 | + $resolveddate = strtotime(now); |
|
39 | + $changes = 'Change Status to Resolved.'; |
|
40 | + } |
|
41 | + if ($ticketstatus == 'Closed') { |
|
42 | + $closedby = $user['username']; |
|
43 | + $closeddate = strtotime(now); |
|
44 | + $changes = 'Change Status to Closed.'; |
|
45 | + } |
|
46 | + $tickets->update_ticket($id, $sla, $reporteddate, $reportedby, $telp, $email, $problemsummary, $problemdetail, $ticketstatus, $assignee, $assigneddate, $pendingby, $pendingdate, $resolution, $resolvedby, $resolveddate, $closedby, $closeddate); |
|
47 | + $tickets->log_tickets($id, $sla, $reporteddate, $reportedby, $telp, $email, $problemsummary, $problemdetail, $ticketstatus, $assignee, $assigneddate, $pendingby, $pendingdate, $resolution, $resolvedby, $resolveddate, $closedby, $closeddate, $changes, $changeby); |
|
48 | + if ($user['level'] == 'Admin') { |
|
49 | + header('Location: ticketlist.php'); |
|
50 | + } else { |
|
51 | + header('Location: myticketbyassignee.php'); |
|
52 | + } |
|
53 | 53 | } |
54 | 54 | ?> |
55 | 55 | <!DOCTYPE HTML> |
@@ -126,9 +126,9 @@ discard block |
||
126 | 126 | <td width="120"> Customer </td><td> : </td> |
127 | 127 | <td> |
128 | 128 | <?php |
129 | - $customer = $customers->customer_data($ticket['idcustomer']); |
|
130 | - echo $customer['namacustomer']; |
|
131 | - ?> </td> |
|
129 | + $customer = $customers->customer_data($ticket['idcustomer']); |
|
130 | + echo $customer['namacustomer']; |
|
131 | + ?> </td> |
|
132 | 132 | </tr> |
133 | 133 | <tr> |
134 | 134 | <td> Customer Product</td><td> : </td> |
@@ -138,16 +138,16 @@ discard block |
||
138 | 138 | <td> Warranty Period</td><td> : </td> |
139 | 139 | <td> |
140 | 140 | <?php |
141 | - $project = $projects->get_project_customer($customer['idcustomer']); |
|
142 | - echo $project['warrantyperiod'].' Year'; |
|
143 | - ?> </td> |
|
141 | + $project = $projects->get_project_customer($customer['idcustomer']); |
|
142 | + echo $project['warrantyperiod'].' Year'; |
|
143 | + ?> </td> |
|
144 | 144 | </tr> |
145 | 145 | <tr> |
146 | 146 | <td> Contract Period</td><td> : </td> |
147 | 147 | <td> |
148 | 148 | <?php |
149 | - echo $project['contractperiod'].' Month'; |
|
150 | - ?> |
|
149 | + echo $project['contractperiod'].' Month'; |
|
150 | + ?> |
|
151 | 151 | </td> |
152 | 152 | </tr> |
153 | 153 | </table>--> |
@@ -171,13 +171,13 @@ discard block |
||
171 | 171 | <td> Urgency (SLA)*</td><td> : </td> |
172 | 172 | <td><select name="sla"> |
173 | 173 | <?php |
174 | - $sladata = $slas->sla_data($ticket['sla']); |
|
175 | - echo '<option value="'.$ticket['sla'].'" selected="selected">'.$sladata['namasla'].'</option>'; |
|
176 | - $sla = $slas->get_sla(); |
|
177 | - foreach ($sla as $slaval) { |
|
178 | - echo '<option value="'.$slaval['slaid'].'">'.$slaval['namasla'].'</option>'; |
|
179 | - } |
|
180 | - ?> |
|
174 | + $sladata = $slas->sla_data($ticket['sla']); |
|
175 | + echo '<option value="'.$ticket['sla'].'" selected="selected">'.$sladata['namasla'].'</option>'; |
|
176 | + $sla = $slas->get_sla(); |
|
177 | + foreach ($sla as $slaval) { |
|
178 | + echo '<option value="'.$slaval['slaid'].'">'.$slaval['namasla'].'</option>'; |
|
179 | + } |
|
180 | + ?> |
|
181 | 181 | </select> |
182 | 182 | </td> |
183 | 183 | </tr> |
@@ -185,10 +185,10 @@ discard block |
||
185 | 185 | <td> Type</td><td> : </td> |
186 | 186 | <td> |
187 | 187 | <?php |
188 | - //$pro = $slas->get_sla(); |
|
189 | - echo $ticket['pro']; |
|
188 | + //$pro = $slas->get_sla(); |
|
189 | + echo $ticket['pro']; |
|
190 | 190 | |
191 | - ?> |
|
191 | + ?> |
|
192 | 192 | |
193 | 193 | </td> |
194 | 194 | </tr> |
@@ -216,13 +216,13 @@ discard block |
||
216 | 216 | <td width="120"> Assign to* </td><td> : </td> |
217 | 217 | <td> <select name="idassignee"> |
218 | 218 | <?php |
219 | - $userassignee = $users->userdata($ticket['assignee']); |
|
220 | - echo '<option value='.$ticket['assignee'].' selected="selected">'.$userassignee['fullname'].'</option>'; |
|
221 | - $listusers = $users->get_users(); |
|
222 | - foreach ($listusers as $user) { |
|
223 | - echo '<option value='.$user['id'].'>'.$user['fullname'].'</option>'; |
|
224 | - } |
|
225 | - ?> |
|
219 | + $userassignee = $users->userdata($ticket['assignee']); |
|
220 | + echo '<option value='.$ticket['assignee'].' selected="selected">'.$userassignee['fullname'].'</option>'; |
|
221 | + $listusers = $users->get_users(); |
|
222 | + foreach ($listusers as $user) { |
|
223 | + echo '<option value='.$user['id'].'>'.$user['fullname'].'</option>'; |
|
224 | + } |
|
225 | + ?> |
|
226 | 226 | </select> </td> |
227 | 227 | </tr> |
228 | 228 | <tr> |
@@ -230,8 +230,8 @@ discard block |
||
230 | 230 | <td> <input type="hidden" name="oldticketstatus" value="<?php echo $ticket['ticketstatus']; ?>"> |
231 | 231 | <select name="ticketstatus"> |
232 | 232 | <?php |
233 | - echo '<option value='.$ticket['ticketstatus'].' selected="selected">'.$ticket['ticketstatus'].'</option>'; |
|
234 | - ?> |
|
233 | + echo '<option value='.$ticket['ticketstatus'].' selected="selected">'.$ticket['ticketstatus'].'</option>'; |
|
234 | + ?> |
|
235 | 235 | <option value="Assigned"> Assigned </option> |
236 | 236 | <option value="Resolved"> Resolved </option> |
237 | 237 | <option value="Pending"> Pending </option> |
@@ -269,14 +269,14 @@ discard block |
||
269 | 269 | <table class="formtable"> |
270 | 270 | <tr bgcolor="#e0e0e0" ><td width="150">Updated On</td><td width="150">Updated By</td><td>Description</td></tr> |
271 | 271 | <?php |
272 | - $list_log_tickets = $tickets->get_audit_trail($id); |
|
273 | - foreach ($list_log_tickets as $log_ticket) { |
|
274 | - $changed_by = $users->userdata($log_ticket['changeby']); |
|
275 | - echo '<tr><td>'.date('d-M-Y H:i:s', $log_ticket['changedate']).'</td>'. |
|
276 | - '<td>'.$changed_by['fullname'].'</td>'. |
|
277 | - '<td>'.$log_ticket['changes'].'</td></tr>'; |
|
278 | - } |
|
279 | - ?> |
|
272 | + $list_log_tickets = $tickets->get_audit_trail($id); |
|
273 | + foreach ($list_log_tickets as $log_ticket) { |
|
274 | + $changed_by = $users->userdata($log_ticket['changeby']); |
|
275 | + echo '<tr><td>'.date('d-M-Y H:i:s', $log_ticket['changedate']).'</td>'. |
|
276 | + '<td>'.$changed_by['fullname'].'</td>'. |
|
277 | + '<td>'.$log_ticket['changes'].'</td></tr>'; |
|
278 | + } |
|
279 | + ?> |
|
280 | 280 | </table> |
281 | 281 | </fieldset> |
282 | 282 | <br/><br/> |
@@ -28,10 +28,10 @@ discard block |
||
28 | 28 | <td><h1 class="content">Welcome to Helpdesk System</h1> |
29 | 29 | <ul> |
30 | 30 | <?php |
31 | - echo "<li><p>Currently you have requested: $tickets_requested tickets. </p></li>"; |
|
32 | - echo "<li><p>Number of ticket that assigned to you: $tickets_assigned tickets.</p></li> "; |
|
33 | - echo "<li><p>You have resolved $tickets_resolved tickets.</p></li>"; |
|
34 | - ?> |
|
31 | + echo "<li><p>Currently you have requested: $tickets_requested tickets. </p></li>"; |
|
32 | + echo "<li><p>Number of ticket that assigned to you: $tickets_assigned tickets.</p></li> "; |
|
33 | + echo "<li><p>You have resolved $tickets_resolved tickets.</p></li>"; |
|
34 | + ?> |
|
35 | 35 | </ol><br/> |
36 | 36 | </td> |
37 | 37 | </tr> |
@@ -43,12 +43,12 @@ discard block |
||
43 | 43 | </thead> |
44 | 44 | <tbody> |
45 | 45 | <?php |
46 | - $news = $hdnews->get_headline_news(); |
|
47 | - foreach ($news as $thenews) { |
|
48 | - echo '<tr><td>'.date('d-M-Y', $thenews['newsdate']).'</td>'. |
|
49 | - '<td><a href=hdnewsread.php?id='.$thenews['id'].'>'.$thenews['title'].'</a></td></tr>'; |
|
50 | - } |
|
51 | - ?> |
|
46 | + $news = $hdnews->get_headline_news(); |
|
47 | + foreach ($news as $thenews) { |
|
48 | + echo '<tr><td>'.date('d-M-Y', $thenews['newsdate']).'</td>'. |
|
49 | + '<td><a href=hdnewsread.php?id='.$thenews['id'].'>'.$thenews['title'].'</a></td></tr>'; |
|
50 | + } |
|
51 | + ?> |
|
52 | 52 | </tbody> |
53 | 53 | </table> |
54 | 54 | <p> </p> |
@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | $general->logged_out_protect(); |
4 | 4 | $user = $users->userdata($_SESSION['loginid']); |
5 | 5 | if ($user['level'] != 'Admin') { |
6 | - exit("You don't have permission to access this page!"); |
|
6 | + exit("You don't have permission to access this page!"); |
|
7 | 7 | } |
8 | 8 | $news = $hdnews->get_news(); |
9 | 9 | ?> |
@@ -57,15 +57,15 @@ discard block |
||
57 | 57 | </thead> |
58 | 58 | <tbody> |
59 | 59 | <?php |
60 | - foreach ($news as $thenews) { |
|
61 | - echo '<td>'.date('d-M-Y', $thenews['newsdate']).'</td>'. |
|
62 | - '<td>'.'<a href=hdnewsedit.php?id='.$thenews['id'].'>'.$thenews['title'].'</td>'. |
|
63 | - '<td>'.$thenews['createdby'].'</td>'. |
|
64 | - '<td>'.date('d-M-Y', $thenews['createdon']).'</td>'. |
|
65 | - '<td>'.date('d-M-Y', $thenews['expired']).'</td>'. |
|
66 | - '<td><a href=hdnewsdel.php?id='.$thenews['id'].' onclick="return delete_confirm();">del</a></td></tr>'; |
|
67 | - } |
|
68 | - ?> |
|
60 | + foreach ($news as $thenews) { |
|
61 | + echo '<td>'.date('d-M-Y', $thenews['newsdate']).'</td>'. |
|
62 | + '<td>'.'<a href=hdnewsedit.php?id='.$thenews['id'].'>'.$thenews['title'].'</td>'. |
|
63 | + '<td>'.$thenews['createdby'].'</td>'. |
|
64 | + '<td>'.date('d-M-Y', $thenews['createdon']).'</td>'. |
|
65 | + '<td>'.date('d-M-Y', $thenews['expired']).'</td>'. |
|
66 | + '<td><a href=hdnewsdel.php?id='.$thenews['id'].' onclick="return delete_confirm();">del</a></td></tr>'; |
|
67 | + } |
|
68 | + ?> |
|
69 | 69 | </tbody> |
70 | 70 | </table> |
71 | 71 | <p> </p> |