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'));
     }
 }
Пример #2
0
 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'));
     }
 }
Пример #3
0
 public function postIndex()
 {
     //        return Input::all();
     $competency = Competency::getActive();
     $totalCompetency = 0;
     $totalValue = 0;
     if (count($competency) > 0) {
         //list recap
         $listRecap = CompetencyRecap::getlistAll($competency->id);
         foreach ($listRecap as $recap) {
             //clean recap individual
             DB::table('competency_recap_individuals')->where('competency_recap_id', $recap->id)->delete();
             //get profile
             $sql = "SELECT c.competency_dictionary_id,c.rcl,c.itj,b.user_nip,a.level,d.value FROM competency_tests a, competency_dictionary_levels d, competency_recaps b RIGHT JOIN competency_profiles c on c.jabatan_id=b.occupation_id WHERE a.level=d.id AND a.competency_recap_id=b.id AND a.competency_dictionary_id=c.competency_dictionary_id AND b.competency_id=" . $competency->id . " and b.id=" . $recap->id . "";
             $arr = DB::select(DB::raw($sql));
             $arr = CompetencyProfile::getProfilefromRecapNip($recap->user_nip);
             $total = 0;
             foreach ($arr as $row) {
                 $test = CompetencyTest::getAvgTest($row->competency_dictionary_id, $recap->user_nip);
                 $recapInv = new CompetencyRecapIndividuals();
                 $recapInv->competency_recap_id = $recap->id;
                 $recapInv->competency_dictionary_id = $row->competency_dictionary_id;
                 $recapInv->rcl = $row->rcl;
                 $recapInv->itj = $row->itj;
                 $recapInv->ccl = $test->lvl;
                 $recapInv->gap = $test->lvl - $row->rcl;
                 $recapInv->priority = ($test->lvl - $row->rcl) * $row->itj;
                 $recapInv->save();
                 if ($recapInv->gap >= 0) {
                     $total = $total + 1;
                 }
             }
             $updateRecap = CompetencyRecap::find($recap->id);
             if ($total == 0) {
                 $updateRecap->total = 0;
             } else {
                 $updateRecap->total = $total / count($arr) * 100;
             }
             $updateRecap->save();
             $totalCompetency = $totalCompetency + count($arr);
             $totalValue = $totalValue + $total;
         }
         //update Competency
         $updateCompetency = Competency::find($competency->id);
         if ($totalValue == 0) {
             $updateCompetency->value = 0;
         } else {
             $updateCompetency->value = $totalValue / $totalCompetency * 100;
         }
         $updateCompetency->save();
         return Redirect::to('admin/competency/recap/result');
     } else {
         dd('fatal error');
     }
 }
Пример #4
0
 public function postIndex()
 {
     $nip = Auth::user()->nip;
     $competency = Competency::all();
     $recap = CompetencyRecap::with('competency')->where('competency_id', '=', Input::get('competency_id'))->where('user_nip', '=', $nip)->first();
     $competencyType = CompetencyType::all();
     $masterPegawai = MasterPegawai::getDetailbyDate($recap->competency->date_start, $nip);
     foreach ($competencyType as $rowCT) {
         $profiles = CompetencyProfile::getProfilebyRecapType($recap->user_nip, $rowCT->id);
         $result[] = array('name' => $rowCT->name, 'data' => $profiles);
     }
     //        return $result;
     $this->layout->content = View::make('competency::result.index', compact('competency', 'recap', 'result', 'masterPegawai'));
 }
 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'));
     }
 }
Пример #6
0
 public function getProfile()
 {
     $rules = array('competency' => 'required', 'type' => 'required');
     $validator = Validator::make(Input::all(), $rules);
     if ($validator->fails()) {
         dd(Input::all());
         Redirect::back()->with('errorMessage', 'inputan salah');
     } else {
         $competencies = Competency::all();
         $competencyTypes = CompetencyType::all();
         $type = Input::get('type');
         $competency = Input::get('competency');
         $nip = Auth::user()->nip;
         $profile = CompetencyProfile::getProfile($nip, $competency, $type)->get();
         //            return $profile;
         $this->layout->content = View::make('competency::userprofile.index', compact('competencies', 'competencyTypes', 'profile'));
     }
 }
