diff --git a/app/Http/Controllers/Admin/LoginController.php b/app/Http/Controllers/Admin/LoginController.php index 5d986f7..68544f3 100644 --- a/app/Http/Controllers/Admin/LoginController.php +++ b/app/Http/Controllers/Admin/LoginController.php @@ -47,7 +47,7 @@ public function __construct() // } public function showLoginForm() { - return view('admin/auth/login'); + return view('admin.auth.login'); } protected function guard() diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index 8381ae7..e642357 100644 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -2,7 +2,9 @@ namespace App\Http\Controllers\Auth; +use Illuminate\Validation; use App\Http\Controllers\Controller; +use Illuminate\Support\Facades\Auth; use Illuminate\http\request; use Illuminate\Foundation\Auth\AuthenticatesUsers; @@ -38,11 +40,20 @@ public function __construct() $this->middleware('guest')->except('logout'); } -// public function mylogin(Request $request) -// { -// if (Auth::attempt(['email' => $request->input('email'), 'password' => $request->input('password'), 'is_active' => 1])) { -// return redirect()->intended('/'); -// } -// -// } + public function mylogin(Request $request) + { + $this->validate(request(),[ + 'email' => 'required|email', + 'password' => 'required', + ]); + if (Auth::attempt(['email' => $request->input('email'), 'password' => $request->input('password'), 'is_active' => 1])) { + return redirect('/'); + //return redirect()->intended('/'); + } + else { + throw \Illuminate\Validation\ValidationException::withMessages([ + $this->username() => [trans('auth.failed')], + ]); + } + } } diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index f0d2bc1..74d95d6 100644 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -28,7 +28,7 @@ class RegisterController extends Controller * * @var string */ - protected $redirectTo = '/home'; + protected $redirectTo = '/register/agreement'; /** * Create a new controller instance. @@ -74,7 +74,7 @@ protected function create(array $data) 'first_name' => $data['first_name'], 'last_name' => $data['last_name'], // 'last_login' => now(), - 'is_active' => 1 + 'is_active' => 0 ]); } } diff --git a/app/Http/Controllers/CaseStudyController.php b/app/Http/Controllers/CaseStudyController.php index 78cf895..55ff159 100644 --- a/app/Http/Controllers/CaseStudyController.php +++ b/app/Http/Controllers/CaseStudyController.php @@ -6,11 +6,14 @@ use Illuminate\Support\Facades\DB; use Symfony\Component\Console\Helper\Table; use Illuminate\Database\Eloquent\Model; +use Illuminate\Support\Facades\Auth; + class CaseStudyController extends Controller { public function chapter($id,$step_id) { + $user_id = Auth::id(); $chapters = DB::table('chapters') ->select('chapters.id','chapters.title') ->orderBy('chapters.id')->get(); @@ -19,10 +22,10 @@ public function chapter($id,$step_id) ->select('case_study_material.id','case_study_material.title','case_study_material.details','case_study_material.reference') ->orderBy('case_study_material.id')->get(); - $case_question = DB::table('case_study_step') - ->select('case_study_step.question_id','case_study_step.question_detail','case_study_step.step_id') - ->orderBy('case_study_step.step_id') - ->orderBy('case_study_step.question_id')->get(); + $case_question = DB::table('case_study_question') + ->select('case_study_question.question_rank as question_id','case_study_question.detail as question_detail','case_study_question.step_id') + ->orderBy('case_study_question.step_id') + ->orderBy('case_study_question.question_rank')->get(); $principle = DB::table('ethical_principles') ->join('detail_principles','ethical_principles.id','=','detail_principles.title_id') @@ -31,57 +34,64 @@ public function chapter($id,$step_id) ->orderBy('detail_principles.detail_id')->get(); $answer = DB::table('case_study_answer') - ->select('case_study_answer.question_answer','case_study_answer.step_id','case_study_answer.user_id','case_study_answer.question_id') - ->where('case_study_answer.case_id','=',$id) - ->orderBy('case_study_answer.step_id') - ->orderBy('case_study_answer.question_id')->get(); - - return view('CaseStudy', compact('case_study','chapters','case_question','principle','id','step_id','answer')); + ->join('case_to_question','case_study_answer.id','=','case_to_question.id') + ->join('case_study_question','case_study_question.id','=','case_to_question.question_id') + ->select('case_study_answer.answer as question_answer','case_study_question.step_id','case_study_question.question_rank as question_id') + ->where('case_to_question.case_id','=',$id) + ->where('case_study_answer.user_id','=',$user_id) + ->orderBy('case_study_question.step_id') + ->orderBy('case_study_question.question_rank')->get(); + + return view('CaseStudy', compact('case_study','chapters','case_question','principle','id','step_id','answer','user_id')); }// public function useransweredit() { + $user_id = Auth::id(); foreach($_POST["question_id"] as $pointer) { - $user_id = $_POST["user_id"][$pointer-1]; $case_id = $_POST["case_id"][$pointer-1]; $case_step_id = $_POST["step_id"][$pointer-1]; $question_id = $_POST["question_id"][$pointer-1]; $question_answer = $_POST["question_answer"][$pointer-1]; + $case_question_id = DB::table('case_study_question') + ->join('case_to_question','case_study_question.id','=','case_to_question.question_id') + ->select('case_to_question.id') + ->where('case_to_question.case_id','=',$case_id) + ->where('case_study_question.step_id','=',$case_step_id) + ->where('case_study_question.question_rank','=',$question_id) + ->get(); + $case_question_id = json_decode($case_question_id,true); + $id = $case_question_id[0]['id']; + $answer = DB::table('case_study_answer') ->select('case_study_answer.user_id') + ->where('case_study_answer.id','=',$id) ->where('case_study_answer.user_id','=',$user_id) - ->where('case_study_answer.case_id','=',$case_id) - ->where('case_study_answer.step_id','=',$case_step_id) - ->where('case_study_answer.question_id','=',$question_id) ->get(); if(count($answer) == 0) { - DB::transaction(function () use ($user_id, $case_id, $case_step_id, $question_id, $question_answer) { + DB::transaction(function () use ($user_id,$id, $question_answer) { DB::table('case_study_answer') ->insert([ 'case_study_answer.user_id' => $user_id, - 'case_study_answer.case_id' => $case_id, - 'case_study_answer.step_id' => $case_step_id, - 'case_study_answer.question_id' => $question_id, - 'case_study_answer.question_answer' => $question_answer + 'case_study_answer.id' => $id, + 'case_study_answer.answer' => $question_answer ]); }); } elseif(count($answer) != 0){ - DB::transaction(function () use ($user_id, $case_id, $case_step_id, $question_id, $question_answer) { + DB::transaction(function () use ($user_id,$id, $question_answer) { DB::table('case_study_answer') ->where('case_study_answer.user_id', '=', $user_id) - ->where('case_study_answer.case_id', '=', $case_id) - ->where('case_study_answer.step_id', '=', $case_step_id) - ->where('case_study_answer.question_id', '=', $question_id) + ->where('case_study_answer.id', '=', $id) ->update([ - 'case_study_answer.question_answer' => $question_answer + 'case_study_answer.answer' => $question_answer ]); }); } } - + return redirect("/casestudy/$case_id/step/$case_step_id"); } diff --git a/app/Http/Controllers/ChapterController.php b/app/Http/Controllers/ChapterController.php index 12f99fd..e6b25eb 100644 --- a/app/Http/Controllers/ChapterController.php +++ b/app/Http/Controllers/ChapterController.php @@ -5,11 +5,14 @@ use Illuminate\Http\Request; use Illuminate\Support\Facades\DB; use Symfony\Component\Console\Helper\Table; +use Illuminate\Support\Facades\Auth; + class ChapterController extends Controller { public function chapter($id,$section_rank) { + $user_id = Auth::user()->id; $sections = DB::table('sections') ->join('chapter_section','sections.id','=','chapter_section.section_id') ->join('chapters','chapters.id','=','chapter_section.chapter_id') @@ -22,12 +25,24 @@ public function chapter($id,$section_rank) ->select('chapters.id','chapters.title') ->orderBy('chapters.id')->get(); + $user_answer = DB::table('section_question_answer') + ->join('section_question','section_question_answer.id','=','section_question.id') + ->join('sections','section_question.section_id','=','sections.id') + ->join('chapter_section','sections.id','=','chapter_section.section_id') + ->select('section_question_answer.answer','section_question.question_rank as question_rank','section_question_answer.user_id','chapter_section.chapter_id as chapter_id','sections.rank as section_rank') + ->where('section_question_answer.user_id','=',$user_id) + ->orderBy('section_question.question_rank')->get(); + $sections_title = DB::table('sections') ->join('chapter_section','sections.id','=','chapter_section.section_id') ->select('sections.rank','sections.title','sections.id') ->where('chapter_section.chapter_id','=',$id) ->orderBy('sections.rank')->get(); + $case_study = DB::table('case_study_material') + ->select('case_study_material.id','case_study_material.title','case_study_material.details','case_study_material.reference') + ->orderBy('case_study_material.id')->get(); + $chapter_section = DB::table('chapter_section') ->join('sections','chapter_section.section_id','=','sections.id') ->select('sections.rank as section_rank','chapter_section.chapter_id','chapter_section.section_id') @@ -36,12 +51,66 @@ public function chapter($id,$section_rank) $section_question = DB::table('section_question') ->join('sections','section_question.section_id','=','sections.id') ->join('chapter_section','sections.id','=','chapter_section.section_id') - ->select('section_question.question_id','section_question.question') + ->select('section_question.question_rank','section_question.detail') ->where('chapter_section.chapter_id','=',$id) ->where('sections.rank','=',$section_rank) - ->orderBy('section_question.question_id')->get(); + ->orderBy('section_question.question_rank')->get(); + + + return view('chapter', compact('user_answer','sections','chapters','sections_title','case_study','chapter_section','section_question','id','section_rank')); + } + public function answeredit() + { + $user_id = Auth::user()->id; + + foreach($_POST["question_id"] as $pointer) + { + $chapter_id = $_POST["chapter_id"][$pointer-1]; + $sec_rank = $_POST["section_rank"][$pointer-1]; + $question_id = $_POST["question_id"][$pointer-1]; + $question_answer = $_POST["answer"][$pointer-1]; + + $section_question_id = DB::table('section_question') + ->join('sections','section_question.section_id','=','sections.id') + ->join('chapter_section','chapter_section.section_id','=','sections.id') + ->select('section_question.id') + ->where('chapter_section.chapter_id','=',$chapter_id) + ->where('sections.rank','=',$sec_rank) + ->where('section_question.question_rank','=',$question_id) + ->get(); + $section_question_id = json_decode($section_question_id,true); + $id = $section_question_id[0]['id']; + $user_answer = DB::table('section_question_answer') + ->select('section_question_answer.id') + ->where('section_question_answer.user_id','=',$user_id) + ->where('section_question_answer.id','=',$id) + ->get(); + $user_answer = json_decode($user_answer,true); + + if(count($user_answer) == 0) { + DB::transaction(function () use ($user_id,$id, $question_answer) { + DB::table('section_question_answer') + ->insert([ + 'section_question_answer.user_id' => $user_id, + 'section_question_answer.id' => $id, + 'section_question_answer.answer' => $question_answer + ]); + }); + } + elseif(count($user_answer) != 0){ + DB::transaction(function () use ($user_id,$id, $question_answer) { + DB::table('section_question_answer') + ->where('section_question_answer.user_id', '=', $user_id) + ->where('section_question_answer.id', '=', $id) + ->update([ + 'section_question_answer.answer' => $question_answer + ]); + }); + } + } + + - return view('chapter', compact('sections','chapters','sections_title','chapter_section','section_question')); } } diff --git a/app/Http/Controllers/ModifyMaterialController.php b/app/Http/Controllers/ModifyMaterialController.php index b3dd289..0f784ae 100644 --- a/app/Http/Controllers/ModifyMaterialController.php +++ b/app/Http/Controllers/ModifyMaterialController.php @@ -21,6 +21,20 @@ public function showsection($id,$section_id)// return view('section_detail_modify', compact('sections','id','section_id')); }//// + public function showsectionquestion($id,$section_id,$question_rank)// + { + $section_question = DB::table('section_question') + ->join('sections','section_question.section_id','=','sections.id') + ->join('chapter_section','sections.id','=','chapter_section.section_id') + ->select('section_question.id as question_id','section_question.detail as question') + ->where('chapter_section.chapter_id','=',$id) + ->where('sections.rank','=',$section_id) + ->where('section_question.question_rank','=',$question_rank) + ->orderBy('section_question.question_rank')->get(); + + return view('section_question_modify', compact('section_question','id','section_id','question_rank')); + } + public function showchapter($id)// { $chapters = DB::table('chapters') @@ -62,19 +76,27 @@ public function addsectionquestion($id)// { return view('add_newsectionquestions', compact('id')); } + public function addnewsurvey()// + { + return view('add_newsurvey'); + } + public function addsurveyquestion($id)// + { + return view('add_newsurveyquestions', compact('id')); + } public function sectiondetailedit() { $chapter_id = $_POST["chapter_id"]; - $section_id = $_POST["section_id"]; + $section_rank = $_POST["section_id"]; $title = $_POST["title"]; $detail = $_POST["detail"]; - $detail = str_replace("\r\n","
",$detail); + $detail = str_replace("\n","
",$detail); - DB::transaction(function () use ($chapter_id, $section_id, $title, $detail) { + DB::transaction(function () use ($chapter_id, $section_rank, $title, $detail) { DB::table('sections') ->join('chapter_section','sections.id','=','chapter_section.section_id') ->where('chapter_section.chapter_id', '=', $chapter_id) - ->where('sections.rank', '=', $section_id) + ->where('sections.rank', '=', $section_rank) ->update([ 'sections.title' => $title, 'sections.detail' => $detail @@ -88,8 +110,8 @@ public function casedetailedit() $title = $_POST["title"]; $detail = $_POST["detail"]; $reference = $_POST["reference"]; - $detail = str_replace("\r\n","
",$detail); - $reference = str_replace("\r\n","
",$reference); + $detail = str_replace("\n","
",$detail); + $reference = str_replace("\n","
",$reference); DB::transaction(function () use ($id, $title, $detail, $reference) { DB::table('case_study_material') @@ -100,7 +122,14 @@ public function casedetailedit() 'case_study_material.reference' => $reference ]); }); - + for($question_id = 1; $question_id<=16; $question_id++) + DB::transaction(function () use ($id,$question_id) { + DB::table('case_to_question') + ->insert([ + 'case_to_question.case_id' => $id, + 'case_to_question.question_id' => $question_id + ]); + }); } @@ -117,13 +146,52 @@ public function chaptertitleedit() ]); }); } + public function sectionquestionedit() + { + $id = $_POST["question_id"]; + $title = $_POST["title"]; + + DB::transaction(function () use ($id, $title) { + DB::table('section_question') + ->where('section_question.id', '=', $id) + ->update([ + 'section_question.detail' => $title, + ]); + }); + } + public function surveydetailedit() + { + $id = $_POST["survey_id"]; + $title = $_POST["title"]; + $choice0 = $_POST["choice0"]; + $choice1 = $_POST["choice1"]; + $choice2 = $_POST["choice2"]; + $choice3 = $_POST["choice3"]; + $choice4 = $_POST["choice4"]; + $choice5 = $_POST["choice5"]; + + DB::transaction(function () use ($id, $title,$choice0,$choice1,$choice2,$choice3,$choice4,$choice5) { + DB::table('survey_question') + ->where('survey_question.id', '=', $id) + ->update([ + 'survey_question.title' => $title, + 'survey_question.choice0' => $choice0, + 'survey_question.choice1' => $choice1, + 'survey_question.choice2' => $choice2, + 'survey_question.choice3' => $choice3, + 'survey_question.choice4' => $choice4, + 'survey_question.choice5' => $choice5, + ]); + }); + + } public function sectiondetailadd() { $chapter_id = $_POST["chapter_id"]; $section_id = $_POST["section_id"]; $title = $_POST["title"]; $detail = $_POST["detail"]; - $detail = str_replace("\r\n","
",$detail); + $detail = str_replace("\n","
",$detail); DB::transaction(function () use ($chapter_id, $section_id, $title, $detail) { DB::table('sections') @@ -154,33 +222,31 @@ public function sectionquestionadd() if($_POST["chapter_id"]!=null and $_POST["question_id"]!=null and $_POST["question_detail"]!=null) { $chapter_id = $_POST["chapter_id"]; - $section_id = $_POST["section_id"]; + $section_rank = $_POST["section_id"]; $question_id = $_POST["question_id"]; $question_detail = $_POST["question_detail"]; + $section = DB::table('sections') ->join('chapter_section','sections.id','=','chapter_section.section_id') - ->select('sections.id as section_id','chapter_section.chapter_id as chapter_id','sections.rank as section_rank') + ->select('sections.id as section_id') + ->where('sections.rank','=',$section_rank) + ->where('chapter_section.chapter_id','=',$chapter_id) ->get(); $section = json_decode($section,true); - foreach($section as $section_com) - { - if($section_com['section_rank'] == $section_id and $section_com['chapter_id'] == $chapter_id) - { - $counter = $section_com['section_id']; - } + $section_id = $section[0]['section_id']; + if ( $section_id!=null ) { + DB::transaction(function () use ($section_id, $question_id, $question_detail) { + DB::table('section_question') + ->insert([ + 'section_question.section_id' => $section_id, + 'section_question.question_rank' => $question_id, + 'section_question.detail' => $question_detail + ]); + }); } - DB::transaction(function () use ($counter,$question_id,$question_detail) { - DB::table('section_question') - ->insert([ - 'section_question.section_id' => $counter, - 'section_question.question_id' => $question_id, - 'section_question.question' => $question_detail - ]); - }); - } @@ -201,6 +267,61 @@ public function chapteradd() } return redirect("showstudymaterial"); } + public function surveyadd() + { + + $survey_question = DB::table('survey_question') + ->select('survey_question.id') + ->orderBy('survey_question.id')->get(); + $survey_question = json_decode($survey_question,true); + foreach($survey_question as $pre_id) + { + if ($pre_id['id'] == $_POST["id"]) + { + return "please input an independent key"; + } + } + + if($_POST["title"]!=null and $_POST["id"]!=null) { + $id = $_POST["id"]; + $title = $_POST["title"]; + $choice0 = $_POST["choice0"]; + $choice1 = $_POST["choice1"]; + $choice2 = $_POST["choice2"]; + $choice3 = $_POST["choice3"]; + $choice4 = $_POST["choice4"]; + $choice5 = $_POST["choice5"]; + + DB::transaction(function () use ($id, $title,$choice0,$choice1,$choice2,$choice3,$choice4,$choice5) { + DB::table('survey_question') + ->insert([ + 'survey_question.id' => $id, + 'survey_question.title' => $title, + 'survey_question.choice0' => $choice0, + 'survey_question.choice1' => $choice1, + 'survey_question.choice2' => $choice2, + 'survey_question.choice3' => $choice3, + 'survey_question.choice4' => $choice4, + 'survey_question.choice5' => $choice5, + ]); + }); + } + } + public function surveyquestionadd() + { + if($_POST["question_detail"]!=null and $_POST["survey_id"]!=null) { + $id = $_POST["survey_id"]; + $title = $_POST["question_detail"]; + + DB::transaction(function () use ($id, $title) { + DB::table('survey_detail_question') + ->insert([ + 'survey_detail_question.survey_id' => $id, + 'survey_detail_question.detail' => $title + ]); + }); + } + } public function casedetailadd() { if($_POST["title"]!=null and $_POST["detail"]!=null) { diff --git a/app/Http/Controllers/RegisterInfoController.php b/app/Http/Controllers/RegisterInfoController.php index b77717e..6721c5d 100644 --- a/app/Http/Controllers/RegisterInfoController.php +++ b/app/Http/Controllers/RegisterInfoController.php @@ -5,26 +5,35 @@ use Illuminate\Http\Request; use Illuminate\Support\Facades\DB; use Symfony\Component\Console\Helper\Table; +use phpDocumentor\Reflection\Types\Null_; +use Illuminate\Database\Eloquent\Model; +use Illuminate\Support\Facades\Auth; + class RegisterInfoController extends Controller { - public function nationality() + public function agreement(){ + $id = Auth::id(); + Auth::logout(); + return view('register_agreement')->with('id', $id); + } + public function nationality($id) { $nationality = DB::table('register_nationality') ->select('register_nationality.id','register_nationality.name') ->orderBy('register_nationality.id')->get(); - return view('register_info1', compact('nationality')); + return view('register_info1', compact('nationality','id')); } - public function language() + public function language($id) { $language = DB::table('register_language') ->select('register_language.id','register_language.name') ->orderBy('register_language.id')->get(); - return view('register_info2', compact('language')); + return view('register_info2', compact('language','id')); } - public function education() + public function education($id) { $field = DB::table('register_field') ->select('register_field.id','register_field.name') @@ -34,6 +43,348 @@ public function education() ->select('register_major.id','register_major.name') ->orderBy('register_major.id')->get(); - return view('register_info3_stu', compact('field','major')); + + return view('register_info3_stu', compact('field','major','id')); + } + public function education2($id) + { + + $major = DB::table('register_major') + ->select('register_major.id','register_major.name') + ->orderBy('register_major.id')->get(); + + $industry = DB::table('register_industry') + ->select('register_industry.id','register_industry.name') + ->orderBy('register_industry.id')->get(); + + return view('register_info3_nonstu', compact('major','industry','id')); + } + + public function addagreement() + { + $agreement1 = $_POST["agreement1"]; + if(isset($_POST["agreement2"])){ + $agreement2 = 1; + } + else{ + $agreement2 = 0; + } + $user_id = $_POST["id"]; + DB::transaction(function () use ($agreement1, $agreement2,$user_id) { + DB::table('registeragreement') + ->insert([ + 'registeragreement.user_id' => $user_id, + 'registeragreement.participate_in_study' => $agreement1, + 'registeragreement.receive_information' => $agreement2, + 'registeragreement.if_valid' => 1 + ]); + }); + return redirect("register/info1/$user_id"); } + + public function addinfo1() + { + $usertype = $_POST["usertype"]; + $age = $_POST["age"]; + $gender = $_POST["gender"]; + $nationality = $_POST["nationality"]; + $identification = $_POST["identification"]; + if ($identification == "Other") { + $identification_other = $_POST["Input"]; + } + else{ + $identification_other = null; + } + $user_id = $_POST["id"]; + DB::transaction(function () use ($usertype, $age, $gender, $nationality, $identification,$identification_other, $user_id) { + DB::table('registerinfo1') + ->insert([ + 'registerinfo1.user_id' => $user_id, + 'registerinfo1.usertype' => $usertype, + 'registerinfo1.age' => $age, + 'registerinfo1.gender' => $gender, + 'registerinfo1.nationality' => $nationality, + 'registerinfo1.identification' => $identification, + 'registerinfo1.identification_other' => $identification_other, + 'registerinfo1..if_valid' => 1 + ]); + }); + return redirect("register/info2/$user_id"); + } + + public function addinfo2() + { + $language = $_POST["language"]; + $order = $_POST["order"]; + $speaking = $_POST["speaking"]; + $listening = $_POST["listening"]; + $reading = $_POST["reading"]; + $writing = $_POST["writing"]; + $length = count($language); + $language1 = $language[0]; + $language1_order = $order[0]; + $language1_speaking = $speaking[0]; + $language1_listening = $listening[0]; + $language1_reading = $reading[0]; + $language1_writing = $writing[0]; + if ($length >= 2){ + $language2 = $language[1]; + $language2_order = $order[1]; + $language2_speaking = $speaking[1]; + $language2_listening = $listening[1]; + $language2_reading = $reading[1]; + $language2_writing = $writing[1]; + } + else{ + $language2 = null; + $language2_order = null; + $language2_speaking = null; + $language2_listening = null; + $language2_reading = null; + $language2_writing = null; + } + if ($length >= 3){ + $language3 = $language[2]; + $language3_order = $order[2]; + $language3_speaking = $speaking[2]; + $language3_listening = $listening[2]; + $language3_reading = $reading[2]; + $language3_writing = $writing[2]; + } + else{ + $language3 = null; + $language3_order = null; + $language3_speaking = null; + $language3_listening = null; + $language3_reading = null; + $language3_writing = null; + } + if ($length >= 4){ + $language4 = $language[3]; + $language4_order = $order[3]; + $language4_speaking = $speaking[3]; + $language4_listening = $listening[3]; + $language4_reading = $reading[3]; + $language4_writing = $writing[3]; + } + else{ + $language4 = null; + $language4_order = null; + $language4_speaking = null; + $language4_listening = null; + $language4_reading = null; + $language4_writing = null; + } + + + $user_id = $_POST["id"]; + DB::transaction(function () use ($language1,$language1_order,$language1_speaking,$language1_listening,$language1_reading,$language1_writing, + $language2,$language2_order,$language2_speaking,$language2_listening,$language2_reading,$language2_writing, + $language3,$language3_order,$language3_speaking,$language3_listening,$language3_reading,$language3_writing, + $language4,$language4_order,$language4_speaking,$language4_listening,$language4_reading,$language4_writing,$user_id) { + DB::table('registerinfo2') + ->insert([ + 'registerinfo2.user_id' => $user_id, + 'registerinfo2.language1' => $language1, + 'registerinfo2.language1_order' => $language1_order, + 'registerinfo2.language1_speaking' => $language1_speaking, + 'registerinfo2.language1_listening' => $language1_listening, + 'registerinfo2.language1_reading' => $language1_reading, + 'registerinfo2.language1_writing' => $language1_writing, + 'registerinfo2.language2' => $language2, + 'registerinfo2.language2_order' => $language2_order, + 'registerinfo2.language2_speaking' => $language2_speaking, + 'registerinfo2.language2_listening' => $language2_listening, + 'registerinfo2.language2_reading' => $language2_reading, + 'registerinfo2.language2_writing' => $language2_writing, + 'registerinfo2.language3' => $language3, + 'registerinfo2.language3_order' => $language3_order, + 'registerinfo2.language3_speaking' => $language3_speaking, + 'registerinfo2.language3_listening' => $language3_listening, + 'registerinfo2.language3_reading' => $language3_reading, + 'registerinfo2.language3_writing' => $language3_writing, + 'registerinfo2.language4' => $language4, + 'registerinfo2.language4_order' => $language4_order, + 'registerinfo2.language4_speaking' => $language4_speaking, + 'registerinfo2.language4_listening' => $language4_listening, + 'registerinfo2.language4_reading' => $language4_reading, + 'registerinfo2.language4_writing' => $language4_writing, + 'registerinfo2.if_valid' => 1 + ]); + }); + + $userdata=DB::table('registerinfo1') + ->select('registerinfo1.user_id','registerinfo1.usertype') + ->where('registerinfo1.user_id','=',$user_id) + ->get(); + $userdata=json_decode($userdata, true); + foreach ($userdata as $key) { + $usertype = $key["usertype"]; + if ($usertype == 'student') { + return redirect("register/info3/$user_id"); + } else { + return redirect("register/info3_non/$user_id"); + } + } + + } + + public function addinfo3() + { + $education_level = $_POST["education_level"]; + if ($education_level <= "2") { + $majoring_in = "No"; + } else { + $majoring_in = $_POST["majoring_in"]; + } + if ($education_level == "1") { + $education_level = "Less than a high school diploma"; + } elseif ($education_level == "2") { + $education_level = "High school degree or equivalent"; + } elseif ($education_level == "3") { + $education_level = "Some college, no degree"; + } elseif ($education_level == "4") { + $education_level = "Associate degree"; + } elseif ($education_level == "5") { + $education_level = "Bachelor’s degree"; + } elseif ($education_level == "6") { + $education_level = "Master’s degree"; + } elseif ($education_level == "7") { + $education_level = "Professional degree"; + } elseif ($education_level == "8") { + $education_level = "Doctorate"; + } + $currently_pursuing = $_POST["currently_pursuing"]; + $major_current = $_POST["major_current"]; + $anticipated_field = $_POST["anticipated_field"]; + if ($anticipated_field == "Other") { + $anticipated_field_other = $_POST["Input"]; + } else { + $anticipated_field_other = null; + } + $parental_level = $_POST["parental_level"]; + if ($parental_level <= "2") { + $major_parent = "No"; + } else { + $major_parent = $_POST["major_parent"]; + } + if ($parental_level == "1") { + $parental_level = "Less than a high school diploma"; + } elseif ($parental_level == "2") { + $parental_level = "High school degree or equivalent"; + } elseif ($parental_level == "3") { + $parental_level = "Some college, no degree"; + } elseif ($parental_level == "4") { + $parental_level = "Associate degree"; + } elseif ($parental_level == "5") { + $parental_level = "Bachelor’s degree"; + } elseif ($parental_level == "6") { + $parental_level = "Master’s degree"; + } elseif ($parental_level == "7") { + $parental_level = "Professional degree"; + } elseif ($parental_level == "8") { + $parental_level = "Doctorate"; + } + $income_rmb = $_POST["income_rmb"]; + $user_id = $_POST["id"]; + DB::transaction(function () use ( + $education_level, $majoring_in, $currently_pursuing, $major_current, + $anticipated_field, $anticipated_field_other, $parental_level, $major_parent, $income_rmb, $user_id + ) { + DB::table('registerinfo3') + ->insert([ + 'registerinfo3.user_id' => $user_id, + 'registerinfo3.education_level' => $education_level, + 'registerinfo3.majoring_in' => $majoring_in, + 'registerinfo3.currently_pursuing' => $currently_pursuing, + 'registerinfo3.major_current' => $major_current, + 'registerinfo3.anticipated_field' => $anticipated_field, + 'registerinfo3.anticipated_field_other' => $anticipated_field_other, + 'registerinfo3.parental_level' => $parental_level, + 'registerinfo3.major_parent' => $major_parent, + 'registerinfo3.income_rmb' => $income_rmb, + 'registerinfo3.if_valid' => 1 + ]); + }); + + return redirect("register/info4/$user_id"); + } + + public function addinfo3_non() + { + $education_level = $_POST["education_level"]; + if ($education_level <= "2"){ + $major_in = Null; + } + else { + $major_in = $_POST["major_in"]; + } + if ($education_level == "1"){$education_level = "Less than a high school diploma";} + elseif ($education_level == "2"){$education_level = "High school degree or equivalent";} + elseif ($education_level == "3"){$education_level = "Some college, no degree";} + elseif ($education_level == "4"){$education_level = "Associate degree";} + elseif ($education_level == "5"){$education_level = "Bachelor’s degree";} + elseif ($education_level == "6"){$education_level = "Master’s degree";} + elseif ($education_level == "7"){$education_level = "Professional degree";} + elseif ($education_level == "8"){$education_level = "Doctorate";} + $industry = $_POST["industry"]; + if ($industry == "Other") { + $industry_other = $_POST["Input"]; + } + else{ + $industry_other = null; + } + $work_position = $_POST["work_position"]; + if ($work_position == "Other") { + $work_position_other = $_POST["Input"]; + } + else{ + $work_position_other = null; + } + $income_rmb = $_POST["income_rmb"]; + $user_id = $_POST["id"]; + DB::transaction(function () use ($education_level, $major_in, + $industry, $industry_other, $work_position, $work_position_other, $income_rmb, $user_id) { + DB::table('registerinfo3_2') + ->insert([ + 'registerinfo3_2.user_id' => $user_id, + 'registerinfo3_2.education_level' => $education_level, + 'registerinfo3_2.major_in' => $major_in, + 'registerinfo3_2.industry' => $industry, + 'registerinfo3_2.industry_other' => $industry_other, + 'registerinfo3_2.work_position' => $work_position, + 'registerinfo3_2.work_position_other' => $work_position_other, + 'registerinfo3_2.income_rmb' => $income_rmb, + 'registerinfo3_2.if_valid' => 1 + ]); + }); + return redirect("register/info4/$user_id"); + } + + public function addinfo4() + { + $affiliation = $_POST["affiliation"]; + $political_orientation = $_POST["political_orientation"]; + if ($affiliation == "Other") { + $affiliation_other = $_POST["Input"]; + } + else{ + $affiliation_other = null; + } + $user_id = $_POST["id"]; + DB::transaction(function () use ($user_id, $affiliation, $political_orientation,$affiliation_other) { + DB::table('registerinfo4') + ->insert([ + 'registerinfo4.user_id' => $user_id, + 'registerinfo4.affiliation' => $affiliation, + 'registerinfo4.political_orientation' => $political_orientation, + 'registerinfo4.affiliation_other' => $affiliation_other, + 'registerinfo4.if_valid' => 1 + ]); + }); + DB::table('users')->where('id', '=', $user_id)->update(['is_active' => 1]); + Auth::loginUsingId($user_id); + return redirect("/"); + } + } diff --git a/app/Http/Controllers/ShowSectionContentController.php b/app/Http/Controllers/ShowSectionContentController.php index 4a1a5b4..5f4f7df 100644 --- a/app/Http/Controllers/ShowSectionContentController.php +++ b/app/Http/Controllers/ShowSectionContentController.php @@ -20,11 +20,12 @@ public function show($id)// $section_question = DB::table('section_question') ->join('sections','section_question.section_id','=','sections.id') ->join('chapter_section','sections.id','=','chapter_section.section_id') - ->select('section_question.question_id','section_question.question','sections.rank as section_rank','chapter_section.chapter_id as chapter_id') - ->where('chapter_id','=',$id) - ->orderBy('chapter_id') + ->select('section_question.question_rank as question_id','section_question.detail as question','sections.rank as section_rank','chapter_section.chapter_id as chapter_id') + ->where('chapter_section.chapter_id','=',$id) ->orderBy('section_rank') - ->orderBy('section_question.question_id')->get(); + ->orderBy('section_question.question_rank') + ->orderBy('section_question.question_rank')->get(); + return view('show_data_sectionmaterials', compact('sections','section_question','id')); }// diff --git a/app/Http/Controllers/ShowStudyMaterialController.php b/app/Http/Controllers/ShowStudyMaterialController.php index f5abdb1..d132ea5 100644 --- a/app/Http/Controllers/ShowStudyMaterialController.php +++ b/app/Http/Controllers/ShowStudyMaterialController.php @@ -22,17 +22,85 @@ public function show()// return view('show_data_studymaterials', compact('chapter','case_study')); } + public function showsurvey()// + { + $survey_question = DB::table('survey_question') + ->select('survey_question.id','survey_question.title') + ->orderBy('survey_question.id')->get(); + + return view('show_survey_questions', compact('survey_question')); + } + public function checksurveytitle($id)// + { + $survey_question = DB::table('survey_question') + ->select('survey_question.title','survey_question.choice0','survey_question.choice1','survey_question.choice2','survey_question.choice3','survey_question.choice4','survey_question.choice5') + ->where('survey_question.id','=',$id) + ->orderBy('survey_question.id')->get(); + + return view('survey_title_modify', compact('survey_question','id')); + } + public function checksurveyquestions($id)// + { + $survey_detail_question = DB::table('survey_detail_question') + ->select('survey_detail_question.id','survey_detail_question.detail') + ->where('survey_detail_question.survey_id','=',$id) + ->orderBy('survey_detail_question.id')->get(); + + return view('show_survey_question_details', compact('survey_detail_question','id')); + } public function destroychapter($id)// { DB::table('chapters')->where('chapters.id', '=', $id)->delete(); + + $section_select = DB::table('chapter_section') + ->join('sections','chapter_section.section_id','=','sections.id') + ->select('sections.id') + ->where('chapter_section.chapter_id', '=', $id)->get(); + + $section_select = json_decode($section_select,true); + + foreach($section_select as $sec_select) + { + DB::table('sections') + ->where('sections.id', '=', $sec_select['id'])->delete(); + } + + DB::table('chapter_section') + ->where('chapter_section.chapter_id', '=', $id)->delete(); + return redirect("showstudymaterial"); } public function destroycase($id)// { DB::table('case_study_material')->where('case_study_material.id', '=', $id)->delete(); + DB::table('case_to_question')->where('case_to_question.case_id', '=', $id)->delete(); + return redirect("showstudymaterial"); } + public function destroysurveyquestions($id,$question_id)// + { + DB::table('survey_answer')->where('survey_answer.id', '=', $question_id)->delete(); + DB::table('survey_detail_question')->where('survey_detail_question.id', '=', $question_id)->delete(); + + return redirect("check/survey/$id"); + } + public function destroysurvey($id)// + { + $question_select = DB::table('survey_detail_question') + ->select('survey_detail_question.id') + ->where('survey_detail_question.survey_id', '=', $id)->get(); + $question_select = json_decode($question_select,true); + foreach($question_select as $answer_to_delete) + { + DB::table('survey_answer')->where('survey_answer.id', '=', $answer_to_delete['id'])->delete(); + } + DB::table('survey_question')->where('survey_question.id', '=', $id)->delete(); + DB::table('survey_detail_question')->where('survey_detail_question.survey_id', '=', $id)->delete(); + + return redirect("showsurvey"); + } + public function destroysecquestion($ch_id,$sec_id,$qu_id) { $section = DB::table('sections') @@ -47,10 +115,23 @@ public function destroysecquestion($ch_id,$sec_id,$qu_id) $counter = $section_com['section_id']; } } + $question_id = DB::table('section_question') + ->select('section_question.id') + ->where('section_question.section_id', '=', $counter) + ->where('section_question.question_rank', '=', $qu_id) + ->get(); + $question_id = json_decode($question_id,true); + $question_id = $question_id[0]['id']; + DB::table('section_question') ->where('section_question.section_id', '=', $counter) - ->where('section_question.question_id', '=', $qu_id) + ->where('section_question.question_rank', '=', $qu_id) + ->delete(); + + DB::table('section_question_answer') + ->where('section_question_answer.id', '=', $question_id) ->delete(); + return redirect("/check/chapter/$ch_id"); } } diff --git a/app/Http/Controllers/SurveyController.php b/app/Http/Controllers/SurveyController.php index 65677c1..b3acc76 100644 --- a/app/Http/Controllers/SurveyController.php +++ b/app/Http/Controllers/SurveyController.php @@ -5,21 +5,92 @@ use Illuminate\Http\Request; use Illuminate\Support\Facades\DB; use Symfony\Component\Console\Helper\Table; +use Illuminate\Support\Facades\Auth; + class SurveyController extends Controller { public function survey($id) { + $user_id = Auth::user()->id; + $survey_questions = DB::table('survey_question') ->select('survey_question.id','survey_question.title','survey_question.choice0','survey_question.choice1','survey_question.choice2','survey_question.choice3','survey_question.choice4','survey_question.choice5') + ->where('survey_question.id','=',$id) + ->get(); + + $survey_details = DB::table('survey_detail_question') + ->select('survey_detail_question.id','survey_detail_question.detail') + ->where('survey_detail_question.survey_id','=',$id) ->get(); - $survey_details = DB::table('survey_question_detail') - ->select('survey_question_detail.id','survey_question_detail.detail') - ->where('survey_question_detail.survey_question_id','=',$id) + $survey_answer = DB::table('survey_detail_question') + ->join('survey_answer','survey_detail_question.id','=','survey_answer.id') + ->select('survey_answer.answer') + ->where('survey_detail_question.survey_id','=',$id) + ->where('survey_answer.user_id','=',$user_id) ->get(); - return view('surveys', compact('survey_questions','survey_details','id')); + $survey_answer = json_decode($survey_answer,true); + if($survey_answer == null) + { + return view('surveys', compact('survey_questions','survey_details','id')); + } + else{ + return redirect('survey_finished'); + } + }// + public function choosesurvey() + { + $survey_question = DB::table('survey_question') + ->select('survey_question.id','survey_question.title') + ->orderBy('survey_question.id')->get(); + + return view('Chooseonesurvey', compact('survey_question')); + + } + public function surveyanswer_edit() + { + $user_id = Auth::user()->id; + for($i = 0; $i < count($_POST["id"]); $i++) + { + + $id = $_POST["id"][$i]; + $question_answer = $_POST["answer"][$i]; + + $survey_answer = DB::table('survey_answer') + ->select('survey_answer.id') + ->where('survey_answer.user_id','=',$user_id) + ->where('survey_answer.id','=',$id) + ->get(); + + $survey_answer = json_decode($survey_answer); + + if(count($survey_answer) == 0) { + DB::transaction(function () use ($user_id,$id, $question_answer) { + DB::table('survey_answer') + ->insert([ + 'survey_answer.user_id' => $user_id, + 'survey_answer.id' => $id, + 'survey_answer.answer' => $question_answer + ]); + }); + } + elseif(count($survey_answer) != 0){ + DB::transaction(function () use ($user_id,$id, $question_answer) { + DB::table('survey_answer') + ->where('survey_answer.user_id', '=', $user_id) + ->where('survey_answer.id', '=', $id) + ->update([ + 'survey_answer.answer' => $question_answer + ]); + }); + } + } + return redirect('survey_finished'); + + + } } diff --git a/app/Http/Middleware/RedirectIfAuthenticated.php b/app/Http/Middleware/RedirectIfAuthenticated.php index 17bf8bd..676fd1f 100644 --- a/app/Http/Middleware/RedirectIfAuthenticated.php +++ b/app/Http/Middleware/RedirectIfAuthenticated.php @@ -18,7 +18,7 @@ class RedirectIfAuthenticated public function handle($request, Closure $next, $guard = null) { if (Auth::guard($guard)->check()) { - $path = $guard? '/admin' : '/home'; + $path = $guard? '/admin' : '/homepage'; return redirect($path); } diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 35471f6..2d5e04b 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -13,6 +13,7 @@ class AppServiceProvider extends ServiceProvider */ public function boot() { + //\URL::forceScheme('https'); // } diff --git a/composer.json b/composer.json index 0aa7120..d49811c 100644 --- a/composer.json +++ b/composer.json @@ -8,11 +8,13 @@ "php": ">=7.0.0", "fideloper/proxy": "~3.3", "laravel/framework": "5.5.*", - "laravel/tinker": "~1.0" + "laravel/tinker": "~1.0", + "ext-sockets": "*" }, "require-dev": { "filp/whoops": "~2.0", "fzaninotto/faker": "~1.4", + "laravel/homestead": "^8.4", "mockery/mockery": "~1.0", "phpunit/phpunit": "~6.0", "symfony/thanks": "^1.0" diff --git a/composer.lock b/composer.lock index 73aaffc..2105d34 100644 --- a/composer.lock +++ b/composer.lock @@ -1,11 +1,10 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "hash": "7f1915ec708986f5c88e22e683d74275", - "content-hash": "b7904d07d1e1765a0a199aa11d6301a3", + "content-hash": "934021e7523aaf1f9615e7a9ca3fca8b", "packages": [ { "name": "dnoegel/php-xdg-base-dir", @@ -38,7 +37,7 @@ "MIT" ], "description": "implementation of xdg base directory specification for php", - "time": "2014-10-24 07:27:01" + "time": "2014-10-24T07:27:01+00:00" }, { "name": "doctrine/inflector", @@ -105,7 +104,7 @@ "singularize", "string" ], - "time": "2017-07-22 12:18:28" + "time": "2017-07-22T12:18:28+00:00" }, { "name": "doctrine/lexer", @@ -159,7 +158,7 @@ "lexer", "parser" ], - "time": "2014-09-09 13:34:57" + "time": "2014-09-09T13:34:57+00:00" }, { "name": "egulias/email-validator", @@ -216,7 +215,7 @@ "validation", "validator" ], - "time": "2018-09-25 20:47:26" + "time": "2018-09-25T20:47:26+00:00" }, { "name": "erusev/parsedown", @@ -262,7 +261,7 @@ "markdown", "parser" ], - "time": "2018-03-08 01:11:30" + "time": "2018-03-08T01:11:30+00:00" }, { "name": "fideloper/proxy", @@ -319,7 +318,7 @@ "proxy", "trusted proxy" ], - "time": "2017-06-15 17:19:42" + "time": "2017-06-15T17:19:42+00:00" }, { "name": "jakub-onderka/php-console-color", @@ -361,7 +360,7 @@ "email": "jakub.onderka@gmail.com" } ], - "time": "2018-09-29 17:23:10" + "time": "2018-09-29T17:23:10+00:00" }, { "name": "jakub-onderka/php-console-highlighter", @@ -407,7 +406,7 @@ } ], "description": "Highlight PHP code in terminal", - "time": "2018-09-29 18:48:56" + "time": "2018-09-29T18:48:56+00:00" }, { "name": "laravel/framework", @@ -541,7 +540,7 @@ "framework", "laravel" ], - "time": "2018-10-04 14:51:24" + "time": "2018-10-04T14:51:24+00:00" }, { "name": "laravel/tinker", @@ -604,7 +603,7 @@ "laravel", "psysh" ], - "time": "2018-10-12 19:39:35" + "time": "2018-10-12T19:39:35+00:00" }, { "name": "league/flysystem", @@ -688,7 +687,7 @@ "sftp", "storage" ], - "time": "2018-10-15 13:53:10" + "time": "2018-10-15T13:53:10+00:00" }, { "name": "monolog/monolog", @@ -766,7 +765,7 @@ "logging", "psr-3" ], - "time": "2018-11-05 09:00:11" + "time": "2018-11-05T09:00:11+00:00" }, { "name": "mtdowling/cron-expression", @@ -810,7 +809,7 @@ "cron", "schedule" ], - "time": "2017-01-23 04:29:33" + "time": "2017-01-23T04:29:33+00:00" }, { "name": "nesbot/carbon", @@ -868,7 +867,7 @@ "datetime", "time" ], - "time": "2018-11-14 21:55:58" + "time": "2018-11-14T21:55:58+00:00" }, { "name": "nikic/php-parser", @@ -919,7 +918,7 @@ "parser", "php" ], - "time": "2018-10-10 09:24:14" + "time": "2018-10-10T09:24:14+00:00" }, { "name": "paragonie/random_compat", @@ -964,7 +963,7 @@ "pseudorandom", "random" ], - "time": "2018-07-02 15:55:56" + "time": "2018-07-02T15:55:56+00:00" }, { "name": "psr/container", @@ -1013,7 +1012,7 @@ "container-interop", "psr" ], - "time": "2017-02-14 16:28:37" + "time": "2017-02-14T16:28:37+00:00" }, { "name": "psr/log", @@ -1060,7 +1059,7 @@ "psr", "psr-3" ], - "time": "2016-10-10 12:19:37" + "time": "2016-10-10T12:19:37+00:00" }, { "name": "psr/simple-cache", @@ -1108,7 +1107,7 @@ "psr-16", "simple-cache" ], - "time": "2017-10-23 01:57:42" + "time": "2017-10-23T01:57:42+00:00" }, { "name": "psy/psysh", @@ -1182,7 +1181,7 @@ "interactive", "shell" ], - "time": "2018-10-13 15:16:03" + "time": "2018-10-13T15:16:03+00:00" }, { "name": "ramsey/uuid", @@ -1264,7 +1263,7 @@ "identifier", "uuid" ], - "time": "2018-07-19 23:38:55" + "time": "2018-07-19T23:38:55+00:00" }, { "name": "swiftmailer/swiftmailer", @@ -1323,7 +1322,7 @@ "mail", "mailer" ], - "time": "2018-09-11 07:12:52" + "time": "2018-09-11T07:12:52+00:00" }, { "name": "symfony/console", @@ -1392,7 +1391,7 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2018-10-30 16:50:50" + "time": "2018-10-30T16:50:50+00:00" }, { "name": "symfony/css-selector", @@ -1445,7 +1444,7 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", - "time": "2018-10-02 16:33:53" + "time": "2018-10-02T16:33:53+00:00" }, { "name": "symfony/debug", @@ -1501,7 +1500,7 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2018-10-31 09:06:03" + "time": "2018-10-31T09:06:03+00:00" }, { "name": "symfony/event-dispatcher", @@ -1564,7 +1563,7 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2018-10-30 16:50:50" + "time": "2018-10-30T16:50:50+00:00" }, { "name": "symfony/finder", @@ -1613,7 +1612,7 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2018-10-03 08:46:40" + "time": "2018-10-03T08:46:40+00:00" }, { "name": "symfony/http-foundation", @@ -1667,7 +1666,7 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2018-10-31 08:57:11" + "time": "2018-10-31T08:57:11+00:00" }, { "name": "symfony/http-kernel", @@ -1756,7 +1755,7 @@ ], "description": "Symfony HttpKernel Component", "homepage": "https://symfony.com", - "time": "2018-11-03 10:03:02" + "time": "2018-11-03T10:03:02+00:00" }, { "name": "symfony/polyfill-ctype", @@ -1814,7 +1813,7 @@ "polyfill", "portable" ], - "time": "2018-08-06 14:22:27" + "time": "2018-08-06T14:22:27+00:00" }, { "name": "symfony/polyfill-mbstring", @@ -1873,7 +1872,7 @@ "portable", "shim" ], - "time": "2018-09-21 13:07:52" + "time": "2018-09-21T13:07:52+00:00" }, { "name": "symfony/polyfill-php70", @@ -1932,7 +1931,7 @@ "portable", "shim" ], - "time": "2018-09-21 06:26:08" + "time": "2018-09-21T06:26:08+00:00" }, { "name": "symfony/process", @@ -1981,7 +1980,7 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2018-10-14 17:33:21" + "time": "2018-10-14T17:33:21+00:00" }, { "name": "symfony/routing", @@ -2058,7 +2057,7 @@ "uri", "url" ], - "time": "2018-10-02 12:28:39" + "time": "2018-10-02T12:28:39+00:00" }, { "name": "symfony/translation", @@ -2126,7 +2125,7 @@ ], "description": "Symfony Translation Component", "homepage": "https://symfony.com", - "time": "2018-10-02 16:33:53" + "time": "2018-10-02T16:33:53+00:00" }, { "name": "symfony/var-dumper", @@ -2195,7 +2194,7 @@ "debug", "dump" ], - "time": "2018-10-02 16:33:53" + "time": "2018-10-02T16:33:53+00:00" }, { "name": "tijsverkoyen/css-to-inline-styles", @@ -2242,7 +2241,7 @@ ], "description": "CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very useful when you're sending emails.", "homepage": "https://github.com/tijsverkoyen/CssToInlineStyles", - "time": "2017-11-27 11:13:29" + "time": "2017-11-27T11:13:29+00:00" }, { "name": "vlucas/phpdotenv", @@ -2292,7 +2291,7 @@ "env", "environment" ], - "time": "2018-07-29 20:33:41" + "time": "2018-07-29T20:33:41+00:00" } ], "packages-dev": [ @@ -2348,7 +2347,7 @@ "constructor", "instantiate" ], - "time": "2015-06-14 21:17:01" + "time": "2015-06-14T21:17:01+00:00" }, { "name": "filp/whoops", @@ -2409,7 +2408,7 @@ "throwable", "whoops" ], - "time": "2018-10-23 09:00:00" + "time": "2018-10-23T09:00:00+00:00" }, { "name": "fzaninotto/faker", @@ -2459,7 +2458,7 @@ "faker", "fixtures" ], - "time": "2018-07-12 10:23:15" + "time": "2018-07-12T10:23:15+00:00" }, { "name": "hamcrest/hamcrest-php", @@ -2507,7 +2506,57 @@ "keywords": [ "test" ], - "time": "2016-01-20 08:20:44" + "time": "2016-01-20T08:20:44+00:00" + }, + { + "name": "laravel/homestead", + "version": "v8.4.0", + "source": { + "type": "git", + "url": "https://github.com/laravel/homestead.git", + "reference": "c1e194bac77a03374adb9f92be818d25fa16335a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/homestead/zipball/c1e194bac77a03374adb9f92be818d25fa16335a", + "reference": "c1e194bac77a03374adb9f92be818d25fa16335a", + "shasum": "" + }, + "require": { + "php": "^7.1", + "symfony/console": "~3.0||~4.0", + "symfony/process": "~3.0||~4.0", + "symfony/yaml": "~3.0||~4.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "bin": [ + "bin/homestead" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "psr-4": { + "Laravel\\Homestead\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylorotwell@gmail.com" + } + ], + "description": "A virtual machine for web artisans.", + "time": "2019-05-01T14:45:57+00:00" }, { "name": "mockery/mockery", @@ -2572,7 +2621,7 @@ "test double", "testing" ], - "time": "2018-10-02 21:52:37" + "time": "2018-10-02T21:52:37+00:00" }, { "name": "myclabs/deep-copy", @@ -2617,7 +2666,7 @@ "object", "object graph" ], - "time": "2017-10-19 19:58:43" + "time": "2017-10-19T19:58:43+00:00" }, { "name": "phar-io/manifest", @@ -2672,7 +2721,7 @@ } ], "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", - "time": "2017-03-05 18:14:27" + "time": "2017-03-05T18:14:27+00:00" }, { "name": "phar-io/version", @@ -2719,7 +2768,7 @@ } ], "description": "Library for handling version information and constraints", - "time": "2017-03-05 17:38:23" + "time": "2017-03-05T17:38:23+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -2773,7 +2822,7 @@ "reflection", "static analysis" ], - "time": "2017-09-11 18:02:19" + "time": "2017-09-11T18:02:19+00:00" }, { "name": "phpdocumentor/reflection-docblock", @@ -2824,7 +2873,7 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2017-11-30 07:14:17" + "time": "2017-11-30T07:14:17+00:00" }, { "name": "phpdocumentor/type-resolver", @@ -2871,7 +2920,7 @@ "email": "me@mikevanriel.com" } ], - "time": "2017-07-14 14:27:02" + "time": "2017-07-14T14:27:02+00:00" }, { "name": "phpspec/prophecy", @@ -2934,7 +2983,7 @@ "spy", "stub" ], - "time": "2018-08-05 17:53:17" + "time": "2018-08-05T17:53:17+00:00" }, { "name": "phpunit/php-code-coverage", @@ -2997,7 +3046,7 @@ "testing", "xunit" ], - "time": "2018-04-06 15:36:58" + "time": "2018-04-06T15:36:58+00:00" }, { "name": "phpunit/php-file-iterator", @@ -3044,7 +3093,7 @@ "filesystem", "iterator" ], - "time": "2017-11-27 13:52:08" + "time": "2017-11-27T13:52:08+00:00" }, { "name": "phpunit/php-text-template", @@ -3085,7 +3134,7 @@ "keywords": [ "template" ], - "time": "2015-06-21 13:50:34" + "time": "2015-06-21T13:50:34+00:00" }, { "name": "phpunit/php-timer", @@ -3134,7 +3183,7 @@ "keywords": [ "timer" ], - "time": "2017-02-26 11:10:40" + "time": "2017-02-26T11:10:40+00:00" }, { "name": "phpunit/php-token-stream", @@ -3183,7 +3232,7 @@ "keywords": [ "tokenizer" ], - "time": "2017-11-27 05:48:46" + "time": "2017-11-27T05:48:46+00:00" }, { "name": "phpunit/phpunit", @@ -3267,7 +3316,7 @@ "testing", "xunit" ], - "time": "2018-09-08 15:10:43" + "time": "2018-09-08T15:10:43+00:00" }, { "name": "phpunit/phpunit-mock-objects", @@ -3326,7 +3375,7 @@ "mock", "xunit" ], - "time": "2018-08-09 05:50:03" + "time": "2018-08-09T05:50:03+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -3371,7 +3420,7 @@ ], "description": "Looks up which function or method a line of code belongs to", "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "time": "2017-03-04 06:30:41" + "time": "2017-03-04T06:30:41+00:00" }, { "name": "sebastian/comparator", @@ -3435,7 +3484,7 @@ "compare", "equality" ], - "time": "2018-02-01 13:46:46" + "time": "2018-02-01T13:46:46+00:00" }, { "name": "sebastian/diff", @@ -3487,7 +3536,7 @@ "keywords": [ "diff" ], - "time": "2017-08-03 08:09:46" + "time": "2017-08-03T08:09:46+00:00" }, { "name": "sebastian/environment", @@ -3537,7 +3586,7 @@ "environment", "hhvm" ], - "time": "2017-07-01 08:51:00" + "time": "2017-07-01T08:51:00+00:00" }, { "name": "sebastian/exporter", @@ -3604,7 +3653,7 @@ "export", "exporter" ], - "time": "2017-04-03 13:19:02" + "time": "2017-04-03T13:19:02+00:00" }, { "name": "sebastian/global-state", @@ -3655,7 +3704,7 @@ "keywords": [ "global state" ], - "time": "2017-04-27 15:39:26" + "time": "2017-04-27T15:39:26+00:00" }, { "name": "sebastian/object-enumerator", @@ -3702,7 +3751,7 @@ ], "description": "Traverses array structures and object graphs to enumerate all referenced objects", "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "time": "2017-08-03 12:35:26" + "time": "2017-08-03T12:35:26+00:00" }, { "name": "sebastian/object-reflector", @@ -3747,7 +3796,7 @@ ], "description": "Allows reflection of object attributes, including inherited and non-public ones", "homepage": "https://github.com/sebastianbergmann/object-reflector/", - "time": "2017-03-29 09:07:27" + "time": "2017-03-29T09:07:27+00:00" }, { "name": "sebastian/recursion-context", @@ -3800,7 +3849,7 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2017-03-03 06:23:57" + "time": "2017-03-03T06:23:57+00:00" }, { "name": "sebastian/resource-operations", @@ -3842,7 +3891,7 @@ ], "description": "Provides a list of PHP built-in functions that operate on resources", "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "time": "2015-07-28 20:34:47" + "time": "2015-07-28T20:34:47+00:00" }, { "name": "sebastian/version", @@ -3885,7 +3934,7 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "time": "2016-10-03 07:35:21" + "time": "2016-10-03T07:35:21+00:00" }, { "name": "symfony/thanks", @@ -3928,7 +3977,66 @@ } ], "description": "Give thanks (in the form of a GitHub ⭐) to your fellow PHP package maintainers (not limited to Symfony components)!", - "time": "2018-08-24 14:08:13" + "time": "2018-08-24T14:08:13+00:00" + }, + { + "name": "symfony/yaml", + "version": "v4.2.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "6712daf03ee25b53abb14e7e8e0ede1a770efdb1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/6712daf03ee25b53abb14e7e8e0ede1a770efdb1", + "reference": "6712daf03ee25b53abb14e7e8e0ede1a770efdb1", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/polyfill-ctype": "~1.8" + }, + "conflict": { + "symfony/console": "<3.4" + }, + "require-dev": { + "symfony/console": "~3.4|~4.0" + }, + "suggest": { + "symfony/console": "For validating YAML files using the lint command" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "time": "2019-03-30T15:58:42+00:00" }, { "name": "theseer/tokenizer", @@ -3968,7 +4076,7 @@ } ], "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "time": "2017-04-07 12:08:54" + "time": "2017-04-07T12:08:54+00:00" }, { "name": "webmozart/assert", @@ -4018,7 +4126,7 @@ "check", "validate" ], - "time": "2018-01-29 19:49:41" + "time": "2018-01-29T19:49:41+00:00" } ], "aliases": [], @@ -4027,7 +4135,8 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=7.0.0" + "php": ">=7.0.0", + "ext-sockets": "*" }, "platform-dev": [] } diff --git a/config/app.php b/config/app.php index 0e4ebed..b5abad0 100644 --- a/config/app.php +++ b/config/app.php @@ -39,7 +39,7 @@ | */ - 'debug' => env('APP_DEBUG', false), + 'debug' => env('APP_DEBUG', true), /* |-------------------------------------------------------------------------- diff --git a/database/migrations/2018_11_13_105505_create_section_question_table.php b/database/migrations/2018_11_13_105505_create_section_question_table.php deleted file mode 100644 index b623c41..0000000 --- a/database/migrations/2018_11_13_105505_create_section_question_table.php +++ /dev/null @@ -1,34 +0,0 @@ -integer('section_id')->unsigned(); - $table->integer('question_id')->unsigned(); - $table->char('question',255); - $table->primary(['section_id','question_id']); - $table->timestamps(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('section_question'); - } -} diff --git a/database/migrations/2018_11_18_124900_create_survey_question_detail_table.php b/database/migrations/2018_11_18_124900_create_survey_question_detail_table.php deleted file mode 100644 index f0139fb..0000000 --- a/database/migrations/2018_11_18_124900_create_survey_question_detail_table.php +++ /dev/null @@ -1,32 +0,0 @@ -increments('id'); - $table->integer('survey_question_id')->unsigned(); - $table->text('detail'); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('survey_question_detail'); - } -} diff --git a/database/migrations/2018_11_18_134436_create_section_question_answer_table.php b/database/migrations/2018_11_18_134436_create_section_question_answer_table.php deleted file mode 100644 index 98370a9..0000000 --- a/database/migrations/2018_11_18_134436_create_section_question_answer_table.php +++ /dev/null @@ -1,36 +0,0 @@ -increments('id'); - $table->integer('section_id')->unsigned(); - $table->integer('question_id')->unsigned(); - $table->integer('user_id'); - $table->text('answer')->nullable(); - $table->integer('score')->nullable(); - $table->integer('full_score')->nullable(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('section_question_answer'); - } -} diff --git a/database/migrations/2018_11_18_135704_create_survey_question_answer_table.php b/database/migrations/2018_11_18_135704_create_survey_question_answer_table.php deleted file mode 100644 index 1f42ecd..0000000 --- a/database/migrations/2018_11_18_135704_create_survey_question_answer_table.php +++ /dev/null @@ -1,32 +0,0 @@ -integer('user_id'); - $table->integer('survey_question_id'); - $table->integer('answer'); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('survey_question_answer'); - } -} diff --git a/database/seeds/DatabaseSeeder.php b/database/seeds/DatabaseSeeder.php index aebd79f..0fc5916 100644 --- a/database/seeds/DatabaseSeeder.php +++ b/database/seeds/DatabaseSeeder.php @@ -12,6 +12,11 @@ class DatabaseSeeder extends Seeder public function run() { // $this->call(UsersTableSeeder::class); - $this->call(AdminsTableSeeder::class); + #$this->call(AdminsTableSeeder::class); + $this->call([ + UsersTableSeeder::class, + AdminsTableSeeder::class, + InsertSection::class, + ]); } } diff --git a/resources/views/CaseStudy.blade.php b/resources/views/CaseStudy.blade.php index afbad61..bbd1eca 100644 --- a/resources/views/CaseStudy.blade.php +++ b/resources/views/CaseStudy.blade.php @@ -1,22 +1,5 @@ - - - - - - Case Study Page - - - - - - - - - -@include('Header') - - - +@extends('layouts.app') +@section('content')
@@ -32,25 +15,32 @@ $case_study = json_decode($case_study,true); //var_dump($sections[0]["chapter_id"]); - echo "
  • "; + echo "
  • "; foreach ($chapters as $ch_value) { $chapter_id = $ch_value["id"]; $title = $ch_value["title"]; $link1 = url("chapter/$chapter_id/section/1"); - echo "
  • Chapter $chapter_id.
    $title
  • "; + echo "
  • Chapter $chapter_id.
    $title
  • "; } - foreach ($case_study as $ca_value) + echo"

    Case Studies

    "; + + foreach ($case_study as $ca_value) { $case_id = $ca_value["id"]; $ca_title = $ca_value["title"]; $link2 = url("casestudy/$case_id/step/1"); - echo "
  • Case Study $case_id.
    $ca_title
  • "; + if ($case_id == $id){ + echo "
  • Case Study $case_id.
    $ca_title
  • "; + } + else{ + echo "
  • Case Study $case_id.
    $ca_title
  • "; + } } - echo "";//No li element in scope but a li end tag seen. + // echo "";//No li element in scope but a li end tag seen. ?> @@ -41,10 +45,7 @@ @endguest - About"; - ?> +
    - + +
    +




    diff --git a/resources/views/Homepage.blade.php b/resources/views/Homepage.blade.php index 8db6a19..dbec397 100644 --- a/resources/views/Homepage.blade.php +++ b/resources/views/Homepage.blade.php @@ -1,30 +1,21 @@ - - +@extends('layouts.app') - - - - - - - - - - Homepage - - - -@include('Header') +@section('content') @guest

    Welcome

    -

    This is a study webpage for you to learn and test engineering ethics. As a guest, you cannot get enough information. Please Log in first.

    - Log in

    "; + $link_login = url('/login'); + $link_register = url('/register'); + $link_umji = "http://umji.sjtu.edu.cn"; + $link_book = "https://www.elsevier.com/books/global-engineering-ethics/luegenbiehl/978-0-12-811218-2"; + echo"

    This site hosts content and collects information related to applied ethics and moral psychology. To access educational modules and complete surveys, please register or login.

    "; + echo"

    It is the result of interdisciplinary education and research efforts by faculty members, administrators, and students in philosophy, computer science, social psychology, mathematics, and international education at the University of Michigan-Shanghai Jiao Tong University Joint Institute, and Institute of Social Cognitive and Behavioral Science, Shanghai Jiao Tong University.

    "; + echo"

    Scandals involving ethics within engineering, business, and medicine negatively affect members of the public, corporations, and governments. Effective ethics training is necessary to address these problems, as well as to raising the reputations of individuals, organizations, and institutions that value ethics and engage in ethical behaviors. To do so, this site provides educational materials on applied ethics, as well as collects information regarding what people think is right and wrong and why, to further develop ethics curricula and contribute to the development of character and perspectives crucial to international leadership, professionalism, and citizenry.

    "; + echo"

    Potential partners in education and industry are encouraged to contact Rockwell Clancy regarding the possibility of using this site in courses, corporate, or professional training: rockwell.clancy@sjtu.edu.cn

    "; + echo"

    The educational modules included herein are based on materials abridged from Global Engineering Ethics, used with the permission of the authors and Elsevier Press. These should not be reproduced without the permission of the authors, Heinz Luegenbiehl and Rockwell Clancy: rockwell.clancy@sjtu.edu.cn.

    "; ?>
    @@ -50,28 +41,30 @@ ?> @else +
    -

    Welcome

    -

    This is a study webpage for you to learn and test engineering ethics. You can first do the following survey to have a primary impression.

    +

    Welcome back, {{ Auth::user()->user_name }}

    + Start The Survey

    "; + echo"

    As a user, you can complete surveys and educational materials on applied ethics

    "; + $link_survey = url('/chooseonesurvey'); + echo"

    Start the Survey

    "; ?>
    +
    - img-thumbnail + img-thumbnail

    News

    -

    The recent new about VG496

    +

    Updates about the project

    Learn More

    @@ -80,7 +73,7 @@
    - img-thumbnail + img-thumbnail "; @@ -101,10 +94,9 @@ ?>
    -
    + {{--
    --}} +
    @endguest -@include('Footer') - - - \ No newline at end of file + +@endsection \ No newline at end of file diff --git a/resources/views/SurveyFinished.blade.php b/resources/views/SurveyFinished.blade.php deleted file mode 100644 index 358b029..0000000 --- a/resources/views/SurveyFinished.blade.php +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - Login - - - - - - - - - - -"; -echo"

    You have already finished the survey and your response will be used for further research. Thank you for your participation!

    "; - -echo"
    "; -$Link_homepage = url('/homepage'); -echo"
    "; -echo""; -echo"
    "; -echo""; -?> - - - - \ No newline at end of file diff --git a/resources/views/add_newcase.blade.php b/resources/views/add_newcase.blade.php index b20f2b1..51f8aa2 100644 --- a/resources/views/add_newcase.blade.php +++ b/resources/views/add_newcase.blade.php @@ -1,18 +1,6 @@ - - - - - - - - - - - Homepage - - - +@extends('admin.Header') +@section('content')
    -
    + {{ csrf_field()}} Case Title"; echo "
    "; - echo ""; echo "
    "; echo ""; echo "
    "; - echo ""; echo "
    "; echo ""; echo "
    "; - echo ""; echo "
    "; echo "
    "; - echo""; echo "
    "; @@ -72,8 +60,13 @@ $link_back = url("/showstudymaterial"); + echo ""; echo"
    "; + echo"
    "; + $link_back = url("/showstudymaterial"); + echo"Back to Material Page"; + echo"
    "; echo"
    "; echo"
    "; @@ -99,7 +92,4 @@
    -
    - - - \ No newline at end of file +@endsection \ No newline at end of file diff --git a/resources/views/add_newsection.blade.php b/resources/views/add_newsection.blade.php index 97a56b6..aee23d2 100644 --- a/resources/views/add_newsection.blade.php +++ b/resources/views/add_newsection.blade.php @@ -1,18 +1,6 @@ - - - - - - - - - - - Homepage - - - +@extends('admin.Header') +@section('content')
    Section Title"; echo "
    "; - echo ""; echo "
    "; echo ""; echo "
    "; - echo ""; echo "
    "; echo "
    "; - echo""; echo "
    "; echo "
    "; - echo""; echo "
    "; @@ -107,7 +95,4 @@
    -
    - - - \ No newline at end of file +@endsection \ No newline at end of file diff --git a/resources/views/add_newsectionquestions.blade.php b/resources/views/add_newsectionquestions.blade.php index 3635974..3cc794d 100644 --- a/resources/views/add_newsectionquestions.blade.php +++ b/resources/views/add_newsectionquestions.blade.php @@ -1,18 +1,6 @@ - - - - - - - - - - - Homepage - - - +@extends('admin.Header') +@section('content')
    "; echo "
    "; echo ""; echo "
    "; - echo""; echo "
    "; @@ -38,20 +27,20 @@ echo ""; echo "
    "; - echo ""; echo "
    "; echo ""; echo "
    "; - echo ""; echo "
    "; echo "
    "; - echo""; echo "
    "; @@ -106,7 +95,4 @@
    -
    - - - \ No newline at end of file +@endsection \ No newline at end of file diff --git a/resources/views/admin/AdminHomepage.blade.php b/resources/views/admin/AdminHomepage.blade.php index 036e489..fe69eff 100644 --- a/resources/views/admin/AdminHomepage.blade.php +++ b/resources/views/admin/AdminHomepage.blade.php @@ -1,20 +1,15 @@ - - +@extends('admin.Header') - +@section('style') + @parent + +@endsection - - - - - - - - Homepage - - - -@include('admin.Header') +@section('content') @guest('admin')
    @@ -37,75 +32,96 @@

    Administer Page

    - +
    -
    -
    -

    Study material

    -

    Adjusting the study material

    +
    +
    +

    Study material

    +
    +
    +

    Adjusting the study material.

    + +
    +
    +
    -
    - - -

    User

    +
    +
    +

    User

    +
    +
    +

    Manage the user

    -

    Manage the user

    - User Management

    " +
    +
    +
    - +
    +
    -
    -
    -

    Survey Management

    +
    +
    +

    Survey Management

    +
    +

    Adjusting the Survey question

    + +
    +
    +
    -
    - - -

    Data Analysis

    +
    +
    +

    View answers

    +
    +
    +

    View the answer of the students

    -

    Data Analysis Check

    - Data Analysis Result

    " +
    +
    +
    +
    @endguest -@include('Footer') - - - \ No newline at end of file +@endsection \ No newline at end of file diff --git a/resources/views/admin/Header.blade.php b/resources/views/admin/Header.blade.php index 69ecd9c..a168455 100644 --- a/resources/views/admin/Header.blade.php +++ b/resources/views/admin/Header.blade.php @@ -1,20 +1,53 @@ - - - - -