Completed
Push — master ( 929644...1ba5c4 )
by mains
02:48
created
index.php 2 patches
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -1,53 +1,53 @@  discard block
 block discarded – undo
1
-<?php include 'php/jodel-web.php';?>
1
+<?php include 'php/jodel-web.php'; ?>
2 2
 <!DOCTYPE html>
3 3
 <html lang="en">
4 4
 	<head>
5
-		<title><?php echo $viewTest->getTitle($posts[0], $view, $isDetailedView);?></title>
5
+		<title><?php echo $viewTest->getTitle($posts[0], $view, $isDetailedView); ?></title>
6 6
 		
7 7
 		<meta charset="utf-8">
8 8
 		<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
9 9
 		<meta http-equiv="x-ua-compatible" content="ie=edge">
10 10
 		
11
-		<meta name="description" content="<?php echo $viewTest->getMetaDescription($posts[0], $view, $isDetailedView);?>">
11
+		<meta name="description" content="<?php echo $viewTest->getMetaDescription($posts[0], $view, $isDetailedView); ?>">
12 12
 		<meta name="keywords" content="jodelblue, jodel, blue, webclient, web, client, web-app, browser, app">
13 13
 		
14 14
 		<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.5/css/bootstrap.min.css" integrity="sha384-AysaV+vQoT3kOAXZkl02PThvDr8HYKPZhNT5h/CXfBThSRXQ6jW5DO2ekP5ViFdi" crossorigin="anonymous">
15
-		<link rel="stylesheet" href="<?php echo $baseUrl;?>css/font-awesome.min.css">
16
-		<link rel="stylesheet" href="<?php echo $baseUrl;?>style.css" type="text/css">
15
+		<link rel="stylesheet" href="<?php echo $baseUrl; ?>css/font-awesome.min.css">
16
+		<link rel="stylesheet" href="<?php echo $baseUrl; ?>style.css" type="text/css">
17 17
 		
18
-		<link rel="shortcut icon" type="image/x-icon" href="<?php echo $baseUrl;?>img/favicon/favicon.ico">
19
-		<link rel="icon" type="image/x-icon" href="<?php echo $baseUrl;?>img/favicon/favicon.ico">
20
-		<link rel="icon" type="image/gif" href="<?php echo $baseUrl;?>img/favicon/favicon.gif">
21
-		<link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon.png">
22
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon.png">
23
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-57x57.png" sizes="57x57">
24
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-60x60.png" sizes="60x60">
25
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-72x72.png" sizes="72x72">
26
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-76x76.png" sizes="76x76">
27
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-114x114.png" sizes="114x114">
28
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-120x120.png" sizes="120x120">
29
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-128x128.png" sizes="128x128">
30
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-144x144.png" sizes="144x144">
31
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-152x152.png" sizes="152x152">
32
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-180x180.png" sizes="180x180">
33
-		<link rel="apple-touch-icon" href="<?php echo $baseUrl;?>img/favicon/apple-touch-icon-precomposed.png">
34
-		<link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-16x16.png" sizes="16x16">
35
-		<link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-32x32.png" sizes="32x32">
36
-		<link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-96x96.png" sizes="96x96">
37
-		<link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-160x160.png" sizes="160x160">
38
-		<link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-192x192.png" sizes="192x192">
39
-		<link rel="icon" type="image/png" href="<?php echo $baseUrl;?>img/favicon/favicon-196x196.png" sizes="196x196">
40
-		<meta name="msapplication-TileImage" content="<?php echo $baseUrl;?>img/favicon/win8-tile-144x144.png"> 
18
+		<link rel="shortcut icon" type="image/x-icon" href="<?php echo $baseUrl; ?>img/favicon/favicon.ico">
19
+		<link rel="icon" type="image/x-icon" href="<?php echo $baseUrl; ?>img/favicon/favicon.ico">
20
+		<link rel="icon" type="image/gif" href="<?php echo $baseUrl; ?>img/favicon/favicon.gif">
21
+		<link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon.png">
22
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon.png">
23
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-57x57.png" sizes="57x57">
24
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-60x60.png" sizes="60x60">
25
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-72x72.png" sizes="72x72">
26
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-76x76.png" sizes="76x76">
27
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-114x114.png" sizes="114x114">
28
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-120x120.png" sizes="120x120">
29
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-128x128.png" sizes="128x128">
30
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-144x144.png" sizes="144x144">
31
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-152x152.png" sizes="152x152">
32
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-180x180.png" sizes="180x180">
33
+		<link rel="apple-touch-icon" href="<?php echo $baseUrl; ?>img/favicon/apple-touch-icon-precomposed.png">
34
+		<link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-16x16.png" sizes="16x16">
35
+		<link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-32x32.png" sizes="32x32">
36
+		<link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-96x96.png" sizes="96x96">
37
+		<link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-160x160.png" sizes="160x160">
38
+		<link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-192x192.png" sizes="192x192">
39
+		<link rel="icon" type="image/png" href="<?php echo $baseUrl; ?>img/favicon/favicon-196x196.png" sizes="196x196">
40
+		<meta name="msapplication-TileImage" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-144x144.png"> 
41 41
 		<meta name="msapplication-TileColor" content="#5682a3"> 
