Passed
Push — master ( 901674...46121d )
by Saepul
02:24
created
ticketnew.php 1 patch
Indentation   +79 added lines, -79 removed lines patch added patch discarded remove patch
@@ -5,64 +5,64 @@  discard block
 block discarded – undo
5 5
 $changeby = $_SESSION['loginid'];
6 6
 $documentedby = $_SESSION['loginid'];
7 7
 if (isset($_POST['submit'])) {
8
-    $lastticket = $tickets->get_last_ticket();
9
-    $id = $lastticket['id'] + 1;
10
-    $ticketnumber = $id.'/SR/'.date('M').'/'.date('Y'); //format nomor tiket
11
-    $sla = $_POST['sla'];
12
-    //$idcustomer		= $_POST['idcustomer'];
13
-    $reporteddate = strtotime($_POST['reporteddate']);
14
-    $reportedby = $_POST['reportedby'];
15
-    $telp = $_POST['telp'];
16
-    $email = $_POST['email'];
17
-    $problemsummary = $_POST['problemsummary'];
18
-    $problemdetail = $_POST['problemdetail'];
19
-    $ticketstatus = 'Assigned'; //ketika pertama kali dibuat, status="Assigned" ke salah satu teknisi
20
-    $assignee = $_POST['idassignee'];
21
-    $pro = $_POST['pro'];
22
-    $user_assignee = $users->userdata($assignee);
23
-    $email_assignee = $user_assignee['email'];
24
-    $changes = 'Create New Ticket';
25
-    $emailcc = '';
26
-    $emailbcc = '';
27
-    $fullname_assignee = $user_assignee['fullname'];
28
-    if ($sla == '1') {
29
-        $managers = $users->get_user_by_level('Manager');
30
-        $i = 0;
31
-        foreach ($managers as $manager) {
32
-            $manageremail[$i] = $manager['email'];
33
-            $emailcc .= $manageremail[$i].', ';
34
-            $i++;
35
-        }
36
-    }
37
-    $emailstatus = 'New';
38
-    $senddate = time();
39
-    $datasla = $slas->sla_data($sla);
40
-    $resolutiontime = $datasla['resolutiontime'];
41
-    $slasenddate = strtotime("+$resolutiontime hours", $senddate);
42
-    $emailsubject = "Ticket No: $ticketnumber has assigned to you";
43
-    $message =
8
+	$lastticket = $tickets->get_last_ticket();
9
+	$id = $lastticket['id'] + 1;
10
+	$ticketnumber = $id.'/SR/'.date('M').'/'.date('Y'); //format nomor tiket
11
+	$sla = $_POST['sla'];
12
+	//$idcustomer		= $_POST['idcustomer'];
13
+	$reporteddate = strtotime($_POST['reporteddate']);
14
+	$reportedby = $_POST['reportedby'];
15
+	$telp = $_POST['telp'];
16
+	$email = $_POST['email'];
17
+	$problemsummary = $_POST['problemsummary'];
18
+	$problemdetail = $_POST['problemdetail'];
19
+	$ticketstatus = 'Assigned'; //ketika pertama kali dibuat, status="Assigned" ke salah satu teknisi
20
+	$assignee = $_POST['idassignee'];
21
+	$pro = $_POST['pro'];
22
+	$user_assignee = $users->userdata($assignee);
23
+	$email_assignee = $user_assignee['email'];
24
+	$changes = 'Create New Ticket';
25
+	$emailcc = '';
26
+	$emailbcc = '';
27
+	$fullname_assignee = $user_assignee['fullname'];
28
+	if ($sla == '1') {
29
+		$managers = $users->get_user_by_level('Manager');
30
+		$i = 0;
31
+		foreach ($managers as $manager) {
32
+			$manageremail[$i] = $manager['email'];
33
+			$emailcc .= $manageremail[$i].', ';
34
+			$i++;
35
+		}
36
+	}
37
+	$emailstatus = 'New';
38
+	$senddate = time();
39
+	$datasla = $slas->sla_data($sla);
40
+	$resolutiontime = $datasla['resolutiontime'];
41
+	$slasenddate = strtotime("+$resolutiontime hours", $senddate);
42
+	$emailsubject = "Ticket No: $ticketnumber has assigned to you";
43
+	$message =
44 44
 "Dear $fullname_assignee, \r\n
45 45
 You are currently assign for this ticket.\r\n
46 46
 Please follow this link to resolved the ticket --> http://localhost/helpdesk/ticketedit.php?id=$id"." \r\n
47 47
 Thank you. \r\n
48 48
 Regards, \r\n
49 49
 Helpdesk";
50
-    $tickets->add_ticket($ticketnumber, $sla, $reporteddate, $reportedby, $telp, $email, $problemsummary, $problemdetail, $ticketstatus, $assignee, $documentedby, $pro);
51
-    $assigneddate = '';
52
-    $pendingby = '';
53
-    $pendingdate = '';
54
-    $resolution = '';
55
-    $resolvedby = '';
56
-    $resolveddate = '';
57
-    $closedby = '';
58
-    $closeddate = '';
59
-    $tickets->log_tickets($id, $sla, $reporteddate, $reportedby, $telp, $email, $problemsummary, $problemdetail, $ticketstatus, $assignee, $assigneddate, $pendingby, $pendingdate, $resolution, $resolvedby, $resolveddate, $closedby, $closeddate, $changes, $changeby);
60
-    $emails->add_email($id, $senddate, $email_assignee, $emailcc, $emailbcc, $emailsubject, $message, $emailstatus);
61
-    $emails->add_sla_remainder($id, $ticketnumber, $slasenddate, $email_assignee, $emailcc, $emailbcc, $emailsubject, $message);
62
-    $result = $emails->send_new_ticket();
63
-    //echo $result;
64
-    header("Location: ticketread.php?id=$id");
65
-    //echo $senddate."<br>".$resolutiontime."<br>".$slasenddate;
50
+	$tickets->add_ticket($ticketnumber, $sla, $reporteddate, $reportedby, $telp, $email, $problemsummary, $problemdetail, $ticketstatus, $assignee, $documentedby, $pro);
51
+	$assigneddate = '';
52
+	$pendingby = '';
53
+	$pendingdate = '';
54
+	$resolution = '';
55
+	$resolvedby = '';
56
+	$resolveddate = '';
57
+	$closedby = '';
58
+	$closeddate = '';
59
+	$tickets->log_tickets($id, $sla, $reporteddate, $reportedby, $telp, $email, $problemsummary, $problemdetail, $ticketstatus, $assignee, $assigneddate, $pendingby, $pendingdate, $resolution, $resolvedby, $resolveddate, $closedby, $closeddate, $changes, $changeby);
60
+	$emails->add_email($id, $senddate, $email_assignee, $emailcc, $emailbcc, $emailsubject, $message, $emailstatus);
61
+	$emails->add_sla_remainder($id, $ticketnumber, $slasenddate, $email_assignee, $emailcc, $emailbcc, $emailsubject, $message);
62
+	$result = $emails->send_new_ticket();
63
+	//echo $result;
64
+	header("Location: ticketread.php?id=$id");
65
+	//echo $senddate."<br>".$resolutiontime."<br>".$slasenddate;
66 66
 }
