Passed
Branch master (1c14b0)
by Saepul
02:59
created
useradd.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,10 +3,10 @@
 block discarded – undo
3 3
 $general->logged_out_protect();
4 4
 if (isset($_POST['submit'])) 
5 5
 {	if ($users->user_exists($_POST['username']) == true && !empty($_POST['username']))
6
-    {	$errors[] = 'Sorry, username '.$_POST['username'].' is already exists!';
6
+	{	$errors[] = 'Sorry, username '.$_POST['username'].' is already exists!';
7 7
 	}
8 8
 	if ($users->email_exists($_POST['email']) == true && !empty($_POST['email']))
9
-    {	$errors[] = 'Sorry, email '.$_POST['email'].' is already exists!';
9
+	{	$errors[] = 'Sorry, email '.$_POST['email'].' is already exists!';
10 10
 	}
11 11
 	if(empty($errors) === true)
12 12
 	{	$fullname 	= $_POST['fullname'];
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -8,15 +8,15 @@  discard block
 block discarded – undo
8 8
 	if ($users->email_exists($_POST['email']) == true && !empty($_POST['email']))
9 9
     {	$errors[] = 'Sorry, email '.$_POST['email'].' is already exists!';
10 10
 	}
11
-	if(empty($errors) === true)
12
-	{	$fullname 	= $_POST['fullname'];
11
+	if (empty($errors) === true)
12
+	{	$fullname = $_POST['fullname'];
13 13
 		$username 	= htmlentities($_POST['username']);
14 14
 		$password 	= $_POST['password'];
15 15
 		$email 		= htmlentities($_POST['email']);
16
-		$Telp 		= $_POST['telp'];
16
+		$Telp = $_POST['telp'];
17 17
 		$level 		= $_POST['level'];
18 18
 		$locked 	= $_POST['locked'];
19
-		$users->register($username,$password,$email,$fullname,$Telp,$level,$locked);
19
+		$users->register($username, $password, $email, $fullname, $Telp, $level, $locked);
20 20
 		header('Location: userlist.php');
21 21
 	}
22 22
 }
@@ -102,8 +102,8 @@  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>';
105
+	if (empty($errors) === false) {
106
+		echo '<p class=errormsg>'.implode('</p><p class=errormsg>', $errors).'</p>';
107 107
 	}
108 108
 	?>
109 109
 </body>
Please login to merge, or discard this patch.
projectdel.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php 
2 2
 require 'core/init.php';
3 3
 $general->logged_out_protect();
4
-$id=$_GET['id'];
4
+$id = $_GET['id'];
5 5
 $projects->delete($id);
6 6
 header('location: projectlist.php');
7 7
 ?>
8 8
\ No newline at end of file
Please login to merge, or discard this patch.
popularsolution.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -2,8 +2,8 @@  discard block
 block discarded – undo
2 2
 require 'core/init.php';
3 3
 $general->logged_out_protect();
4 4
 $user = $users->userdata($_SESSION['loginid']);
5
-$tickets 		= $tickets->get_tickets_by_status("Closed");
6
-$tickets_count 	= count($tickets);
5
+$tickets = $tickets->get_tickets_by_status("Closed");
6
+$tickets_count = count($tickets);
7 7
 ?>
8 8
 <!DOCTYPE HTML>
9 9
 <html>
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 			$sla = $slas->sla_data($ticket['sla']);
54 54
 			$customer = $customers->customer_data($ticket['idcustomer']);
55 55
 			echo '<tr><td>'.$customer['namacustomer'].'</td>'.
56
-				 '<td>'.date('d-M-Y',$ticket['reporteddate']).'</td>'.
56
+				 '<td>'.date('d-M-Y', $ticket['reporteddate']).'</td>'.
57 57
 				 '<td>'.$ticket['problemsummary'].'</td>'.
58 58
 				 '<td>'.$ticket['problemdetail'].'</td>'.
59 59
 				 '<td>'.$ticket['resolution'].'</td>'.
Please login to merge, or discard this patch.
changepwd.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,17 +1,17 @@  discard block
 block discarded – undo
1 1
 <?php 
2 2
 require 'core/init.php';
3 3
 $general->logged_out_protect();
4
-$user 	= $users->userdata($_SESSION['loginid']);
5
-$userid	= $user['id'];
4
+$user = $users->userdata($_SESSION['loginid']);
5
+$userid = $user['id'];
6 6
 if (isset($_POST['submit']))
7
-{	$oldpassword 	= sha1($_POST['oldpassword']);
8
-	$userpassword	= $user['password'];
7
+{	$oldpassword = sha1($_POST['oldpassword']);
8
+	$userpassword = $user['password'];
9 9
 	if ($oldpassword != $userpassword)
10 10
 	{	$errors[] = 'The old password does not match!';	
11 11
 	}else
12
-	{	$newpassword1 	= $_POST['newpassword1'];
13
-		$users->changepwd($userid,$newpassword1);
14
-		$users->log_users($_SESSION['loginid'],"Change the old password");
12
+	{	$newpassword1 = $_POST['newpassword1'];
13
+		$users->changepwd($userid, $newpassword1);
14
+		$users->log_users($_SESSION['loginid'], "Change the old password");
15 15
 		header('Location: changepwd.php?success');
16 16
 	}
17 17
 }
@@ -73,8 +73,8 @@  discard block
 block discarded – undo
73 73
 	</form>
74 74
 	<br/>
75 75
 	<?php
76
-	if(empty($errors) === false){
77
-		echo '<p class=errormsg>' . implode('</p><p class=errormsg>', $errors) . '</p>';
76
+	if (empty($errors) === false) {
77
+		echo '<p class=errormsg>'.implode('</p><p class=errormsg>', $errors).'</p>';
78 78
 	}
79 79
 	if (isset($_GET['success']) && empty($_GET['success'])) {
80 80
 		echo 'Your password has been changed. Please logout and relogin with the new password.';
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 	$userpassword	= $user['password'];
9 9
 	if ($oldpassword != $userpassword)
10 10
 	{	$errors[] = 'The old password does not match!';	
11
-	}else
11
+	} else
12 12
 	{	$newpassword1 	= $_POST['newpassword1'];
13 13
 		$users->changepwd($userid,$newpassword1);
14 14
 		$users->log_users($_SESSION['loginid'],"Change the old password");
Please login to merge, or discard this patch.
ticketlist.php 2 patches
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -2,14 +2,14 @@  discard block
 block discarded – undo
2 2
 require 'core/init.php';
3 3
 $general->logged_out_protect();
4 4
 $user = $users->userdata($_SESSION['loginid']);
5
-if($user['level'] == "Admin" || $user['level'] == "Manager")
6
-{$akses=true;}
5
+if ($user['level'] == "Admin" || $user['level'] == "Manager")
6
+{$akses = true; }
7 7
 else 
8
-{$akses=false;}
9
-if ($akses=False)
10
-{exit("You don't have permission to access this page!");}
11
-$ticket_list 		= $tickets->get_tickets();
12
-$tickets_count 	= count($ticket_list);
8
+{$akses = false; }
9
+if ($akses = False)
10
+{exit("You don't have permission to access this page!"); }
11
+$ticket_list = $tickets->get_tickets();
12
+$tickets_count = count($ticket_list);
13 13
 $currenttime = time();
14 14
 ?>
15 15
 <!DOCTYPE HTML>
@@ -71,28 +71,28 @@  discard block
 block discarded – undo
71 71
 		<?php 
72 72
 		foreach ($ticket_list as $ticket) {
73 73
 			$sla = $slas->sla_data($ticket['sla']);
74
-			$documenteddate=$ticket['documenteddate'];
75
-			$resolutiontime=$sla['resolutiontime'];
76
-			$slawarning=$sla['slawarning'];
77
-			$slagoaltime=strtotime("+$resolutiontime hours",$documenteddate);
78
-			$slawarningtime=strtotime("+$slawarning hours",$documenteddate);
74
+			$documenteddate = $ticket['documenteddate'];
75
+			$resolutiontime = $sla['resolutiontime'];
76
+			$slawarning = $sla['slawarning'];
77
+			$slagoaltime = strtotime("+$resolutiontime hours", $documenteddate);
78
+			$slawarningtime = strtotime("+$slawarning hours", $documenteddate);
79 79
 			if ($currenttime > $slagoaltime)
80
-			{$slabgcolor="#FF0000";$slatxtcolor="#ffffff";}
80
+			{$slabgcolor = "#FF0000"; $slatxtcolor = "#ffffff"; }
81 81
 			else if ($currenttime >= $slawarningtime)
82
-			{$slabgcolor="#FFFF00";$slatxtcolor="#000000";}
83
-			else {$slabgcolor="#00FF00";$slatxtcolor="#000000";}
82
+			{$slabgcolor = "#FFFF00"; $slatxtcolor = "#000000"; }
83
+			else {$slabgcolor = "#00FF00"; $slatxtcolor = "#000000"; }
84 84
 			$customer = $customers->customer_data($ticket['idcustomer']);
85 85
 			$user = $users->userdata($ticket['assignee']);
86
-			echo '<tr><td><a href=ticketedit.php?id='.$ticket['id']. '>'.$ticket['ticketnumber'].'</a></td>'.
86
+			echo '<tr><td><a href=ticketedit.php?id='.$ticket['id'].'>'.$ticket['ticketnumber'].'</a></td>'.
87 87
 				 '<td style="background-color:'.$slabgcolor.';color:'.$slatxtcolor.';">'.$sla['namasla'].'</td>'.
88
-				 '<td>'.date('d-M-Y H:i:s',$slagoaltime).'</td>'.
88
+				 '<td>'.date('d-M-Y H:i:s', $slagoaltime).'</td>'.
89 89
 				 '<td>'.$customer['namacustomer'].'</td>'.
90
-				 '<td>'.date('d-M-Y H:i:s',$ticket['reporteddate']).'</td>'.
91
-				 '<td>'.date('d-M-Y H:i:s',$ticket['documenteddate']).'</td>'.
90
+				 '<td>'.date('d-M-Y H:i:s', $ticket['reporteddate']).'</td>'.
91
+				 '<td>'.date('d-M-Y H:i:s', $ticket['documenteddate']).'</td>'.
92 92
 				 '<td>'.$ticket['problemsummary'].'</td>'.
93 93
 				 '<td>'.$ticket['ticketstatus'].'</td>'.
94 94
 				 '<td>'.$user['fullname'].'</td>'.
95
-				 '<td><a href=ticketdel.php?id='.$ticket['id']. ' onclick="return delete_confirm();">del</a></td></tr>';
95
+				 '<td><a href=ticketdel.php?id='.$ticket['id'].' onclick="return delete_confirm();">del</a></td></tr>';
96 96
 		}
97 97
 		?>
98 98
     </tbody>
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -3,8 +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" || $user['level'] == "Manager")
6
-{$akses=true;}
7
-else 
6
+{$akses=true;} else 
8 7
 {$akses=false;}
9 8
 if ($akses=False)
10 9
 {exit("You don't have permission to access this page!");}
@@ -77,10 +76,8 @@  discard block
 block discarded – undo
77 76
 			$slagoaltime=strtotime("+$resolutiontime hours",$documenteddate);
78 77
 			$slawarningtime=strtotime("+$slawarning hours",$documenteddate);
79 78
 			if ($currenttime > $slagoaltime)
80
-			{$slabgcolor="#FF0000";$slatxtcolor="#ffffff";}
81
-			else if ($currenttime >= $slawarningtime)
82
-			{$slabgcolor="#FFFF00";$slatxtcolor="#000000";}
83
-			else {$slabgcolor="#00FF00";$slatxtcolor="#000000";}
79
+			{$slabgcolor="#FF0000";$slatxtcolor="#ffffff";} else if ($currenttime >= $slawarningtime)
80
+			{$slabgcolor="#FFFF00";$slatxtcolor="#000000";} else {$slabgcolor="#00FF00";$slatxtcolor="#000000";}
84 81
 			$customer = $customers->customer_data($ticket['idcustomer']);
85 82
 			$user = $users->userdata($ticket['assignee']);
86 83
 			echo '<tr><td><a href=ticketedit.php?id='.$ticket['id']. '>'.$ticket['ticketnumber'].'</a></td>'.
Please login to merge, or discard this patch.
myticketbyrequester.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -2,8 +2,8 @@  discard block
 block discarded – undo
2 2
 require 'core/init.php';
3 3
 $general->logged_out_protect();
4 4
 $user = $users->userdata($_SESSION['loginid']);
5
-$tickets 		= $tickets->get_tickets_by_requester($_SESSION['loginid']);
6
-$tickets_count 	= count($tickets);
5
+$tickets = $tickets->get_tickets_by_requester($_SESSION['loginid']);
6
+$tickets_count = count($tickets);
7 7
 ?>
8 8
 <!DOCTYPE HTML>
9 9
 <html>
@@ -55,10 +55,10 @@  discard block
 block discarded – undo
55 55
 			$sla = $slas->sla_data($ticket['sla']);
56 56
 			$customer = $customers->customer_data($ticket['idcustomer']);
57 57
 			$user = $users->userdata($ticket['assignee']);
58
-			echo '<tr><td><a href=ticketedituser.php?id='.$ticket['id']. '>'.$ticket['ticketnumber'].'</a></td>'.
58
+			echo '<tr><td><a href=ticketedituser.php?id='.$ticket['id'].'>'.$ticket['ticketnumber'].'</a></td>'.
59 59
 				 '<td>'.$sla['namasla'].'</td>'.
60 60
 				 '<td>'.$customer['namacustomer'].'</td>'.
61
-				 '<td>'.date('d-M-Y',$ticket['reporteddate']).'</td>'.
61
+				 '<td>'.date('d-M-Y', $ticket['reporteddate']).'</td>'.
62 62
 				 '<td>'.$ticket['reportedby'].'</td>'.
63 63
 				 '<td>'.$ticket['problemsummary'].'</td>'.
64 64
 				 '<td>'.$ticket['ticketstatus'].'</td>'.
Please login to merge, or discard this patch.
userlist.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -2,10 +2,10 @@  discard block
 block discarded – undo
2 2
 require 'core/init.php';
3 3
 $general->logged_out_protect();
4 4
 $user = $users->userdata($_SESSION['loginid']);
5
-if($user['level'] != "Admin")
5
+if ($user['level'] != "Admin")
6 6
 { 	exit("You don't have permission to access this page!"); }
7
-$members 		= $users->get_users();
8
-$member_count 	= count($members);
7
+$members = $users->get_users();
8
+$member_count = count($members);
9 9
 ?>
10 10
 <!DOCTYPE HTML>
11 11
 <html>
@@ -61,18 +61,18 @@  discard block
 block discarded – undo
61 61
     <tbody>
62 62
 		<?php 
63 63
 		foreach ($members as $member) {
64
-			if ($member['confirmed']=='1')
65
-			{$locked='No';}
64
+			if ($member['confirmed'] == '1')
65
+			{$locked = 'No'; }
66 66
 			else
67
-			{$locked='Yes';}
68
-			echo '<tr><td><a href=useredit.php?id='.$member['id']. '>'.$member['username'].'</a></td>'.
67
+			{$locked = 'Yes'; }
68
+			echo '<tr><td><a href=useredit.php?id='.$member['id'].'>'.$member['username'].'</a></td>'.
69 69
 				 '<td>'.$member['level'].'</td>'.
70 70
 				 '<td>'.$member['fullname'].'</td>'.
71 71
 				 '<td>'.$member['email'].'</td>'.
72 72
 				 '<td>'.$member['Telp'].'</td>'.
73 73
 				 '<td>'.date('d-M-Y H:i', $member['time']).'</td>'.
74 74
 				 '<td>'.$locked.'</td>'.
75
-				 '<td><a href=userdel.php?id='.$member['id']. ' onclick="return delete_confirm();">del</a></td></tr>';
75
+				 '<td><a href=userdel.php?id='.$member['id'].' onclick="return delete_confirm();">del</a></td></tr>';
76 76
 		}
77 77
 		?>
78 78
     </tbody>
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -62,8 +62,7 @@
 block discarded – undo
62 62
 		<?php 
63 63
 		foreach ($members as $member) {
64 64
 			if ($member['confirmed']=='1')
65
-			{$locked='No';}
66
-			else
65
+			{$locked='No';} else
67 66
 			{$locked='Yes';}
68 67
 			echo '<tr><td><a href=useredit.php?id='.$member['id']. '>'.$member['username'].'</a></td>'.
69 68
 				 '<td>'.$member['level'].'</td>'.
Please login to merge, or discard this patch.
useredit.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,20 +1,20 @@
 block discarded – undo
1 1
 <?php 
2 2
 require 'core/init.php';
3 3
 $general->logged_out_protect();
4
-$id=$_GET['id'];
5
-$member=$users->userdata($id);
4
+$id = $_GET['id'];
5
+$member = $users->userdata($id);
6 6
 if (isset($_POST['submit']))
7
-{	$fullname 	= $_POST['fullname'];
7
+{	$fullname = $_POST['fullname'];
8 8
 	$username 	= htmlentities($_POST['username']);
9 9
 	$password 	= $_POST['password'];
10 10
 	$email 		= htmlentities($_POST['email']);
11
-	$Telp 		= $_POST['telp'];
11
+	$Telp = $_POST['telp'];
12 12
 	$level 		= $_POST['level'];
13 13
 	$locked 	= $_POST['locked'];
14 14
 	//echo 'Old Passw: '.$member['password']. ' New Passw:'. $password;
15
-	if ($password=="")
16
-	{	$password = $member['password'];}
17
-	$users->update($id,$username,$password,$email,$fullname,$Telp,$level,$locked);
15
+	if ($password == "")
16
+	{	$password = $member['password']; }
17
+	$users->update($id, $username, $password, $email, $fullname, $Telp, $level, $locked);
18 18
 	header('Location: userlist.php');
19 19
 }
20 20
 ?>
Please login to merge, or discard this patch.
customeredit.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,18 +1,18 @@  discard block
 block discarded – undo
1 1
 <?php 
2 2
 require 'core/init.php';
3 3
 $general->logged_out_protect();
4
-$id_cust=$_GET['id'];
5
-$member=$customers->customer_data($id_cust);
4
+$id_cust = $_GET['id'];
5
+$member = $customers->customer_data($id_cust);
6 6
 if (isset($_POST['submit']))
7
-{	$namacustomer 	= $_POST['namacustomer'];
8
-	$password 		= $_POST['password'];
7
+{	$namacustomer = $_POST['namacustomer'];
8
+	$password = $_POST['password'];
9 9
 	$alamat 		= $_POST['alamat'];
10
-	$Telp 			= $_POST['telp'];
10
+	$Telp = $_POST['telp'];
11 11
 	$email 			= $_POST['email'];
12
-	$PIC 			= $_POST['PIC'];
13
-	$selesperson 	= $_POST['selesperson'];
14
-	$customerproduct= $_POST['customerproduct'];
15
-	$customers->update_customer($id_cust,$namacustomer,$alamat,$Telp,$email,$PIC,$selesperson,$customerproduct);
12
+	$PIC = $_POST['PIC'];
13
+	$selesperson = $_POST['selesperson'];
14
+	$customerproduct = $_POST['customerproduct'];
15
+	$customers->update_customer($id_cust, $namacustomer, $alamat, $Telp, $email, $PIC, $selesperson, $customerproduct);
16 16
 	header('Location: customerlist.php');
17 17
 }
18 18
 ?>
@@ -125,8 +125,8 @@  discard block
 block discarded – undo
125 125
 	</form>
126 126
 
127 127
 	<?php 
128
-	if(empty($errors) === false){
129
-		echo '<p class=errormsg>' . implode('</p><p class=errormsg>', $errors) . '</p>';
128
+	if (empty($errors) === false) {
129
+		echo '<p class=errormsg>'.implode('</p><p class=errormsg>', $errors).'</p>';
130 130
 	}
131 131
 	?>
132 132
 </body>
Please login to merge, or discard this patch.