Test Setup Failed
Pull Request — master (#261)
by Mohamed
07:57
created
app/Models/Examination_student.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,9 +52,9 @@
 block discarded – undo
52 52
         $value = self::where('st_no', $data['st_no'])->get();
53 53
         if (count($value) > 0) {
54 54
             self::where('st_no', $data['st_no'])->update($data);
55
-        } else {
55
+        }else {
56 56
             self::insert($data);
57 57
         }
58
-        $output->writeln('Student name: ' . ($data['f_name']) . ' has been inserted to the database');
58
+        $output->writeln('Student name: '.($data['f_name']).' has been inserted to the database');
59 59
     }
60 60
 }
Please login to merge, or discard this patch.
app/Http/Middleware/classTeacher.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -15,13 +15,13 @@
 block discarded – undo
15 15
      */
16 16
     public function handle($request, Closure $next)
17 17
     {
18
-        if($request->user()->super_admin == 1){
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');
Please login to merge, or discard this patch.
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -17,11 +17,11 @@
 block discarded – undo
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');
Please login to merge, or discard this patch.
app/Http/Controllers/ImportExport.php 3 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -29,9 +29,9 @@  discard block
 block discarded – undo
29 29
 
30 30
     }
31 31
 
32
-     /**
33
-    * @return \Illuminate\Support\Collection
34
-    */
32
+        /**
33
+         * @return \Illuminate\Support\Collection
34
+         */
35 35
     public function importExportView()
36 36
     {
37 37
         if(Auth::user()->super_admin ){
@@ -45,11 +45,11 @@  discard block
 block discarded – undo
45 45
 
46 46
    
47 47
     /**
48
-    * @return \Illuminate\Support\Collection
49
-    */
48
+     * @return \Illuminate\Support\Collection
49
+     */
50 50
     public function export(Request $request) 
51 51
     {
52
-         $request->validate([
52
+            $request->validate([
53 53
                 'class' => 'required'
54 54
             ]);
55 55
         return Excel::download(new UsersExport($request->input('class')), 'users.xlsx');
@@ -58,8 +58,8 @@  discard block
 block discarded – undo
58 58
 
59 59
 
60 60
     /**
61
-    * @return \Illuminate\Support\Collection
62
-    */
61
+     * @return \Illuminate\Support\Collection
62
+     */
63 63
     public function import(Request $request)
64 64
     {
65 65
 
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -34,11 +34,11 @@  discard block
 block discarded – undo
34 34
     */
35 35
     public function importExportView()
36 36
     {
37
-        if(Auth::user()->super_admin ){
37
+        if (Auth::user()->super_admin) {
38 38
             return view('uploadcsv');
39
-        }else{
40
-            $classes = (!Auth::user()->permissions->isEmpty())  ?  Auth::user()->permissions[0]->staff_class : Auth::user()->principal[0]->security_group_institution->institution_classes;
41
-            return view('importExport')->with('classes',$classes);
39
+        }else {
40
+            $classes = (!Auth::user()->permissions->isEmpty()) ?  Auth::user()->permissions[0]->staff_class : Auth::user()->principal[0]->security_group_institution->institution_classes;
41
+            return view('importExport')->with('classes', $classes);
42 42
         }
43 43
     }
44 44
 
@@ -73,9 +73,9 @@  discard block
 block discarded – undo
73 73
 
74 74
 
75 75
             $import = new UsersImport();
76
-            try{
76
+            try {
77 77
                 $files = Storage::disk('sis-bulk-data-files')->allFiles();
78
-                Excel::import($import,request()->file('import_file'));
78
+                Excel::import($import, request()->file('import_file'));
79 79
             }catch (\Maatwebsite\Excel\Validators\ValidationException $e) {
80 80
                 $failures = $e->failures();
81 81
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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) {
Please login to merge, or discard this patch.
app/Http/Controllers/FilesController.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@
 block discarded – undo
80 80
                 }
81 81
 
82 82
             })
83
-             ->editColumn('error', function ($data) {
83
+                ->editColumn('error', function ($data) {
84 84
                 if(\App::environment('local') || \App::environment('stage')  || \App::environment('prod')){
85 85
                     return '<a href="/download/'.$data->filename.'">'.substr($data->filename, 0, 10).'</a>';
86 86
 
Please login to merge, or discard this patch.
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -13,101 +13,101 @@
 block discarded – undo
13 13
 
14 14
     public function index()
15 15
     {
16
-        return Datatables::of(Upload::with(['classRoom'])->where('security_user_id','=',Auth::user()->id))
17
-            ->editColumn('is_processed', function ($data) {
16
+        return Datatables::of(Upload::with(['classRoom'])->where('security_user_id', '=', Auth::user()->id))
17
+            ->editColumn('is_processed', function($data) {
18 18
 
19 19
                 $nowTime = \Carbon\Carbon::now();
20 20
                 $to = \Carbon\Carbon::createFromFormat('Y-m-d H:s:i', $nowTime);
21 21
                 $from = \Carbon\Carbon::createFromFormat('Y-m-d H:s:i', $data->updated_at);
22 22
                 $diff_in_hours = $to->diffInHours($from);
23 23
 
24
-                if($diff_in_hours >= 2 && $data->is_processed == 3){
24
+                if ($diff_in_hours >= 2 && $data->is_processed == 3) {
25 25
                     return "Terminated";
26 26
                 }
27 27
                 elseif ($data->is_processed === 1) {
28 28
                     return "Success";
29
-                }elseif ($data->is_processed === 2){
29
+                }elseif ($data->is_processed === 2) {
30 30
                     return "Failed";
31
-                }elseif($diff_in_hours < 2 && $data->is_processed == 3){
31
+                }elseif ($diff_in_hours < 2 && $data->is_processed == 3) {
32 32
                     return "Processing";
33
-                }elseif ($data->is_processed == 4){
33
+                }elseif ($data->is_processed == 4) {
34 34
                     return "Process Paused";
35
-                }else{
35
+                }else {
36 36
                     return 'Pending';
37 37
                 };
38 38
 
39 39
             })
40
-            ->editColumn('is_email_sent', function ($data) {
40
+            ->editColumn('is_email_sent', function($data) {
41 41
                 if ($data->is_email_sent === 1) {
42 42
                     return "Success";
43
-                }elseif($data->is_email_sent === 2 ){
43
+                }elseif ($data->is_email_sent === 2) {
44 44
                     return 'Failed';
45
-                }else{
45
+                }else {
46 46
                     return 'Pending';
47 47
                 };
48 48
 
49 49
             })
50
-            ->editColumn('update', function ($data) {
50
+            ->editColumn('update', function($data) {
51 51
                 if ($data->update === 0) {
52 52
                     return "No Processes";
53
-                }elseif($data->update === 1 ){
53
+                }elseif ($data->update === 1) {
54 54
                     return 'Success';
55
-                }elseif($data->update === 3 ){
55
+                }elseif ($data->update === 3) {
56 56
                     return 'Partial Success';
57
-                }else{
57
+                }else {
58 58
                     return 'Failed';
59 59
                 };
60 60
 
61 61
             })
62
-            ->editColumn('insert', function ($data) {
62
+            ->editColumn('insert', function($data) {
63 63
                 if ($data->insert === 0) {
64 64
                     return "No Processes";
65
-                }elseif($data->insert === 1 ){
65
+                }elseif ($data->insert === 1) {
66 66
                     return 'Success';
67
-                }elseif($data->insert === 3 ){
67
+                }elseif ($data->insert === 3) {
68 68
                     return 'Partial Success';
69
-                }else{
69
+                }else {
70 70
                     return 'Failed';
71 71
                 };
72 72
 
73 73
             })
74
-            ->editColumn('filename', function ($data) {
75
-                if(\App::environment('local') || \App::environment('stage')  || \App::environment('prod')){
74
+            ->editColumn('filename', function($data) {
75
+                if (\App::environment('local') || \App::environment('stage') || \App::environment('prod')) {
76 76
                     return '<a href="/download_file/'.$data->filename.'">'.substr($data->filename, 0, 10).'</a>';
77 77
 
78
-                }else{
78
+                }else {
79 79
                     return '<a href="/bulk-upload/download_file/'.$data->filename.'">'.substr($data->filename, 0, 10).'</a>';
80 80
                 }
81 81
 
82 82
             })
83
-             ->editColumn('error', function ($data) {
84
-                if(\App::environment('local') || \App::environment('stage')  || \App::environment('prod')){
83
+             ->editColumn('error', function($data) {
84
+                if (\App::environment('local') || \App::environment('stage') || \App::environment('prod')) {
85 85
                     return '<a href="/download/'.$data->filename.'">'.substr($data->filename, 0, 10).'</a>';
86 86
 
87
-                }else{
88
-                    return '<a href="/bulk-upload/download/'.$data->filename.'">'.substr($data->filename, 0,10).'</a>';
87
+                }else {
88
+                    return '<a href="/bulk-upload/download/'.$data->filename.'">'.substr($data->filename, 0, 10).'</a>';
89 89
                 }
90 90
 
91
-            })->editColumn('actions', function ($data) {
91
+            })->editColumn('actions', function($data) {
92 92
 
93 93
                 $nowTime = \Carbon\Carbon::now();
94 94
                 $to = \Carbon\Carbon::createFromFormat('Y-m-d H:s:i', $nowTime);
95 95
                 $from = \Carbon\Carbon::createFromFormat('Y-m-d H:s:i', $data->updated_at);
96 96
                 $diff_in_hours = $to->diffInHours($from);
97 97
 
98
-                if($diff_in_hours >= 2 && $data->is_processed == 3){
98
+                if ($diff_in_hours >= 2 && $data->is_processed == 3) {
99 99
                     return '<button onclick="updateProcess('.($data->id).',100)" class="btn btn-primary text-uppercase">reprocess</button>';
100
-                }elseif ($data->is_processed == 1){
100
+                }elseif ($data->is_processed == 1) {
101 101
                     return '<div><h6>Processing <span class="badge badge-success text-uppercase">Successful</span></h6></div>';
102
-                }elseif ($data->is_processed == 2){
102
+                }elseif ($data->is_processed == 2) {
103 103
                     return '<div><h6>Processing <span class="badge badge-danger text-uppercase">Failed</span></h6></div>';
104
-                }elseif ($data->is_processed == 0){
104
+                }elseif ($data->is_processed == 0) {
105 105
                     return '<button onclick="updateProcess('.($data->id).',200)" class="btn btn-block btn-warning text-uppercase">pause</button>';
106
-                }elseif ($data->is_processed == 4){
106
+                }elseif ($data->is_processed == 4) {
107 107
                     return '<button onclick="updateProcess('.($data->id).',100)" class="btn btn-block btn-success text-uppercase">resume</button>';
108 108
                 }
109 109
             })
110
-            ->rawColumns(['filename','error','actions'])
110
+            ->rawColumns(['filename', 'error', 'actions'])
111 111
             ->make(true);
112 112
     }
113 113
 
Please login to merge, or discard this patch.
Braces   +19 added lines, -20 removed lines patch added patch discarded remove patch
@@ -23,16 +23,15 @@  discard block
 block discarded – undo
23 23
 
24 24
                 if($diff_in_hours >= 2 && $data->is_processed == 3){
25 25
                     return "Terminated";
26
-                }
27
-                elseif ($data->is_processed === 1) {
26
+                } elseif ($data->is_processed === 1) {
28 27
                     return "Success";
29
-                }elseif ($data->is_processed === 2){
28
+                } elseif ($data->is_processed === 2){
30 29
                     return "Failed";
31
-                }elseif($diff_in_hours < 2 && $data->is_processed == 3){
30
+                } elseif($diff_in_hours < 2 && $data->is_processed == 3){
32 31
                     return "Processing";
33
-                }elseif ($data->is_processed == 4){
32
+                } elseif ($data->is_processed == 4){
34 33
                     return "Process Paused";
35
-                }else{
34
+                } else{
36 35
                     return 'Pending';
37 36
                 };
38 37
 
@@ -40,9 +39,9 @@  discard block
 block discarded – undo
40 39
             ->editColumn('is_email_sent', function ($data) {
41 40
                 if ($data->is_email_sent === 1) {
42 41
                     return "Success";
43
-                }elseif($data->is_email_sent === 2 ){
42
+                } elseif($data->is_email_sent === 2 ){
44 43
                     return 'Failed';
45
-                }else{
44
+                } else{
46 45
                     return 'Pending';
47 46
                 };
48 47
 
@@ -50,11 +49,11 @@  discard block
 block discarded – undo
50 49
             ->editColumn('update', function ($data) {
51 50
                 if ($data->update === 0) {
52 51
                     return "No Processes";
53
-                }elseif($data->update === 1 ){
52
+                } elseif($data->update === 1 ){
54 53
                     return 'Success';
55
-                }elseif($data->update === 3 ){
54
+                } elseif($data->update === 3 ){
56 55
                     return 'Partial Success';
57
-                }else{
56
+                } else{
58 57
                     return 'Failed';
59 58
                 };
60 59
 
@@ -62,11 +61,11 @@  discard block
 block discarded – undo
62 61
             ->editColumn('insert', function ($data) {
63 62
                 if ($data->insert === 0) {
64 63
                     return "No Processes";
65
-                }elseif($data->insert === 1 ){
64
+                } elseif($data->insert === 1 ){
66 65
                     return 'Success';
67
-                }elseif($data->insert === 3 ){
66
+                } elseif($data->insert === 3 ){
68 67
                     return 'Partial Success';
69
-                }else{
68
+                } else{
70 69
                     return 'Failed';
71 70
                 };
72 71
 
@@ -75,7 +74,7 @@  discard block
 block discarded – undo
75 74
                 if(\App::environment('local') || \App::environment('stage')  || \App::environment('prod')){
76 75
                     return '<a href="/download_file/'.$data->filename.'">'.substr($data->filename, 0, 10).'</a>';
77 76
 
78
-                }else{
77
+                } else{
79 78
                     return '<a href="/bulk-upload/download_file/'.$data->filename.'">'.substr($data->filename, 0, 10).'</a>';
80 79
                 }
81 80
 
@@ -84,7 +83,7 @@  discard block
 block discarded – undo
84 83
                 if(\App::environment('local') || \App::environment('stage')  || \App::environment('prod')){
85 84
                     return '<a href="/download/'.$data->filename.'">'.substr($data->filename, 0, 10).'</a>';
86 85
 
87
-                }else{
86
+                } else{
88 87
                     return '<a href="/bulk-upload/download/'.$data->filename.'">'.substr($data->filename, 0,10).'</a>';
89 88
                 }
90 89
 
@@ -97,13 +96,13 @@  discard block
 block discarded – undo
97 96
 
98 97
                 if($diff_in_hours >= 2 && $data->is_processed == 3){
99 98
                     return '<button onclick="updateProcess('.($data->id).',100)" class="btn btn-primary text-uppercase">reprocess</button>';
100
-                }elseif ($data->is_processed == 1){
99
+                } elseif ($data->is_processed == 1){
101 100
                     return '<div><h6>Processing <span class="badge badge-success text-uppercase">Successful</span></h6></div>';
102
-                }elseif ($data->is_processed == 2){
101
+                } elseif ($data->is_processed == 2){
103 102
                     return '<div><h6>Processing <span class="badge badge-danger text-uppercase">Failed</span></h6></div>';
104
-                }elseif ($data->is_processed == 0){
103
+                } elseif ($data->is_processed == 0){
105 104
                     return '<button onclick="updateProcess('.($data->id).',200)" class="btn btn-block btn-warning text-uppercase">pause</button>';
106
-                }elseif ($data->is_processed == 4){
105
+                } elseif ($data->is_processed == 4){
107 106
                     return '<button onclick="updateProcess('.($data->id).',100)" class="btn btn-block btn-success text-uppercase">resume</button>';
108 107
                 }
109 108
             })
Please login to merge, or discard this patch.
app/Models/Security_user.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
             $studentData['id'] = $id;
181 181
             $this->uniqueUserId->updateOrInsertRecord($studentData);
182 182
             return $studentData;
183
-        } catch (\Exception $th) {
183
+        }catch (\Exception $th) {
184 184
             Log::error($th->getMessage());
185 185
             // in case of duplication of the Unique ID this will recursive.
186 186
             $this->insertExaminationStudent($student);
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
         $this->uniqueUserId = new Unique_user_id();
202 202
         $this->uniqueUId = new UniqueUid();
203 203
         // regenerate unique id if it's not available
204
-        $uniqueId = ($this->uniqueUId::isValidUniqueId($sis_student['openemis_no']) && $this->isUnique) ?  $sis_student['openemis_no'] : $this->uniqueUId::getUniqueAlphanumeric();
204
+        $uniqueId = ($this->uniqueUId::isValidUniqueId($sis_student['openemis_no']) && $this->isUnique) ? $sis_student['openemis_no'] : $this->uniqueUId::getUniqueAlphanumeric();
205 205
 
206 206
         $studentData = [
207 207
             'id' => $sis_student['id'],
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
             $this->update($studentData);
219 219
             $this->uniqueUserId->updateOrInsertRecord($studentData);
220 220
             return $studentData;
221
-        } catch (\Exception $th) {
221
+        }catch (\Exception $th) {
222 222
             $this->isUnique = false;
223 223
             Log::error($th->getMessage());
224 224
             // in case of duplication of the Unique ID this will recursive.
Please login to merge, or discard this patch.
app/Models/Institution_student.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
     public static function boot()
64 64
     {
65 65
         parent::boot();
66
-        self::creating(function ($model) {
66
+        self::creating(function($model) {
67 67
             $model->id = (string) Uuid::generate(4);
68 68
             $model->created = now();
69 69
         });
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
      */
133 133
     public static function createExaminationData($student, $admissionInfo)
134 134
     {
135
-        $student['sp_center'] = gettype((int)$student['sp_center']) == 'integer' ?  $student['sp_center'] : 0;
135
+        $student['sp_center'] = gettype((int) $student['sp_center']) == 'integer' ? $student['sp_center'] : 0;
136 136
         try {
137 137
             self::create([
138 138
                 'id' => (string) Uuid::generate(4),
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
                 'created' => now(),
157 157
                 'created_user_id' => 1
158 158
             ]);
159
-        } catch (\Throwable $th) {
159
+        }catch (\Throwable $th) {
160 160
             Log::error($th);
161 161
         }
162 162
     }
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
      */
171 171
     public static function updateExaminationData($student, $admissionInfo)
172 172
     {
173
-        $student['sp_center'] = gettype((int)$student['sp_center']) == 'integer' ?  $student['sp_center'] : 0;
173
+        $student['sp_center'] = gettype((int) $student['sp_center']) == 'integer' ? $student['sp_center'] : 0;
174 174
         try {
175 175
             self::where([
176 176
                 'student_id' => $student['student_id'],
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
                     'modified_user_id' => 1
192 192
                 ]
193 193
             );
194
-        } catch (\Throwable $th) {
194
+        }catch (\Throwable $th) {
195 195
             Log::error($th);
196 196
         }
197 197
     }
Please login to merge, or discard this patch.
app/Http/Controllers/ExaminationStudentsController.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
         $this->grade = $grade;
28 28
         $this->student = new Security_user();
29 29
         $this->examination_student = new Examination_student();
30
-        $this->academic_period =  Academic_period::where('code', '=', $this->year)->first();
30
+        $this->academic_period = Academic_period::where('code', '=', $this->year)->first();
31 31
         $this->education_grade = Education_grade::where('code', '=', $this->grade)->first();
32 32
         $this->output = new \Symfony\Component\Console\Output\ConsoleOutput();
33 33
     }
@@ -69,10 +69,10 @@  discard block
 block discarded – undo
69 69
                     );
70 70
                     Session::flash('message', 'File upload successfully!');
71 71
                     // Redirect to index
72
-                } else {
72
+                }else {
73 73
                     Session::flash('message', 'File too large. File must be less than 20MB.');
74 74
                 }
75
-            } else {
75
+            }else {
76 76
                 Session::flash('message', 'Invalid File Extension.');
77 77
             }
78 78
         }
@@ -184,12 +184,12 @@  discard block
 block discarded – undo
184 184
                     Institution_student::createExaminationData($student, $admissionInfo);
185 185
                     Institution_student_admission::createExaminationData($student, $admissionInfo);
186 186
                     Institution_class_student::createExaminationData($student, $admissionInfo);
187
-                } else {
187
+                }else {
188 188
                     Institution_student_admission::createExaminationData($student, $admissionInfo);
189 189
                     Institution_student::createExaminationData($student, $admissionInfo);
190 190
                 }
191 191
                 // update the matched student's data    
192
-            } else {
192
+            }else {
193 193
                 $studentData = $this->student->updateExaminationStudent($student, $matchedStudent);
194 194
                 $studentData['student_id'] = $studentData['id'];
195 195
                 $matchedStudent = array_merge((array) $student, $matchedStudent);
@@ -241,21 +241,21 @@  discard block
 block discarded – undo
241 241
             }
242 242
 
243 243
             if (($previousValue)) {
244
-                $highest =  ($percentage > $previousValue['rate']) ? $value : $value;
245
-            } else {
244
+                $highest = ($percentage > $previousValue['rate']) ? $value : $value;
245
+            }else {
246 246
                 $highest = $value;
247 247
             }
248 248
             $previousValue = $value;
249 249
         }
250 250
 
251 251
         //If the not matched 100% try to get most highest value with full name
252
-        if (($highest['rate']  < 100) || (count($matchedData) > 1)) {
252
+        if (($highest['rate'] < 100) || (count($matchedData) > 1)) {
253 253
             foreach ($sis_students as $key => $value) {
254 254
                 similar_text(strtoupper($student['f_name']), strtoupper($value['first_name']), $percentage);
255 255
                 $value['rate'] = $percentage;
256 256
                 if (($previousValue)) {
257
-                    $highest =  ($percentage > $previousValue['rate']) ? $value : $value;
258
-                } else {
257
+                    $highest = ($percentage > $previousValue['rate']) ? $value : $value;
258
+                }else {
259 259
                     $highest = $value;
260 260
                 }
261 261
                 $previousValue = $value;
@@ -274,12 +274,12 @@  discard block
 block discarded – undo
274 274
     public function updateStudentId($student, $sis_student)
275 275
     {
276 276
         try {
277
-            $student['nsid'] =  $sis_student['openemis_no'];
277
+            $student['nsid'] = $sis_student['openemis_no'];
278 278
 
279 279
             // add new NSID to the examinations data set
280 280
             $this->examination_student->where(['st_no' => $student['st_no']])->update($student);
281
-            $this->output->writeln('Updated ' . $sis_student['student_id'] . ' to NSID' . $sis_student['openemis_no']);
282
-        } catch (\Exception $th) {
281
+            $this->output->writeln('Updated '.$sis_student['student_id'].' to NSID'.$sis_student['openemis_no']);
282
+        }catch (\Exception $th) {
283 283
             Log::error($th);
284 284
         }
285 285
     }
Please login to merge, or discard this patch.