Passed
Push — master ( 8dd1b9...249eab )
by Saepul
02:51
created
slaedit.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -3,17 +3,17 @@  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
 $slaid = $_GET['id'];
9 9
 $sla = $slas->sla_data($slaid);
10 10
 if (isset($_POST['submit'])) {
11
-    $namasla = $_POST['namasla'];
12
-    $responsetime = $_POST['responsetime'];
13
-    $resolutiontime = $_POST['resolutiontime'];
14
-    $slawarning = $_POST['slawarning'];
15
-    $slas->update_sla($slaid, $namasla, $responsetime, $resolutiontime, $slawarning);
16
-    header('location:slalist.php');
11
+	$namasla = $_POST['namasla'];
12
+	$responsetime = $_POST['responsetime'];
13
+	$resolutiontime = $_POST['resolutiontime'];
14
+	$slawarning = $_POST['slawarning'];
15
+	$slas->update_sla($slaid, $namasla, $responsetime, $resolutiontime, $slawarning);
16
+	header('location:slalist.php');
17 17
 }
18 18
 ?>
19 19
 <!DOCTYPE HTML>
@@ -92,9 +92,9 @@  discard block
 block discarded – undo
92 92
 	</fieldset>
93 93
 	</form>
94 94
 	<?php 
95
-    if (empty($errors) === false) {
96
-        echo '<p class=errormsg>'.implode('</p><p class=errormsg>', $errors).'</p>';
97
-    }
98
-    ?>
95
+	if (empty($errors) === false) {
96
+		echo '<p class=errormsg>'.implode('</p><p class=errormsg>', $errors).'</p>';
97
+	}
98
+	?>
99 99
 </body>
100 100
 </html>
101 101
\ No newline at end of file
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
 ?>
@@ -57,15 +57,15 @@  discard block
 block discarded – undo
57 57
     </thead>
58 58
     <tbody>
59 59
 		<?php 
60
-        foreach ($sla as $slaval) {
61
-            echo '<tr><td>'.$slaval['slaid'].'</td>'.
62
-                 '<td><a href=slaedit.php?id='.$slaval['slaid'].'>'.$slaval['namasla'].'</a></td>'.
63
-                 '<td>'.$slaval['responsetime'].' Hours</td>'.
64
-                 '<td>'.$slaval['resolutiontime'].' Hours</td>'.
65
-                 '<td>'.$slaval['slawarning'].' Hours</td>'.
66
-                 '<td><a href=sladel.php?id='.$slaval['slaid'].' onclick="return delete_confirm();">del</a></td></tr>';
67
-        }
68
-        ?>
60
+		foreach ($sla as $slaval) {
61
+			echo '<tr><td>'.$slaval['slaid'].'</td>'.
62
+				 '<td><a href=slaedit.php?id='.$slaval['slaid'].'>'.$slaval['namasla'].'</a></td>'.
63
+				 '<td>'.$slaval['responsetime'].' Hours</td>'.
64
+				 '<td>'.$slaval['resolutiontime'].' Hours</td>'.
65
+				 '<td>'.$slaval['slawarning'].' Hours</td>'.
66
+				 '<td><a href=sladel.php?id='.$slaval['slaid'].' onclick="return delete_confirm();">del</a></td></tr>';
67
+		}
68
+		?>
69 69
     </tbody>
70 70
 	</table>
71 71
 	</div>
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.
report_all_tickets_print.php 1 patch
Indentation   +11 added lines, -11 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_by_date($_GET['periode_awal'], $_GET['periode_akhir']);
14 14
 $tickets_count = count($ticket_list);
@@ -180,14 +180,14 @@  discard block
 block discarded – undo
180 180
         </thead>
181 181
         <tbody>
182 182
             <?php foreach ($ticket_list as $ticket) :
183
-                $sla = $slas->sla_data($ticket['sla']);
184
-                $documenteddate = $ticket['documenteddate'];
185
-                $resolutiontime = $sla['resolutiontime'];
186
-                $slawarning = $sla['slawarning'];
187
-                $slagoaltime = strtotime("+$resolutiontime hours", $documenteddate);
188
-                $slawarningtime = strtotime("+$slawarning hours", $documenteddate);
189
-                $user = $users->userdata($ticket['assignee']);
190
-            ?>
183
+				$sla = $slas->sla_data($ticket['sla']);
184
+				$documenteddate = $ticket['documenteddate'];
185
+				$resolutiontime = $sla['resolutiontime'];
186
+				$slawarning = $sla['slawarning'];
187
+				$slagoaltime = strtotime("+$resolutiontime hours", $documenteddate);
188
+				$slawarningtime = strtotime("+$slawarning hours", $documenteddate);
189
+				$user = $users->userdata($ticket['assignee']);
190
+			?>
191 191
                 <tr>
192 192
                     <td>
193 193
                         <?php echo $ticket['ticketnumber'];?>
Please login to merge, or discard this patch.
userlist.php 2 patches
Indentation   +17 added lines, -17 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
 $members = $users->get_users();
9 9
 $member_count = count($members);
@@ -60,22 +60,22 @@  discard block
 block discarded – undo
60 60
     </thead>
61 61
     <tbody>
62 62
 		<?php 
63
-        foreach ($members as $member) {
64
-            if ($member['confirmed'] == '1') {
65
-                $locked = 'No';
66
-            } else {
67
-                $locked = 'Yes';
68
-            }
69
-            echo '<tr><td><a href=useredit.php?id='.$member['id'].'>'.$member['username'].'</a></td>'.
70
-                 '<td>'.$member['level'].'</td>'.
71
-                 '<td>'.$member['fullname'].'</td>'.
72
-                 '<td>'.$member['email'].'</td>'.
73
-                 '<td>'.$member['Telp'].'</td>'.
74
-                 '<td>'.date('d-M-Y H:i', $member['time']).'</td>'.
75
-                 '<td>'.$locked.'</td>'.
76
-                 '<td><a href=userdel.php?id='.$member['id'].' onclick="return delete_confirm();">del</a></td></tr>';
77
-        }
78
-        ?>
63
+		foreach ($members as $member) {
64
+			if ($member['confirmed'] == '1') {
65
+				$locked = 'No';
66
+			} else {
67
+				$locked = 'Yes';
68
+			}
69
+			echo '<tr><td><a href=useredit.php?id='.$member['id'].'>'.$member['username'].'</a></td>'.
70
+				 '<td>'.$member['level'].'</td>'.
71
+				 '<td>'.$member['fullname'].'</td>'.
72
+				 '<td>'.$member['email'].'</td>'.
73
+				 '<td>'.$member['Telp'].'</td>'.
74
+				 '<td>'.date('d-M-Y H:i', $member['time']).'</td>'.
75
+				 '<td>'.$locked.'</td>'.
76
+				 '<td><a href=userdel.php?id='.$member['id'].' onclick="return delete_confirm();">del</a></td></tr>';
77
+		}
78
+		?>
79 79
     </tbody>
80 80
 	</table>
81 81
 	<p>&nbsp;</p>
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@
 block discarded – undo