67 67
 ?>
68 68
 <!DOCTYPE HTML>
@@ -177,12 +177,12 @@  discard block
 block discarded – undo
177 177
 			<td> <select name="idcustomer" id="idcustomer">
178 178
 				<option></option>
179 179
 			// <?php
180
-                // $customers = $customers->get_customers();
181
-                // foreach ($customers as $customerval)
182
-                // {
183
-                    // echo '<option value=' . $customerval['idcustomer'] . '>' .  $customerval['namacustomer'] . '</option>';
184
-                // }
185
-            //?>
180
+				// $customers = $customers->get_customers();
181
+				// foreach ($customers as $customerval)
182
+				// {
183
+					// echo '<option value=' . $customerval['idcustomer'] . '>' .  $customerval['namacustomer'] . '</option>';
184
+				// }
185
+			//?>
186 186
 			</select></td>
187 187
 		</tr>
188 188
 		<tr>
@@ -220,12 +220,12 @@  discard block
 block discarded – undo
220 220
 			<td> Urgency (SLA)*</td><td> : </td>
221 221
 			<td><select name="sla">
222 222
 				<?php 
223
-                    $sla = $slas->get_sla();
224
-                    echo '<option value="'.$slaval['slaid'].'" selected="selected">'.$slaval['namasla'].'</option>';
225
-                    foreach ($sla as $slaval) {
226
-                        echo '<option value="'.$slaval['slaid'].'">'.$slaval['namasla'].'</option>';
227
-                    }
228
-                ?>
223
+					$sla = $slas->get_sla();
224
+					echo '<option value="'.$slaval['slaid'].'" selected="selected">'.$slaval['namasla'].'</option>';
225
+					foreach ($sla as $slaval) {
226
+						echo '<option value="'.$slaval['slaid'].'">'.$slaval['namasla'].'</option>';
227
+					}
228
+				?>
229 229
 				</select>
230 230
 			</td>
231 231
 		</tr>
@@ -233,11 +233,11 @@  discard block
 block discarded – undo
233 233
 			<td> Type</td><td> : </td>
234 234
 			<td><select name="pro">
235 235
 				<?php 
236
-                    //$pro = $slas->get_sla();
237
-                    echo '<option value=""></option>';
238
-                    echo '<option value="Hardware">Hardware</option>';
239
-                    echo '<option value="Software">Software</option>';
240
-                ?>
236
+					//$pro = $slas->get_sla();
237
+					echo '<option value=""></option>';
238
+					echo '<option value="Hardware">Hardware</option>';
239
+					echo '<option value="Software">Software</option>';
240
+				?>
241 241
 				</select>
242 242
 			</td>
243 243
 		</tr>
@@ -254,12 +254,12 @@  discard block
 block discarded – undo
254 254
 			<td> <select name="idassignee">
255 255
 				<option> </option>
256 256
 			<?php
257
-                $Asignees = $users->get_users();
258
-                foreach ($Asignees as $user) {
259
-                    //echo '<option value=' . $user['id'] . '>' .  $user['fullname'] . '</option>';
260
-                    echo '<option selected value='.$user['id'].'>'.$user['fullname'].'</option>';
261
-                }
262
-            ?>
257
+				$Asignees = $users->get_users();
258
+				foreach ($Asignees as $user) {
259
+					//echo '<option value=' . $user['id'] . '>' .  $user['fullname'] . '</option>';
260
+					echo '<option selected value='.$user['id'].'>'.$user['fullname'].'</option>';
261
+				}
262
+			?>
263 263
 			</select> </td>
264 264
 		</tr>
265 265
 		<tr>
@@ -283,9 +283,9 @@  discard block
 block discarded – undo
283 283
 	</form>
284 284
 
285 285
 	<?php 
286
-    if (empty($errors) === false) {
287
-        echo '<p class=errormsg>'.implode('</p><p class=errormsg>', $errors).'</p>';
288
-    }
289
-    ?>
286
+	if (empty($errors) === false) {
287
+		echo '<p class=errormsg>'.implode('</p><p class=errormsg>', $errors).'</p>';
288
+	}
289
+	?>
290 290
 </body>
291 291
 </html>
292 292
\ No newline at end of file
Please login to merge, or discard this patch.
useradd.php 1 patch
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -2,23 +2,23 @@  discard block
 block discarded – undo
2 2
 require 'core/init.php';
3 3
 $general->logged_out_protect();
4 4
 if (isset($_POST['submit'])) {
5
-    if ($users->user_exists($_POST['username']) == true && !empty($_POST['username'])) {
6
-        $errors[] = 'Sorry, username '.$_POST['username'].' is already exists!';
7
-    }
8
-    if ($users->email_exists($_POST['email']) == true && !empty($_POST['email'])) {
9
-        $errors[] = 'Sorry, email '.$_POST['email'].' is already exists!';
10
-    }
11
-    if (empty($errors) === true) {
12
-        $fullname = $_POST['fullname'];
13
-        $username = htmlentities($_POST['username']);
14
-        $password = $_POST['password'];
15
-        $email = htmlentities($_POST['email']);
16
-        $Telp = $_POST['telp'];
17
-        $level = $_POST['level'];
18
-        $locked = $_POST['locked'];
19
-        $users->register($username, $password, $email, $fullname, $Telp, $level, $locked);
20
-        header('Location: userlist.php');
21
-    }
5
+	if ($users->user_exists($_POST['username']) == true && !empty($_POST['username'])) {
6
+		$errors[] = 'Sorry, username '.$_POST['username'].' is already exists!';
7
+	}
8
+	if ($users->email_exists($_POST['email']) == true && !empty($_POST['email'])) {
9
+		$errors[] = 'Sorry, email '.$_POST['email'].' is already exists!';
10
+	}
11
+	if (empty($errors) === true) {
12
+		$fullname = $_POST['fullname'];
13
+		$username = htmlentities($_POST['username']);
14
+		$password = $_POST['password'];
15
+		$email = htmlentities($_POST['email']);
16
+		$Telp = $_POST['telp'];
17
+		$level = $_POST['level'];
18
+		$locked = $_POST['locked'];
19
+		$users->register($username, $password, $email, $fullname, $Telp, $level, $locked);
20
+		header('Location: userlist.php');
21
+	}
22 22
 }
23 23
 ?>
24 24
 <!DOCTYPE HTML>
@@ -102,9 +102,9 @@  discard block
 block discarded – undo
102 102
 	</fieldset>
103 103
 	</form>
104 104
 	<?php 
105
-    if (empty($errors) === false) {
106
-        echo '<p class=errormsg>'.implode('</p><p class=errormsg>', $errors).'</p>';
107
-    }
108
-    ?>
105
+	if (empty($errors) === false) {
106
+		echo '<p class=errormsg>'.implode('</p><p class=errormsg>', $errors).'</p>';
107
+	}
108
+	?>
109 109
 </body>
110 110
 </html>
111 111
\ No newline at end of file
Please login to merge, or discard this patch.
projectlist.php 1 patch
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
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
 $projects = $projects->get_projects();
9 9
 $projects_count = count($projects);
@@ -67,25 +67,25 @@  discard block
 block discarded – undo
67 67
     </thead>
68 68
     <tbody>
69 69
 		<?php 
