| @@ -50,14 +50,14 @@ | ||
| 50 | 50 | unset($files); | 
| 51 | 51 | exit(); | 
| 52 | 52 | |
| 53 | -                }else{ | |
| 53 | +                } else{ | |
| 54 | 54 | $output = new \Symfony\Component\Console\Output\ConsoleOutput(); | 
| 55 | 55 |                      $output->writeln('No files found,Waiting for files'); | 
| 56 | 56 | exit(); | 
| 57 | 57 | |
| 58 | 58 | } | 
| 59 | 59 | |
| 60 | -            }catch (Exception $e){ | |
| 60 | +            } catch (Exception $e){ | |
| 61 | 61 | $output = new \Symfony\Component\Console\Output\ConsoleOutput(); | 
| 62 | 62 | $output->writeln($e); | 
| 63 | 63 | sleep(300); | 
| @@ -109,7 +109,7 @@ | ||
| 109 | 109 | # # | 
| 110 | 110 | ####################################################' ); | 
| 111 | 111 | // $output->writeln(); | 
| 112 | -           }catch (\Exception $e){ | |
| 112 | +           } catch (\Exception $e){ | |
| 113 | 113 | // echo $e->getMessage(); | 
| 114 | 114 | $output->writeln( $e->getMessage()); | 
| 115 | 115 | } | 
| @@ -58,7 +58,7 @@ | ||
| 58 | 58 | 'preferred' => 1 | 
| 59 | 59 | ]; | 
| 60 | 60 | self::updateOrCreate($data); | 
| 61 | -            }else{ | |
| 61 | +            } else{ | |
| 62 | 62 | $exists = $exists->toArray(); | 
| 63 | 63 | $exists['preferred'] = 1; | 
| 64 | 64 | $exists['value'] = $data['contact']; | 
| @@ -109,8 +109,9 @@ | ||
| 109 | 109 | }) | 
| 110 | 110 |                  ->where('institution_class_id', '=', $student->institution_class_id) | 
| 111 | 111 | ->get()->toArray(); | 
| 112 | - if (!empty($subjectId)) | |
| 113 | - $data[] = $subjectId[0]; | |
| 112 | +            if (!empty($subjectId)) { | |
| 113 | + $data[] = $subjectId[0]; | |
| 114 | + } | |
| 114 | 115 | } | 
| 115 | 116 | return $data; | 
| 116 | 117 | } | 
| @@ -17,11 +17,11 @@ | ||
| 17 | 17 |      { | 
| 18 | 18 |          if($request->user()->super_admin == 1){ | 
| 19 | 19 | return $next($request); | 
| 20 | -        }elseif ($request->user() && (!($request->user()->permissions->isEmpty()))  && $request->user()->permissions[0]->roles &&  $request->user()->permissions[0]->roles->code === 'HOMEROOM_TEACHER') { | |
| 20 | +        } elseif ($request->user() && (!($request->user()->permissions->isEmpty()))  && $request->user()->permissions[0]->roles &&  $request->user()->permissions[0]->roles->code === 'HOMEROOM_TEACHER') { | |
| 21 | 21 | return $next($request); | 
| 22 | -        }elseif($request->user() && (!($request->user()->principal->isEmpty()))  && $request->user()->principal[0]->roles &&  $request->user()->principal[0]->roles->code === 'PRINCIPAL'){ | |
| 22 | +        } elseif($request->user() && (!($request->user()->principal->isEmpty()))  && $request->user()->principal[0]->roles &&  $request->user()->principal[0]->roles->code === 'PRINCIPAL'){ | |
| 23 | 23 | return $next($request); | 
| 24 | -        }elseif($request->user() && (!($request->user()->zonal_cordinator->isEmpty()))  && $request->user()->zonal_cordinator[0]->roles &&  $request->user()->zonal_cordinator[0]->roles->code === 'PRINCIPAL'){ | |
| 24 | +        } elseif($request->user() && (!($request->user()->zonal_cordinator->isEmpty()))  && $request->user()->zonal_cordinator[0]->roles &&  $request->user()->zonal_cordinator[0]->roles->code === 'PRINCIPAL'){ | |
| 25 | 25 | return $next($request); | 
| 26 | 26 | } | 
| 27 | 27 |          return redirect('/login')->with('status', 'Your dont have access for upload data. Please get assign your to the class and try'); | 
| @@ -36,7 +36,7 @@ discard block | ||
| 36 | 36 |      { | 
| 37 | 37 |          if(Auth::user()->super_admin ){ | 
| 38 | 38 |              return view('uploadcsv'); | 
| 39 | -        }else{ | |
| 39 | +        } else{ | |
| 40 | 40 | $classes = (!Auth::user()->permissions->isEmpty()) ? Auth::user()->permissions[0]->staff_class : Auth::user()->principal[0]->security_group_institution->institution_classes; | 
| 41 | 41 |              return view('importExport')->with('classes',$classes); | 
| 42 | 42 | } | 
| @@ -76,7 +76,7 @@ discard block | ||
| 76 | 76 |              try{ | 
| 77 | 77 |                  $files = Storage::disk('sis-bulk-data-files')->allFiles(); | 
| 78 | 78 |                  Excel::import($import,request()->file('import_file')); | 
| 79 | -            }catch (\Maatwebsite\Excel\Validators\ValidationException $e) { | |
| 79 | +            } catch (\Maatwebsite\Excel\Validators\ValidationException $e) { | |
| 80 | 80 | $failures = $e->failures(); | 
| 81 | 81 | |
| 82 | 82 |                  foreach ($failures as $failure) { | 
| @@ -99,7 +99,7 @@ discard block | ||
| 99 | 99 |              DB::table('uploads') | 
| 100 | 100 |                  ->where('id', $id) | 
| 101 | 101 | ->update(['is_processed' => 0]); | 
| 102 | -        }elseif ($action == 200) { | |
| 102 | +        } elseif ($action == 200) { | |
| 103 | 103 |              DB::table('uploads') | 
| 104 | 104 |                  ->where('id', $id) | 
| 105 | 105 | ->update(['is_processed' => 4]); | 
| @@ -116,8 +116,7 @@ discard block | ||
| 116 | 116 | return Response::download($file_path, Auth::user()->openemis_no.'_'.$filename.$version, [ | 
| 117 | 117 | 'Content-Length: '. filesize($file_path) | 
| 118 | 118 | ]); | 
| 119 | - } | |
| 120 | - else | |
| 119 | + } else | |
| 121 | 120 |          { | 
| 122 | 121 |              return response()->view('errors.404'); | 
| 123 | 122 | } | 
| @@ -136,8 +135,7 @@ discard block | ||
| 136 | 135 | return Response::download($file_path, $filename, [ | 
| 137 | 136 | 'Content-Length: '. filesize($file_path) | 
| 138 | 137 | ]); | 
| 139 | - } | |
| 140 | - else | |
| 138 | + } else | |
| 141 | 139 |          { | 
| 142 | 140 | abort(404, 'We did not found an error file.'); | 
| 143 | 141 | } | 
| @@ -151,8 +149,7 @@ discard block | ||
| 151 | 149 | return Response::download($file_path, $filename, [ | 
| 152 | 150 | 'Content-Length: '. filesize($file_path) | 
| 153 | 151 | ]); | 
| 154 | - } | |
| 155 | - else | |
| 152 | + } else | |
| 156 | 153 |          { | 
| 157 | 154 | |
| 158 | 155 | abort(404, 'We did not found an error file.'); | 
| @@ -64,7 +64,7 @@ | ||
| 64 | 64 | } | 
| 65 | 65 | $date = date_format($date, 'Y-m-d'); | 
| 66 | 66 | return $date; | 
| 67 | -        }catch(\Exception $e){ | |
| 67 | +        } catch(\Exception $e){ | |
| 68 | 68 | $error = \Illuminate\Validation\ValidationException::withMessages([]); | 
| 69 | 69 | $failure = new Failure(2, 'remark', [0 => 'The given date is wrong']); | 
| 70 | 70 | $failures = [0 => $failure]; | 
| @@ -36,7 +36,7 @@ | ||
| 36 | 36 | (new ExportReady($this->user)) | 
| 37 | 37 | ]); | 
| 38 | 38 | |
| 39 | -        }catch(\Exception $e){ | |
| 39 | +        } catch(\Exception $e){ | |
| 40 | 40 | $output = new \Symfony\Component\Console\Output\ConsoleOutput(); | 
| 41 | 41 | $output->writeln($e->getMessage()); | 
| 42 | 42 | } |