42 42
 		<meta name="msapplication-navbutton-color" content="#5682a3"> 
43 43
 		<meta name="application-name" content="JodelBlue"/> 
44 44
 		<meta name="msapplication-tooltip" content="JodelBlue"/> 
45 45
 		<meta name="apple-mobile-web-app-title" content="JodelBlue"/> 
46
-		<meta name="msapplication-square70x70logo" content="<?php echo $baseUrl;?>img/favicon/win8-tile-70x70.png"> 
47
-		<meta name="msapplication-square144x144logo" content="<?php echo $baseUrl;?>img/favicon/win8-tile-144x144.png"> 
48
-		<meta name="msapplication-square150x150logo" content="<?php echo $baseUrl;?>img/favicon/win8-tile-150x150.png"> 
49
-		<meta name="msapplication-wide310x150logo" content="<?php echo $baseUrl;?>img/favicon/win8-tile-310x150.png"> 
50
-		<meta name="msapplication-square310x310logo" content="<?php echo $baseUrl;?>img/favicon/win8-tile-310x310.png"> 
46
+		<meta name="msapplication-square70x70logo" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-70x70.png"> 
47
+		<meta name="msapplication-square144x144logo" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-144x144.png"> 
48
+		<meta name="msapplication-square150x150logo" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-150x150.png"> 
49
+		<meta name="msapplication-wide310x150logo" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-310x150.png"> 
50
+		<meta name="msapplication-square310x310logo" content="<?php echo $baseUrl; ?>img/favicon/win8-tile-310x310.png"> 
51 51
 	</head>
52 52
 	
53 53
 	<body>
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 
91 91
 					<content id="posts">
92 92
 						<?php