70
-        foreach ($projects as $project) {
71
-            $customer = $customers->customer_data($project['idcustomer']);
72
-            $disp_id_project = sprintf('%04s', $project['projectid']);
73
-            echo '<tr><td><a href=projectedit.php?id='.$project['projectid'].'>'.$disp_id_project.'</a></td>'.
74
-                 '<td>'.$customer['namacustomer'].'</td>'.
75
-                 '<td>'.date('d-M-Y', $project['deliverybegin']).'</td>'.
76
-                 '<td>'.date('d-M-Y', $project['deliveryend']).'</td>'.
77
-                 '<td>'.date('d-M-Y', $project['installbegin']).'</td>'.
78
-                 '<td>'.date('d-M-Y', $project['installend']).'</td>'.
79
-                 '<td>'.date('d-M-Y', $project['uatbegin']).'</td>'.
80
-                 '<td>'.date('d-M-Y', $project['uatend']).'</td>'.
81
-                 '<td>'.date('d-M-Y', $project['billstartdate']).'</td>'.
82
-                 '<td>'.date('d-M-Y', $project['billduedate']).'</td>'.
83
-                 '<td>'.$project['warrantyperiod'].' Year</td>'.
84
-                 '<td>'.date('d-M-Y', $project['contractstartdate']).'</td>'.
85
-                 '<td>'.$project['contractperiod'].' Month</td>'.
86
-                 '<td><a href=projectdel.php?id='.$project['projectid'].' onclick="return delete_confirm();">del</a></td></tr>';
87
-        }
88
-        ?>
70
+		foreach ($projects as $project) {
71
+			$customer = $customers->customer_data($project['idcustomer']);
72
+			$disp_id_project = sprintf('%04s', $project['projectid']);
73
+			echo '<tr><td><a href=projectedit.php?id='.$project['projectid'].'>'.$disp_id_project.'</a></td>'.
74
+				 '<td>'.$customer['namacustomer'].'</td>'.
75
+				 '<td>'.date('d-M-Y', $project['deliverybegin']).'</td>'.
76
+				 '<td>'.date('d-M-Y', $project['deliveryend']).'</td>'.
77
+				 '<td>'.date('d-M-Y', $project['installbegin']).'</td>'.
78
+				 '<td>'.date('d-M-Y', $project['installend']).'</td>'.
79
+				 '<td>'.date('d-M-Y', $project['uatbegin']).'</td>'.
80
+				 '<td>'.date('d-M-Y', $project['uatend']).'</td>'.
81
+				 '<td>'.date('d-M-Y', $project['billstartdate']).'</td>'.
82
+				 '<td>'.date('d-M-Y', $project['billduedate']).'</td>'.
83
+				 '<td>'.$project['warrantyperiod'].' Year</td>'.
84
+				 '<td>'.date('d-M-Y', $project['contractstartdate']).'</td>'.
85
+				 '<td>'.$project['contractperiod'].' Month</td>'.
86
+				 '<td><a href=projectdel.php?id='.$project['projectid'].' onclick="return delete_confirm();">del</a></td></tr>';
87
+		}
88
+		?>
89 89
     </tbody>
90 90
 	</table>
91 91
 	<p>&nbsp;</p>
Please login to merge, or discard this patch.
myticketbyrequester.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -51,20 +51,20 @@
 block discarded – undo
51 51
     </thead>
52 52
     <tbody>
53 53
 		<?php 
54
-        foreach ($tickets as $ticket) {
55
-            $sla = $slas->sla_data($ticket['sla']);
56
-            $customer = $customers->customer_data($ticket['idcustomer']);
57
-            $user = $users->userdata($ticket['assignee']);
58
-            echo '<tr><td><a href=ticketedituser.php?id='.$ticket['id'].'>'.$ticket['ticketnumber'].'</a></td>'.
59
-                 '<td>'.$sla['namasla'].'</td>'.
60
-                 '<td>'.$customer['namacustomer'].'</td>'.
61
-                 '<td>'.date('d-M-Y', $ticket['reporteddate']).'</td>'.
62
-                 '<td>'.$ticket['reportedby'].'</td>'.
63
-                 '<td>'.$ticket['problemsummary'].'</td>'.
64
-                 '<td>'.$ticket['ticketstatus'].'</td>'.
65
-                 '<td>'.$user['fullname'].'</td></tr>';
66
-        }
67
-        ?>
54
+		foreach ($tickets as $ticket) {
55
+			$sla = $slas->sla_data($ticket['sla']);
56
+			$customer = $customers->customer_data($ticket['idcustomer']);
57
+			$user = $users->userdata($ticket['assignee']);
58
+			echo '<tr><td><a href=ticketedituser.php?id='.$ticket['id'].'>'.$ticket['ticketnumber'].'</a></td>'.
59
+				 '<td>'.$sla['namasla'].'</td>'.
60
+				 '<td>'.$customer['namacustomer'].'</td>'.
61
+				 '<td>'.date('d-M-Y', $ticket['reporteddate']).'</td>'.
62
+				 '<td>'.$ticket['reportedby'].'</td>'.
63
+				 '<td>'.$ticket['problemsummary'].'</td>'.
64
+				 '<td>'.$ticket['ticketstatus'].'</td>'.
65
+				 '<td>'.$user['fullname'].'</td></tr>';
66
+		}
67
+		?>
68 68
     </tbody>
69 69
 	</table>
70 70
 	<p>&nbsp;</p>
Please login to merge, or discard this patch.
slaadd.php 2 patches
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -3,21 +3,21 @@  discard block
 block discarded – undo
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
 
9 9
 if (isset($_POST['submit'])) {
10
-    $slaid = $_POST['slaid'];
11
-    $namasla = $_POST['namasla'];
12
-    $responsetime = $_POST['responsetime'];
13
-    $resolutiontime = $_POST['resolutiontime'];
14
-    $slawarning = $_POST['slawarning'];
15
-    if ($slas->sla_exists($slaid) === true) {
16
-        $errors[] = 'SLA ID is already exists!';
17
-    } else {
18
-        $slas->add_sla($slaid, $namasla, $responsetime, $resolutiontime, $slawarning);
19
-        header('location:slalist.php');
20
-    }
10
+	$slaid = $_POST['slaid'];
11
+	$namasla = $_POST['namasla'];
12
+	$responsetime = $_POST['responsetime'];
13
+	$resolutiontime = $_POST['resolutiontime'];
14
+	$slawarning = $_POST['slawarning'];
15
+	if ($slas->sla_exists($slaid) === true) {
16
+		$errors[] = 'SLA ID is already exists!';
17
+	} else {
18
+		$slas->add_sla($slaid, $namasla, $responsetime, $resolutiontime, $slawarning);
19
+		header('location:slalist.php');
20
+	}
21 21
 }
22 22
 ?>
23 23
 <!DOCTYPE HTML>
@@ -100,9 +100,9 @@  discard block
 block discarded – undo
100 100
 	</fieldset>
101 101
 	</form>
102 102
 	<?php 
103
-    if (empty($errors) === false) {
104
-        echo '<p class=errormsg>'.implode('</p><p class=errormsg>', $errors).'</p>';
105
-    }
106
-    ?>
103
+	if (empty($errors) === false) {
104
+		echo '<p class=errormsg>'.implode('</p><p class=errormsg>', $errors).'</p>';
105
+	}
106
+	?>
107 107
 </body>
108 108
 </html>
109 109
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
     $slawarning = $_POST['slawarning'];
15 15
     if ($slas->sla_exists($slaid) === true) {
16 16
         $errors[] = 'SLA ID is already exists!';
17
-    } else {
17
+    }else {
18 18
         $slas->add_sla($slaid, $namasla, $responsetime, $resolutiontime, $slawarning);
19 19
         header('location:slalist.php');
20 20
     }
Please login to merge, or discard this patch.
searchticket.php 1 patch
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -10,11 +10,11 @@  discard block
 block discarded – undo
10 10
 $p2 = strtotime($period2);
11 11
 $listtickets = $tickets->search_closed_ticket($p1, $p2);
12 12
 if (isset($_POST['submit'])) {
13
-    $period1 = strtotime($_POST['period1']);
14
-    $period2 = strtotime($_POST['period2']);
15
-    $listtickets = $tickets->search_closed_ticket($period1, $period2);
16
-    $period1 = date('d-M-Y', $period1);
17
-    $period2 = date('d-M-Y', $period2);
13
+	$period1 = strtotime($_POST['period1']);
14
+	$period2 = strtotime($_POST['period2']);
15
+	$listtickets = $tickets->search_closed_ticket($period1, $period2);
16
+	$period1 = date('d-M-Y', $period1);
17
+	$period2 = date('d-M-Y', $period2);
18 18
 }
19 19
 ?>
20 20
 <!doctype html>
@@ -79,20 +79,20 @@  discard block
 block discarded – undo
79 79
     </thead>
80 80
     <tbody>
81 81
 		<?php 
82
-        foreach ($listtickets as $ticket) {
83
-            $sla = $slas->sla_data($ticket['sla']);
84
-            $customer = $customers->customer_data($ticket['idcustomer']);
85
-            $user = $users->userdata($ticket['assignee']);
86
-            echo '<tr><td><a href=ticketread.php?id='.$ticket['id'].'>'.$ticket['ticketnumber'].'</a></td>'.
87
-                 '<td>'.$sla['namasla'].'</td>'.
88
-                 '<td>'.$customer['namacustomer'].'</td>'.
89
-                 '<td>'.date('d-M-Y', $ticket['reporteddate']).'</td>'.
90
-                 '<td>'.$ticket['reportedby'].'</td>'.
91
-                 '<td>'.$ticket['problemsummary'].'</td>'.
92
-                 '<td>'.$ticket['ticketstatus'].'</td>'.
93
-                 '<td>'.$user['fullname'].'</td></tr>';
94
-        }
95
-        ?>
82
+		foreach ($listtickets as $ticket) {
83
+			$sla = $slas->sla_data($ticket['sla']);
84
+			$customer = $customers->customer_data($ticket['idcustomer']);
85
+			$user = $users->userdata($ticket['assignee']);
86
+			echo '<tr><td><a href=ticketread.php?id='.$ticket['id'].'>'.$ticket['ticketnumber'].'</a></td>'.
87
+				 '<td>'.$sla['namasla'].'</td>'.
88
+				 '<td>'.$customer['namacustomer'].'</td>'.
89
+				 '<td>'.date('d-M-Y', $ticket['reporteddate']).'</td>'.
90
+				 '<td>'.$ticket['reportedby'].'</td>'.
91
+				 '<td>'.$ticket['problemsummary'].'</td>'.
92
+				 '<td>'.$ticket['ticketstatus'].'</td>'.
93
+				 '<td>'.$user['fullname'].'</td></tr>';
94
+		}
95
+		?>
96 96
     </tbody>
97 97
 	<tfoot>
98 98
     <tr>
Please login to merge, or discard this patch.
ticketedituser.php 1 patch
Indentation   +59 added lines, -59 removed lines patch added patch discarded remove patch
@@ -6,50 +6,50 @@  discard block
 block discarded – undo
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 = $_POST['reporteddate'];
15
-    $reportedmonth = $_POST['reportedmonth'];
16
-    $reportedyear = $_POST['reportedyear'];
17
-    $datetimeStr = $reportedyear.'-'.$reportedmonth.'-'.$reporteddate;
18
-    $reporteddate = strtotime($datetimeStr);
13
+	$sla = $_POST['sla'];
14
+	$reporteddate = $_POST['reporteddate'];
15
+	$reportedmonth = $_POST['reportedmonth'];
16
+	$reportedyear = $_POST['reportedyear'];
17
+	$datetimeStr = $reportedyear.'-'.$reportedmonth.'-'.$reporteddate;
18
+	$reporteddate = strtotime($datetimeStr);
19 19
 
