예제 #1
0
 public function anyIndex()
 {
     $breadcrumbs = array(array("Kompetensi" => url("admin/competency/type")), array("Kolega & bawahan" => ""));
     $competencyActive = Competency::getActive();
     //list karyawan
     if (Input::has('keyword')) {
         $pegawai = MasterPegawai::where('master_pegawai.nip', 'like', '%' . Input::get('keyword') . '%')->orWhere('master_pegawai.nama', 'like', '%' . Input::get('keyword') . '%')->mastertoDafunitStaff($competencyActive)->paginate(10);
     } else {
         $pegawai = MasterPegawai::mastertoDafUnitStaff($competencyActive)->paginate(10);
     }
     //        return $pegawai;
     //list jabatan
     $jabatan = DafUnitStaff::all();
     $this->layout->breadcrumbs = View::make('layouts.breadcrumb', compact('breadcrumbs'));
     $this->layout->content = View::make('competency::adminPeers.index', compact('pegawai', 'jabatan', 'competencyActive'));
 }
예제 #2
0
 public function index()
 {
     $units = DafUnitStaff::all();
     if (Request::isMethod('post')) {
         // create the validation rules ------------------------
         $rules = array('unit' => 'required');
         // validate against the inputs from our form
         $validator = Validator::make(Input::all(), $rules);
         if ($validator->fails()) {
             // get the error messages from the validator
             $messages = $validator->messages();
             // redirect our user back to the form with the errors from the validator
             return Redirect::back()->withErrors($messages);
         } else {
             $unit = DafUnitStaff::where('unit_staf_id', Input::get('unit'))->first();
             $softProfiles = CompetencyProfile::with('competencyDictionary')->join('competency_dictionaries', 'competency_profiles.competency_dictionary_id', '=', 'competency_dictionaries.id')->where('competency_dictionaries.type_id', '=', '1')->where('jabatan_id', '=', Input::get('unit'))->groupBy('competency_dictionary_id')->get();
             $hardProfiles = CompetencyProfile::with('competencyDictionary')->join('competency_dictionaries', 'competency_profiles.competency_dictionary_id', '=', 'competency_dictionaries.id')->where('competency_dictionaries.type_id', '=', '2')->where('jabatan_id', '=', Input::get('unit'))->groupBy('competency_dictionary_id')->get();
             //                return $profiles;
             $this->layout->content = View::make('competency::profile.postindex', compact('units', 'unit', 'softProfiles', 'hardProfiles'));
         }
     } else {
         $this->layout->content = View::make('competency::profile.index', compact('units'));
     }
 }