93
-							for($i = 0; $i<$loops; $i++)
93
+							for($i = 0; $i < $loops; $i++)
94 94
 							{
95 95
 								if(array_key_exists($i, $posts) && array_key_exists('post_id', $posts[$i]) && isset($posts[$i]['post_id']))
96 96
 								{
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 								<?php if(isset($_GET['postId']) && isset($_GET['getPostDetails'])) { ?>
135 135
 								<h2>Comment on Jodel</h2>
136 136
 								<form method="POST">				
137
-										<input type="hidden" name="ancestor" value="<?php echo htmlspecialchars($_GET['postId']);?>" />
137
+										<input type="hidden" name="ancestor" value="<?php echo htmlspecialchars($_GET['postId']); ?>" />
138 138
 										<textarea id="message" name="message" placeholder="Send a comment on a Jodel to all students within 10km" required></textarea> 
139 139
 									<br />
140 140
 									<input type="submit" value="SEND" /> 
@@ -171,17 +171,17 @@  discard block
 block discarded – undo
171 171
 				<div class="col-xs-12">
172 172
 					<div class="row">
173 173
 						<div class="col-xs-3">
174
-							<a href="<?php echo $baseUrl;?>index.php" <?php if($view=='time') echo 'class="active"';?>><i class="fa fa-clock-o fa-3x"></i></a>
174
+							<a href="<?php echo $baseUrl; ?>index.php" <?php if($view == 'time') echo 'class="active"'; ?>><i class="fa fa-clock-o fa-3x"></i></a>
175 175
 						</div>
176 176
 						<div class="col-xs-3">
177
-							<a href="<?php echo $baseUrl;?>index.php?view=comment" <?php if($view=='comment') echo 'class="active"';?>><i class="fa fa-commenting-o fa-3x"></i></a>
177
+							<a href="<?php echo $baseUrl; ?>index.php?view=comment" <?php if($view == 'comment') echo 'class="active"'; ?>><i class="fa fa-commenting-o fa-3x"></i></a>
178 178
 						</div>
179 179
 						<div class="col-xs-3">
180
-							<a href="<?php echo $baseUrl;?>index.php?view=upVote" <?php if($view=='upVote') echo 'class="active"';?>><i class="fa fa-angle-up fa-3x"></i></a>
180
+							<a href="<?php echo $baseUrl; ?>index.php?view=upVote" <?php if($view == 'upVote') echo 'class="active"'; ?>><i class="fa fa-angle-up fa-3x"></i></a>
181 181
 						</div>
182 182
 						<div class="col-xs-3">
183 183
 							<nav>
184
-								<a href="<?php echo $baseUrl;?>about-us.html">about us</a>
184
+								<a href="<?php echo $baseUrl; ?>about-us.html">about us</a>
185 185
 							</nav>
186 186
 						</div>
187 187
 					</div>
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
 		<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js" integrity="sha384-3ceskX3iaEnIogmQchP8opvBy3Mi7Ce34nWjpBIwVTHfGYWQS9jwHDVRnpKKHJg7" crossorigin="anonymous"></script>
195 195
     	<script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.3.7/js/tether.min.js" integrity="sha384-XTs3FgkjiBgo8qjEjBk0tGmf3wPrWtA6coPfQDfFEY8AnYJwjalXCiosYRBIBZX8" crossorigin="anonymous"></script>
196 196
     	<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.5/js/bootstrap.min.js" integrity="sha384-BLiI7JTZm+JWlgKa0M0kGRpJbF2J8q+qreVrKBC47e3K6BW78kGLrCkeRX6I9RoK" crossorigin="anonymous"></script>
197
-    	<script src="<?php echo $baseUrl;?>js/jQueryEmoji.js"></script>
197
+    	<script src="<?php echo $baseUrl; ?>js/jQueryEmoji.js"></script>
198 198
 
199 199
 		<script>
200 200
 			//BackButton
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 							if(!$("article[id='"+ hash +"']").length)
242 242
 							{
243 243
 								$.ajax({
244
-									url: '<?php echo $baseUrl;?>get-posts-ajax.php?lastPostId=' + lastPostId + '&view=' + view,
244
+									url: '<?php echo $baseUrl; ?>get-posts-ajax.php?lastPostId=' + lastPostId + '&view=' + view,
245 245
 									dataType: 'html',
246 246
 									async: false,
247 247
 									success: function(html) {
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
 						$('#loading').show();
285 285
 
286 286
 						$.ajax({
287
-							url: '<?php echo $baseUrl;?>get-posts-ajax.php?lastPostId=' + lastPostId + '&view=' + view,
287
+							url: '<?php echo $baseUrl; ?>get-posts-ajax.php?lastPostId=' + lastPostId + '&view=' + view,
288 288
 							dataType: 'html',
289 289
 							async: false,
290 290
 							success: function(html) {
Please login to merge, or discard this patch.
Braces   +38 added lines, -9 removed lines patch added patch discarded remove patch
@@ -75,7 +75,11 @@  discard block
 block discarded – undo
75 75
 
76 76
 					<div id="location_mobile" class="hidden-sm-up">
77 77
 						<form method="get">
78
-							<input type="text" id="city_mobile" name="city" placeholder="<?php if(isset($newPositionStatus)) echo $newPositionStatus; ?>" required>
78
+							<input type="text" id="city_mobile" name="city" placeholder="<?php if(isset($newPositionStatus))
79
+{
80
+	echo $newPositionStatus;
81
+}
82
+?>" required>
79 83
 
80 84
 							<input type="submit" id="submit_mobile" class="fa" value="&#xf0ac;" />
81 85
 						</form>
@@ -102,7 +106,9 @@  discard block
 block discarded – undo
102 106
 
103 107
 					</content>
104 108
 					
105
-					<?php if(!isset($_GET['postId']) && !isset($_GET['getPostDetails'])) { ?>
109
+					<?php if(!isset($_GET['postId']) && !isset($_GET['getPostDetails']))
110
+{
111
+?>
106 112
 						<p id="loading">
107 113
 							Loading…
108 114
 						</p>
@@ -115,7 +121,11 @@  discard block
 block discarded – undo
115 121
 							<div>
116 122
 								<h2>Position / Hashtag</h2>
117 123
 								<form method="get">
118
-									<input type="text" id="city" name="city" placeholder="<?php if(isset($newPositionStatus)) echo $newPositionStatus; ?>" required>
124
+									<input type="text" id="city" name="city" placeholder="<?php if(isset($newPositionStatus))
125
+{
126
+	echo $newPositionStatus;
127
+}
128
+?>" required>
119 129
 									<label>try: #jhj</label><br>
120 130
 									<input type="submit" value="Set Location" /> 
121 131
 								</form>
@@ -131,7 +141,9 @@  discard block
 block discarded – undo
131 141
 
132 142
 						<article>
133 143
 							<div>
134
-								<?php if(isset($_GET['postId']) && isset($_GET['getPostDetails'])) { ?>
144
+								<?php if(isset($_GET['postId']) && isset($_GET['getPostDetails']))
145
+{
146
+?>
135 147
 								<h2>Comment on Jodel</h2>
136 148
 								<form method="POST">				
137 149
 										<input type="hidden" name="ancestor" value="<?php echo htmlspecialchars($_GET['postId']);?>" />
@@ -139,7 +151,10 @@  discard block
 block discarded – undo
139 151
 									<br />
140 152
 									<input type="submit" value="SEND" /> 
141 153
 								</form>
142
-									<?php } else { ?>
154
+									<?php }
155
+else
156
+{
157
+?>
143 158
 								<h2>New Jodel</h2>
144 159
 								<form method="POST">
145 160
 									<textarea id="message" name="message" placeholder="Send a Jodel to all students within 10km" required></textarea> 
@@ -171,13 +186,25 @@  discard block
 block discarded – undo
171 186
 				<div class="col-xs-12">
172 187
 					<div class="row">
173 188
 						<div class="col-xs-3">
174
-							<a href="<?php echo $baseUrl;?>index.php" <?php if($view=='time') echo 'class="active"';?>><i class="fa fa-clock-o fa-3x"></i></a>
189
+							<a href="<?php echo $baseUrl;?>index.php" <?php if($view=='time')
190
+{
191
+	echo 'class="active"';
192
+}
193
+?>><i class="fa fa-clock-o fa-3x"></i></a>
175 194
 						</div>
176 195
 						<div class="col-xs-3">
177
-							<a href="<?php echo $baseUrl;?>index.php?view=comment" <?php if($view=='comment') echo 'class="active"';?>><i class="fa fa-commenting-o fa-3x"></i></a>
196
+							<a href="<?php echo $baseUrl;?>index.php?view=comment" <?php if($view=='comment')
197
+{
198
+	echo 'class="active"';
199
+}
200
+?>><i class="fa fa-commenting-o fa-3x"></i></a>
178 201
 						</div>
179 202
 						<div class="col-xs-3">
180
-							<a href="<?php echo $baseUrl;?>index.php?view=upVote" <?php if($view=='upVote') echo 'class="active"';?>><i class="fa fa-angle-up fa-3x"></i></a>
203
+							<a href="<?php echo $baseUrl;?>index.php?view=upVote" <?php if($view=='upVote')
204
+{
205
+	echo 'class="active"';
206
+}
207
+?>><i class="fa fa-angle-up fa-3x"></i></a>
181 208
 						</div>
182 209
 						<div class="col-xs-3">
183 210
 							<nav>
@@ -218,7 +245,9 @@  discard block
 block discarded – undo
218 245
 				    $('html,body').animate({scrollTop: aTag.offset().top-90},'slow');
219 246
 				}
220 247
 
221
-				<?php if(!isset($_GET['postId']) && !isset($_GET['getPostDetails'])) { ?>
248
+				<?php if(!isset($_GET['postId']) && !isset($_GET['getPostDetails']))
249
+{
250
+?>
222 251
 
223 252
 				
224 253
 
Please login to merge, or discard this patch.
php/JodelAccount.php 2 patches
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
         {
36 36
             $this->refreshToken();
37 37
         }
38
-        $this->accessToken  = $this->getAccessToken();
38
+        $this->accessToken = $this->getAccessToken();
39 39
     }
40 40
 
41 41
     function isAccountVerified()
@@ -64,11 +64,11 @@  discard block
 block discarded – undo
64 64
         }
65 65
 
66 66
         $db = new DatabaseConnect();
67
-        $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid  . "'");
67
+        $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid . "'");
68 68
         
69 69
         $location = new Location();
70 70
         
71
-        if ($result->num_rows > 0)
71
+        if($result->num_rows > 0)
72 72
         {
73 73
             // output data of each row
74 74
             while($row = $result->fetch_assoc())
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
                     }
142 142
                     else
143 143
                     {
144
-                        error_log('User with JodelDeviceId:' . $this->deviceUid .  ' [' . $_SERVER['REMOTE_ADDR'] . '][' . $_SERVER ['HTTP_USER_AGENT'] . '] changed to Location: ' . $name);
144
+                        error_log('User with JodelDeviceId:' . $this->deviceUid . ' [' . $_SERVER['REMOTE_ADDR'] . '][' . $_SERVER ['HTTP_USER_AGENT'] . '] changed to Location: ' . $name);
145 145
                     }
146 146
                 }
147 147
 
@@ -153,11 +153,11 @@  discard block
 block discarded – undo
153 153
     function getLocation()
154 154
     {
155 155
         $db = new DatabaseConnect();
156
-        $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid  . "'");
156
+        $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid . "'");
157 157
         
158 158
         $location = new Location();
159 159
         
160
-        if ($result->num_rows > 0)
160
+        if($result->num_rows > 0)
161 161
         {
162 162
             // output data of each row
163 163
             while($row = $result->fetch_assoc())
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
         if(isset($_POST['color']))
263 263
         {
264 264
             $color = $_POST['color'];
265
-            switch ($color) {
265
+            switch($color) {
266 266
                 case '8ABDB0':
267 267
                     $color = '8ABDB0';
268 268
                     break;
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
         $db = new DatabaseConnect();  
317 317
         $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid . "'");
318 318
 
319
-        if ($result->num_rows > 0)
319
+        if($result->num_rows > 0)
320 320
         {
321 321
             // output data of each row
322 322
             while($row = $result->fetch_assoc())
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
                                     expiration_date='" . $expiration_date . "'
356 356
                                 WHERE device_uid='" . $device_uid . "'");
357 357
 
358
-        if($result === false){
358
+        if($result === false) {
359 359
                 error_log("Adding account failed: (" . $db->errno . ") " . $db->error);
360 360
         }   
361 361
     }
@@ -365,11 +365,11 @@  discard block
 block discarded – undo
365 365
     function getAccessToken()
366 366
     {
367 367
         $db = new DatabaseConnect();
368
-        $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid  . "'");
368
+        $result = $db->query("SELECT * FROM accounts WHERE device_uid='" . $this->deviceUid . "'");
369 369
         
370 370
         $accessToken;
371 371
         
372
-        if ($result->num_rows > 0)
372
+        if($result->num_rows > 0)
373 373
         {
374 374
             // output data of each row
375 375
             while($row = $result->fetch_assoc())
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
         $result = $db->query("INSERT INTO votes (device_uid, postId, type)
436 436
                         VALUES ('" . $this->deviceUid . "','" . $postId . "','" . $voteType . "')");
437 437
         
438
-        if($result === false){
438
+        if($result === false) {
439 439
                 $error = db_error();
440 440
                 echo $error;
441 441
                 echo "Adding Vote failed: (" . $result->errno . ") " . $result->error;
@@ -463,11 +463,11 @@  discard block
 block discarded – undo
463 463
         $result = $db->query("INSERT INTO accounts (access_token, refresh_token, token_type,
464 464
                         expires_in, expiration_date, distinct_id, device_uid, name, lat, lng)
465 465
                         VALUES ('" . $access_token . "','" . $refresh_token . "','" . $token_type .
466
-                        "','" .  $expires_in . "','" . $expiration_date . "','" . $distinct_id .
466
+                        "','" . $expires_in . "','" . $expiration_date . "','" . $distinct_id .
467 467
                         "','" . $device_uid . "','" . $name . "','" . $lat . "','" . $lng . "') ");
468 468
 
469 469
         $success = TRUE;
470
-        if($result === false){
470
+        if($result === false) {
471 471
                 $error = db_error();
472 472
                 echo $error;
473 473
                 echo "Adding account failed: (" . $result->errno . ") " . $result->error;
Please login to merge, or discard this patch.
Braces   +12 added lines, -7 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
         if($location->getLat() == $lat && $location->getLng() == $lng && $location->getCityName() == $name)
88 88
         {
89 89
             return TRUE;
90
-        }  
90
+        }
91 91
         else
92 92
         {
93 93
             return FALSE;
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
         if(substr($_GET['city'], 0, 1) === '#')
101 101
         {
102 102
             return htmlspecialchars($_GET['city']) . " " . $this->location->cityName;
103
-        }                
103
+        }
104 104
         else
105 105
         {
106 106
             $url = 'https://maps.googleapis.com/maps/api/geocode/json?address=' . htmlspecialchars($_GET['city']) . '&key=AIzaSyCwhnja-or07012HqrhPW7prHEDuSvFT4w';
@@ -262,7 +262,8 @@  discard block
 block discarded – undo
262 262
         if(isset($_POST['color']))
263 263
         {
264 264
             $color = $_POST['color'];
265
-            switch ($color) {
265
+            switch ($color)
266
+            {
266 267
                 case '8ABDB0':
267 268
                     $color = '8ABDB0';
268 269
                     break;
@@ -355,7 +356,8 @@  discard block
 block discarded – undo
355 356
                                     expiration_date='" . $expiration_date . "'
356 357
                                 WHERE device_uid='" . $device_uid . "'");
357 358
 
358
-        if($result === false){
359
+        if($result === false)
360
+        {
359 361
                 error_log("Adding account failed: (" . $db->errno . ") " . $db->error);
360 362
         }   
361 363
     }
@@ -435,14 +437,16 @@  discard block
 block discarded – undo
435 437
         $result = $db->query("INSERT INTO votes (device_uid, postId, type)
436 438
                         VALUES ('" . $this->deviceUid . "','" . $postId . "','" . $voteType . "')");
437 439
         
438
-        if($result === false){
440
+        if($result === false)
441
+        {
439 442
                 $error = db_error();
440 443
                 echo $error;
441 444
                 echo "Adding Vote failed: (" . $result->errno . ") " . $result->error;
442 445
         }       
443 446
     }
444 447
 
445
-    function registerAccount($location) {
448
+    function registerAccount($location)
449
+    {
446 450
         $accountCreator = new CreateUser();
447 451
         $accountCreator->setLocation($location);
448 452
         $data = $accountCreator->execute();
@@ -467,7 +471,8 @@  discard block
 block discarded – undo
467 471
                         "','" . $device_uid . "','" . $name . "','" . $lat . "','" . $lng . "') ");
468 472
 
469 473
         $success = TRUE;
470
-        if($result === false){
474
+        if($result === false)
475
+        {
471 476
                 $error = db_error();
472 477
                 echo $error;
473 478
                 echo "Adding account failed: (" . $result->errno . ") " . $result->error;
Please login to merge, or discard this patch.