20
-    $reportedby = $_POST['reportedby'];
21
-    $telp = $_POST['telp'];
22
-    $email = $_POST['email'];
23
-    $problemsummary = $_POST['problemsummary'];
24
-    $problemdetail = $_POST['problemdetail'];
25
-    $assignee = $_POST['idassignee'];
26
-    $ticketstatus = $_POST['ticketstatus'];
27
-    $resolution = $_POST['resolution'];
28
-    $pendingby = $_POST['pendingby'];
29
-    $pendingdate = $_POST['pendingdate'];
30
-    $resolvedby = $_POST['resolvedby'];
31
-    $resolveddate = $_POST['resolveddate'];
32
-    $closedby = $_POST['closedby'];
33
-    $closeddate = $_POST['closeddate'];
34
-    $changes = 'Re-assigned the ticket.';
35
-    if ($ticketstatus == 'Pending') {
36
-        $pendingby = $user['username'];
37
-        $pendingdate = strtotime(now);
38
-        $changes = 'Change Status to Pending.';
39
-    }
40
-    if ($ticketstatus == 'Resolved') {
41
-        $resolvedby = $user['username'];
42
-        $resolveddate = strtotime(now);
43
-        $changes = 'Change Status to Resolved.';
44
-    }
45
-    if ($ticketstatus == 'Closed') {
46
-        $closedby = $user['username'];
47
-        $closeddate = strtotime(now);
48
-        $changes = 'Change Status to Closed.';
49
-    }
50
-    $tickets->update_ticket($id, $sla, $reporteddate, $reportedby, $telp, $email, $problemsummary, $problemdetail, $ticketstatus, $assignee, $assigneddate, $pendingby, $pendingdate, $resolution, $resolvedby, $resolveddate, $closedby, $closeddate);
51
-    $tickets->log_tickets($id, $sla, $reporteddate, $reportedby, $telp, $email, $problemsummary, $problemdetail, $ticketstatus, $assignee, $assigneddate, $pendingby, $pendingdate, $resolution, $resolvedby, $resolveddate, $closedby, $closeddate, $changes, $changeby);
52
-    header('Location: ticketlistuser.php');
20
+	$reportedby = $_POST['reportedby'];
21
+	$telp = $_POST['telp'];
22
+	$email = $_POST['email'];
23
+	$problemsummary = $_POST['problemsummary'];
24
+	$problemdetail = $_POST['problemdetail'];
25
+	$assignee = $_POST['idassignee'];
26
+	$ticketstatus = $_POST['ticketstatus'];
27
+	$resolution = $_POST['resolution'];
28
+	$pendingby = $_POST['pendingby'];
29
+	$pendingdate = $_POST['pendingdate'];
30
+	$resolvedby = $_POST['resolvedby'];
31
+	$resolveddate = $_POST['resolveddate'];
32
+	$closedby = $_POST['closedby'];
33
+	$closeddate = $_POST['closeddate'];
34
+	$changes = 'Re-assigned the ticket.';
35
+	if ($ticketstatus == 'Pending') {
36
+		$pendingby = $user['username'];
37
+		$pendingdate = strtotime(now);
38
+		$changes = 'Change Status to Pending.';
39
+	}
40
+	if ($ticketstatus == 'Resolved') {
41
+		$resolvedby = $user['username'];
42
+		$resolveddate = strtotime(now);
43
+		$changes = 'Change Status to Resolved.';
44
+	}
45
+	if ($ticketstatus == 'Closed') {
46
+		$closedby = $user['username'];
47
+		$closeddate = strtotime(now);
48
+		$changes = 'Change Status to Closed.';
49
+	}
50
+	$tickets->update_ticket($id, $sla, $reporteddate, $reportedby, $telp, $email, $problemsummary, $problemdetail, $ticketstatus, $assignee, $assigneddate, $pendingby, $pendingdate, $resolution, $resolvedby, $resolveddate, $closedby, $closeddate);
51
+	$tickets->log_tickets($id, $sla, $reporteddate, $reportedby, $telp, $email, $problemsummary, $problemdetail, $ticketstatus, $assignee, $assigneddate, $pendingby, $pendingdate, $resolution, $resolvedby, $resolveddate, $closedby, $closeddate, $changes, $changeby);
52
+	header('Location: ticketlistuser.php');
53 53
 }
54 54
 ?>
55 55
 <!DOCTYPE HTML>
@@ -95,9 +95,9 @@  discard block
 block discarded – undo
95 95
 			<td width="120"> Customer </td><td> : </td>
96 96
 			<td> 
97 97
 			<?php 
98
-                $customer = $customers->customer_data($ticket['idcustomer']);
99
-                echo $customer['namacustomer'];
100
-            ?> </td>
98
+				$customer = $customers->customer_data($ticket['idcustomer']);
99
+				echo $customer['namacustomer'];
100
+			?> </td>
101 101
 		</tr>
102 102
 		<tr>
103 103
 			<td> Customer Product</td><td> : </td>
@@ -107,16 +107,16 @@  discard block
 block discarded – undo
107 107
 			<td> Warranty Period</td><td> : </td>
108 108
 			<td> 
109 109
 			<?php 