Пример #7
0
 public function downloadUnit($idUnit)
 {
     $unit = DafUnit::find($idUnit);
     //        $profiles = CompetencyProfile::with(['competencyDictionary' => function($q) use($idUnit) {
     //
     //            }])->where('jabatan_id', '=', $idUnit)->get();
     $profiles = CompetencyProfile::with(['competencyDictionary' => function ($q) use($idUnit) {
         $q->with('level')->get();
     }])->where('jabatan_id', '=', $idUnit)->get();
     if (count($profiles) > 0) {
         //            echo "<pre>";
         //            print_r($profiles) ;
         return $profiles;
         //            $dictionaries = CompetencyDictionary::with('competencyType', 'kopet', 'child', 'level')->take('20')->get();
         $html = View::make('competency::dictionary.unitDownload', compact('profiles'));
         //            return $html;
         return PDF::load($html, 'A4', 'portrait')->show($unit->nama);
     } else {
         dd('tidak memiliki kompetensi');
     }
 }
Пример #8
0
                    <table class="table table-bordered table-striped table-advance table-hover">
                        <thead>
                        <tr>
                            <th>Nama</th>
                            <th>Kemajuan</th>
                            <th style="width: 15%">Aksi</th>
                        </tr>
                        </thead>
                        <tbody>
                        @foreach ($listData as $data)
                            <tr>
                                <td> {{ $data->name }} </td>
                                <td>
                                    <?php 
$totalProfile = count(\Meniqa\Competency\Models\CompetencyProfile::getProfile($riwJabatan->unit_staf_id, $competencyData->id, $data->id));
$checkProfile = count(\Meniqa\Competency\Models\CompetencyProfile::checkTestInv($user->nip, $riwJabatan->unit_staf_id, $competencyData->id, $data->id));
?>
                                    {{ $totalProfile - $checkProfile }} pengisian dari {{ $totalProfile }} kompetensi
                                </td>
                                <td>
                                    <a href="{{ url('competency/test/inv/type/'.$data->id) }}" class="btn btn-primary"><i class="fa fa-edit"></i> Pengukuran</a>
                                </td>
                            </tr>
                        @endforeach
                        </tbody>
                    </table>
                </div>
            </section>
        </div>
    </div>
Пример #9
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'));
 }
Пример #10
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');
         }
     }
 }
Пример #11
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'));
     }
 }
Пример #12
0
 /**
  * @param $competencyId
  * @param $competencyDictionaryId
  * @return array|null
  */
 public static function getJabatanfromProfile($competencyId, $competencyDictionaryId)
 {
     $profiles = CompetencyProfile::where('competency_id', '=', $competencyId)->where('competency_dictionary_id', '=', $competencyDictionaryId)->get();
     if ($profiles->count()) {
         $jabatanArray = array();
         foreach ($profiles as $profile) {
             $jabatanArray[] = $profile->jabatan_id;
         }
         return $jabatanArray;
     } else {
         return null;
     }
 }
Пример #13
0
 public function getAction($type, $id)
 {
     $user = Auth::user();
     $peers = CompetencyPeers::find($id);
     if ($peers != null) {
         //get User
         $pegawai = MasterPegawai::find($peers->user_id);
     } else {
         $pegawai = MasterPegawai::find($id);
     }
     //get jabatan
     $riwJabatan = RiwJabStruk::getJabatanOnCompetency($this->competencyData->date_start, $pegawai->nip);
     if ($riwJabatan != false) {
         $profile = CompetencyProfile::getTestPrs($pegawai->nip, $user->nip, $riwJabatan->unit_staf_id, $this->competencyData->id, $type);
         $totalProfile = count(CompetencyProfile::getProfile($riwJabatan->unit_staf_id, $this->competencyData->id, $type));
         $checkProfile = count(CompetencyProfile::checkTestPrsType($pegawai->nip, $user->nip, $riwJabatan->unit_staf_id, $this->competencyData->id, $type));
         $this->layout->content = View::make('competency::testPrs.type', compact('profile', 'pegawai', 'totalProfile', 'checkProfile'));
     }
 }