Beispiel #1
0
 /**
  * Create a new user controller instance.
  *
  * @return void
  */
 public function __construct()
 {
     $this->priviledge_user();
     $this->_user = \Auth::user();
     if (2 == $this->_user->role_id) {
         $this->_query_connect = "=";
         $this->_query_value = $this->_user->department_id;
     }
     $this->_plan_courses = Course::where('department_id', $this->_query_connect, $this->_query_value)->lists('name', 'id');
     $this->_plan_curriculums = Curriculum::lists('name', 'id');
 }
 public function update($category)
 {
     // dd(\Input::all());
     try {
         $curriculum = Curriculum::where('category', $category)->first();
         $curriculum->update(\Input::all());
         Flash::message('News was successfully updated');
         return \Redirect::route('admin.curriculum.edit', $category);
     } catch (ValidationException $e) {
         return \Redirect::route('admin.curriculum.edit', $category)->withInput()->withErrors($e->getErrors());
     }
 }
Beispiel #3
0
 /**
  * Create a new user controller instance.
  *
  * @return void
  */
 public function __construct()
 {
     $this->priviledge_user();
     $this->_user = \Auth::user();
     if (2 == $this->_user->role_id) {
         $this->_query_connect = "=";
         $this->_query_value = $this->_user->department_id;
     }
     $this->_schedule_masters = Master::orderBy('id', 'desc')->lists('name', 'id');
     $this->_schedule_curriculums = Curriculum::all();
     $this->_schedule_rooms = Room::orderBy('id', 'desc')->lists('name', 'id');
 }
Beispiel #4
0
 /**
  * Get the validation rules that apply to the request.
  *
  * @return array
  */
 public function rules()
 {
     $curriculum = Curriculum::find($this->curriculums);
     switch ($this->method()) {
         case 'GET':
         case 'DELETE':
             return [];
         case 'POST':
             return ['name' => 'required|max:254', 'description' => 'required'];
         case 'PUT':
         case 'PATCH':
             return ['name' => 'required|max:254', 'description' => 'required'];
         default:
             break;
     }
 }
Beispiel #5
0
 public function saveCurriculum(Request $req)
 {
     $guid = Uuid::uuid();
     $curriculum = new Curriculum();
     $curriculum->curriculum_guid = $guid;
     $curriculum->course = $req->course;
     $curriculum->major = $req->major;
     $curriculum->effective_sy = $req->effective;
     $curriculum->years_taken = $req->years_taken;
     $curriculum->bor_res = $req->bor;
     $curriculum->save();
     return Base32::encode($guid);
 }
Beispiel #6
0
 public function prospectus($year, $guid)
 {
     $cur = Base32::decode($guid);
     $curriculum = Curriculum::with('getCourse', 'getMajor')->where('curriculum_guid', $cur)->get()->first();
     $subjects = Prospectus::with('getCatalog')->where('curriculum', $cur)->where('year', $year)->get();
     $semester = array('first' => Prospectus::with('getCatalog')->where('curriculum', $cur)->where('year', $year)->where('semester', 'first')->count(), 'second' => Prospectus::with('getCatalog')->where('curriculum', $cur)->where('year', $year)->where('semester', 'second')->count(), 'summer' => Prospectus::with('getCatalog')->where('curriculum', $cur)->where('year', $year)->where('semester', 'summer')->count());
     return view('admin.prospectus', compact('curriculum', 'subjects', 'year', 'semester'));
     //return compact('curriculum', 'subjects', 'year', 'semester');
 }
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function show($id)
 {
     $cv = Curriculum::findOrFail($id);
     return view('bdt-consulta-show', ["cv" => $cv]);
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     Curriculum::destroy($id);
     return redirect('/curriculums');
 }