110
-                $project = $projects->get_project_customer($customer['idcustomer']);
111
-                echo $project['warrantyperiod'].' Year';
112
-            ?> </td>
110
+				$project = $projects->get_project_customer($customer['idcustomer']);
111
+				echo $project['warrantyperiod'].' Year';
112
+			?> </td>
113 113
 		</tr>
114 114
 		<tr>
115 115
 			<td> Contract Period</td><td> : </td>
116 116
 			<td>
117 117
 			<?php
118
-                echo $project['contractperiod'].' Month';
119
-            ?>
118
+				echo $project['contractperiod'].' Month';
119
+			?>
120 120
 			</td>
121 121
 		</tr>
122 122
 	</table>-->
@@ -176,8 +176,8 @@  discard block
 block discarded – undo
176 176
 			<td> <input type="hidden" name="oldticketstatus" value="<?php echo $ticket['ticketstatus']; ?>"> 
177 177
 			<select name="ticketstatus">
178 178
 				<?php
179
-                    echo '<option value='.$ticket['ticketstatus'].' selected="selected">'.$ticket['ticketstatus'].'</option>';
180
-                ?>
179
+					echo '<option value='.$ticket['ticketstatus'].' selected="selected">'.$ticket['ticketstatus'].'</option>';
180
+				?>
181 181
 				<option value="Assigned"> Assigned </option>
182 182
 				<option value="Resolved"> Resolved </option>
183 183
 				<option value="Pending"> Pending </option>
@@ -215,14 +215,14 @@  discard block
 block discarded – undo
215 215
 	<table class="formtable">
216 216
 	<tr bgcolor="#e0e0e0" ><td width="150">Updated On</td><td width="150">Updated By</td><td>Description</td></tr>
217 217
 	<?php
218
-        $list_log_tickets = $tickets->get_audit_trail($id);
219
-        foreach ($list_log_tickets as $log_ticket) {
220
-            $changed_by = $users->userdata($log_ticket['changeby']);
221
-            echo '<tr><td>'.date('d-M-Y H:i:s', $log_ticket['changedate']).'</td>'.
222
-                 '<td>'.$changed_by['fullname'].'</td>'.
223
-                 '<td>'.$log_ticket['changes'].'</td></tr>';
224
-        }
225
-    ?>
218
+		$list_log_tickets = $tickets->get_audit_trail($id);
219
+		foreach ($list_log_tickets as $log_ticket) {
220
+			$changed_by = $users->userdata($log_ticket['changeby']);
221
+			echo '<tr><td>'.date('d-M-Y H:i:s', $log_ticket['changedate']).'</td>'.
222
+				 '<td>'.$changed_by['fullname'].'</td>'.
223
+				 '<td>'.$log_ticket['changes'].'</td></tr>';
224
+		}
225
+	?>
226 226
 	</table>
227 227
 	</fieldset>
228 228
 	<br/><br/>
Please login to merge, or discard this patch.
ticketlist.php 2 patches
Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -3,12 +3,12 @@  discard block
 block discarded – undo
3 3
 $general->logged_out_protect();
4 4
 $user = $users->userdata($_SESSION['loginid']);
5 5
 if ($user['level'] == 'Admin' || $user['level'] == 'Manager') {
6
-    $akses = true;
6
+	$akses = true;
7 7
 } else {
8
-    $akses = false;
8
+	$akses = false;
9 9
 }
10 10
 if ($akses = false) {
11
-    exit("You don't have permission to access this page!");
11
+	exit("You don't have permission to access this page!");
12 12
 }
13 13
 $ticket_list = $tickets->get_tickets();
14 14
 $tickets_count = count($ticket_list);
@@ -71,37 +71,37 @@  discard block
 block discarded – undo
71 71
     </thead>
72 72
     <tbody>
73 73
 		<?php 
74
-        foreach ($ticket_list as $ticket) {
75
-            $sla = $slas->sla_data($ticket['sla']);
76
-            $documenteddate = $ticket['documenteddate'];
77
-            $resolutiontime = $sla['resolutiontime'];
78
-            $slawarning = $sla['slawarning'];
79
-            $slagoaltime = strtotime("+$resolutiontime hours", $documenteddate);
80
-            $slawarningtime = strtotime("+$slawarning hours", $documenteddate);
81
-            if ($currenttime > $slagoaltime) {
82
-                $slabgcolor = '#FF0000';
83
-                $slatxtcolor = '#ffffff';
84
-            } elseif ($currenttime >= $slawarningtime) {
85
-                $slabgcolor = '#FFFF00';
86
-                $slatxtcolor = '#000000';
87
-            } else {
88
-                $slabgcolor = '#00FF00';
89
-                $slatxtcolor = '#000000';
90
-            }
91
-            $customer = $customers->customer_data($ticket['idcustomer']);
92
-            $user = $users->userdata($ticket['assignee']);
93
-            echo '<tr><td><a href=ticketedit.php?id='.$ticket['id'].'>'.$ticket['ticketnumber'].'</a></td>'.
94
-                 '<td style="background-color:'.$slabgcolor.';color:'.$slatxtcolor.';">'.$sla['namasla'].'</td>'.
95
-                 '<td>'.date('d-M-Y H:i:s', $slagoaltime).'</td>'.
96
-                 '<td>'.$customer['namacustomer'].'</td>'.
97
-                 '<td>'.date('d-M-Y H:i:s', $ticket['reporteddate']).'</td>'.
98
-                 '<td>'.date('d-M-Y H:i:s', $ticket['documenteddate']).'</td>'.
99
-                 '<td>'.$ticket['problemsummary'].'</td>'.
100
-                 '<td>'.$ticket['ticketstatus'].'</td>'.
101
-                 '<td>'.$user['fullname'].'</td>'.
102
-                 '<td><a href=ticketdel.php?id='.$ticket['id'].' onclick="return delete_confirm();">del</a></td></tr>';
103
-        }
104
-        ?>
74
+		foreach ($ticket_list as $ticket) {
75
+			$sla = $slas->sla_data($ticket['sla']);
76
+			$documenteddate = $ticket['documenteddate'];
77
+			$resolutiontime = $sla['resolutiontime'];
78
+			$slawarning = $sla['slawarning'];
79
+			$slagoaltime = strtotime("+$resolutiontime hours", $documenteddate);
80
+			$slawarningtime = strtotime("+$slawarning hours", $documenteddate);
81
+			if ($currenttime > $slagoaltime) {
82
+				$slabgcolor = '#FF0000';
83
+				$slatxtcolor = '#ffffff';
84
+			} elseif ($currenttime >= $slawarningtime) {
85
+				$slabgcolor = '#FFFF00';
86
+				$slatxtcolor = '#000000';
87
+			} else {
88
+				$slabgcolor = '#00FF00';
89
+				$slatxtcolor = '#000000';
90
+			}
91
+			$customer = $customers->customer_data($ticket['idcustomer']);
92
+			$user = $users->userdata($ticket['assignee']);
93
+			echo '<tr><td><a href=ticketedit.php?id='.$ticket['id'].'>'.$ticket['ticketnumber'].'</a></td>'.
94
+				 '<td style="background-color:'.$slabgcolor.';color:'.$slatxtcolor.';">'.$sla['namasla'].'</td>'.
95
+				 '<td>'.date('d-M-Y H:i:s', $slagoaltime).'</td>'.
96
+				 '<td>'.$customer['namacustomer'].'</td>'.
97
+				 '<td>'.date('d-M-Y H:i:s', $ticket['reporteddate']).'</td>'.
98
+				 '<td>'.date('d-M-Y H:i:s', $ticket['documenteddate']).'</td>'.
99
+				 '<td>'.$ticket['problemsummary'].'</td>'.
100
+				 '<td>'.$ticket['ticketstatus'].'</td>'.
101
+				 '<td>'.$user['fullname'].'</td>'.
102
+				 '<td><a href=ticketdel.php?id='.$ticket['id'].' onclick="return delete_confirm();">del</a></td></tr>';
103
+		}
104
+		?>
105 105
     </tbody>
106 106
 	</table>
107 107
 	<p>&nbsp;</p>
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
 $user = $users->userdata($_SESSION['loginid']);
6 6
 if ($user['level'] == 'Admin' || $user['level'] == 'Manager') {
7 7
     $akses = true;
8
-} else {
8
+}else {
9 9
     $akses = false;
10 10
 }
11 11
 if ($akses = false) {
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
             } elseif ($currenttime >= $slawarningtime) {
79 79
                 $slabgcolor = '#FFFF00';
80 80
                 $slatxtcolor = '#000000';
81
-            } else {
81
+            }else {
82 82
                 $slabgcolor = '#00FF00';
83 83
                 $slatxtcolor = '#000000';
84 84
             }
Please login to merge, or discard this patch.
slalist.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
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
 $sla = $slas->get_sla();
9 9
 ?>
@@ -58,15 +58,15 @@  discard block
 block discarded – undo
58 58
     </thead>
59 59
     <tbody>
60 60
 		<?php 
61
-        foreach ($sla as $slaval) {
62
-            echo '<tr><td>'.$slaval['slaid'].'</td>'.
63
-                 '<td><a href=slaedit.php?id='.$slaval['slaid'].'>'.$slaval['namasla'].'</a></td>'.
64
-                 '<td>'.$slaval['responsetime'].' Hours</td>'.
65
-                 '<td>'.$slaval['resolutiontime'].' Hours</td>'.
66
-                 '<td>'.$slaval['slawarning'].' Hours</td>'.
67
-                 '<td><a href=sladel.php?id='.$slaval['slaid'].' onclick="return delete_confirm();">del</a></td></tr>';
68
-        }
69
-        ?>
61
+		foreach ($sla as $slaval) {
62
+			echo '<tr><td>'.$slaval['slaid'].'</td>'.
63
+				 '<td><a href=slaedit.php?id='.$slaval['slaid'].'>'.$slaval['namasla'].'</a></td>'.
64
+				 '<td>'.$slaval['responsetime'].' Hours</td>'.
65
+				 '<td>'.$slaval['resolutiontime'].' Hours</td>'.
66
+				 '<td>'.$slaval['slawarning'].' Hours</td>'.
67
+				 '<td><a href=sladel.php?id='.$slaval['slaid'].' onclick="return delete_confirm();">del</a></td></tr>';
68
+		}
69
+		?>
70 70
     </tbody>
71 71
 	</table>
72 72
 	</div>
Please login to merge, or discard this patch.