-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f055ab4
commit e98dd6f
Showing
22 changed files
with
294 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,161 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers; | ||
|
||
use Illuminate\Http\Request; | ||
|
||
class CategoryController extends Controller | ||
{ | ||
public function index($grade, $subject) { | ||
if ($grade == '10') { | ||
if ($subject == 'fisika') { | ||
return $this->tenthGradeFisika(); | ||
} | ||
|
||
if ($subject == 'matematika') { | ||
return $this->tenthGradeMatematika(); | ||
} | ||
|
||
if ($subject == 'kimia') { | ||
return $this->tenthGradeKimia(); | ||
} | ||
|
||
if ($subject == 'biologi') { | ||
return $this->tenthGradeBiologi(); | ||
} | ||
|
||
if ($subject == 'indonesia') { | ||
return $this->tenthGradeIndonesia(); | ||
} | ||
|
||
if ($subject == 'inggris') { | ||
return $this->tenthGradeInggris(); | ||
} | ||
|
||
} else if ($grade == '11') { | ||
if ($subject == 'fisika') { | ||
return $this->eleventhGradeFisika(); | ||
} | ||
|
||
if ($subject == 'matematika') { | ||
return $this->eleventhGradeMatematika(); | ||
} | ||
|
||
if ($subject == 'kimia') { | ||
return $this->eleventhGradeKimia(); | ||
} | ||
|
||
if ($subject == 'biologi') { | ||
return $this->eleventhGradeBiologi(); | ||
} | ||
|
||
if ($subject == 'indonesia') { | ||
return $this->eleventhGradeIndonesia(); | ||
} | ||
|
||
if ($subject == 'inggris') { | ||
return $this->eleventhGradeInggris(); | ||
} | ||
|
||
} else if ($grade == '12') { | ||
if ($subject == 'fisika') { | ||
return $this->twelfthGradeFisika(); | ||
} | ||
|
||
if ($subject == 'matematika') { | ||
return $this->twelfthGradeMatematika(); | ||
} | ||
|
||
if ($subject == 'kimia') { | ||
return $this->twelfthGradeKimia(); | ||
} | ||
|
||
if ($subject == 'biologi') { | ||
return $this->twelfthGradeBiologi(); | ||
} | ||
|
||
if ($subject == 'indonesia') { | ||
return $this->twelfthGradeIndonesia(); | ||
} | ||
|
||
if ($subject == 'inggris') { | ||
return $this->twelfthGradeInggris(); | ||
} | ||
|
||
} else { | ||
return "Something went wrong."; | ||
} | ||
} | ||
|
||
private function tenthGradeFisika() { | ||
return view('categories.kelas10.fisika'); | ||
} | ||
|
||
private function tenthGradeMatematika() { | ||
return view('categories.kelas10.matematika'); | ||
} | ||
|
||
private function tenthGradeKimia() { | ||
return view('categories.kelas10.kimia'); | ||
} | ||
|
||
private function tenthGradeBiologi() { | ||
return view('categories.kelas10.biologi'); | ||
} | ||
|
||
private function tenthGradeIndonesia() { | ||
return view('categories.kelas10.indonesia'); | ||
} | ||
|
||
private function tenthGradeInggris() { | ||
return view('categories.kelas10.inggris'); | ||
} | ||
|
||
private function eleventhGradeFisika() { | ||
return view('categories.kelas11.fisika'); | ||
} | ||
|
||
private function eleventhGradeMatematika() { | ||
return view('categories.kelas11.matematika'); | ||
} | ||
|
||
private function eleventhGradeKimia() { | ||
return view('categories.kelas11.kimia'); | ||
} | ||
|
||
private function eleventhGradeBiologi() { | ||
return view('categories.kelas11.biologi'); | ||
} | ||
|
||
private function eleventhGradeIndonesia() { | ||
return view('categories.kelas11.indonesia'); | ||
} | ||
|
||
private function eleventhGradeInggris() { | ||
return view('categories.kelas11.inggris'); | ||
} | ||
|
||
private function twelfthGradeFisika() { | ||
return view('categories.kelas12.fisika'); | ||
} | ||
|
||
private function twelfthGradeMatematika() { | ||
return view('categories.kelas12.matematika'); | ||
} | ||
|
||
private function twelfthGradeKimia() { | ||
return view('categories.kelas12.kimia'); | ||
} | ||
|
||
private function twelfthGradeBiologi() { | ||
return view('categories.kelas12.biologi'); | ||
} | ||
|
||
private function twelfthGradeIndonesia() { | ||
return view('categories.kelas12.indonesia'); | ||
} | ||
|
||
private function twelfthGradeInggris() { | ||
return view('categories.kelas12.inggris'); | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
database/migrations/2020_12_08_032953_create_courses_table.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
class CreateCoursesTable extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
Schema::create('courses', function (Blueprint $table) { | ||
$table->id(); | ||
$table->string('course_name'); | ||
$table->string('category'); | ||
$table->string('grade'); | ||
$table->json('content'); | ||
$table->timestamps(); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
Schema::dropIfExists('courses'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.