@@ -58,9 +58,9 @@ discard block |
||
58 | 58 | use App\Imports\StudentUpdate; |
59 | 59 | use Maatwebsite\Excel\Exceptions\ConcernConflictException; |
60 | 60 | |
61 | -class UsersImport extends Import Implements ToModel, WithStartRow, WithHeadingRow, WithMultipleSheets, WithEvents, WithMapping, WithLimit, WithBatchInserts, WithValidation ,SkipsOnFailure ,SkipsOnError { |
|
61 | +class UsersImport extends Import Implements ToModel, WithStartRow, WithHeadingRow, WithMultipleSheets, WithEvents, WithMapping, WithLimit, WithBatchInserts, WithValidation, SkipsOnFailure, SkipsOnError { |
|
62 | 62 | |
63 | - use Importable, SkipsFailures , SkipsErrors; |
|
63 | + use Importable, SkipsFailures, SkipsErrors; |
|
64 | 64 | |
65 | 65 | |
66 | 66 | public function sheets(): array { |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | throw new \Maatwebsite\Excel\Validators\ValidationException($error, $failures); |
85 | 85 | } |
86 | 86 | }, |
87 | - BeforeImport::class => function (BeforeImport $event) { |
|
87 | + BeforeImport::class => function(BeforeImport $event) { |
|
88 | 88 | $this->highestRow = ($event->getReader()->getDelegate()->getActiveSheet()->getHighestDataRow('C')); |
89 | 89 | if ($this->highestRow < 3) { |
90 | 90 | $error = \Illuminate\Validation\ValidationException::withMessages([]); |
@@ -120,9 +120,9 @@ discard block |
||
120 | 120 | break; |
121 | 121 | } |
122 | 122 | |
123 | - $BirthArea = Area_administrative::where('name', 'like', '%' . $row['birth_registrar_office_as_in_birth_certificate'] . '%')->first(); |
|
124 | - $nationalityId = Nationality::where('name', 'like', '%' . $row['nationality'] . '%')->first(); |
|
125 | - $identityType = Identity_type::where('national_code', 'like', '%' . $row['identity_type'] . '%')->first(); |
|
123 | + $BirthArea = Area_administrative::where('name', 'like', '%'.$row['birth_registrar_office_as_in_birth_certificate'].'%')->first(); |
|
124 | + $nationalityId = Nationality::where('name', 'like', '%'.$row['nationality'].'%')->first(); |
|
125 | + $identityType = Identity_type::where('national_code', 'like', '%'.$row['identity_type'].'%')->first(); |
|
126 | 126 | $academicPeriod = Academic_period::where('name', '=', $row['academic_period'])->first(); |
127 | 127 | |
128 | 128 | |
@@ -138,8 +138,8 @@ discard block |
||
138 | 138 | |
139 | 139 | $openemisStudent = $this->uniqueUid::getUniqueAlphanumeric(); |
140 | 140 | \Log::debug('Security_user'); |
141 | - $student = Security_user::create([ |
|
142 | - 'username' => str_replace('-','',$openemisStudent), |
|
141 | + $student = Security_user::create([ |
|
142 | + 'username' => str_replace('-', '', $openemisStudent), |
|
143 | 143 | 'openemis_no' => $openemisStudent, |
144 | 144 | 'first_name' => $row['full_name'], // here we save full name in the column of first name. re reduce breaks of the system. |
145 | 145 | 'last_name' => genNameWithInitials($row['full_name']), |
@@ -232,12 +232,12 @@ discard block |
||
232 | 232 | } |
233 | 233 | |
234 | 234 | |
235 | - if(!empty($row['bmi_weight']) && !empty($row['bmi_weight']) && !empty($row['bmi_date_yyyy_mm_dd'])){ |
|
235 | + if (!empty($row['bmi_weight']) && !empty($row['bmi_weight']) && !empty($row['bmi_date_yyyy_mm_dd'])) { |
|
236 | 236 | // convert Meeter to CM |
237 | - $hight = $row['bmi_height'] / 100; |
|
237 | + $hight = $row['bmi_height']/100; |
|
238 | 238 | |
239 | 239 | //calculate BMI |
240 | - $bodyMass = ($row['bmi_weight']) / pow($hight, 2); |
|
240 | + $bodyMass = ($row['bmi_weight'])/pow($hight, 2); |
|
241 | 241 | |
242 | 242 | $bmiAcademic = Academic_period::where('name', '=', $row['bmi_academic_period'])->first(); |
243 | 243 | |
@@ -256,9 +256,9 @@ discard block |
||
256 | 256 | |
257 | 257 | if (!empty($row['fathers_full_name']) && ($row['fathers_date_of_birth_yyyy_mm_dd'] !== null)) { |
258 | 258 | |
259 | - $AddressArea = Area_administrative::where('name', 'like', '%' . $row['fathers_address_area'] . '%')->first(); |
|
260 | - $nationalityId = Nationality::where('name', 'like', '%' . $row['fathers_nationality'] . '%')->first(); |
|
261 | - $identityType = Identity_type::where('national_code', 'like', '%' . $row['fathers_identity_type'] . '%')->first(); |
|
259 | + $AddressArea = Area_administrative::where('name', 'like', '%'.$row['fathers_address_area'].'%')->first(); |
|
260 | + $nationalityId = Nationality::where('name', 'like', '%'.$row['fathers_nationality'].'%')->first(); |
|
261 | + $identityType = Identity_type::where('national_code', 'like', '%'.$row['fathers_identity_type'].'%')->first(); |
|
262 | 262 | $openemisFather = $this->uniqueUid::getUniqueAlphanumeric(); |
263 | 263 | |
264 | 264 | $identityType = ($identityType !== null) ? $identityType->id : null; |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | if ($father === null) { |
275 | 275 | |
276 | 276 | $father = Security_user::create([ |
277 | - 'username' => str_replace('-','',$openemisFather), |
|
277 | + 'username' => str_replace('-', '', $openemisFather), |
|
278 | 278 | 'openemis_no' => $openemisFather, |
279 | 279 | 'first_name' => $row['fathers_full_name'], // here we save full name in the column of first name. re reduce breaks of the system. |
280 | 280 | 'last_name' => genNameWithInitials($row['fathers_full_name']), |
@@ -293,25 +293,25 @@ discard block |
||
293 | 293 | $father['guardian_relation_id'] = 1; |
294 | 294 | if (array_key_exists('fathers_phone', $row)) { |
295 | 295 | $father['contact'] = $row['fathers_phone']; |
296 | - User_contact::createOrUpdate($father,$this->file['security_user_id']); |
|
296 | + User_contact::createOrUpdate($father, $this->file['security_user_id']); |
|
297 | 297 | } |
298 | 298 | Student_guardian::createStudentGuardian($student, $father, $this->file['security_user_id']); |
299 | - } else { |
|
299 | + }else { |
|
300 | 300 | Security_user::where('id', '=', $father->id) |
301 | 301 | ->update(['is_guardian' => 1]); |
302 | 302 | $father['guardian_relation_id'] = 1; |
303 | 303 | if (array_key_exists('fathers_phone', $row)) { |
304 | 304 | $father['contact'] = $row['fathers_phone']; |
305 | - User_contact::createOrUpdate($father,$this->file['security_user_id']); |
|
305 | + User_contact::createOrUpdate($father, $this->file['security_user_id']); |
|
306 | 306 | } |
307 | 307 | Student_guardian::createStudentGuardian($student, $father, $this->file['security_user_id']); |
308 | 308 | } |
309 | 309 | } |
310 | 310 | |
311 | 311 | if (!empty($row['mothers_full_name']) && ($row['mothers_date_of_birth_yyyy_mm_dd'] !== null)) { |
312 | - $AddressArea = Area_administrative::where('name', 'like', '%' . $row['mothers_address_area'] . '%')->first(); |
|
313 | - $nationalityId = Nationality::where('name', 'like', '%' . $row['mothers_nationality'] . '%')->first(); |
|
314 | - $identityType = Identity_type::where('national_code', 'like', '%' . $row['mothers_identity_type'] . '%')->first(); |
|
312 | + $AddressArea = Area_administrative::where('name', 'like', '%'.$row['mothers_address_area'].'%')->first(); |
|
313 | + $nationalityId = Nationality::where('name', 'like', '%'.$row['mothers_nationality'].'%')->first(); |
|
314 | + $identityType = Identity_type::where('national_code', 'like', '%'.$row['mothers_identity_type'].'%')->first(); |
|
315 | 315 | $openemisMother = $this->uniqueUid::getUniqueAlphanumeric(); |
316 | 316 | |
317 | 317 | $identityType = $identityType !== null ? $identityType->id : null; |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | |
327 | 327 | if ($mother === null) { |
328 | 328 | $mother = Security_user::create([ |
329 | - 'username' => str_replace('-','',$openemisMother), |
|
329 | + 'username' => str_replace('-', '', $openemisMother), |
|
330 | 330 | 'openemis_no' => $openemisMother, |
331 | 331 | 'first_name' => $row['mothers_full_name'], // here we save full name in the column of first name. re reduce breaks of the system. |
332 | 332 | 'last_name' => genNameWithInitials($row['mothers_full_name']), |
@@ -353,16 +353,16 @@ discard block |
||
353 | 353 | $mother['guardian_relation_id'] = 2; |
354 | 354 | if (array_key_exists('mothers_phone', $row)) { |
355 | 355 | $mother['contact'] = $row['mothers_phone']; |
356 | - User_contact::createOrUpdate($mother,$this->file['security_user_id']); |
|
356 | + User_contact::createOrUpdate($mother, $this->file['security_user_id']); |
|
357 | 357 | } |
358 | 358 | Student_guardian::createStudentGuardian($student, $mother, $this->file['security_user_id']); |
359 | - } else { |
|
359 | + }else { |
|
360 | 360 | Security_user::where('id', '=', $mother->id) |
361 | 361 | ->update(['is_guardian' => 1]); |
362 | 362 | $mother['guardian_relation_id'] = 2; |
363 | 363 | if (array_key_exists('mothers_phone', $row)) { |
364 | 364 | $mother['contact'] = $row['mothers_phone']; |
365 | - User_contact::createOrUpdate($mother,$this->file['security_user_id']); |
|
365 | + User_contact::createOrUpdate($mother, $this->file['security_user_id']); |
|
366 | 366 | } |
367 | 367 | Student_guardian::createStudentGuardian($student, $mother, $this->file['security_user_id']); |
368 | 368 | } |
@@ -371,9 +371,9 @@ discard block |
||
371 | 371 | |
372 | 372 | if (!empty($row['guardians_full_name']) && ($row['guardians_date_of_birth_yyyy_mm_dd'] !== null)) { |
373 | 373 | $genderId = $row['guardians_gender_mf'] == 'M' ? 1 : 2; |
374 | - $AddressArea = Area_administrative::where('name', 'like', '%' . $row['guardians_address_area'] . '%')->first(); |
|
375 | - $nationalityId = Nationality::where('name', 'like', '%' . $row['guardians_nationality'] . '%')->first(); |
|
376 | - $identityType = Identity_type::where('national_code', 'like', '%' . $row['guardians_identity_type'] . '%')->first(); |
|
374 | + $AddressArea = Area_administrative::where('name', 'like', '%'.$row['guardians_address_area'].'%')->first(); |
|
375 | + $nationalityId = Nationality::where('name', 'like', '%'.$row['guardians_nationality'].'%')->first(); |
|
376 | + $identityType = Identity_type::where('national_code', 'like', '%'.$row['guardians_identity_type'].'%')->first(); |
|
377 | 377 | $openemisGuardian = $this->uniqueUid::getUniqueAlphanumeric(); |
378 | 378 | |
379 | 379 | $identityType = $identityType !== null ? $identityType->id : null; |
@@ -388,7 +388,7 @@ discard block |
||
388 | 388 | |
389 | 389 | if ($guardian === null) { |
390 | 390 | $guardian = Security_user::create([ |
391 | - 'username' => str_replace('-','',$openemisGuardian), |
|
391 | + 'username' => str_replace('-', '', $openemisGuardian), |
|
392 | 392 | 'openemis_no' => $openemisGuardian, |
393 | 393 | 'first_name' => $row['guardians_full_name'], // here we save full name in the column of first name. re reduce breaks of the system. |
394 | 394 | 'last_name' => genNameWithInitials($row['guardians_full_name']), |
@@ -415,16 +415,16 @@ discard block |
||
415 | 415 | $guardian['guardian_relation_id'] = 3; |
416 | 416 | if (array_key_exists('guardians_phone', $row)) { |
417 | 417 | $guardian['contact'] = $row['guardians_phone']; |
418 | - User_contact::createOrUpdate($guardian,$this->file['security_user_id']); |
|
418 | + User_contact::createOrUpdate($guardian, $this->file['security_user_id']); |
|
419 | 419 | } |
420 | 420 | Student_guardian::createStudentGuardian($student, $guardian, $this->file['security_user_id']); |
421 | - } else { |
|
421 | + }else { |
|
422 | 422 | Security_user::where('id', '=', $guardian->id) |
423 | 423 | ->update(['is_guardian' => 1]); |
424 | 424 | $guardian['guardian_relation_id'] = 3; |
425 | 425 | if (array_key_exists('guardians_phone', $row)) { |
426 | 426 | $guardian['contact'] = $row['guardians_phone']; |
427 | - User_contact::createOrUpdate($guardian,$this->file['security_user_id']); |
|
427 | + User_contact::createOrUpdate($guardian, $this->file['security_user_id']); |
|
428 | 428 | } |
429 | 429 | Student_guardian::createStudentGuardian($student, $guardian, $this->file['security_user_id']); |
430 | 430 | } |
@@ -437,12 +437,12 @@ discard block |
||
437 | 437 | if (!empty($allSubjects)) { |
438 | 438 | $allSubjects = unique_multidim_array($allSubjects, 'institution_subject_id'); |
439 | 439 | $this->student = $student; |
440 | - $allSubjects = array_map(array($this,'setStudentSubjects'),$allSubjects); |
|
440 | + $allSubjects = array_map(array($this, 'setStudentSubjects'), $allSubjects); |
|
441 | 441 | // $allSubjects = array_unique($allSubjects,SORT_REGULAR); |
442 | 442 | // $allSubjects = unique_multidim_array($allSubjects, 'education_subject_id'); |
443 | 443 | // array_walk($allSubjects,array($this,'insertSubject')); |
444 | 444 | $allSubjects = unique_multidim_array($allSubjects, 'education_subject_id'); |
445 | - array_walk($allSubjects,array($this,'insertSubject')); |
|
445 | + array_walk($allSubjects, array($this, 'insertSubject')); |
|
446 | 446 | // Institution_subject_student::insert((array) $allSubjects); |
447 | 447 | } |
448 | 448 | |
@@ -452,7 +452,7 @@ discard block |
||
452 | 452 | |
453 | 453 | if ($totalStudents['total'] > $institutionClass->no_of_students) { |
454 | 454 | $error = \Illuminate\Validation\ValidationException::withMessages([]); |
455 | - $failure = new Failure(3, 'rows', [3 => 'Class student count exceeded! Max number of students is ' . $institutionClass->no_of_students], [null]); |
|
455 | + $failure = new Failure(3, 'rows', [3 => 'Class student count exceeded! Max number of students is '.$institutionClass->no_of_students], [null]); |
|
456 | 456 | $failures = [0 => $failure]; |
457 | 457 | throw new \Maatwebsite\Excel\Validators\ValidationException($error, $failures); |
458 | 458 | Log::info('email-sent', [$this->file]); |
@@ -463,7 +463,7 @@ discard block |
||
463 | 463 | 'total_male_students' => $totalStudents['total_male_students'], |
464 | 464 | 'total_female_students' => $totalStudents['total_female_students']]); |
465 | 465 | } |
466 | - } catch (\Maatwebsite\Excel\Validators\ValidationException $e) { |
|
466 | + }catch (\Maatwebsite\Excel\Validators\ValidationException $e) { |
|
467 | 467 | $error = \Illuminate\Validation\ValidationException::withMessages([]); |
468 | 468 | // $failure = new Failure(3, 'remark', [3 => ], [null]); |
469 | 469 | $failures = $e->failures(); |
@@ -477,7 +477,7 @@ discard block |
||
477 | 477 | return [ |
478 | 478 | '*.full_name' => 'required|regex:/^[\pL\s\-]+$/u|max:100', |
479 | 479 | '*.gender_mf' => 'required|in:M,F', |
480 | - '*.date_of_birth_yyyy_mm_dd' => 'date|required|admission_age:' . $this->file['institution_class_id'], |
|
480 | + '*.date_of_birth_yyyy_mm_dd' => 'date|required|admission_age:'.$this->file['institution_class_id'], |
|
481 | 481 | '*.address' => 'nullable', |
482 | 482 | '*.birth_registrar_office_as_in_birth_certificate' => 'nullable|exists:area_administratives,name|required_if:identity_type,BC|birth_place', |
483 | 483 | '*.birth_divisional_secretariat' => 'nullable|exists:area_administratives,name|required_with:birth_registrar_office_as_in_birth_certificate', |
@@ -487,14 +487,14 @@ discard block |
||
487 | 487 | '*.academic_period' => 'required|exists:academic_periods,name', |
488 | 488 | '*.education_grade' => 'required', |
489 | 489 | '*.option_*' => 'nullable|exists:education_subjects,name', |
490 | - '*.bmi_height' => 'bail|bmi:'. $this->file['institution_class_id'], |
|
491 | - '*.bmi_weight' => 'bail|bmi:'. $this->file['institution_class_id'], |
|
492 | - '*.bmi_date_yyyy_mm_dd' => 'bail|bmi:'. $this->file['institution_class_id'].'date', |
|
493 | - '*.bmi_academic_period' => 'bail|bmi:'. $this->file['institution_class_id'].'exists:academic_periods,name', |
|
490 | + '*.bmi_height' => 'bail|bmi:'.$this->file['institution_class_id'], |
|
491 | + '*.bmi_weight' => 'bail|bmi:'.$this->file['institution_class_id'], |
|
492 | + '*.bmi_date_yyyy_mm_dd' => 'bail|bmi:'.$this->file['institution_class_id'].'date', |
|
493 | + '*.bmi_academic_period' => 'bail|bmi:'.$this->file['institution_class_id'].'exists:academic_periods,name', |
|
494 | 494 | '*.admission_no' => 'required|max:12|min:1', |
495 | 495 | '*.start_date_yyyy_mm_dd' => 'required', |
496 | 496 | '*.special_need_type' => 'nullable', |
497 | - '*.special_need' => 'nullable|exists:special_need_difficulties,name|required_if:special_need_type,Differantly Able',//|exists:special_need_difficulties,name', |
|
497 | + '*.special_need' => 'nullable|exists:special_need_difficulties,name|required_if:special_need_type,Differantly Able', //|exists:special_need_difficulties,name', |
|
498 | 498 | '*.fathers_full_name' => 'nullable|regex:/^[\pL\s\-]+$/u', |
499 | 499 | '*.fathers_date_of_birth_yyyy_mm_dd' => 'required_with:fathers_full_name', |
500 | 500 | '*.fathers_address' => 'required_with:fathers_full_name', |
@@ -32,8 +32,8 @@ |
||
32 | 32 | } |
33 | 33 | |
34 | 34 | /** |
35 | - * @return \Illuminate\Support\Collection |
|
36 | - */ |
|
35 | + * @return \Illuminate\Support\Collection |
|
36 | + */ |
|
37 | 37 | public function collection() |
38 | 38 | { |
39 | 39 | // |
@@ -6,7 +6,7 @@ |
||
6 | 6 | use App\Models\Examination_student; |
7 | 7 | use Maatwebsite\Excel\Concerns\WithHeadings; |
8 | 8 | |
9 | -class ExaminationStudentsExport implements FromCollection , WithHeadings |
|
9 | +class ExaminationStudentsExport implements FromCollection, WithHeadings |
|
10 | 10 | { |
11 | 11 | |
12 | 12 | public function headings(): array |
@@ -40,7 +40,7 @@ |
||
40 | 40 | { |
41 | 41 | $output = new \Symfony\Component\Console\Output\ConsoleOutput(); |
42 | 42 | $output->writeln('###########################################------Inserting file records------###########################################'); |
43 | - $this->examinationController = new ExaminationStudentsController($this->argument('year'),$this->argument('grade')); |
|
43 | + $this->examinationController = new ExaminationStudentsController($this->argument('year'), $this->argument('grade')); |
|
44 | 44 | $this->examinationController->doMatch(); |
45 | 45 | $output->writeln('###########################################------Finished inserting file records------###########################################'); |
46 | 46 | } |
@@ -31,16 +31,16 @@ discard block |
||
31 | 31 | $institution = Institution_class::find($file['institution_class_id']); |
32 | 32 | |
33 | 33 | $this->user = User::find($file['security_user_id']); |
34 | - $this->subject = 'SIS Bulk Upload: Upload Failed '.$institution->institution->code.': '. $institution->name . date('Y:m:d H:i:s'); |
|
34 | + $this->subject = 'SIS Bulk Upload: Upload Failed '.$institution->institution->code.': '.$institution->name.date('Y:m:d H:i:s'); |
|
35 | 35 | $this->from_address = env('MAIL_FROM_ADDRESS'); |
36 | 36 | $this->from_name = 'SIS Bulk Uploader'; |
37 | 37 | $this->with = [ |
38 | 38 | 'name' => $this->user->first_name, |
39 | - 'link' => env('APP_ENV','local') == 'stage' | 'local' | 'prod' ? env('APP_URL').'/download/' .$file['filename'] : env('APP_URL').'/bulk-upload/download/' .$file['filename'] |
|
39 | + 'link' => env('APP_ENV', 'local') == 'stage' | 'local' | 'prod' ? env('APP_URL').'/download/'.$file['filename'] : env('APP_URL').'/bulk-upload/download/'.$file['filename'] |
|
40 | 40 | ]; |
41 | 41 | $this->viewData = [ |
42 | 42 | 'name'=>$this->user->first_name, "body" => "The class you tried to import data is exceeded the student count limit.Please check the class / increase the student limit", |
43 | - 'link' => env('APP_ENV','local') == 'stage' | 'local' | 'prod' ? env('APP_URL').'/download/' .$file['filename'] : env('APP_URL').'/bulk-upload/download/' .$file['filename'] |
|
43 | + 'link' => env('APP_ENV', 'local') == 'stage' | 'local' | 'prod' ? env('APP_URL').'/download/'.$file['filename'] : env('APP_URL').'/bulk-upload/download/'.$file['filename'] |
|
44 | 44 | ]; |
45 | 45 | } |
46 | 46 | |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | public function build() |
53 | 53 | { |
54 | 54 | return $this->view('emails.mail') |
55 | - ->from($this->from_address,$this->from_name) |
|
55 | + ->from($this->from_address, $this->from_name) |
|
56 | 56 | ->to($this->user->email) |
57 | 57 | ->subject($this->subject) |
58 | 58 | ->with($this->with); |
@@ -24,17 +24,17 @@ discard block |
||
24 | 24 | |
25 | 25 | |
26 | 26 | $this->user = User::find($file['security_user_id']); |
27 | - $this->subject = 'SIS Bulk Upload: ' .$file['subject']. $institution->institution->code.': '. $institution->name.' '. date('Y:m:d H:i:s'); |
|
27 | + $this->subject = 'SIS Bulk Upload: '.$file['subject'].$institution->institution->code.': '.$institution->name.' '.date('Y:m:d H:i:s'); |
|
28 | 28 | $this->from_address = env('MAIL_FROM_ADDRESS'); |
29 | 29 | $this->from_name = 'SIS Bulk Uploader'; |
30 | 30 | $this->with = [ |
31 | 31 | 'name' => $this->user->first_name, |
32 | - 'link' => env('APP_ENV','local') == 'stage' | 'local' | 'prod' ? env('APP_URL').'/download/' .$file['filename'] : env('APP_URL').'/bulk-upload/download/' .$file['filename'] |
|
32 | + 'link' => env('APP_ENV', 'local') == 'stage' | 'local' | 'prod' ? env('APP_URL').'/download/'.$file['filename'] : env('APP_URL').'/bulk-upload/download/'.$file['filename'] |
|
33 | 33 | ]; |
34 | 34 | $this->viewData = [ |
35 | - 'name'=>$this->user->first_name, "body" => "We found some errors on your data file ". $file['filename']. ' Pleas fix the errors and re-upload only with incorrect data, |
|
35 | + 'name'=>$this->user->first_name, "body" => "We found some errors on your data file ".$file['filename'].' Pleas fix the errors and re-upload only with incorrect data, |
|
36 | 36 | We uploaded the correct data to the system', |
37 | - 'link' => env('APP_ENV','local') == 'stage' | 'local' | 'prod' ? env('APP_URL').'/download/' .$file['filename'] : env('APP_URL').'/bulk-upload/download/' .$file['filename'] |
|
37 | + 'link' => env('APP_ENV', 'local') == 'stage' | 'local' | 'prod' ? env('APP_URL').'/download/'.$file['filename'] : env('APP_URL').'/bulk-upload/download/'.$file['filename'] |
|
38 | 38 | ]; |
39 | 39 | } |
40 | 40 | |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | public function build() |
47 | 47 | { |
48 | 48 | return $this->view('emails.mail') |
49 | - ->from($this->from_address,$this->from_name) |
|
49 | + ->from($this->from_address, $this->from_name) |
|
50 | 50 | ->to($this->user->email) |
51 | 51 | ->subject($this->subject) |
52 | 52 | ->with($this->with); |
@@ -25,16 +25,16 @@ discard block |
||
25 | 25 | |
26 | 26 | |
27 | 27 | $this->user = User::find($file['security_user_id']); |
28 | - $this->subject = 'SIS Bulk Upload: ' .$file['subject'].' Empty ' . $institution->institution->code.': '. $institution->name.' '. date('Y:m:d H:i:s'); |
|
28 | + $this->subject = 'SIS Bulk Upload: '.$file['subject'].' Empty '.$institution->institution->code.': '.$institution->name.' '.date('Y:m:d H:i:s'); |
|
29 | 29 | $this->from_address = env('MAIL_FROM_ADDRESS'); |
30 | 30 | $this->from_name = 'SIS Bulk Uploader'; |
31 | 31 | $this->with = [ |
32 | 32 | 'name' => $this->user->first_name, |
33 | - 'link' => env('APP_ENV','local') == 'stage' | 'local' | 'prod' ? env('APP_URL') : env('APP_URL').'bulk-upload/' |
|
33 | + 'link' => env('APP_ENV', 'local') == 'stage' | 'local' | 'prod' ? env('APP_URL') : env('APP_URL').'bulk-upload/' |
|
34 | 34 | ]; |
35 | 35 | $this->viewData = [ |
36 | - 'name'=>$this->user->first_name, "body" => "No data Found in ". $file['filename']. ' Please re-upload the file with data', |
|
37 | - 'link' => env('APP_ENV','local') == 'stage' | 'local' | 'prod' ? env('APP_URL') : env('APP_URL').'bulk-upload/' |
|
36 | + 'name'=>$this->user->first_name, "body" => "No data Found in ".$file['filename'].' Please re-upload the file with data', |
|
37 | + 'link' => env('APP_ENV', 'local') == 'stage' | 'local' | 'prod' ? env('APP_URL') : env('APP_URL').'bulk-upload/' |
|
38 | 38 | ]; |
39 | 39 | } |
40 | 40 | |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | public function build() |
47 | 47 | { |
48 | 48 | return $this->view('emails.mail') |
49 | - ->from($this->from_address,$this->from_name) |
|
49 | + ->from($this->from_address, $this->from_name) |
|
50 | 50 | ->to($this->user->email) |
51 | 51 | ->subject($this->subject) |
52 | 52 | ->with($this->with); |
@@ -22,17 +22,17 @@ discard block |
||
22 | 22 | |
23 | 23 | $institution = Institution_class::find($file['institution_class_id']); |
24 | 24 | $this->user = User::find($file['security_user_id']); |
25 | - $this->subject = 'SIS Bulk Upload: Process Terminated'.$institution->institution->code.': '. $institution->name.' '. date('Y:m:d H:i:s'); |
|
25 | + $this->subject = 'SIS Bulk Upload: Process Terminated'.$institution->institution->code.': '.$institution->name.' '.date('Y:m:d H:i:s'); |
|
26 | 26 | $this->from_address = env('MAIL_FROM_ADDRESS'); |
27 | 27 | $this->from_name = 'SIS Bulk Uploader'; |
28 | 28 | $this->with = [ |
29 | 29 | 'name' => $this->user->first_name, |
30 | - 'link' => env('APP_ENV','local') == 'stage' | 'local' | 'prod' ? env('APP_URL').'/download/' .$file['filename'] : env('APP_URL').'/bulk-upload/download/' .$file['filename'] |
|
30 | + 'link' => env('APP_ENV', 'local') == 'stage' | 'local' | 'prod' ? env('APP_URL').'/download/'.$file['filename'] : env('APP_URL').'/bulk-upload/download/'.$file['filename'] |
|
31 | 31 | ]; |
32 | 32 | $this->viewData = [ |
33 | 33 | 'name'=>$this->user->first_name, "body" => "Apologize ,The process of you file has been terminated in the middle, |
34 | 34 | We advice you to check the student data and re-upload with only with correct data which are not in the system ", |
35 | - 'link' => env('APP_ENV','local') == 'stage' | 'local' | 'prod' ? env('APP_URL').'/download/' .$file['filename'] : env('APP_URL').'/bulk-upload/download/' .$file['filename'] |
|
35 | + 'link' => env('APP_ENV', 'local') == 'stage' | 'local' | 'prod' ? env('APP_URL').'/download/'.$file['filename'] : env('APP_URL').'/bulk-upload/download/'.$file['filename'] |
|
36 | 36 | ]; |
37 | 37 | } |
38 | 38 | |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | public function build() |
45 | 45 | { |
46 | 46 | return $this->view('emails.mail') |
47 | - ->from($this->from_address,$this->from_name) |
|
47 | + ->from($this->from_address, $this->from_name) |
|
48 | 48 | ->to($this->user->email) |
49 | 49 | ->subject($this->subject) |
50 | 50 | ->with($this->with); |
@@ -67,12 +67,12 @@ |
||
67 | 67 | 'institution_id' => $admissionInfo['instituion']->id, |
68 | 68 | 'academic_period_id' => $admissionInfo['academic_period']->id, |
69 | 69 | 'education_grade_id' => $admissionInfo['education_grade']->id, |
70 | - 'institution_class_id' => (($admissionInfo['instituion_class'] != []) && (count($admissionInfo['instituion_class'])==1)) ? $admissionInfo['instituion_class']['id'] : null, |
|
70 | + 'institution_class_id' => (($admissionInfo['instituion_class'] != []) && (count($admissionInfo['instituion_class']) == 1)) ? $admissionInfo['instituion_class']['id'] : null, |
|
71 | 71 | 'comment' => 'Imported From Examination Data', |
72 | 72 | 'created_user_id' => 1 |
73 | 73 | ]; |
74 | 74 | self::create($data); |
75 | - } catch (\Throwable $th) { |
|
75 | + }catch (\Throwable $th) { |
|
76 | 76 | Log::error($th); |
77 | 77 | } |
78 | 78 | } |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | public static function boot() |
54 | 54 | { |
55 | 55 | parent::boot(); |
56 | - self::creating(function ($model) { |
|
56 | + self::creating(function($model) { |
|
57 | 57 | $model->id = (string) Uuid::generate(4); |
58 | 58 | $model->created = now(); |
59 | 59 | }); |
@@ -66,15 +66,15 @@ discard block |
||
66 | 66 | |
67 | 67 | public static function getStudentsCount($institution_class_id) |
68 | 68 | { |
69 | - $total_male_students = self::with(['student' => function ($query) { |
|
69 | + $total_male_students = self::with(['student' => function($query) { |
|
70 | 70 | $query->where('student.gender_id', '=', 1); |
71 | - }])->whereHas('student', function ($query) { |
|
71 | + }])->whereHas('student', function($query) { |
|
72 | 72 | $query->where('gender_id', '=', 1); |
73 | 73 | })->where('institution_class_id', '=', $institution_class_id)->count(); |
74 | 74 | |
75 | - $total_female_students = self::with(['student' => function ($query) { |
|
75 | + $total_female_students = self::with(['student' => function($query) { |
|
76 | 76 | $query->where('student.gender_id', '=', 2); |
77 | - }])->whereHas('student', function ($query) { |
|
77 | + }])->whereHas('student', function($query) { |
|
78 | 78 | $query->where('gender_id', '=', 2); |
79 | 79 | })->where('institution_class_id', '=', $institution_class_id)->count(); |
80 | 80 | |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | 'institution_id' => $admissionInfo['instituion']->id, |
127 | 127 | 'student_status_id' => 1 |
128 | 128 | ]); |
129 | - } catch (\Throwable $th) { |
|
129 | + }catch (\Throwable $th) { |
|
130 | 130 | Log::error($th); |
131 | 131 | } |
132 | 132 | } |