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'));
 }
 public function getOfflinetest()
 {
     //q1 => jabatan_id
     $dataScheduleActive = Competency::where('status', '=', 'active')->first();
     $dataJabatan = DafUnitStaff::where('aktif_id', '=', 1)->get();
     $dataProfile = null;
     if (Input::has('q1')) {
         $jabatanTerpilih = DafUnitStaff::where('unit_staf_id', Input::get('q1'))->first();
         $dataProfile = CompetencyProfile::with('competencyDictionary.competencyType', 'competencyDictionary.level')->where('competency_id', '=', $dataScheduleActive->id)->where('jabatan_id', '=', Input::get('q1'))->get();
         //            return $jabatanTerpilih;
         $html = View::make('competency::adminProfile.downloadoffflinetest', compact('dataProfile', 'jabatanTerpilih'));
         return PDF::load($html, 'A4', 'portrait')->download('offline test competency');
     } else {
         $this->layout->content = View::make('competency::adminProfile.offlineTest', compact('dataScheduleActive', 'dataJabatan'));
     }
 }
Esempio n. 3
0
 public function getPrs()
 {
     $breadcrumbs = array(array("Kompetensi" => ""), array("Pengukuran" => ""), array("Kemajuan" => ""), array("Orang Lain" => ""));
     $user = Auth::user();
     //list Peers
     $listPeers = CompetencyPeers::with('user', 'rater')->where('rater_id', '=', $user->nip)->where(function ($query) {
         $query->where('status', '=', 'kolega');
         //                    ->orWhere('status', '=', 'customer');
     })->get();
     $riwJabatan = RiwJabStruk::getJabatanOnCompetency($this->competencyData->date_start, $user->nip);
     $bawahan = DafUnitStaff::with('bawahan.bawahan')->where('unit_staf_id', '=', $riwJabatan->unit_staf_id)->first();
     $atasan = DafUnitStaff::with('atasan')->where('unit_staf_id', '=', $riwJabatan->unit_staf_id)->first();
     $data = array();
     $competencyType = CompetencyType::all();
     foreach ($listPeers as $peers) {
         //get jabatan
         $riwJabatan = RiwJabStruk::getJabatanOnCompetency($this->competencyData->date_start, $peers->user_id);
         $totalProfile = count(CompetencyProfile::getProfileAll($riwJabatan->unit_staf_id, $this->competencyData->id));
         $checkProfile = count(CompetencyProfile::checkTestPrs($peers->user_id, $user->nip, $riwJabatan->unit_staf_id, $this->competencyData->id));
         $result = array();
         foreach ($competencyType as $rowType) {
             $profile = CompetencyProfile::getProfile($riwJabatan->unit_staf_id, $this->competencyData->id, $rowType->id);
             $result[] = array('type' => array('id' => $rowType->id, 'name' => $rowType->name), 'profile' => $profile);
         }
         $data[] = array('id' => $peers->id, 'nip' => $peers->user_id, 'nama' => $peers->user->nama, 'status' => $peers->status, 'progress' => "" . $totalProfile - $checkProfile . " pengisian dari " . $totalProfile . " kompetensi", 'data' => $result);
     }
     //list bawahan level 1 & 2
     if (isset($bawahan->bawahan) && $bawahan->bawahan != null) {
         foreach ($bawahan->bawahan as $rowBawahanlvl1) {
             //get user
             $userBawahan = RiwJabStruk::getUser($this->competencyData->date_start, $rowBawahanlvl1->unit_staf_id);
             if (isset($userBawahan) && $userBawahan != null) {
                 $riwJabatan = RiwJabStruk::getJabatanOnCompetency($this->competencyData->date_start, $userBawahan->nip);
                 $totalProfile = count(CompetencyProfile::getProfileAll($riwJabatan->unit_staf_id, $this->competencyData->id));
                 $checkProfile = count(CompetencyProfile::checkTestPrs($userBawahan->nip, $user->nip, $riwJabatan->unit_staf_id, $this->competencyData->id));
                 $result = array();
                 foreach ($competencyType as $rowType) {
                     $profile = CompetencyProfile::getProfile($riwJabatan->unit_staf_id, $this->competencyData->id, $rowType->id);
                     $result[] = array('type' => array('id' => $rowType->id, 'name' => $rowType->name), 'profile' => $profile);
                 }
                 $data[] = array('id' => $userBawahan->nip, 'nip' => $userBawahan->nip, 'nama' => $userBawahan->pegawai->nama, 'status' => 'bawahan level 1', 'progress' => "" . $totalProfile - $checkProfile . " pengisian dari " . $totalProfile . " kompetensi", 'data' => $result);
             }
             //list bawahan level 2
             if (isset($bawahan->bawahan->bawahan) && $bawahan->bawahan->bawahan != null) {
                 foreach ($bawahan->bawahan as $rowBawahanlvl2) {
                     //get user
                     $userBawahan = RiwJabStruk::getUser($this->competencyData->date_start, [$rowBawahanlvl2->unit_staf_id]);
                     if (isset($userBawahan) && $userBawahan != null) {
                         $riwJabatan = RiwJabStruk::getJabatanOnCompetency($this->competencyData->date_start, $userBawahan->nip);
                         $totalProfile = count(CompetencyProfile::getProfileAll($riwJabatan->unit_staf_id, $this->competencyData->id));
                         $checkProfile = count(CompetencyProfile::checkTestPrs($userBawahan->nip, $user->nip, $riwJabatan->unit_staf_id, $this->competencyData->id));
                         $result = array();
                         foreach ($competencyType as $rowType) {
                             $profile = CompetencyProfile::getProfile($riwJabatan->unit_staf_id, $this->competencyData->id, $rowType->id);
                             $result[] = array('type' => array('id' => $rowType->id, 'name' => $rowType->name), 'profile' => $profile);
                         }
                         $data[] = array('id' => $userBawahan->nip, 'nip' => $userBawahan->nip, 'nama' => $userBawahan->pegawai->nama, 'status' => 'bawahan level 2', 'progress' => "" . $totalProfile - $checkProfile . " pengisian dari " . $totalProfile . " kompetensi", 'data' => $result);
                     }
                 }
             }
         }
     }
     //list atasan
     if (isset($atasan->atasan) && $atasan->atasan != null) {
         $rowAtasan = $atasan->atasan;
         //get user
         $userBawahan = RiwJabStruk::getUser($this->competencyData->date_start, $rowAtasan->unit_staf_id);
         if (isset($userBawahan) && $userBawahan != null) {
             $riwJabatan = RiwJabStruk::getJabatanOnCompetency($this->competencyData->date_start, $userBawahan->nip);
             $totalProfile = count(CompetencyProfile::getProfileAll($riwJabatan->unit_staf_id, $this->competencyData->id));
             $checkProfile = count(CompetencyProfile::checkTestPrs($userBawahan->nip, $user->nip, $riwJabatan->unit_staf_id, $this->competencyData->id));
             $result = array();
             foreach ($competencyType as $rowType) {
                 $profile = CompetencyProfile::getProfile($riwJabatan->unit_staf_id, $this->competencyData->id, $rowType->id);
                 $result[] = array('type' => array('id' => $rowType->id, 'name' => $rowType->name), 'profile' => $profile);
             }
             $data[] = array('id' => $userBawahan->nip, 'nip' => $userBawahan->nip, 'nama' => $userBawahan->pegawai->nama, 'status' => 'atasan', 'progress' => "" . $totalProfile - $checkProfile . " pengisian dari " . $totalProfile . " kompetensi", 'data' => $result);
         }
     }
     //        return $data;
     $this->layout->breadcrumbs = View::make('layouts.breadcrumb', compact('breadcrumbs'));
     $this->layout->content = View::make('competency::progress.peers', compact('data'));
 }
Esempio n. 4
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'));
     }
 }