@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | $numberTypes = PhoneNumberType::all(); |
27 | 27 | |
28 | 28 | $numTypes = []; |
29 | - foreach($numberTypes as $type) |
|
29 | + foreach ($numberTypes as $type) |
|
30 | 30 | { |
31 | 31 | $numTypes[$type->phone_type_id] = $type->description; |
32 | 32 | } |
@@ -49,12 +49,12 @@ discard block |
||
49 | 49 | |
50 | 50 | $contID = $cont->cont_id; |
51 | 51 | |
52 | - if(!empty(array_filter($request['phoneNumber']))) |
|
52 | + if (!empty(array_filter($request['phoneNumber']))) |
|
53 | 53 | { |
54 | 54 | $num = count($request['phoneNumber']); |
55 | - for($i=0; $i < $num; $i++) |
|
55 | + for ($i = 0; $i<$num; $i++) |
|
56 | 56 | { |
57 | - if(!empty($request['phoneNumber'][$i])) |
|
57 | + if (!empty($request['phoneNumber'][$i])) |
|
58 | 58 | { |
59 | 59 | CustomerContactPhones::create([ |
60 | 60 | 'cont_id' => $contID, |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | $numberTypes = PhoneNumberType::all(); |
88 | 88 | |
89 | 89 | $numTypes = []; |
90 | - foreach($numberTypes as $type) |
|
90 | + foreach ($numberTypes as $type) |
|
91 | 91 | { |
92 | 92 | $numTypes[$type->phone_type_id] = $type->description; |
93 | 93 | } |
@@ -113,10 +113,10 @@ discard block |
||
113 | 113 | |
114 | 114 | // Clear all contact phone numbers and re-enter them |
115 | 115 | CustomerContactPhones::where('cont_id', $id)->delete(); |
116 | - if(!empty(array_filter($request['phoneNumber']))) |
|
116 | + if (!empty(array_filter($request['phoneNumber']))) |
|
117 | 117 | { |
118 | 118 | $num = count($request['phoneNumber']); |
119 | - for($i=0; $i < $num; $i++) |
|
119 | + for ($i = 0; $i<$num; $i++) |
|
120 | 120 | { |
121 | 121 | CustomerContactPhones::create([ |
122 | 122 | 'cont_id' => $id, |
@@ -158,9 +158,9 @@ discard block |
||
158 | 158 | $vcard->addEmail($contact->email); |
159 | 159 | $vcard->addAddress(null, null, $custData->address, $custData->city, $custData->state, $custData->zip, null); |
160 | 160 | |
161 | - if(!empty($numbers)) |
|
161 | + if (!empty($numbers)) |
|
162 | 162 | { |
163 | - foreach($numbers as $phone) |
|
163 | + foreach ($numbers as $phone) |
|
164 | 164 | { |
165 | 165 | $vcard->addPhoneNumber($phone->phone_number, $phone->description); |
166 | 166 | } |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | $custDetails = Customers::find($id); |
56 | 56 | |
57 | 57 | // Check for empty data set |
58 | - if(empty($custDetails)) |
|
58 | + if (empty($custDetails)) |
|
59 | 59 | { |
60 | 60 | return view('err.customerNotFound'); |
61 | 61 | } |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | Customers::find($id)->update($request->all()); |
91 | 91 | |
92 | 92 | // Modify to the new ID number if set |
93 | - if(isset($request->cust_id)) |
|
93 | + if (isset($request->cust_id)) |
|
94 | 94 | { |
95 | 95 | $id = $request->cust_id; |
96 | 96 | } |
@@ -35,7 +35,7 @@ |
||
35 | 35 | */ |
36 | 36 | public function report(Exception $exception) |
37 | 37 | { |
38 | - if(config('app.debug')) |
|
38 | + if (config('app.debug')) |
|
39 | 39 | { |
40 | 40 | parent::report($exception); |
41 | 41 | } |
@@ -25,12 +25,12 @@ discard block |
||
25 | 25 | $details = FileLinks::where('link_hash', $id)->first(); |
26 | 26 | |
27 | 27 | // Verify that the link is valid |
28 | - if(empty($details)) |
|
28 | + if (empty($details)) |
|
29 | 29 | { |
30 | 30 | return view('links.guest.badLink'); |
31 | 31 | } |
32 | 32 | // Verify that the link has not expired |
33 | - else if($details->expire <= date('Y-m-d')) |
|
33 | + else if ($details->expire<=date('Y-m-d')) |
|
34 | 34 | { |
35 | 35 | return view('links.guest.expiredLink'); |
36 | 36 | } |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | |
56 | 56 | $filePath = config('filesystems.paths.links').DIRECTORY_SEPARATOR.$details->link_id; |
57 | 57 | |
58 | - foreach($request->file as $file) |
|
58 | + foreach ($request->file as $file) |
|
59 | 59 | { |
60 | 60 | // Clean the file and store it |
61 | 61 | $fileName = Files::cleanFilename($filePath, $file->getClientOriginalName()); |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | 'upload' => 1 |
77 | 77 | ]); |
78 | 78 | |
79 | - if(!empty($request->note)) |
|
79 | + if (!empty($request->note)) |
|
80 | 80 | { |
81 | 81 | FileLinkNotes::create([ |
82 | 82 | 'link_id' => $details->link_id, |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | { |
93 | 93 | Mail::to($user)->send(new NewLinkFile($details)); |
94 | 94 | } |
95 | - catch(Exception $e) |
|
95 | + catch (Exception $e) |
|
96 | 96 | { |
97 | 97 | report($e); |
98 | 98 | } |
@@ -35,9 +35,9 @@ discard block |
||
35 | 35 | ->get(); |
36 | 36 | |
37 | 37 | $sysArr = []; |
38 | - foreach($systems as $sys) |
|
38 | + foreach ($systems as $sys) |
|
39 | 39 | { |
40 | - foreach($sys->SystemTypes as $s) |
|
40 | + foreach ($sys->SystemTypes as $s) |
|
41 | 41 | { |
42 | 42 | $sysArr[$sys->name][$s->sys_id] = $s->name; |
43 | 43 | } |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | public function search(Request $request) |
53 | 53 | { |
54 | 54 | // Run different request based on if system field is filled out or not |
55 | - if(!empty($request->system)) |
|
55 | + if (!empty($request->system)) |
|
56 | 56 | { |
57 | 57 | $tipData = TechTips::where('subject', 'like', '%'.$request->tipSearch.'%') |
58 | 58 | ->whereHas('TechTipSystems', function($q) use($request) |
@@ -81,9 +81,9 @@ discard block |
||
81 | 81 | ->get(); |
82 | 82 | |
83 | 83 | $sysArr = []; |
84 | - foreach($systems as $sys) |
|
84 | + foreach ($systems as $sys) |
|
85 | 85 | { |
86 | - foreach($sys->SystemTypes as $s) |
|
86 | + foreach ($sys->SystemTypes as $s) |
|
87 | 87 | { |
88 | 88 | $sysArr[$sys->name][$s->sys_id] = $s->name; |
89 | 89 | } |
@@ -108,10 +108,10 @@ discard block |
||
108 | 108 | $tipID = $tip->tip_id; |
109 | 109 | |
110 | 110 | // Enter all system tags associated with the tip |
111 | - if(is_array($request->sysTags)) |
|
111 | + if (is_array($request->sysTags)) |
|
112 | 112 | { |
113 | 113 | |
114 | - foreach($request->sysTags as $tag) |
|
114 | + foreach ($request->sysTags as $tag) |
|
115 | 115 | { |
116 | 116 | TechTipSystems::create([ |
117 | 117 | 'tip_id' => $tipID, |
@@ -128,10 +128,10 @@ discard block |
||
128 | 128 | } |
129 | 129 | |
130 | 130 | // If there are any files, process them |
131 | - if(!empty($request->file)) |
|
131 | + if (!empty($request->file)) |
|
132 | 132 | { |
133 | 133 | $filePath = config('filesystems.paths.tips').DIRECTORY_SEPARATOR.$tipID; |
134 | - foreach($request->file as $file) |
|
134 | + foreach ($request->file as $file) |
|
135 | 135 | { |
136 | 136 | // Clean the file and store it |
137 | 137 | $fileName = Files::cleanFilename($filePath, $file->getClientOriginalName()); |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | { |
160 | 160 | Mail::to($userList)->send(new newTechtip($tipData)); |
161 | 161 | } |
162 | - catch(Exception $e) |
|
162 | + catch (Exception $e) |
|
163 | 163 | { |
164 | 164 | report($e); |
165 | 165 | } |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | public function details($id, $name) |
174 | 174 | { |
175 | 175 | $tipData = TechTips::where('tip_id', $id)->with('user')->first(); |
176 | - if(empty($tipData)) |
|
176 | + if (empty($tipData)) |
|
177 | 177 | { |
178 | 178 | return view('err.tipNotFound'); |
179 | 179 | } |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | public function edit($id) |
222 | 222 | { |
223 | 223 | $tipData = TechTips::find($id); |
224 | - if(empty($tipData)) |
|
224 | + if (empty($tipData)) |
|
225 | 225 | { |
226 | 226 | return 'tip not found'; |
227 | 227 | } |
@@ -244,9 +244,9 @@ discard block |
||
244 | 244 | ->get(); |
245 | 245 | |
246 | 246 | $sysArr = []; |
247 | - foreach($systems as $sys) |
|
247 | + foreach ($systems as $sys) |
|
248 | 248 | { |
249 | - foreach($sys->SystemTypes as $s) |
|
249 | + foreach ($sys->SystemTypes as $s) |
|
250 | 250 | { |
251 | 251 | $sysArr[$sys->name][$s->sys_id] = $s->name; |
252 | 252 | } |
@@ -275,10 +275,10 @@ discard block |
||
275 | 275 | |
276 | 276 | // Enter all system tags associated with the tip after destroying the existing systems |
277 | 277 | TechTipSystems::where('tip_id', $id)->delete(); |
278 | - if(is_array($request->sysTags)) |
|
278 | + if (is_array($request->sysTags)) |
|
279 | 279 | { |
280 | 280 | |
281 | - foreach($request->sysTags as $tag) |
|
281 | + foreach ($request->sysTags as $tag) |
|
282 | 282 | { |
283 | 283 | TechTipSystems::create([ |
284 | 284 | 'tip_id' => $id, |
@@ -296,13 +296,13 @@ discard block |
||
296 | 296 | |
297 | 297 | // Determine if any files were removed |
298 | 298 | $tipFiles = TechTipFiles::where('tip_id', $id)->get(); |
299 | - if(!$tipFiles->isEmpty()) |
|
299 | + if (!$tipFiles->isEmpty()) |
|
300 | 300 | { |
301 | - if(!empty($request->existingFile)) |
|
301 | + if (!empty($request->existingFile)) |
|
302 | 302 | { |
303 | - foreach($tipFiles as $file) |
|
303 | + foreach ($tipFiles as $file) |
|
304 | 304 | { |
305 | - if(!in_array($file->file_id, $request->existingFile)) |
|
305 | + if (!in_array($file->file_id, $request->existingFile)) |
|
306 | 306 | { |
307 | 307 | TechTipFiles::where('file_id', $file->file_id)->delete(); |
308 | 308 | Files::deleteFile($file->file_id); |
@@ -317,10 +317,10 @@ discard block |
||
317 | 317 | } |
318 | 318 | |
319 | 319 | // Process any new files |
320 | - if(!empty($request->file)) |
|
320 | + if (!empty($request->file)) |
|
321 | 321 | { |
322 | 322 | $filePath = config('filesystems.paths.tips').DIRECTORY_SEPARATOR.$id; |
323 | - foreach($request->file as $file) |
|
323 | + foreach ($request->file as $file) |
|
324 | 324 | { |
325 | 325 | // Clean the file and store it |
326 | 326 | $fileName = Files::cleanFilename($filePath, $file->getClientOriginalName()); |
@@ -38,9 +38,9 @@ discard block |
||
38 | 38 | $roles = Role::all(); |
39 | 39 | |
40 | 40 | $roleArr = []; |
41 | - foreach($roles as $role) |
|
41 | + foreach ($roles as $role) |
|
42 | 42 | { |
43 | - if($role->role_id == 1 && Auth::user()->role_id != 1) |
|
43 | + if ($role->role_id == 1 && Auth::user()->role_id != 1) |
|
44 | 44 | { |
45 | 45 | continue; |
46 | 46 | } |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | { |
96 | 96 | Mail::to($request->email)->send(new InitializeUser($hash, $request->username, $request->first_name.' '.$request->last_name)); |
97 | 97 | } |
98 | - catch(Exception $e) |
|
98 | + catch (Exception $e) |
|
99 | 99 | { |
100 | 100 | report($e); |
101 | 101 | } |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | // Validate the hash token |
114 | 114 | $user = UserInitialize::where('token', $hash)->get(); |
115 | 115 | |
116 | - if($user->isEmpty()) |
|
116 | + if ($user->isEmpty()) |
|
117 | 117 | { |
118 | 118 | return abort(404); |
119 | 119 | } |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | { |
127 | 127 | // Verify that the link matches the assigned email address |
128 | 128 | $valid = UserInitialize::where('token', $hash)->first(); |
129 | - if(empty($valid)) |
|
129 | + if (empty($valid)) |
|
130 | 130 | { |
131 | 131 | return abort(404); |
132 | 132 | } |
@@ -198,9 +198,9 @@ discard block |
||
198 | 198 | $userRole = DB::select('SELECT `role_id` FROM `user_role` WHERE `user_id` = ?', [$id])[0]->role_id; |
199 | 199 | |
200 | 200 | $roleArr = []; |
201 | - foreach($roles as $role) |
|
201 | + foreach ($roles as $role) |
|
202 | 202 | { |
203 | - if($role->role_id == 1 && Auth::user()->role_id != 1) |
|
203 | + if ($role->role_id == 1 && Auth::user()->role_id != 1) |
|
204 | 204 | { |
205 | 205 | continue; |
206 | 206 | } |