@@ -18,9 +18,9 @@ |
||
18 | 18 | // dd($request->user()->permissions); |
19 | 19 | if ($request->user() && (!($request->user()->permissions->isEmpty())) && $request->user()->permissions[0]->roles && $request->user()->permissions[0]->roles->code === 'HOMEROOM_TEACHER') { |
20 | 20 | return $next($request); |
21 | - }elseif($request->user() && (!($request->user()->principal->isEmpty())) && $request->user()->principal[0]->roles && $request->user()->principal[0]->roles->code === 'PRINCIPAL'){ |
|
21 | + } elseif($request->user() && (!($request->user()->principal->isEmpty())) && $request->user()->principal[0]->roles && $request->user()->principal[0]->roles->code === 'PRINCIPAL'){ |
|
22 | 22 | return $next($request); |
23 | - }elseif($request->user() && (!($request->user()->zonal_cordinator->isEmpty())) && $request->user()->zonal_cordinator[0]->roles && $request->user()->zonal_cordinator[0]->roles->code === 'PRINCIPAL'){ |
|
23 | + } elseif($request->user() && (!($request->user()->zonal_cordinator->isEmpty())) && $request->user()->zonal_cordinator[0]->roles && $request->user()->zonal_cordinator[0]->roles->code === 'PRINCIPAL'){ |
|
24 | 24 | return $next($request); |
25 | 25 | } |
26 | 26 | return redirect('/login')->with('status', 'Your dont have access for upload data. Please get assign your to the class and try'); |
@@ -23,16 +23,15 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 | |
@@ -85,13 +84,13 @@ discard block |
||
85 | 84 | |
86 | 85 | if($diff_in_hours >= 2 && $data->is_processed == 3){ |
87 | 86 | return '<button onclick="updateProcess('.($data->id).',100)" class="btn btn-primary text-uppercase">reprocess</button>'; |
88 | - }elseif ($data->is_processed == 1){ |
|
87 | + } elseif ($data->is_processed == 1){ |
|
89 | 88 | return '<div><h6>Processing <span class="badge badge-success text-uppercase">Successful</span></h6></div>'; |
90 | - }elseif ($data->is_processed == 2){ |
|
89 | + } elseif ($data->is_processed == 2){ |
|
91 | 90 | return '<div><h6>Processing <span class="badge badge-danger text-uppercase">Failed</span></h6></div>'; |
92 | - }elseif ($data->is_processed == 0){ |
|
91 | + } elseif ($data->is_processed == 0){ |
|
93 | 92 | return '<button onclick="updateProcess('.($data->id).',200)" class="btn btn-block btn-warning text-uppercase">pause</button>'; |
94 | - }elseif ($data->is_processed == 4){ |
|
93 | + } elseif ($data->is_processed == 4){ |
|
95 | 94 | return '<button onclick="updateProcess('.($data->id).',100)" class="btn btn-block btn-success text-uppercase">resume</button>'; |
96 | 95 | } |
97 | 96 | }) |
@@ -73,7 +73,7 @@ |
||
73 | 73 | try{ |
74 | 74 | $files = Storage::disk('sis-bulk-data-files')->allFiles(); |
75 | 75 | Excel::import($import,request()->file('import_file')); |
76 | - }catch (\Maatwebsite\Excel\Validators\ValidationException $e) { |
|
76 | + } catch (\Maatwebsite\Excel\Validators\ValidationException $e) { |
|
77 | 77 | $failures = $e->failures(); |
78 | 78 | |
79 | 79 | foreach ($failures as $failure) { |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | DB::table('uploads') |
101 | 101 | ->where('id', $id) |
102 | 102 | ->update(['is_processed' => 0]); |
103 | - }elseif ($action == 200) { |
|
103 | + } elseif ($action == 200) { |
|
104 | 104 | DB::table('uploads') |
105 | 105 | ->where('id', $id) |
106 | 106 | ->update(['is_processed' => 4]); |
@@ -117,8 +117,7 @@ discard block |
||
117 | 117 | return Response::download($file_path, Auth::user()->openemis_no.'_'.$filename.$version, [ |
118 | 118 | 'Content-Length: '. filesize($file_path) |
119 | 119 | ]); |
120 | - } |
|
121 | - else |
|
120 | + } else |
|
122 | 121 | { |
123 | 122 | return View::make('errors.404'); |
124 | 123 | } |
@@ -137,8 +136,7 @@ discard block |
||
137 | 136 | return Response::download($file_path, $filename, [ |
138 | 137 | 'Content-Length: '. filesize($file_path) |
139 | 138 | ]); |
140 | - } |
|
141 | - else |
|
139 | + } else |
|
142 | 140 | { |
143 | 141 | abort(404, 'We did not found an error file.'); |
144 | 142 | } |
@@ -152,8 +150,7 @@ discard block |
||
152 | 150 | return Response::download($file_path, $filename, [ |
153 | 151 | 'Content-Length: '. filesize($file_path) |
154 | 152 | ]); |
155 | - } |
|
156 | - else |
|
153 | + } else |
|
157 | 154 | { |
158 | 155 | |
159 | 156 | abort(404, 'We did not found an error file.'); |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | } |
151 | 151 | } |
152 | 152 | return $row; |
153 | - }catch (Exception $e){ |
|
153 | + } catch (Exception $e){ |
|
154 | 154 | $error = \Illuminate\Validation\ValidationException::withMessages([]); |
155 | 155 | $failure = new Failure(3, 'remark', [0 => 'Template is not valid for upload, use the template given in the system'], [null]); |
156 | 156 | $failures = [0 => $failure]; |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | protected function checkKeys($key,$count,$row){ |
197 | 197 | if(array_key_exists($key,$row)){ |
198 | 198 | return true; |
199 | - }else{ |
|
199 | + } else{ |
|
200 | 200 | $error = \Illuminate\Validation\ValidationException::withMessages([]); |
201 | 201 | $failure = new Failure($count, 'remark', [0 => 'Template is not valid for upload, use the template given in the system'. $key ,' Is missing form the template'], [null]); |
202 | 202 | $failures = [0 => $failure]; |
@@ -423,8 +423,9 @@ |
||
423 | 423 | } |
424 | 424 | |
425 | 425 | protected function insertSubject($subject){ |
426 | - if(!Institution_subject_student::isDuplicated($subject)) |
|
427 | - Institution_subject_student::updateOrInsert($subject); |
|
426 | + if(!Institution_subject_student::isDuplicated($subject)) { |
|
427 | + Institution_subject_student::updateOrInsert($subject); |
|
428 | + } |
|
428 | 429 | } |
429 | 430 | |
430 | 431 |
@@ -87,12 +87,12 @@ discard block |
||
87 | 87 | } |
88 | 88 | return true; |
89 | 89 | } |
90 | - }else{ |
|
90 | + } else{ |
|
91 | 91 | $this->_custom_messages['bmi'] = $attribute.' is required for '. $educationGrade->name; |
92 | 92 | $this->_set_custom_stuff(); |
93 | 93 | return false; |
94 | 94 | } |
95 | - }else{ |
|
95 | + } else{ |
|
96 | 96 | return true; |
97 | 97 | } |
98 | 98 | } |
@@ -125,10 +125,10 @@ discard block |
||
125 | 125 | $check = Institution_class_student::where('student_id', '=', $student['id'])->where('institution_class_id','=',$perameters[0])->count(); |
126 | 126 | if($check == 1){ |
127 | 127 | return true; |
128 | - }else{ |
|
128 | + } else{ |
|
129 | 129 | return false; |
130 | 130 | } |
131 | - }else{ |
|
131 | + } else{ |
|
132 | 132 | return false; |
133 | 133 | } |
134 | 134 | |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | $this->_custom_messages['nic'] = $attribute. ' is not valid, Please check the NIC number'; |
140 | 140 | $this->_set_custom_stuff(); |
141 | 141 | return false; |
142 | - }else{ |
|
142 | + } else{ |
|
143 | 143 | return true; |
144 | 144 | } |
145 | 145 | } |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | |
81 | 81 | if (!empty($isAvailableforPromotion)) { |
82 | 82 | $this->process($institutionGrade,$nextGrade,$year,1); |
83 | - }else{ |
|
83 | + } else{ |
|
84 | 84 | $this->process($institutionGrade,$nextGrade,$year,3); |
85 | 85 | } |
86 | 86 | } |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | array_walk($studentListToPromote,array($this,'assingeToClasses'),$params); |
128 | 128 | array_walk($parallelClasses,array($this,'updateStudentCount')); |
129 | 129 | } |
130 | - }catch (\Exception $e){ |
|
130 | + } catch (\Exception $e){ |
|
131 | 131 | dd($e); |
132 | 132 | Log::error($e->getMessage()); |
133 | 133 | } |
@@ -166,20 +166,20 @@ discard block |
||
166 | 166 | // promote parallel classes |
167 | 167 | $this->promotion($institutionGrade,$nextGrade,$academicPeriod,$nextAcademicPeriod,$nextGradeObj->toArray(),1); |
168 | 168 | return 1; |
169 | - }elseif (($nextGradeObj->count() > 1) && ($nextGradeObj->count() !== $currentGradeObj->count())){ |
|
169 | + } elseif (($nextGradeObj->count() > 1) && ($nextGradeObj->count() !== $currentGradeObj->count())){ |
|
170 | 170 | // promote pool promotion |
171 | 171 | $this->promotion($institutionGrade,$nextGrade,$academicPeriod,$nextAcademicPeriod,[],1); |
172 | 172 | return 2; |
173 | - }elseif(($nextGradeObj->count() > 1) && $currentGradeObj->count() == $nextGradeObj->count()){ |
|
173 | + } elseif(($nextGradeObj->count() > 1) && $currentGradeObj->count() == $nextGradeObj->count()){ |
|
174 | 174 | // Promote matching class name with previous class |
175 | 175 | $this->promotion($institutionGrade,$nextGrade,$academicPeriod,$nextAcademicPeriod,$nextGradeObj->toArray(),1); |
176 | 176 | return 1; |
177 | - }else{ |
|
177 | + } else{ |
|
178 | 178 | // default pool promotion |
179 | 179 | $this->promotion($institutionGrade,$nextGrade,$academicPeriod,$nextAcademicPeriod,[],1); |
180 | 180 | return 2; |
181 | 181 | } |
182 | - }else{ |
|
182 | + } else{ |
|
183 | 183 | // default pool promotion |
184 | 184 | $this->promotion($institutionGrade,$nextGrade,$academicPeriod,$nextAcademicPeriod,[],3); |
185 | 185 | return 2; |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | $output = new \Symfony\Component\Console\Output\ConsoleOutput(); |
217 | 217 | $output->writeln('----------------- '. $student['admission_id'] . ' to ' . $studentData['education_grade_id']); |
218 | 218 | |
219 | - }catch (\Exception $e){ |
|
219 | + } catch (\Exception $e){ |
|
220 | 220 | dd($e); |
221 | 221 | Log::error($e->getMessage()); |
222 | 222 | } |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | $studentClass = $this->institution_class_students->getStudentNewClass($student); |
237 | 237 | if(!is_null($studentClass)){ |
238 | 238 | return array_search(str_replace($educationGrade['name'],$nextGrade->name,$studentClass->name),array_column($classes,'name')); |
239 | - }else{ |
|
239 | + } else{ |
|
240 | 240 | return false; |
241 | 241 | } |
242 | 242 | |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | $this->institution_class_students->create($studentObj); |
281 | 281 | $output = new \Symfony\Component\Console\Output\ConsoleOutput(); |
282 | 282 | $output->writeln('----------------- '. $student['student_id']. 'to ' . $class['name']); |
283 | - }else{ |
|
283 | + } else{ |
|
284 | 284 | $this->institution_class_students->where('id',(string)$student['id'])->update($studentObj); |
285 | 285 | $output = new \Symfony\Component\Console\Output\ConsoleOutput(); |
286 | 286 | $output->writeln('----------------- '. $student['student_id']. 'to ' . $class['name']); |
@@ -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); |