@@ -29,9 +29,9 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 | |
@@ -80,7 +80,7 @@ |
||
| 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')){ |
| 85 | 85 | return '<a href="/download/'.$data->filename.'">'.$data->classRoom->name.'</a>'; |
| 86 | 86 | |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | * `select total from students_count_view where institution_id = $id` |
| 16 | 16 | * `select male from students_count_view where institution_id = $id` |
| 17 | 17 | * `select female from students_count_view where institution_id = $id` |
| 18 | - **/ |
|
| 18 | + **/ |
|
| 19 | 19 | DashboardViews::createOrUpdateStudentCount(); |
| 20 | 20 | |
| 21 | 21 | /** |
@@ -48,10 +48,10 @@ discard block |
||
| 48 | 48 | */ |
| 49 | 49 | DashboardViews::createOrUpdateStudentsCountByGrade(); |
| 50 | 50 | |
| 51 | - /** |
|
| 52 | - * Students count by BMI |
|
| 53 | - * select * from students_count_by_bmi_view where institution_id = $id |
|
| 54 | - */ |
|
| 51 | + /** |
|
| 52 | + * Students count by BMI |
|
| 53 | + * select * from students_count_by_bmi_view where institution_id = $id |
|
| 54 | + */ |
|
| 55 | 55 | DashboardViews::createOrUpdateStudentCountByBMI(); |
| 56 | 56 | |
| 57 | 57 | /** |
@@ -27,11 +27,11 @@ |
||
| 27 | 27 | */ |
| 28 | 28 | protected $description = 'Update the students count male/female'; |
| 29 | 29 | |
| 30 | - /** |
|
| 31 | - * Create a new command instance. |
|
| 32 | - * |
|
| 33 | - * @return void |
|
| 34 | - */ |
|
| 30 | + /** |
|
| 31 | + * Create a new command instance. |
|
| 32 | + * |
|
| 33 | + * @return void |
|
| 34 | + */ |
|
| 35 | 35 | public function __construct() |
| 36 | 36 | { |
| 37 | 37 | parent::__construct(); |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | */ |
| 40 | 40 | public function handle() |
| 41 | 41 | { |
| 42 | - $views = new DashboardViewsController(); |
|
| 43 | - $views->callback(); |
|
| 42 | + $views = new DashboardViewsController(); |
|
| 43 | + $views->callback(); |
|
| 44 | 44 | } |
| 45 | 45 | } |
@@ -37,8 +37,8 @@ |
||
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | /** |
| 40 | - * @return \Illuminate\Support\Collection |
|
| 41 | - */ |
|
| 40 | + * @return \Illuminate\Support\Collection |
|
| 41 | + */ |
|
| 42 | 42 | public function query() |
| 43 | 43 | { |
| 44 | 44 | return Examination_student::query()->whereNotNull('nsid') |
@@ -70,21 +70,21 @@ |
||
| 70 | 70 | */ |
| 71 | 71 | public static function isDuplicated($inputs){ |
| 72 | 72 | |
| 73 | - $exists = self::where('student_id','=',$inputs['student_id']) |
|
| 74 | - ->where('institution_subject_id','=',$inputs['institution_subject_id']) |
|
| 75 | - ->where('education_subject_id','=',$inputs['education_subject_id'])->count(); |
|
| 73 | + $exists = self::where('student_id','=',$inputs['student_id']) |
|
| 74 | + ->where('institution_subject_id','=',$inputs['institution_subject_id']) |
|
| 75 | + ->where('education_subject_id','=',$inputs['education_subject_id'])->count(); |
|
| 76 | 76 | |
| 77 | 77 | |
| 78 | 78 | return $exists ? true :false; |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | |
| 82 | - public function student(){ |
|
| 82 | + public function student(){ |
|
| 83 | 83 | return $this->belongsTo('App\Models\Security_user','student_id'); |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | public static function getStudentsCount($institution_subject_id){ |
| 87 | - $total_male_students = self::with(['student' => function($query) { |
|
| 87 | + $total_male_students = self::with(['student' => function($query) { |
|
| 88 | 88 | $query->where('student.gender_id', '=', 1); |
| 89 | 89 | }])->whereHas('student', function ($query) { |
| 90 | 90 | $query->where('gender_id', '=', 1); |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | |
| 55 | 55 | public function updateOrInsertRecord($user) |
| 56 | 56 | { |
| 57 | - try { |
|
| 57 | + try { |
|
| 58 | 58 | // regenerate unique id if it's not available |
| 59 | 59 | $uniqueId = $this->uniqueUserId::isValidUniqueId($user['openemis_no'],9) ? $this->uniqueUserId::getUniqueAlphanumeric() : $user['openemis_no']; |
| 60 | 60 | |
@@ -69,10 +69,10 @@ discard block |
||
| 69 | 69 | ]); |
| 70 | 70 | } |
| 71 | 71 | return $user; |
| 72 | - } catch (\Exception $th) { |
|
| 72 | + } catch (\Exception $th) { |
|
| 73 | 73 | Log::error($th->getMessage()); |
| 74 | - $user['openemis_no'] = $this->uniqueUserId::getUniqueAlphanumeric(); |
|
| 75 | - $this->updateOrInsertRecord($user); |
|
| 76 | - } |
|
| 74 | + $user['openemis_no'] = $this->uniqueUserId::getUniqueAlphanumeric(); |
|
| 75 | + $this->updateOrInsertRecord($user); |
|
| 76 | + } |
|
| 77 | 77 | } |
| 78 | 78 | } |
@@ -86,11 +86,11 @@ |
||
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | public function process($students,$count,$type){ |
| 89 | - if($type === 'duplicate'){ |
|
| 89 | + if($type === 'duplicate'){ |
|
| 90 | 90 | array_walk($students,array($this,'cleanData')); |
| 91 | - }elseif($type === 'lock'){ |
|
| 91 | + }elseif($type === 'lock'){ |
|
| 92 | 92 | array_walk($students,array($this,'lockData')); |
| 93 | - } |
|
| 93 | + } |
|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | public function lockData($Student){ |