63 63
         foreach ($members as $member) {
64 64
             if ($member['confirmed'] == '1') {
65 65
                 $locked = 'No';
66
-            } else {
66
+            }else {
67 67
                 $locked = 'Yes';
68 68
             }
69 69
             echo '<tr><td><a href=useredit.php?id='.$member['id'].'>'.$member['username'].'</a></td>'.
Please login to merge, or discard this patch.
userlog.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
 $logs = $users->get_users_log();
9 9
 ?>
@@ -54,15 +54,15 @@  discard block
 block discarded – undo
54 54
     </thead>
55 55
     <tbody>
56 56
 		<?php 
57
-        foreach ($logs as $log) {
58
-            $username = $users->get_user_by_id($log['iduser']);
59
-            echo '<tr><td>'.date('d-M-Y H:i', $log['time']).'</td>'.
60
-                 '<td>'.$username['username'].'</td>'.
61
-                 '<td>'.$log['ip'].'</td>'.
62
-                 '<td>'.$log['browser'].'</td>'.
63
-                 '<td>'.$log['log'].'</td></tr>';
64
-        }
65
-        ?>
57
+		foreach ($logs as $log) {
58
+			$username = $users->get_user_by_id($log['iduser']);
59
+			echo '<tr><td>'.date('d-M-Y H:i', $log['time']).'</td>'.
60
+				 '<td>'.$username['username'].'</td>'.
61
+				 '<td>'.$log['ip'].'</td>'.
62
+				 '<td>'.$log['browser'].'</td>'.
63
+				 '<td>'.$log['log'].'</td></tr>';
64
+		}
65
+		?>
66 66
     </tbody>
67 67
 	</table>
68 68
 </body>
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.
core/classes/Tickets.php 2 patches
Indentation   +340 added lines, -340 removed lines patch added patch discarded remove patch
@@ -3,296 +3,296 @@  discard block
 block discarded – undo
3 3
 date_default_timezone_set('Asia/Jakarta');
4 4
 class Tickets
5 5
 {
6
-    private $db;
7
-
8
-    public function __construct($database)
9
-    {
10
-        $this->db = $database;
11
-    }
12
-
13
-    public function add_ticket($ticketnumber, $sla, $reporteddate, $reportedby, $telp, $email, $problemsummary, $problemdetail, $ticketstatus, $assignee, $documentedby, $pro)
14
-    {
15
-        $current = time();
16
-        $querystring = 'INSERT INTO `tickets` (`ticketnumber`,`sla`,`reporteddate`, `reportedby`, `telp`, `email`, `problemsummary`,`problemdetail`,`ticketstatus`,`assignee`,`documentedby`,`documenteddate`,`pro`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)';
17
-        $query = $this->db->prepare($querystring);
18
-        $query->bindValue(1, $ticketnumber);
19
-        $query->bindValue(2, $sla);
20
-        $query->bindValue(3, $reporteddate);
21
-        $query->bindValue(4, $reportedby);
22
-        $query->bindValue(5, $telp);
23
-        $query->bindValue(6, $email);
24
-        $query->bindValue(7, $problemsummary);
25
-        $query->bindValue(8, $problemdetail);
26
-        $query->bindValue(9, $ticketstatus);
27
-        $query->bindValue(10, $assignee);
28
-        $query->bindValue(11, $documentedby);
29
-        $query->bindValue(12, $current);
30
-        $query->bindValue(13, $pro);
31
-
32
-        try {
33
-            $query->execute();
34
-        } catch (PDOException $e) {
35
-            die($e->getMessage());
36
-        }
37
-    }
38
-
39
-    public function update_ticket($id, $sla, $reporteddate, $reportedby, $telp, $email, $problemsummary, $problemdetail, $ticketstatus, $assignee, $assigneddate, $pendingby, $pendingdate, $resolution, $resolvedby, $resolveddate, $closedby, $closeddate, $processby, $processdate, $comment)
40
-    {
41
-        $querystring = 'UPDATE `tickets` SET `sla` = ? , `reporteddate` = ? , `reportedby` = ? , `telp` = ? ,`email` = ? , `problemsummary` = ? , `problemdetail` = ? ,`ticketstatus` = ?, `assignee` = ? , `assigneddate` = ?, `pendingby` = ?,`pendingdate` = ?, `resolution` = ? ,`resolvedby` = ?,`resolveddate` = ?,`closedby` = ?,`closeddate` = ?, `processby` = ?, `processdate` = ?, `comment` = ? WHERE `id` = ?';
42
-        $query = $this->db->prepare($querystring);
43
-        $query->bindValue(1, $sla);
44
-        $query->bindValue(2, $reporteddate);
45
-        $query->bindValue(3, $reportedby);
46
-        $query->bindValue(4, $telp);
47
-        $query->bindValue(5, $email);
48
-        $query->bindValue(6, $problemsummary);
49
-        $query->bindValue(7, $problemdetail);
50
-        $query->bindValue(8, $ticketstatus);
51
-        $query->bindValue(9, $assignee);
52
-        $query->bindValue(10, $assigneddate);
53
-        $query->bindValue(11, $pendingby);
54
-        $query->bindValue(12, $pendingdate);
55
-        $query->bindValue(13, $resolution);
56
-        $query->bindValue(14, $resolvedby);
57
-        $query->bindValue(15, $resolveddate);
58
-        $query->bindValue(16, $closedby);
59
-        $query->bindValue(17, $closeddate);
60
-        $query->bindValue(18, $processby);
61
-        $query->bindValue(19, $processdate);
62
-        $query->bindValue(20, $comment);
63
-        $query->bindValue(21, $id);
64
-
65
-        try {
66
-            $query->execute();
67
-        } catch (PDOException $e) {
68
-            die($e->getMessage());
69
-        }
70
-    }
71
-
72
-    public function delete($id)
73
-    {
74
-        $sql = 'DELETE FROM `tickets` WHERE `id` = ?';
75
-        $query = $this->db->prepare($sql);
76
-        $query->bindValue(1, $id);
77
-
78
-        try {
79
-            $query->execute();
80
-        } catch (PDOException $e) {
81
-            die($e->getMessage());
82
-        }
83
-    }
84
-
85
-    public function ticket_data($id)
86
-    {
87
-        $query = $this->db->prepare('SELECT * FROM `tickets` WHERE `id`= ?');
88
-        $query->bindValue(1, $id);
89
-
90
-        try {
91
-            $query->execute();
92
-
93
-            return $query->fetch();
94
-        } catch (PDOException $e) {
95
-            die($e->getMessage());
96
-        }
97
-    }
98
-
99
-    public function get_tickets()
100
-    {
101
-        $query = $this->db->prepare('SELECT * FROM `tickets` ORDER BY `ticketnumber` DESC');
102
-
103
-        try {
104
-            $query->execute();
105
-        } catch (PDOException $e) {
106
-            die($e->getMessage());
107
-        }
108
-
109
-        return $query->fetchAll();
110
-    }
111
-
112
-    public function get_pro()
113
-    {
114
-        $query = $this->db->prepare('SELECT pro FROM `tickets`');
115
-
116
-        try {
117
-            $query->execute();
118
-        } catch (PDOException $e) {
119
-            die($e->getMessage());
120
-        }
121
-
122
-        return $query->fetchAll();
123
-    }
124
-
125
-    public function get_opened_tickets()
126
-    {
127
-        $query = $this->db->prepare("SELECT * FROM `tickets` WHERE `ticketstatus` <> 'Closed' ORDER BY `ticketnumber` DESC");
128
-
129
-        try {
130
-            $query->execute();
131
-        } catch (PDOException $e) {
132
-            die($e->getMessage());
133
-        }
134
-
135
-        return $query->fetchAll();
136
-    }
137
-
138
-    public function get_tickets_by_requester($userid)
139
-    {
140
-        $query = $this->db->prepare('SELECT * FROM `tickets` WHERE `documentedby`= ? ORDER BY `ticketnumber` DESC');
141
-        $query->bindValue(1, $userid);
142
-
143
-        try {
144
-            $query->execute();
145
-        } catch (PDOException $e) {
146
-            die($e->getMessage());
147
-        }
148
-
149
-        return $query->fetchAll();
150
-    }
151
-
152
-    public function get_tickets_by_assignee($userid)
153
-    {
154
-        $query = $this->db->prepare('SELECT * FROM `tickets` WHERE `assignee`= ? ORDER BY `ticketnumber` DESC');
155
-        $query->bindValue(1, $userid);
156
-
157
-        try {
158
-            $query->execute();
159
-        } catch (PDOException $e) {
160
-            die($e->getMessage());
161
-        }
162
-
163
-        return $query->fetchAll();
164
-    }
165
-
166
-    public function get_tickets_by_resolver($username)
167
-    {
168
-        $query = $this->db->prepare('SELECT * FROM `tickets` WHERE `resolvedby`= ? ORDER BY `ticketnumber` DESC');
169
-        $query->bindValue(1, $username);
170
-
171
-        try {
172
-            $query->execute();
173
-        } catch (PDOException $e) {
174
-            die($e->getMessage());
175
-        }
176
-
177
-        return $query->fetchAll();
178
-    }
179
-
180
-    public function get_tickets_by_resolver_not_closed($username)
181
-    {
182
-        $query = $this->db->prepare('SELECT * FROM `tickets` WHERE `resolvedby`=? and `ticketstatus` <> ? ORDER BY `ticketnumber` DESC');
183
-        $query->bindValue(1, $username);
184
-        $query->bindValue(2, 'Closed');
185
-
186
-        try {
187
-            $query->execute();
188
-        } catch (PDOException $e) {
189
-            die($e->getMessage());
190
-        }
191
-
192
-        return $query->fetchAll();
193
-    }
194
-
195
-    public function get_tickets_by_status($ticketstatus)
196
-    {
197
-        $query = $this->db->prepare('SELECT * FROM `tickets` WHERE `ticketstatus`=? ORDER BY `ticketnumber` DESC');
198
-        $query->bindValue(1, $ticketstatus);
199
-
200
-        try {
201
-            $query->execute();
202
-        } catch (PDOException $e) {
203
-            die($e->getMessage());
204
-        }
205
-
206
-        return $query->fetchAll();
207
-    }
208
-
209
-    public function get_tickets_by_date($start_date, $end_date)
210
-    {
211
-        $start_date = strtotime($start_date);
212
-        $end_date = strtotime($end_date);
213
-        $query = $this->db->prepare('SELECT * FROM `tickets` WHERE `documenteddate` >= ? AND `documenteddate` <= ? ORDER BY `ticketnumber` DESC');
214
-        $query->bindValue(1, $start_date);
215
-        $query->bindValue(2, $end_date);
216
-
217
-        try {
218
-            $query->execute();
219
-        } catch (PDOException $e) {
220
-            die($e->getMessage());
221
-        }
222
-
223
-        return $query->fetchAll();
224
-    }
225
-
226
-    public function search_closed_ticket($fromperiod, $toperiod)
227
-    {
228
-        $query = $this->db->prepare("SELECT * FROM `tickets` WHERE `documenteddate` >= ? AND `documenteddate` <= ? AND `ticketstatus` = 'Closed' ORDER BY `documenteddate` DESC");
229
-        $query->bindValue(1, $fromperiod);
230
-        $query->bindValue(2, $toperiod);
231
-
232
-        try {
233
-            $query->execute();
234
-        } catch (PDOException $e) {
235
-            die($e->getMessage());
236
-        }
237
-
238
-        return $query->fetchAll();
239
-    }
240
-
241
-    public function count_tickets_by_status()
242
-    {
243
-        $query = $this->db->prepare('SELECT ticketstatus, count(*) as total FROM `tickets` GROUP BY ticketstatus');
244
-
245
-        try {
246
-            $query->execute();
247
-        } catch (PDOException $e) {
248
-            die($e->getMessage());
249
-        }
250
-
251
-        return $query->fetchAll();
252
-    }
253
-
254
-    public function count_resolved_tickets_by_month()
255
-    {
256
-        $sql = "SELECT Month(FROM_UNIXTIME(`documenteddate`)) as Bulan, Count(*) as Total FROM `tickets` WHERE (`ticketstatus`='Resolved' OR `ticketstatus`='Closed') AND FROM_UNIXTIME(`documenteddate`) >= CURDATE() - INTERVAL 1 YEAR GROUP BY Month(FROM_UNIXTIME(`documenteddate`))";
257
-        $query = $this->db->prepare($sql);
258
-
259
-        try {
260
-            $query->execute();
261
-        } catch (PDOException $e) {
262
-            die($e->getMessage());
263
-        }
264
-
265
-        return $query->fetchAll();
266
-    }
267
-
268
-    public function count_inprogress_tickets_by_month()
269
-    {
270
-        $sql = "SELECT Month(FROM_UNIXTIME(`documenteddate`)) as Bulan, Count(*) as Total FROM `tickets` WHERE (`ticketstatus`='Assigned' OR `ticketstatus`='Pending') AND FROM_UNIXTIME(`documenteddate`) >= CURDATE() - INTERVAL 1 YEAR GROUP BY Month(FROM_UNIXTIME(`documenteddate`))";
271
-        $query = $this->db->prepare($sql);
272
-
273
-        try {
274
-            $query->execute();
275
-        } catch (PDOException $e) {
276
-            die($e->getMessage());
277
-        }
278
-
279
-        return $query->fetchAll();
280
-    }
281
-
282
-    public function get_last_ticket()
283
-    {
284
-        $query = $this->db->prepare('SELECT * FROM `tickets` ORDER BY id DESC LIMIT 1');
285
-
286
-        try {
287
-            $query->execute();
288
-
289
-            return $query->fetch();
290
-        } catch (PDOException $e) {
291
-            die($e->getMessage());
292
-        }
293
-    }
294
-
295
-    /*
6
+	private $db;
7
+
8
+	public function __construct($database)
9
+	{
10
+		$this->db = $database;
11
+	}
12
+
13
+	public function add_ticket($ticketnumber, $sla, $reporteddate, $reportedby, $telp, $email, $problemsummary, $problemdetail, $ticketstatus, $assignee, $documentedby, $pro)
14
+	{
15
+		$current = time();
16
+		$querystring = 'INSERT INTO `tickets` (`ticketnumber`,`sla`,`reporteddate`, `reportedby`, `telp`, `email`, `problemsummary`,`problemdetail`,`ticketstatus`,`assignee`,`documentedby`,`documenteddate`,`pro`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)';
17
+		$query = $this->db->prepare($querystring);
18
+		$query->bindValue(1, $ticketnumber);
19
+		$query->bindValue(2, $sla);
20
+		$query->bindValue(3, $reporteddate);
21
+		$query->bindValue(4, $reportedby);
22
+		$query->bindValue(5, $telp);
23
+		$query->bindValue(6, $email);
24
+		$query->bindValue(7, $problemsummary);
25
+		$query->bindValue(8, $problemdetail);
26
+		$query->bindValue(9, $ticketstatus);
27
+		$query->bindValue(10, $assignee);
28
+		$query->bindValue(11, $documentedby);
29
+		$query->bindValue(12, $current);
30
+		$query->bindValue(13, $pro);
31
+
32
+		try {
33
+			$query->execute();
34
+		} catch (PDOException $e) {
35
+			die($e->getMessage());
36
+		}
37
+	}
38
+
39
+	public function update_ticket($id, $sla, $reporteddate, $reportedby, $telp, $email, $problemsummary, $problemdetail, $ticketstatus, $assignee, $assigneddate, $pendingby, $pendingdate, $resolution, $resolvedby, $resolveddate, $closedby, $closeddate, $processby, $processdate, $comment)
40
+	{
41
+		$querystring = 'UPDATE `tickets` SET `sla` = ? , `reporteddate` = ? , `reportedby` = ? , `telp` = ? ,`email` = ? , `problemsummary` = ? , `problemdetail` = ? ,`ticketstatus` = ?, `assignee` = ? , `assigneddate` = ?, `pendingby` = ?,`pendingdate` = ?, `resolution` = ? ,`resolvedby` = ?,`resolveddate` = ?,`closedby` = ?,`closeddate` = ?, `processby` = ?, `processdate` = ?, `comment` = ? WHERE `id` = ?';
42
+		$query = $this->db->prepare($querystring);
43
+		$query->bindValue(1, $sla);
44
+		$query->bindValue(2, $reporteddate);
45
+		$query->bindValue(3, $reportedby);
46
+		$query->bindValue(4, $telp);
47
+		$query->bindValue(5, $email);
48
+		$query->bindValue(6, $problemsummary);
49
+		$query->bindValue(7, $problemdetail);
50
+		$query->bindValue(8, $ticketstatus);
51
+		$query->bindValue(9, $assignee);
52
+		$query->bindValue(10, $assigneddate);
53
+		$query->bindValue(11, $pendingby);
54
+		$query->bindValue(12, $pendingdate);
55
+		$query->bindValue(13, $resolution);
56
+		$query->bindValue(14, $resolvedby);
57
+		$query->bindValue(15, $resolveddate);
58
+		$query->bindValue(16, $closedby);
59
+		$query->bindValue(17, $closeddate);
60
+		$query->bindValue(18, $processby);
61
+		$query->bindValue(19, $processdate);
62
+		$query->bindValue(20, $comment);
63
+		$query->bindValue(21, $id);
64
+
65
+		try {
66
+			$query->execute();
67
+		} catch (PDOException $e) {
68
+			die($e->getMessage());
69
+		}
70
+	}
71
+
72
+	public function delete($id)
73
+	{
74
+		$sql = 'DELETE FROM `tickets` WHERE `id` = ?';
75
+		$query = $this->db->prepare($sql);
76
+		$query->bindValue(1, $id);
77
+
78
+		try {
79
+			$query->execute();
80
+		} catch (PDOException $e) {
81
+			die($e->getMessage());
82
+		}
83
+	}
84
+
85
+	public function ticket_data($id)
86
+	{
87
+		$query = $this->db->prepare('SELECT * FROM `tickets` WHERE `id`= ?');
88
+		$query->bindValue(1, $id);
89
+
90
+		try {
91
+			$query->execute();
92
+
93
+			return $query->fetch();
94
+		} catch (PDOException $e) {
95
+			die($e->getMessage());
96
+		}
97
+	}
98
+
99
+	public function get_tickets()
100
+	{
101
+		$query = $this->db->prepare('SELECT * FROM `tickets` ORDER BY `ticketnumber` DESC');
102
+
103
+		try {
104
+			$query->execute();
105
+		} catch (PDOException $e) {
106
+			die($e->getMessage());
107
+		}
108
+
109
+		return $query->fetchAll();
110
+	}
111
+
112
+	public function get_pro()
113
+	{
114
+		$query = $this->db->prepare('SELECT pro FROM `tickets`');
115
+
116
+		try {
117
+			$query->execute();
118
+		} catch (PDOException $e) {
119
+			die($e->getMessage());
120
+		}
121
+
122
+		return $query->fetchAll();
123
+	}
124
+
125
+	public function get_opened_tickets()
126
+	{
127
+		$query = $this->db->prepare("SELECT * FROM `tickets` WHERE `ticketstatus` <> 'Closed' ORDER BY `ticketnumber` DESC");
128
+
129
+		try {
130
+			$query->execute();
131
+		} catch (PDOException $e) {
132
+			die($e->getMessage());
133
+		}
134
+
135
+		return $query->fetchAll();
136
+	}
137
+
138
+	public function get_tickets_by_requester($userid)
139
+	{
140
+		$query = $this->db->prepare('SELECT * FROM `tickets` WHERE `documentedby`= ? ORDER BY `ticketnumber` DESC');
141
+		$query->bindValue(1, $userid);
142
+
143
+		try {
144
+			$query->execute();
145
+		} catch (PDOException $e) {
146
+			die($e->getMessage());
147
+		}
148
+
149
+		return $query->fetchAll();
150
+	}
151
+
152
+	public function get_tickets_by_assignee($userid)
153
+	{
154
+		$query = $this->db->prepare('SELECT * FROM `tickets` WHERE `assignee`= ? ORDER BY `ticketnumber` DESC');
155
+		$query->bindValue(1, $userid);
156
+
157
+		try {
158
+			$query->execute();
159
+		} catch (PDOException $e) {
160
+			die($e->getMessage());
161
+		}
162
+
163
+		return $query->fetchAll();
164
+	}
165
+
166
+	public function get_tickets_by_resolver($username)
167
+	{
168
+		$query = $this->db->prepare('SELECT * FROM `tickets` WHERE `resolvedby`= ? ORDER BY `ticketnumber` DESC');
169
+		$query->bindValue(1, $username);
170
+
171
+		try {
172
+			$query->execute();
173
+		} catch (PDOException $e) {
174
+			die($e->getMessage());
175
+		}
176
+
177
+		return $query->fetchAll();
178
+	}
179
+
180
+	public function get_tickets_by_resolver_not_closed($username)
181
+	{
182
+		$query = $this->db->prepare('SELECT * FROM `tickets` WHERE `resolvedby`=? and `ticketstatus` <> ? ORDER BY `ticketnumber` DESC');
183
+		$query->bindValue(1, $username);
184
+		$query->bindValue(2, 'Closed');
185
+
186
+		try {
187
+			$query->execute();
188
+		} catch (PDOException $e) {
189
+			die($e->getMessage());
190
+		}
191
+
192
+		return $query->fetchAll();
193
+	}
194
+
195
+	public function get_tickets_by_status($ticketstatus)
196
+	{
197
+		$query = $this->db->prepare('SELECT * FROM `tickets` WHERE `ticketstatus`=? ORDER BY `ticketnumber` DESC');
198
+		$query->bindValue(1, $ticketstatus);
199
+
200
+		try {
201
+			$query->execute();
202
+		} catch (PDOException $e) {
203
+			die($e->getMessage());
204
+		}
205
+
206
+		return $query->fetchAll();
207
+	}
208
+
209
+	public function get_tickets_by_date($start_date, $end_date)
210
+	{
211
+		$start_date = strtotime($start_date);
212
+		$end_date = strtotime($end_date);
213
+		$query = $this->db->prepare('SELECT * FROM `tickets` WHERE `documenteddate` >= ? AND `documenteddate` <= ? ORDER BY `ticketnumber` DESC');
214
+		$query->bindValue(1, $start_date);
215
+		$query->bindValue(2, $end_date);
216
+
217
+		try {
218
+			$query->execute();
219
+		} catch (PDOException $e) {
220
+			die($e->getMessage());
221
+		}
222
+
223
+		return $query->fetchAll();
224
+	}
225
+
226
+	public function search_closed_ticket($fromperiod, $toperiod)
227
+	{
228
+		$query = $this->db->prepare("SELECT * FROM `tickets` WHERE `documenteddate` >= ? AND `documenteddate` <= ? AND `ticketstatus` = 'Closed' ORDER BY `documenteddate` DESC");
229
+		$query->bindValue(1, $fromperiod);
230
+		$query->bindValue(2, $toperiod);
231
+
232
+		try {
233
+			$query->execute();
234
+		} catch (PDOException $e) {
235
+			die($e->getMessage());
236
+		}
237
+
238
+		return $query->fetchAll();
239
+	}
240
+
241
+	public function count_tickets_by_status()
242
+	{
243
+		$query = $this->db->prepare('SELECT ticketstatus, count(*) as total FROM `tickets` GROUP BY ticketstatus');
244
+
245
+		try {
246
+			$query->execute();
247
+		} catch (PDOException $e) {
248
+			die($e->getMessage());
249
+		}
250
+
251
+		return $query->fetchAll();
252
+	}
253
+
254
+	public function count_resolved_tickets_by_month()
255
+	{
256
+		$sql = "SELECT Month(FROM_UNIXTIME(`documenteddate`)) as Bulan, Count(*) as Total FROM `tickets` WHERE (`ticketstatus`='Resolved' OR `ticketstatus`='Closed') AND FROM_UNIXTIME(`documenteddate`) >= CURDATE() - INTERVAL 1 YEAR GROUP BY Month(FROM_UNIXTIME(`documenteddate`))";
257
+		$query = $this->db->prepare($sql);
258
+
259
+		try {
260
+			$query->execute();
261
+		} catch (PDOException $e) {
262
+			die($e->getMessage());
263
+		}
264
+
265
+		return $query->fetchAll();
266
+	}
267
+
268
+	public function count_inprogress_tickets_by_month()
269
+	{
270
+		$sql = "SELECT Month(FROM_UNIXTIME(`documenteddate`)) as Bulan, Count(*) as Total FROM `tickets` WHERE (`ticketstatus`='Assigned' OR `ticketstatus`='Pending') AND FROM_UNIXTIME(`documenteddate`) >= CURDATE() - INTERVAL 1 YEAR GROUP BY Month(FROM_UNIXTIME(`documenteddate`))";
271
+		$query = $this->db->prepare($sql);
272
+
273
+		try {
274
+			$query->execute();
275
+		} catch (PDOException $e) {
276
+			die($e->getMessage());
277
+		}
278
+
279
+		return $query->fetchAll();
280
+	}
281
+
282
+	public function get_last_ticket()
283
+	{
284
+		$query = $this->db->prepare('SELECT * FROM `tickets` ORDER BY id DESC LIMIT 1');
285
+
286
+		try {
287
+			$query->execute();
288
+
289
+			return $query->fetch();
290
+		} catch (PDOException $e) {
291
+			die($e->getMessage());
292
+		}
293
+	}
294
+
295
+	/*
296 296
         public function notify_assignee($id,$ticketnumber,$email_assignee)
297 297
         {	if (substr(php_uname(), 0, 7) == "Windows"){
298 298
                 $cmd = "D:\mowes_portable\www\helpdesk\batch\sendemail.bat";
@@ -306,54 +306,54 @@  discard block
 block discarded – undo
306 306
             }
307 307
         }*/
308 308
 
309
-    public function log_tickets($id, $sla, $reporteddate, $reportedby, $telp, $email, $problemsummary, $problemdetail, $ticketstatus, $assignee, $assigneddate, $pendingby, $pendingdate, $resolution, $resolvedby, $resolveddate, $closedby, $closeddate, $changes, $changeby, $processby, $processdate, $comment)
310
-    {
311
-        $changedate = time();
312
-        $querystring = 'INSERT INTO `log_tickets` (`id`,`sla`,`reporteddate`, `reportedby`, `telp`, `email`, `problemsummary`,`problemdetail`,`ticketstatus`,`assignee`,`assigneddate`,`pendingby`,`pendingdate`,`resolution`,`resolvedby`,`resolveddate`,`closedby`,`closeddate`,`changes`,`changeby`,`changedate`,`processby`,`processdate`,`comment`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)';
313
-        $query = $this->db->prepare($querystring);
314
-        $query->bindValue(1, $id);
315
-        $query->bindValue(2, $sla);
316
-        $query->bindValue(3, $reporteddate);
317
-        $query->bindValue(4, $reportedby);
318
-        $query->bindValue(5, $telp);
319
-        $query->bindValue(6, $email);
320
-        $query->bindValue(7, $problemsummary);
321
-        $query->bindValue(8, $problemdetail);
322
-        $query->bindValue(9, $ticketstatus);
323
-        $query->bindValue(10, $assignee);
324
-        $query->bindValue(11, $assigneddate);
325
-        $query->bindValue(12, $pendingby);
326
-        $query->bindValue(13, $pendingdate);
327
-        $query->bindValue(14, $resolution);
328
-        $query->bindValue(15, $resolvedby);
329
-        $query->bindValue(16, $resolveddate);
330
-        $query->bindValue(17, $closedby);
331
-        $query->bindValue(18, $closeddate);
332
-        $query->bindValue(19, $changes);
333
-        $query->bindValue(20, $changeby);
334
-        $query->bindValue(21, $changedate);
335
-        $query->bindValue(22, $processby);
336
-        $query->bindValue(23, $processdate);
337
-        $query->bindValue(24, $comment);
338
-
339
-        try {
340
-            $query->execute();
341
-        } catch (PDOException $e) {
342
-            die($e->getMessage());
343
-        }
344
-    }
345
-
346
-    public function get_audit_trail($id)
347
-    {
348
-        $query = $this->db->prepare('SELECT * FROM `log_tickets` WHERE `id`= ? ORDER BY `changedate` DESC');
349
-        $query->bindValue(1, $id);
350
-
351
-        try {
352
-            $query->execute();
353
-        } catch (PDOException $e) {
354
-            die($e->getMessage());
355
-        }
356
-
357
-        return $query->fetchAll();
358
-    }
309
+	public function log_tickets($id, $sla, $reporteddate, $reportedby, $telp, $email, $problemsummary, $problemdetail, $ticketstatus, $assignee, $assigneddate, $pendingby, $pendingdate, $resolution, $resolvedby, $resolveddate, $closedby, $closeddate, $changes, $changeby, $processby, $processdate, $comment)
310
+	{
311
+		$changedate = time();
312
+		$querystring = 'INSERT INTO `log_tickets` (`id`,`sla`,`reporteddate`, `reportedby`, `telp`, `email`, `problemsummary`,`problemdetail`,`ticketstatus`,`assignee`,`assigneddate`,`pendingby`,`pendingdate`,`resolution`,`resolvedby`,`resolveddate`,`closedby`,`closeddate`,`changes`,`changeby`,`changedate`,`processby`,`processdate`,`comment`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)';
313
+		$query = $this->db->prepare($querystring);
314
+		$query->bindValue(1, $id);
315
+		$query->bindValue(2, $sla);
316
+		$query->bindValue(3, $reporteddate);
317
+		$query->bindValue(4, $reportedby);
318
+		$query->bindValue(5, $telp);
319
+		$query->bindValue(6, $email);
320
+		$query->bindValue(7, $problemsummary);
321
+		$query->bindValue(8, $problemdetail);
322
+		$query->bindValue(9, $ticketstatus);
323
+		$query->bindValue(10, $assignee);
324
+		$query->bindValue(11, $assigneddate);
325
+		$query->bindValue(12, $pendingby);
326
+		$query->bindValue(13, $pendingdate);
327
+		$query->bindValue(14, $resolution);
328
+		$query->bindValue(15, $resolvedby);
329
+		$query->bindValue(16, $resolveddate);
330
+		$query->bindValue(17, $closedby);
331
+		$query->bindValue(18, $closeddate);
332
+		$query->bindValue(19, $changes);
333
+		$query->bindValue(20, $changeby);
334
+		$query->bindValue(21, $changedate);
335
+		$query->bindValue(22, $processby);
336
+		$query->bindValue(23, $processdate);
337
+		$query->bindValue(24, $comment);
338
+
339
+		try {
340
+			$query->execute();
341
+		} catch (PDOException $e) {
342
+			die($e->getMessage());
343
+		}
344
+	}
345
+
346
+	public function get_audit_trail($id)
347
+	{
348
+		$query = $this->db->prepare('SELECT * FROM `log_tickets` WHERE `id`= ? ORDER BY `changedate` DESC');
349
+		$query->bindValue(1, $id);
350
+
351
+		try {
352
+			$query->execute();
353
+		} catch (PDOException $e) {
354
+			die($e->getMessage());
355
+		}
356
+
357
+		return $query->fetchAll();
358
+	}
359 359
 }
Please login to merge, or discard this patch.
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 
32 32
         try {
33 33
             $query->execute();
34
-        } catch (PDOException $e) {
34
+        }catch (PDOException $e) {
35 35
             die($e->getMessage());
36 36
         }
37 37
     }
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 
65 65
         try {
66 66
             $query->execute();
67
-        } catch (PDOException $e) {
67
+        }catch (PDOException $e) {
68 68
             die($e->getMessage());
69 69
         }
70 70
     }
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 
78 78
         try {
79 79
             $query->execute();
80
-        } catch (PDOException $e) {
80
+        }catch (PDOException $e) {
81 81
             die($e->getMessage());
82 82
         }
83 83
     }
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
             $query->execute();
92 92
 
93 93
             return $query->fetch();
94
-        } catch (PDOException $e) {
94
+        }catch (PDOException $e) {
95 95
             die($e->getMessage());
96 96
         }
97 97
     }
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 
103 103
         try {
104 104
             $query->execute();
105
-        } catch (PDOException $e) {
105
+        }catch (PDOException $e) {
106 106
             die($e->getMessage());
107 107
         }
108 108
 
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 
116 116
         try {
117 117
             $query->execute();
118
-        } catch (PDOException $e) {
118
+        }catch (PDOException $e) {
119 119
             die($e->getMessage());
120 120
         }
121 121
 
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 
129 129
         try {
130 130
             $query->execute();
131
-        } catch (PDOException $e) {
131
+        }catch (PDOException $e) {
132 132
             die($e->getMessage());
133 133
         }
134 134
 
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 
143 143
         try {
144 144
             $query->execute();
145
-        } catch (PDOException $e) {
145
+        }catch (PDOException $e) {
146 146
             die($e->getMessage());
147 147
         }
