@@ -76,9 +76,9 @@ discard block |
||
76 | 76 | $this->end_time = microtime(TRUE); |
77 | 77 | |
78 | 78 | |
79 | - $this->output->writeln('$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$'); |
|
80 | - $this->output->writeln('The cook took ' . ($this->end_time - $this->start_time) . ' seconds to complete'); |
|
81 | - $this->output->writeln('$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$'); |
|
79 | + $this->output->writeln('$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$'); |
|
80 | + $this->output->writeln('The cook took ' . ($this->end_time - $this->start_time) . ' seconds to complete'); |
|
81 | + $this->output->writeln('$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$'); |
|
82 | 82 | |
83 | 83 | } |
84 | 84 | |
@@ -113,13 +113,13 @@ discard block |
||
113 | 113 | $this->output->writeln('updating from '. $shiftId); |
114 | 114 | |
115 | 115 | }catch (\Exception $e){ |
116 | - Log::error($e->getMessage(),[$e]); |
|
116 | + Log::error($e->getMessage(),[$e]); |
|
117 | 117 | } |
118 | 118 | } |
119 | 119 | // DB::commit(); |
120 | 120 | }catch (\Exception $e){ |
121 | 121 | // DB::rollBack(); |
122 | - Log::error($e->getMessage(),[$e]); |
|
122 | + Log::error($e->getMessage(),[$e]); |
|
123 | 123 | } |
124 | 124 | } |
125 | 125 | |
@@ -130,16 +130,16 @@ discard block |
||
130 | 130 | * @param $academicPeriod |
131 | 131 | */ |
132 | 132 | public function insertInstitutionSubjects($subjects, $count,$academicPeriod){ |
133 | - try{ |
|
134 | - $subjects['academic_period_id'] = $academicPeriod->id; |
|
135 | - $subjects['created'] = now(); |
|
136 | - unset($subjects['total_male_students']); |
|
137 | - unset($subjects['total_female_students']); |
|
138 | - unset($subjects['id']); |
|
139 | - $classSubject = Institution_subject::create($subjects); |
|
140 | - }catch (\Exception $e){ |
|
133 | + try{ |
|
134 | + $subjects['academic_period_id'] = $academicPeriod->id; |
|
135 | + $subjects['created'] = now(); |
|
136 | + unset($subjects['total_male_students']); |
|
137 | + unset($subjects['total_female_students']); |
|
138 | + unset($subjects['id']); |
|
139 | + $classSubject = Institution_subject::create($subjects); |
|
140 | + }catch (\Exception $e){ |
|
141 | 141 | Log::error($e->getMessage(),[$e]); |
142 | - } |
|
142 | + } |
|
143 | 143 | } |
144 | 144 | |
145 | 145 | |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | $this->insertInstitutionClassSubjects($institutionSubjects,$class); |
182 | 182 | // array_walk($classSubjects,array($this,'insertInstitutionClassSubjects'),$params); |
183 | 183 | }catch (\Exception $e){ |
184 | - Log::error($e->getMessage(),[$e]); |
|
184 | + Log::error($e->getMessage(),[$e]); |
|
185 | 185 | } |
186 | 186 | } |
187 | 187 | |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | array_walk($subjects,array($this,'insertClassSubjects'),$class); |
192 | 192 | $this->output->writeln('updating subjects '. $class->name); |
193 | 193 | }catch (\Exception $e){ |
194 | - Log::error($e->getMessage(),[$e]); |
|
194 | + Log::error($e->getMessage(),[$e]); |
|
195 | 195 | } |
196 | 196 | }; |
197 | 197 | } |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | $this->institution_class_subjects->create($subjectobj); |
210 | 210 | } |
211 | 211 | }catch (\Exception $e){ |
212 | - Log::error($e->getMessage(),[$e]); |
|
212 | + Log::error($e->getMessage(),[$e]); |
|
213 | 213 | } |
214 | 214 | } |
215 | 215 |
@@ -286,8 +286,8 @@ discard block |
||
286 | 286 | |
287 | 287 | |
288 | 288 | protected function getSheetCount($file){ |
289 | - $objPHPExcel = $this->setReader($file); |
|
290 | - return $objPHPExcel->getSheetCount(); |
|
289 | + $objPHPExcel = $this->setReader($file); |
|
290 | + return $objPHPExcel->getSheetCount(); |
|
291 | 291 | } |
292 | 292 | |
293 | 293 | |
@@ -298,8 +298,8 @@ discard block |
||
298 | 298 | * @param $column |
299 | 299 | */ |
300 | 300 | protected function import($file, $sheet, $column){ |
301 | - try { |
|
302 | - ini_set('memory_limit', '2048M'); |
|
301 | + try { |
|
302 | + ini_set('memory_limit', '2048M'); |
|
303 | 303 | $this->getFileSize($file); |
304 | 304 | $user = User::find($file['security_user_id']); |
305 | 305 | $excelFile = '/sis-bulk-data-files/' . $file['filename']; |
@@ -360,23 +360,23 @@ discard block |
||
360 | 360 | break; |
361 | 361 | } |
362 | 362 | }catch (\Maatwebsite\Excel\Validators\ValidationException $e) { |
363 | - $this->output->writeln( $e->getMessage()); |
|
364 | - if($sheet == 1){ |
|
365 | - self::writeErrors($e,$file,'Insert Students'); |
|
366 | - DB::table('uploads') |
|
367 | - ->where('id', $file['id']) |
|
368 | - ->update(['insert' => 2,'updated_at' => now()]); |
|
363 | + $this->output->writeln( $e->getMessage()); |
|
364 | + if($sheet == 1){ |
|
365 | + self::writeErrors($e,$file,'Insert Students'); |
|
366 | + DB::table('uploads') |
|
367 | + ->where('id', $file['id']) |
|
368 | + ->update(['insert' => 2,'updated_at' => now()]); |
|
369 | 369 | $this->processFailedEmail($file,$user,'Fresh Student Data Upload:Failed'); |
370 | - }else if($sheet == 2){ |
|
371 | - self::writeErrors($e,$file,'Update Students'); |
|
372 | - DB::table('uploads') |
|
373 | - ->where('id', $file['id']) |
|
374 | - ->update(['update' => 2,'updated_at' => now()]); |
|
370 | + }else if($sheet == 2){ |
|
371 | + self::writeErrors($e,$file,'Update Students'); |
|
372 | + DB::table('uploads') |
|
373 | + ->where('id', $file['id']) |
|
374 | + ->update(['update' => 2,'updated_at' => now()]); |
|
375 | 375 | $this->processFailedEmail($file,$user, 'Existing Student Data Update:Failed'); |
376 | - } |
|
377 | - DB::table('uploads') |
|
378 | - ->where('id', $file['id']) |
|
379 | - ->update(['is_processed' =>2 , 'updated_at' => now()]); |
|
376 | + } |
|
377 | + DB::table('uploads') |
|
378 | + ->where('id', $file['id']) |
|
379 | + ->update(['is_processed' =>2 , 'updated_at' => now()]); |
|
380 | 380 | |
381 | 381 | } |
382 | 382 |
@@ -25,8 +25,8 @@ |
||
25 | 25 | */ |
26 | 26 | protected function schedule(Schedule $schedule) |
27 | 27 | { |
28 | - $schedule->command('import:students') |
|
29 | - ->cron('* * * * * '); |
|
28 | + $schedule->command('import:students') |
|
29 | + ->cron('* * * * * '); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | /** |
@@ -107,8 +107,8 @@ |
||
107 | 107 | * @return mixed |
108 | 108 | */ |
109 | 109 | public function getInstitutionGrade($institutionId, $gradeId){ |
110 | - return self::where('education_grade_id',$gradeId) |
|
111 | - ->where('institution_id',$institutionId)->get()->first(); |
|
110 | + return self::where('education_grade_id',$gradeId) |
|
111 | + ->where('institution_id',$institutionId)->get()->first(); |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | /** |
@@ -71,21 +71,21 @@ |
||
71 | 71 | */ |
72 | 72 | public static function isDuplicated($inputs){ |
73 | 73 | |
74 | - $exists = self::where('student_id','=',$inputs['student_id']) |
|
75 | - ->where('institution_subject_id','=',$inputs['institution_subject_id']) |
|
76 | - ->where('education_subject_id','=',$inputs['education_subject_id'])->count(); |
|
74 | + $exists = self::where('student_id','=',$inputs['student_id']) |
|
75 | + ->where('institution_subject_id','=',$inputs['institution_subject_id']) |
|
76 | + ->where('education_subject_id','=',$inputs['education_subject_id'])->count(); |
|
77 | 77 | |
78 | 78 | |
79 | 79 | return $exists ? true :false; |
80 | 80 | } |
81 | 81 | |
82 | 82 | |
83 | - public function student(){ |
|
83 | + public function student(){ |
|
84 | 84 | return $this->belongsTo('App\Models\Security_user','student_id'); |
85 | 85 | } |
86 | 86 | |
87 | 87 | public static function getStudentsCount(){ |
88 | - $total_male_students = self::with(['student' => function($query) { |
|
88 | + $total_male_students = self::with(['student' => function($query) { |
|
89 | 89 | $query->where('student.gender_id', '=', 1); |
90 | 90 | }])->whereHas('student', function ($query) { |
91 | 91 | $query->where('gender_id', '=', 1); |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | protected $table = 'security_users'; |
24 | 24 | |
25 | 25 | protected $appends = [ |
26 | - 'special_need_name' |
|
26 | + 'special_need_name' |
|
27 | 27 | ]; |
28 | 28 | |
29 | 29 | /** |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | |
105 | 105 | |
106 | 106 | |
107 | - public function rules() |
|
107 | + public function rules() |
|
108 | 108 | { |
109 | 109 | return [ |
110 | 110 | 'identity_number' => [ |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | } |
127 | 127 | |
128 | 128 | public function uploads(){ |
129 | - return $this->hasMany('App\Models\Upload'); |
|
129 | + return $this->hasMany('App\Models\Upload'); |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | public function class(){ |
@@ -42,7 +42,7 @@ |
||
42 | 42 | protected $dates = ['modified', 'created']; |
43 | 43 | |
44 | 44 | public function shiftExists($shift){ |
45 | - return self::query() |
|
45 | + return self::query() |
|
46 | 46 | ->where('institution_id',$shift['institution_id']) |
47 | 47 | ->where('location_institution_id',$shift['location_institution_id']) |
48 | 48 | ->where('shift_option_id',$shift['shift_option_id']) |
@@ -42,11 +42,11 @@ |
||
42 | 42 | protected $dates = ['special_need_date', 'modified', 'created']; |
43 | 43 | |
44 | 44 | |
45 | - public static function isDuplicated($inputs){ |
|
45 | + public static function isDuplicated($inputs){ |
|
46 | 46 | |
47 | - $exists = self::where('security_user_id','=',$inputs['security_user_id']) |
|
48 | - ->where('special_need_type_id','=',$inputs['special_need_type_id']) |
|
49 | - ->where('special_need_difficulty_id','=',$inputs['special_need_difficulty_id'])->count(); |
|
47 | + $exists = self::where('security_user_id','=',$inputs['security_user_id']) |
|
48 | + ->where('special_need_type_id','=',$inputs['special_need_type_id']) |
|
49 | + ->where('special_need_difficulty_id','=',$inputs['special_need_difficulty_id'])->count(); |
|
50 | 50 | |
51 | 51 | // dd($exists); |
52 | 52 | return $exists == 0 ? true :false; |
@@ -42,7 +42,7 @@ |
||
42 | 42 | protected $dates = ['date_opened', 'date_closed', 'modified', 'created']; |
43 | 43 | |
44 | 44 | public function isActive($id){ |
45 | - return self::query()->find($id)->get()->first()->institution_status_id == 1; |
|
45 | + return self::query()->find($id)->get()->first()->institution_status_id == 1; |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | } |