public function getIndex()
 {
     $breadcrumbs = array(array('Kompetensi' => ""), array('Realiasi' => ""), array('Diklat' => ""));
     $diklat = DiklatEvaluasi::all();
     $page = DiklatEvaluasi::paginate(5);
     set_time_limit(0);
     $user = Auth::user();
     //ambil jabatan
     $riwJabatan = RiwJabStruk::getJabatanOnCompetency($this->competencyData->date_start, $user->nip);
     //return $riwJabatan;
     //ambil detail user
     $masterPegawai = MasterPegawai::getDetailbyDate($this->competencyData->date_start, $user->nip);
     if ($riwJabatan != false) {
         $profileSoft = CompetencyProfile::getProfilebyJabatan($riwJabatan->unit_staf_id, 1)->get();
         $profileBusiness = CompetencyProfile::getProfilebyJabatan($riwJabatan->unit_staf_id, 2)->get();
         $competencyType = CompetencyType::all();
         $data = array();
         foreach ($competencyType as $rowType) {
             $profile = CompetencyProfile::getProfile($riwJabatan->unit_staf_id, $this->competencyData->id, $rowType->id);
             $data[] = array('type' => array('id' => $rowType->id, 'name' => $rowType->name), 'profile' => $profile);
         }
         //return $data;
         $this->layout->breadcrumbs = View::make('layouts.breadcrumb', compact('breadcrumbs'));
         $this->layout->content = View::make('development::userrealisasidiklat.index', compact('data', 'masterPegawai', 'diklat', 'page'));
     }
 }
 public function getIndex()
 {
     set_time_limit(0);
     $user = Auth::user();
     $breadcrumbs = array(array('Kompetensi' => ""), array('Realiasi' => ""), array('Diklat' => ""));
     $prioritas = PreoritasDiklat::all();
     //ambil jabatan
     $riwJabatan = RiwJabStruk::getJabatanOnCompetency($this->competencyData->date_start, $user->nip);
     // return $riwJabatan;
     //ambil detail user
     $masterPegawai = MasterPegawai::getDetailbyDate($this->competencyData->date_start, $user->nip);
     if ($riwJabatan != false) {
         $profileSoft = CompetencyProfile::getProfilebyJabatan($riwJabatan->unit_staf_id, 1)->get();
         $profileBusiness = CompetencyProfile::getProfilebyJabatan($riwJabatan->unit_staf_id, 2)->get();
         $competencyType = CompetencyType::all();
         $data = array();
         foreach ($competencyType as $rowType) {
             $profile = CompetencyProfile::getProfile($riwJabatan->unit_staf_id, $this->competencyData->id, $rowType->id);
             $data[] = array('type' => array('id' => $rowType->id, 'name' => $rowType->name), 'profile' => $profile);
         }
         //  $db = DB::table('db_pegawai.master_pegawai')->get();
         //return $db;
         //ambil data recap individual
         $preoritask = DB::table('competency_recap_individuals')->join('competency_recaps', 'competency_recap_individuals.competency_recap_id', '=', 'competency_recaps.id')->join('competency_dictionaries', 'competency_recap_individuals.competency_dictionary_id', '=', 'competency_dictionaries.id')->join('db_pegawai.master_pegawai', 'db_pegawai.master_pegawai.nip', '=', 'competency_recaps.user_nip')->join('db_pegawai.daf_unit_staf', 'db_pegawai.daf_unit_staf.unit_staf_id', '=', 'competency_recaps.occupation_id')->select(db::RAW('round(min(competency_recap_individuals.gap),2) as gap, count(competency_recaps.user_nip) as nip'), 'competency_recap_individuals.rcl', 'competency_recap_individuals.itj', 'competency_recap_individuals.ccl', 'competency_recap_individuals.gap', 'competency_recaps.id', 'db_pegawai.master_pegawai.nip', 'db_pegawai.daf_unit_staf.nama_lengkap', 'competency_dictionaries.id')->orderBy('rcl', 'asc')->orderBy('itj', 'desc')->groupBy('competency_dictionary_id')->paginate(8);
         $this->layout->breadcrumbs = View::make('layouts.breadcrumb', compact('breadcrumbs'));
         $this->layout->content = View::make('development::useridentificationdiklat.index', compact('data', 'masterPegawai', 'deputi', 'unit', 'prioritas', 'preoritask'));
     }
 }
Beispiel #3
0
 public static function getUser($competencyDateStart, $jabatan)
 {
     $user = RiwJabStruk::with('pegawai')->where('unit_staf_id', $jabatan)->where('tmt_mulai', '<=', $competencyDateStart)->where(function ($query) use($competencyDateStart) {
         $query->where('tmt_selesai', '>=', $competencyDateStart)->orWhere('tmt_selesai', '=', '0000-00-00');
     })->first();
     if ($user != null) {
         return $user;
     } else {
         return null;
     }
 }
Beispiel #4
0
 public static function getDetailbyDate($date, $nip)
 {
     $jabatan = RiwJabStruk::with('jabatan', 'pegawai', 'jabatan.unit')->where('nip', '=', $nip)->where('tmt_mulai', '<=', $date)->where(function ($query) use($date) {
         $query->where('tmt_selesai', '>=', $date)->orWhere('tmt_selesai', '=', '0000-00-00');
     })->orderBy('tmt_mulai', 'DESC')->first();
     if (count($jabatan) > 0) {
         return $jabatan;
     } else {
         return null;
     }
 }
 public function getIndex()
 {
     $breadcrumbs = array(array("Kompetensi" => ""), array("Profil Kompetensi" => ""));
     set_time_limit(0);
     $user = Auth::user();
     //get jabatan
     $riwJabatan = RiwJabStruk::getJabatanOnCompetency($this->competencyData->date_start, $user->nip);
     //get user detail
     $masterPegawai = MasterPegawai::getDetailbyDate($this->competencyData->date_start, $user->nip);
     if ($riwJabatan != false) {
         $profileSoft = CompetencyProfile::getProfilebyJabatan($riwJabatan->unit_staf_id, 1)->get();
         $profileBusiness = CompetencyProfile::getProfilebyJabatan($riwJabatan->unit_staf_id, 2)->get();
         $competencyType = CompetencyType::all();
         $data = array();
         foreach ($competencyType as $rowType) {
             $profile = CompetencyProfile::getProfile($riwJabatan->unit_staf_id, $this->competencyData->id, $rowType->id);
             $data[] = array('type' => array('id' => $rowType->id, 'name' => $rowType->name), 'profile' => $profile);
         }
         //            return $data;
         $this->layout->breadcrumbs = View::make('layouts.breadcrumb', compact('breadcrumbs'));
         $this->layout->content = View::make('competency::profile.index', compact('data', 'masterPegawai'));
     }
 }
 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'));
 }
Beispiel #7
0
 public function peersAction($typeId, $step = 1)
 {
     $page = $step - 1;
     if (Request::isMethod('post')) {
     } else {
         //data dari session
         $nip = Auth::user()->nip;
         $jabatan = RiwJabStruk::getJabatanOnCompetency($this->competencyData->date_start, $nip);
         //cek peers
         $peers = CompetencyPeers::getSoftPeers($this->competencyData->id, $nip);
         if ($peers != null) {
             //get jabatan Array
             $jabatanArray = RiwJabStruk::getJabatanofPeers($this->competencyData->date_start, $peers);
             //get profile by jabatan Array
             $profiles = CompetencyProfile::getProfilefromPeers($this->competencyData->id, $jabatanArray, $typeId)->take(1)->skip($page)->first();
             //get jabatan from profiles
             $jabatanProfile = CompetencyProfile::getJabatanfromProfile($this->competencyData->id, $profiles->competency_dictionary_id);
             //get user detail from jabatan
             $jabatan = array_intersect($jabatanArray, $jabatanProfile);
             $users = RiwJabStruk::getUserfromJabatan($this->competencyData->date_start, $jabatan);
             $this->layout->content = View::make('competency::test.peers', compact('profiles', 'users'));
         } else {
             dd('error');
         }
     }
 }
 public function postUpdate($dictionary_id, $peersNip)
 {
     $userNip = Auth::user()->nip;
     $pegawai = MasterPegawai::find($peersNip);
     // cek memiliki recap_id atau enggak
     $recap = CompetencyRecap::where('competency_id', '=', $this->competencyData->id)->where('user_nip', '=', $pegawai->nip)->first();
     if (is_null($recap)) {
         //get jabatan
         $riwJabatan = RiwJabStruk::getJabatanOnCompetency($this->competencyData->date_start, $pegawai->nip);
         $recap = new CompetencyRecap();
         $recap->competency_id = $this->competencyData->id;
         $recap->user_nip = $pegawai->nip;
         $recap->occupation_id = $riwJabatan->unit_staf_id;
         $recap->save();
     }
     //simpan ke dalam database
     $test = new CompetencyTest();
     $test->competency_id = $this->competencyData->id;
     $test->competency_recap_id = $recap->id;
     $test->competency_dictionary_id = Input::get('compId');
     $test->user_id = $pegawai->nip;
     $test->rater_id = $userNip;
     $test->level = Input::get('level');
     $test->evidence = Input::get('evidence');
     if ($test->save()) {
         return Redirect::to('competency/progress/prs');
     }
 }