diff --git a/app/Http/Controllers/MasterController.php b/app/Http/Controllers/MasterController.php index a9cdd2b2e..2371be80f 100755 --- a/app/Http/Controllers/MasterController.php +++ b/app/Http/Controllers/MasterController.php @@ -1,13 +1,23 @@ get()); + $students = count(User::where('role', 'student')->get()); + $admins = count(User::where('role', 'admin')->get()); + return view('masters.index',[ + 'school_count'=>$school_count, + 'teachers_count'=>$teachers, + 'students_count'=>$students, + 'admins_count'=>$admins, + ]); } } diff --git a/database/migrations/2014_10_12_000000_create_schools_table.php b/database/migrations/2014_10_12_000000_create_schools_table.php index d1bf7efb1..9e1db8297 100755 --- a/database/migrations/2014_10_12_000000_create_schools_table.php +++ b/database/migrations/2014_10_12_000000_create_schools_table.php @@ -14,7 +14,7 @@ class CreateSchoolsTable extends Migration public function up() { Schema::create('schools', function (Blueprint $table) { - $table->increments('id'); + $table->bigIncrements('id'); $table->string('name'); $table->string('established')->default(''); $table->text('about'); diff --git a/database/migrations/2014_10_12_100000_create_users_table.php b/database/migrations/2014_10_12_100000_create_users_table.php index b9adcc328..b96f61a61 100755 --- a/database/migrations/2014_10_12_100000_create_users_table.php +++ b/database/migrations/2014_10_12_100000_create_users_table.php @@ -14,15 +14,14 @@ class CreateUsersTable extends Migration public function up() { Schema::create('users', function (Blueprint $table) { - $table->increments('id'); + $table->bigIncrements('id'); $table->string('name'); $table->string('email')->unique(); $table->string('password'); $table->string('role'); $table->tinyInteger('active'); - $table->integer('school_id')->nullable(); $table->integer('code')->nullable();//school code Auto generated - $table->integer('student_code')->unique()->nullable();//Auto generated + $table->bigInteger('student_code')->unique()->nullable();//Auto generated $table->string('gender')->default(''); $table->string('blood_group')->default(''); $table->string('nationality')->default(''); @@ -32,6 +31,8 @@ public function up() $table->string('pic_path')->default(''); $table->tinyInteger('verified'); $table->integer('section_id')->unsigned()->nullable(); + $table->bigInteger('school_id')->unsigned()->nullable(); + $table->foreign('school_id')->references('id')->on('schools'); $table->rememberToken(); $table->timestamps(); }); diff --git a/database/migrations/2017_12_21_065735_create_exams_table.php b/database/migrations/2017_12_21_065735_create_exams_table.php index d79dff77a..874b3d4ad 100755 --- a/database/migrations/2017_12_21_065735_create_exams_table.php +++ b/database/migrations/2017_12_21_065735_create_exams_table.php @@ -14,13 +14,15 @@ class CreateExamsTable extends Migration public function up() { Schema::create('exams', function (Blueprint $table) { - $table->increments('id'); + $table->bigIncrements('id'); $table->string('exam_name'); $table->tinyInteger('active'); $table->tinyInteger('notice_published'); $table->tinyInteger('result_published'); - $table->integer('school_id')->unsigned(); - $table->integer('user_id')->unsigned(); + $table->bigInteger('school_id')->unsigned(); + $table->bigInteger('user_id')->unsigned(); + $table->foreign('school_id')->references('id')->on('schools'); + $table->foreign('user_id')->references('id')->on('users'); $table->timestamps(); }); } diff --git a/database/migrations/2017_12_27_025413_create_classes_table.php b/database/migrations/2017_12_27_025340_create_classes_table.php similarity index 78% rename from database/migrations/2017_12_27_025413_create_classes_table.php rename to database/migrations/2017_12_27_025340_create_classes_table.php index 764872f26..59d849a03 100755 --- a/database/migrations/2017_12_27_025413_create_classes_table.php +++ b/database/migrations/2017_12_27_025340_create_classes_table.php @@ -14,10 +14,11 @@ class CreateClassesTable extends Migration public function up() { Schema::create('classes', function (Blueprint $table) { - $table->increments('id'); + $table->bigIncrements('id'); $table->string('class_number'); - $table->integer('school_id')->unsigned(); + $table->bigInteger('school_id')->unsigned(); $table->string('group'); + $table->foreign('school_id')->references('id')->on('schools'); $table->timestamps(); }); } diff --git a/database/migrations/2017_12_27_025427_create_sections_table.php b/database/migrations/2017_12_27_025345_create_sections_table.php similarity index 67% rename from database/migrations/2017_12_27_025427_create_sections_table.php rename to database/migrations/2017_12_27_025345_create_sections_table.php index 5109f1607..8df851b25 100755 --- a/database/migrations/2017_12_27_025427_create_sections_table.php +++ b/database/migrations/2017_12_27_025345_create_sections_table.php @@ -14,11 +14,14 @@ class CreateSectionsTable extends Migration public function up() { Schema::create('sections', function (Blueprint $table) { - $table->increments('id'); + $table->bigIncrements('id'); $table->string('section_number'); $table->integer('room_number'); - $table->integer('class_id')->unsigned(); - $table->integer('user_id')->unsigned()->default(0); + $table->bigInteger('class_id')->unsigned(); + $table->bigInteger('user_id')->unsigned()->default(0); + $table->foreign('class_id')->references('id')->on('classes'); + $table->foreign('user_id')->references('id')->on('users'); + $table->timestamps(); }); } diff --git a/database/migrations/2017_12_27_025349_create_attendances_table.php b/database/migrations/2017_12_27_025349_create_attendances_table.php index 64e73d800..d5d35194b 100755 --- a/database/migrations/2017_12_27_025349_create_attendances_table.php +++ b/database/migrations/2017_12_27_025349_create_attendances_table.php @@ -15,11 +15,16 @@ public function up() { Schema::create('attendances', function (Blueprint $table) { $table->increments('id'); - $table->integer('student_id')->unsigned(); - $table->integer('section_id')->unsigned(); - $table->integer('exam_id')->unsigned(); + $table->bigInteger('student_id')->unsigned(); + $table->bigInteger('section_id')->unsigned(); + $table->bigInteger('exam_id')->unsigned(); $table->tinyInteger('present')->unsigned(); - $table->integer('user_id')->unsigned(); + $table->bigInteger('user_id')->unsigned(); + // $table->foreign('student_id')->references('student_code')->on('users'); + $table->foreign('section_id')->references('id')->on('sections'); + $table->foreign('exam_id')->references('id')->on('exams'); + $table->foreign('user_id')->references('id')->on('users'); + $table->timestamps(); }); } diff --git a/database/migrations/2017_12_27_025450_create_syllabuses_table.php b/database/migrations/2017_12_27_025450_create_syllabuses_table.php index 572906c58..16247d367 100755 --- a/database/migrations/2017_12_27_025450_create_syllabuses_table.php +++ b/database/migrations/2017_12_27_025450_create_syllabuses_table.php @@ -19,8 +19,10 @@ public function up() $table->string('title'); $table->text('description'); $table->tinyInteger('active'); - $table->integer('school_id')->unsigned(); - $table->integer('user_id')->unsigned(); + $table->bigInteger('school_id')->unsigned(); + $table->bigInteger('user_id')->unsigned(); + $table->foreign('school_id')->references('id')->on('schools'); + $table->foreign('user_id')->references('id')->on('users'); $table->timestamps(); }); } diff --git a/database/migrations/2017_12_27_025503_create_notices_table.php b/database/migrations/2017_12_27_025503_create_notices_table.php index f814a685f..5c59319d5 100755 --- a/database/migrations/2017_12_27_025503_create_notices_table.php +++ b/database/migrations/2017_12_27_025503_create_notices_table.php @@ -14,13 +14,15 @@ class CreateNoticesTable extends Migration public function up() { Schema::create('notices', function (Blueprint $table) { - $table->increments('id'); + $table->bigIncrements('id'); $table->string('file_path'); $table->string('title'); $table->text('description'); $table->tinyInteger('active'); - $table->integer('school_id')->unsigned(); - $table->integer('user_id')->unsigned(); + $table->bigInteger('school_id')->unsigned(); + $table->bigInteger('user_id')->unsigned(); + $table->foreign('school_id')->references('id')->on('schools'); + $table->foreign('user_id')->references('id')->on('users'); $table->timestamps(); }); } diff --git a/database/migrations/2017_12_27_025512_create_events_table.php b/database/migrations/2017_12_27_025512_create_events_table.php index 37bcde2b0..e96b3e3a8 100755 --- a/database/migrations/2017_12_27_025512_create_events_table.php +++ b/database/migrations/2017_12_27_025512_create_events_table.php @@ -19,8 +19,10 @@ public function up() $table->string('title'); $table->text('description'); $table->tinyInteger('active'); - $table->integer('school_id')->unsigned(); - $table->integer('user_id')->unsigned(); + $table->bigInteger('school_id')->unsigned(); + $table->bigInteger('user_id')->unsigned(); + $table->foreign('school_id')->references('id')->on('schools'); + $table->foreign('user_id')->references('id')->on('users'); $table->timestamps(); }); } diff --git a/database/migrations/2017_12_27_025530_create_homeworks_table.php b/database/migrations/2017_12_27_025530_create_homeworks_table.php index 1aba14da8..553bf90d9 100755 --- a/database/migrations/2017_12_27_025530_create_homeworks_table.php +++ b/database/migrations/2017_12_27_025530_create_homeworks_table.php @@ -17,8 +17,10 @@ public function up() $table->increments('id'); $table->string('file_path'); $table->text('description'); - $table->integer('teacher_id')->unsigned(); - $table->integer('section_id')->unsigned(); + $table->bigInteger('teacher_id')->unsigned(); + $table->bigInteger('section_id')->unsigned(); + $table->foreign('teacher_id')->references('id')->on('users'); + $table->foreign('section_id')->references('id')->on('sections'); $table->timestamps(); }); } diff --git a/database/migrations/2017_12_27_025542_create_routines_table.php b/database/migrations/2017_12_27_025542_create_routines_table.php index 2ed3e7e43..0bef59158 100755 --- a/database/migrations/2017_12_27_025542_create_routines_table.php +++ b/database/migrations/2017_12_27_025542_create_routines_table.php @@ -19,8 +19,10 @@ public function up() $table->string('title'); $table->text('description'); $table->tinyInteger('active'); - $table->integer('school_id')->unsigned(); - $table->integer('user_id')->unsigned(); + $table->bigInteger('school_id')->unsigned(); + $table->bigInteger('user_id')->unsigned(); + $table->foreign('school_id')->references('id')->on('schools'); + $table->foreign('user_id')->references('id')->on('users'); $table->timestamps(); }); } diff --git a/database/migrations/2017_12_27_025727_create_courses_table.php b/database/migrations/2017_12_27_025549_create_courses_table.php similarity index 70% rename from database/migrations/2017_12_27_025727_create_courses_table.php rename to database/migrations/2017_12_27_025549_create_courses_table.php index 3d61b37dd..913cd91f0 100755 --- a/database/migrations/2017_12_27_025727_create_courses_table.php +++ b/database/migrations/2017_12_27_025549_create_courses_table.php @@ -14,7 +14,7 @@ class CreateCoursesTable extends Migration public function up() { Schema::create('courses', function (Blueprint $table) { - $table->increments('id'); + $table->bigIncrements('id'); $table->string('course_name'); $table->integer('class_id')->unsigned(); $table->string('course_type'); @@ -35,11 +35,16 @@ public function up() $table->integer('ct_fullmark'); $table->integer('final_fullmark'); $table->integer('practical_fullmark'); - $table->integer('school_id')->unsigned(); - $table->integer('exam_id')->unsigned(); - $table->integer('teacher_id')->unsigned(); - $table->integer('section_id')->unsigned(); - $table->integer('user_id')->unsigned(); + $table->bigInteger('school_id')->unsigned(); + $table->bigInteger('exam_id')->unsigned(); + $table->bigInteger('teacher_id')->unsigned(); + $table->bigInteger('section_id')->unsigned(); + $table->bigInteger('user_id')->unsigned(); + $table->foreign('school_id')->references('id')->on('schools'); + $table->foreign('exam_id')->references('id')->on('exams'); + $table->foreign('teacher_id')->references('id')->on('users'); + $table->foreign('section_id')->references('id')->on('sections'); + $table->timestamps(); }); } diff --git a/database/migrations/2017_12_27_025556_create_grades_table.php b/database/migrations/2017_12_27_025556_create_grades_table.php index c49f1b82c..9563c1861 100755 --- a/database/migrations/2017_12_27_025556_create_grades_table.php +++ b/database/migrations/2017_12_27_025556_create_grades_table.php @@ -34,11 +34,16 @@ public function up() $table->float('written', 8, 2); $table->float('mcq', 8, 2); $table->float('practical', 8, 2); - $table->integer('exam_id')->unsigned(); + $table->bigInteger('exam_id')->unsigned(); $table->integer('student_id')->unsigned(); - $table->integer('teacher_id')->unsigned(); - $table->integer('course_id')->unsigned(); - $table->integer('user_id')->unsigned(); + $table->bigInteger('teacher_id')->unsigned(); + $table->bigInteger('course_id')->unsigned(); + $table->bigInteger('user_id')->unsigned(); + // $table->foreign('student_id')->references('student_code')->on('users'); + $table->foreign('course_id')->references('id')->on('courses'); + $table->foreign('user_id')->references('id')->on('users'); + $table->foreign('teacher_id')->references('id')->on('users'); + $table->foreign('exam_id')->references('id')->on('exams'); $table->timestamps(); }); } diff --git a/database/migrations/2017_12_27_025612_create_notifications_table.php b/database/migrations/2017_12_27_025612_create_notifications_table.php index d7a710689..2b4408db8 100755 --- a/database/migrations/2017_12_27_025612_create_notifications_table.php +++ b/database/migrations/2017_12_27_025612_create_notifications_table.php @@ -19,7 +19,9 @@ public function up() $table->tinyInteger('active'); $table->text('message'); $table->integer('student_id')->unsigned(); - $table->integer('user_id')->unsigned(); + $table->bigInteger('user_id')->unsigned(); + $table->foreign('user_id')->references('id')->on('users'); + // $table->foreign('student_id')->references('student_code')->on('users'); $table->timestamps(); }); } diff --git a/database/migrations/2017_12_27_025631_create_feedbacks_table.php b/database/migrations/2017_12_27_025631_create_feedbacks_table.php index 665689bef..b19bde7f0 100755 --- a/database/migrations/2017_12_27_025631_create_feedbacks_table.php +++ b/database/migrations/2017_12_27_025631_create_feedbacks_table.php @@ -16,8 +16,9 @@ public function up() Schema::create('feedbacks', function (Blueprint $table) { $table->increments('id'); $table->text('description'); - $table->integer('teacher_id')->unsigned(); + $table->bigInteger('teacher_id')->unsigned(); $table->integer('student_id')->unsigned(); + $table->foreign('teacher_id')->references('id')->on('users'); $table->timestamps(); }); } diff --git a/database/migrations/2017_12_27_025644_create_books_table.php b/database/migrations/2017_12_27_025644_create_books_table.php index 84399a3a4..8d271aeba 100755 --- a/database/migrations/2017_12_27_025644_create_books_table.php +++ b/database/migrations/2017_12_27_025644_create_books_table.php @@ -14,7 +14,7 @@ class CreateBooksTable extends Migration public function up() { Schema::create('books', function (Blueprint $table) { - $table->increments('id'); + $table->bigIncrements('id'); $table->string('book_code',50)->unique(); $table->string('title',250); $table->string('author',100); @@ -25,9 +25,12 @@ public function up() $table->text('about'); $table->string('type',10); $table->integer('price'); - $table->integer('class_id')->unsigned(); - $table->integer('school_id')->unsigned(); - $table->integer('user_id')->unsigned(); + $table->bigInteger('class_id')->unsigned(); + $table->bigInteger('school_id')->unsigned(); + $table->bigInteger('user_id')->unsigned(); + $table->foreign('class_id')->references('id')->on('classes'); + $table->foreign('school_id')->references('id')->on('schools'); + $table->foreign('user_id')->references('id')->on('users'); $table->timestamps(); }); } diff --git a/database/migrations/2017_12_27_025738_create_forms_table.php b/database/migrations/2017_12_27_025738_create_forms_table.php index ee3553935..dacef2ce9 100755 --- a/database/migrations/2017_12_27_025738_create_forms_table.php +++ b/database/migrations/2017_12_27_025738_create_forms_table.php @@ -17,8 +17,11 @@ public function up() $table->increments('id'); $table->string('name'); $table->string('file_path'); - $table->integer('school_id')->unsigned(); - $table->integer('user_id')->unsigned(); + $table->bigInteger('school_id')->unsigned(); + $table->bigInteger('user_id')->unsigned(); + $table->foreign('school_id')->references('id')->on('schools'); + $table->foreign('user_id')->references('id')->on('users'); + $table->timestamps(); }); } diff --git a/database/migrations/2017_12_27_025751_create_messages_table.php b/database/migrations/2017_12_27_025751_create_messages_table.php index 032bfb8df..57d93b966 100755 --- a/database/migrations/2017_12_27_025751_create_messages_table.php +++ b/database/migrations/2017_12_27_025751_create_messages_table.php @@ -18,8 +18,10 @@ public function up() $table->string('phone_number'); $table->string('email')->unique(); $table->text('message'); - $table->integer('school_id')->unsigned(); - $table->integer('user_id')->unsigned(); + $table->bigInteger('school_id')->unsigned(); + $table->bigInteger('user_id')->unsigned(); + $table->foreign('school_id')->references('id')->on('schools'); + $table->foreign('user_id')->references('id')->on('users'); $table->timestamps(); }); } diff --git a/database/migrations/2017_12_27_025806_create_faqs_table.php b/database/migrations/2017_12_27_025806_create_faqs_table.php index 50a9bc767..eecab6a24 100755 --- a/database/migrations/2017_12_27_025806_create_faqs_table.php +++ b/database/migrations/2017_12_27_025806_create_faqs_table.php @@ -17,7 +17,8 @@ public function up() $table->increments('id'); $table->string('question'); $table->text('answer'); - $table->integer('user_id')->unsigned(); + $table->bigInteger('user_id')->unsigned(); + $table->foreign('user_id')->references('id')->on('users'); $table->timestamps(); }); } diff --git a/database/migrations/2018_02_06_161642_create_fees_table.php b/database/migrations/2018_02_06_161642_create_fees_table.php index fbf74756f..3118b85fd 100755 --- a/database/migrations/2018_02_06_161642_create_fees_table.php +++ b/database/migrations/2018_02_06_161642_create_fees_table.php @@ -16,7 +16,7 @@ public function up() Schema::create('fees', function (Blueprint $table) { $table->increments('id'); $table->string('fee_name');// or Re-admisson - $table->integer('school_id')->unsigned(); + $table->bigInteger('school_id')->unsigned(); // $table->string('fine_fee');//penalty // $table->string('exam_fee'); // $table->string('registration_fee'); @@ -28,7 +28,9 @@ public function up() // $table->string('internet_fee'); // $table->string('farewell_fee'); // $table->string('other_fee'); - $table->integer('user_id'); + $table->bigInteger('user_id')->unsigned(); + $table->foreign('school_id')->references('id')->on('schools'); + $table->foreign('user_id')->references('id')->on('users'); $table->timestamps(); }); } diff --git a/database/migrations/2018_03_26_105657_create_grade_systems_table.php b/database/migrations/2018_03_26_105657_create_grade_systems_table.php index 2b4482830..74a01a376 100755 --- a/database/migrations/2018_03_26_105657_create_grade_systems_table.php +++ b/database/migrations/2018_03_26_105657_create_grade_systems_table.php @@ -20,8 +20,10 @@ public function up() $table->float('point'); $table->integer('from_mark'); $table->integer('to_mark'); - $table->integer('school_id'); - $table->integer('user_id')->unsigned(); + $table->bigInteger('school_id')->unsigned(); + $table->bigInteger('user_id')->unsigned(); + $table->foreign('school_id')->references('id')->on('schools'); + $table->foreign('user_id')->references('id')->on('users'); $table->timestamps(); }); } diff --git a/database/migrations/2018_03_27_153448_create_issued_books_table.php b/database/migrations/2018_03_27_153448_create_issued_books_table.php index 926c806b4..b18a9c82a 100755 --- a/database/migrations/2018_03_27_153448_create_issued_books_table.php +++ b/database/migrations/2018_03_27_153448_create_issued_books_table.php @@ -15,15 +15,19 @@ public function up() { Schema::create('issued_books', function (Blueprint $table) { $table->increments('id'); - $table->integer('student_code'); - $table->integer('book_id')->unsigned(); + $table->bigInteger('student_code'); + $table->bigInteger('book_id')->unsigned(); $table->integer('quantity'); - $table->integer('school_id')->unsigned(); + $table->bigInteger('school_id')->unsigned(); $table->date('issue_date'); $table->date('return_date'); $table->decimal('fine'); $table->tinyInteger('borrowed'); - $table->integer('user_id')->unsigned(); + $table->bigInteger('user_id')->unsigned(); + $table->foreign('student_code')->references('student_code')->on('users'); + $table->foreign('book_id')->references('id')->on('books'); + $table->foreign('school_id')->references('id')->on('schools'); + $table->foreign('user_id')->references('id')->on('users'); $table->timestamps(); }); } diff --git a/database/migrations/2018_04_01_195635_create_accounts_table.php b/database/migrations/2018_04_01_195635_create_accounts_table.php index 3753139f9..07a05625e 100755 --- a/database/migrations/2018_04_01_195635_create_accounts_table.php +++ b/database/migrations/2018_04_01_195635_create_accounts_table.php @@ -19,8 +19,10 @@ public function up() $table->string('type'); $table->integer('amount'); $table->text('description'); - $table->integer('school_id')->unsigned(); - $table->integer('user_id')->unsigned(); + $table->bigInteger('school_id')->unsigned(); + $table->bigInteger('user_id')->unsigned(); + $table->foreign('school_id')->references('id')->on('schools'); + $table->foreign('user_id')->references('id')->on('users'); $table->timestamps(); }); } diff --git a/database/migrations/2018_04_01_195715_create_account_sectors_table.php b/database/migrations/2018_04_01_195715_create_account_sectors_table.php index 7a7c74681..1672e2ead 100755 --- a/database/migrations/2018_04_01_195715_create_account_sectors_table.php +++ b/database/migrations/2018_04_01_195715_create_account_sectors_table.php @@ -17,8 +17,10 @@ public function up() $table->increments('id'); $table->string('name'); $table->string('type'); - $table->integer('school_id')->unsigned(); - $table->integer('user_id')->unsigned(); + $table->bigInteger('school_id')->unsigned(); + $table->bigInteger('user_id')->unsigned(); + $table->foreign('school_id')->references('id')->on('schools'); + $table->foreign('user_id')->references('id')->on('users'); $table->timestamps(); }); } diff --git a/database/migrations/2018_04_29_121233_create_student_infos_table.php b/database/migrations/2018_04_29_121233_create_student_infos_table.php index b7f10cb50..faa82eb98 100755 --- a/database/migrations/2018_04_29_121233_create_student_infos_table.php +++ b/database/migrations/2018_04_29_121233_create_student_infos_table.php @@ -33,7 +33,8 @@ public function up() $table->string('mother_occupation'); $table->string('mother_designation'); $table->integer('mother_annual_income'); - $table->integer('user_id')->unsigned()->nullable(); + $table->bigInteger('user_id')->unsigned()->nullable(); + $table->foreign('user_id')->references('id')->on('users'); $table->timestamps(); }); } diff --git a/database/migrations/2018_04_29_121517_create_student_board_exams_table.php b/database/migrations/2018_04_29_121517_create_student_board_exams_table.php index 6f7a53d1e..5812b60ff 100755 --- a/database/migrations/2018_04_29_121517_create_student_board_exams_table.php +++ b/database/migrations/2018_04_29_121517_create_student_board_exams_table.php @@ -25,7 +25,8 @@ public function up() $table->integer('passing_year'); $table->string('institution_name'); $table->float('gpa'); - $table->integer('user_id')->unsigned(); + $table->bigInteger('user_id')->unsigned(); + $table->foreign('user_id')->references('id')->on('users'); $table->timestamps(); }); } diff --git a/database/migrations/2018_10_05_163435_create_exam_for_classes_table.php b/database/migrations/2018_10_05_163435_create_exam_for_classes_table.php index 35fdc8f8d..625472d51 100755 --- a/database/migrations/2018_10_05_163435_create_exam_for_classes_table.php +++ b/database/migrations/2018_10_05_163435_create_exam_for_classes_table.php @@ -15,8 +15,10 @@ public function up() { Schema::create('exam_for_classes', function (Blueprint $table) { $table->increments('id'); - $table->integer('class_id')->unsigned(); - $table->integer('exam_id')->unsigned(); + $table->bigInteger('class_id')->unsigned(); + $table->bigInteger('exam_id')->unsigned(); + $table->foreign('class_id')->references('id')->on('classes'); + $table->foreign('exam_id')->references('id')->on('exams'); }); } diff --git a/database/migrations/2020_07_24_201246_create_certificates_table.php b/database/migrations/2020_07_24_201246_create_certificates_table.php index 2a6c9479e..5b60db3aa 100755 --- a/database/migrations/2020_07_24_201246_create_certificates_table.php +++ b/database/migrations/2020_07_24_201246_create_certificates_table.php @@ -20,8 +20,10 @@ public function up() $table->string('title'); $table->integer('given_to'); $table->tinyInteger('active'); - $table->integer('school_id')->unsigned(); - $table->integer('user_id')->unsigned(); + $table->bigInteger('school_id')->unsigned(); + $table->bigInteger('user_id')->unsigned(); + $table->foreign('school_id')->references('id')->on('schools'); + $table->foreign('user_id')->references('id')->on('users'); }); } diff --git a/resources/views/layouts/leftside-menubar.blade.php b/resources/views/layouts/leftside-menubar.blade.php index fcfed20bd..eb29c4a3b 100755 --- a/resources/views/layouts/leftside-menubar.blade.php +++ b/resources/views/layouts/leftside-menubar.blade.php @@ -1,245 +1,251 @@ - -{{--@if(Auth::user()->role != 'master') - -@endif--}} - + $(document).ready(function () { + $('.nav-item.active').removeClass('active'); + $('a[href="' + window.location.href + '"]').closest('li').closest('ul').closest('li').addClass('active'); + $('a[href="' + window.location.href + '"]').closest('li').addClass('active'); + }); + + + {{--@if(Auth::user()->role != 'master') + + @endif--}} + + \ No newline at end of file diff --git a/resources/views/masters/index.blade.php b/resources/views/masters/index.blade.php index 864a81390..c85a52082 100755 --- a/resources/views/masters/index.blade.php +++ b/resources/views/masters/index.blade.php @@ -1,7 +1,193 @@ @extends('layouts.app') @section('content') -
+ +
+
+
+ @include('layouts.leftside-menubar') +
+
+
+
+ @if (session('status')) +
+ {{ session('status') }} +
+ @endif +
+
@lang('Dashboard')
+
+
+
@lang('Schools') - {{$school_count}}
+
+
+
+
+
@lang('Admins') - {{$admins_count}}
+
+
+
+
+
@lang('Teachers') - {{$teachers_count}}
+
+
+
+
+
@lang('Students') - {{$students_count}}
+
+
+
+
+ {{--
@lang('Dashboard')
--}} + +
+ {{--

+
+
+
+
+

@lang('Welcome to') {{Auth::user()->school->name}}

+ @lang('Your presence and cooperation will help us to improve the education system of our organization.') +
+
+
+
@lang('Active Exams')
+
+ @if(count($exams) > 0) + + + + + + + @foreach($exams as $exam) + + + + + + @endforeach +
@lang('Exam Name')@lang('Notice Published')@lang('Result Published')
{{$exam->exam_name}}{{($exam->notice_published === 1)?__('Yes'):__('No')}}{{($exam->result_published === 1)?__('Yes'):__('No')}}
+ @else + @lang('No Active Examination') + @endif +
+
+
+
+
+
@lang('Notices')
+
+ @if(count($notices) > 0) + + @else + @lang('No New Notice') + @endif +
+
+
+
+
+
+
+
@lang('Events')
+
+ @if(count($events) > 0) + + @else + @lang('No New Event') + @endif +
+
+
+
+
+
@lang('Routines')
+
+ @if(count($routines) > 0) + + @else + @lang('No New Routine') + @endif +
+
+
+
+
+
@lang('Syllabus')
+
+ @if(count($syllabuses) > 0) + + @else + @lang('No New Syllabus') + @endif +
+
+
+
--}} +
+
+
+
+
+{{--
@@ -15,5 +201,5 @@
-
+
--}} @endsection