148 148
 
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 
157 157
         try {
158 158
             $query->execute();
159
-        } catch (PDOException $e) {
159
+        }catch (PDOException $e) {
160 160
             die($e->getMessage());
161 161
         }
162 162
 
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
 
171 171
         try {
172 172
             $query->execute();
173
-        } catch (PDOException $e) {
173
+        }catch (PDOException $e) {
174 174
             die($e->getMessage());
175 175
         }
176 176
 
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
 
186 186
         try {
187 187
             $query->execute();
188
-        } catch (PDOException $e) {
188
+        }catch (PDOException $e) {
189 189
             die($e->getMessage());
190 190
         }
191 191
 
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
 
200 200
         try {
201 201
             $query->execute();
202
-        } catch (PDOException $e) {
202
+        }catch (PDOException $e) {
203 203
             die($e->getMessage());
204 204
         }
205 205
 
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 
217 217
         try {
218 218
             $query->execute();
219
-        } catch (PDOException $e) {
219
+        }catch (PDOException $e) {
220 220
             die($e->getMessage());
221 221
         }
222 222
 
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
 
232 232
         try {
233 233
             $query->execute();
234
-        } catch (PDOException $e) {
234
+        }catch (PDOException $e) {
235 235
             die($e->getMessage());
236 236
         }
237 237
 
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
 
245 245
         try {
246 246
             $query->execute();
247
-        } catch (PDOException $e) {
247
+        }catch (PDOException $e) {
248 248
             die($e->getMessage());
249 249
         }
250 250
 
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 
259 259
         try {
260 260
             $query->execute();
261
-        } catch (PDOException $e) {
261
+        }catch (PDOException $e) {
262 262
             die($e->getMessage());
263 263
         }
264 264
 
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
 
273 273
         try {
274 274
             $query->execute();
275
-        } catch (PDOException $e) {
275
+        }catch (PDOException $e) {
276 276
             die($e->getMessage());
277 277
         }
278 278
 
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
             $query->execute();
288 288
 
289 289
             return $query->fetch();
290
-        } catch (PDOException $e) {
290
+        }catch (PDOException $e) {
291 291
             die($e->getMessage());
292 292
         }
293 293
     }
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
 
339 339
         try {
340 340
             $query->execute();
341
-        } catch (PDOException $e) {
341
+        }catch (PDOException $e) {
342 342
             die($e->getMessage());
343 343
         }
344 344
     }
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
 
351 351
         try {
352 352
             $query->execute();
353
-        } catch (PDOException $e) {
353
+        }catch (PDOException $e) {
354 354
             die($e->getMessage());
355 355
         }
356 356
 
Please login to merge, or discard this patch.