コード例 #1
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');
     }
 }
コード例 #2
0
ファイル: peers.blade.php プロジェクト: hendrilara/kemenpan
                                            <div class="tab-pane @if($j == 0)active@endif" id="type{{ $rowData['type']['id'] }}">
                                                <table class="table table-bordered table-striped table-advance table-hover">
                                                    <thead>
                                                    <tr>
                                                        <th>Kode</th>
                                                        <th>Judul</th>
                                                        <th>Evidence</th>
                                                        <th>Level</th>
                                                        <th>Aksi</th>
                                                    </tr>
                                                    </thead>
                                                    <tbody>
                                                    @if(count($rowData['profile']) > 0)
                                                        @foreach($rowData['profile'] as $rowProfile)
                                                            <?php 
$answer = \Meniqa\Competency\Models\CompetencyTest::checkTest($rowProfile->competency_dictionary_id, $key['nip'], Auth::user()->nip);
?>
                                                            <tr>
                                                                <td>{{ $rowProfile->code }}</td>
                                                                <td>{{ $rowProfile->title }}</td>
                                                                <td>@if(!is_null($answer)){{ $answer->evidence }}@else -- @endif</td>
                                                                <td>@if(!is_null($answer)){{ $answer->dictionarylevel->title }}@else -- @endif</td>
                                                                <td>
                                                                    @if(is_null($answer))
                                                                        <a href="{{ url('competency/test/prs/update/'.$rowProfile->competency_dictionary_id.'/'.$key['nip']) }}" class="btn btn-primary"><i class="fa fa-edit"></i> Isi Data</a>
                                                                    @endif
                                                                </td>
                                                            </tr>
                                                        @endforeach
                                                    @endif
                                                    </tbody>
コード例 #3
0
 public function action($typeId, $step = 1)
 {
     $page = $step - 1;
     if (Request::isMethod('post')) {
         //cek
         // create the validation rules ------------------------
         $rules = array('level' => 'required', 'evidence' => 'required');
         // create custom validation messages ------------------
         $messages = array('required' => 'form :attribute wajib diisi.');
         $validator = Validator::make(Input::all(), $rules, $messages);
         if ($validator->fails()) {
         } else {
             $userNip = Auth::user()->nip;
             $userId = Auth::user()->id;
             // cek memiliki recap_id atau enggak
             $recap = CompetencyRecap::where('competency_id', '=', $this->competencyId)->where('user_id', '=', $userId)->where('user_nip', '=', $userNip)->first();
             if (is_null($recap)) {
                 $recap = new CompetencyRecap();
                 $recap->competency_id = $this->competencyId;
                 $recap->user_id = $userId;
                 $recap->user_nip = $userNip;
                 $recap->occupation_id = '';
                 $recap->save();
             }
             //simpan ke dalam database
             $test = new CompetencyTest();
             $test->competency_id = $this->competencyId;
             $test->competency_recap_id = $recap->id;
             $test->competency_dictionary_id = Input::get('compId');
             $test->user_id = $userId;
             $test->rater_id = $userId;
             $test->level = Input::get('level');
             $test->evidence = Input::get('evidence');
             if ($test->save()) {
                 $newStep = $step + 1;
                 return Redirect::to('competency/test/inv/' . $typeId . '/' . $newStep . '');
             }
         }
     } else {
         //data dari session
         $nip = Auth::user()->nip;
         //cek data master golongan
         $userData = CompetencyHistoryUser::where('nip', $nip)->where('competency_id', $this->competencyId)->first();
         $jabatan = RiwJabStruk::getJabatanOnCompetency($this->competencyData->date_start, $nip);
         //getProfile
         $profiles = CompetencyProfile::getProfilebyJabatan($jabatan->unit_staf_id, $typeId)->take(1)->skip($page)->first();
         //            //jika ada fung_id maka tidak menggunakan struk_id
         //            if($userData->fung_id != 0){
         //                //get profile
         //                $profiles = CompetencyProfile::with('competencyDictionary', 'competencyDictionary.level')
         //                    ->join('competency_dictionaries', 'competency_profiles.competency_dictionary_id', '=', 'competency_dictionaries.id')
         //                    ->where('competency_dictionaries.type_id', '=', $typeId)
         //                    ->where('struktural_id', '=', $userData->struk_id)
         //                    ->where('jabatan_id', '=', $userData->unit_id)
         //                    ->groupBy('competency_dictionary_id')
         //                    ->take(1)
         //                    ->skip($page)
         //                    ->first();
         //            }else {
         //                //get profile
         //                $profiles = CompetencyProfile::with('competencyDictionary', 'competencyDictionary.level')
         //                    ->join('competency_dictionaries', 'competency_profiles.competency_dictionary_id', '=', 'competency_dictionaries.id')
         //                    ->where('competency_dictionaries.type_id', '=', $typeId)
         //                    ->where('fungsional_id', '=', $userData->fung_id)
         //                    ->where('jabatan_id', '=', $userData->unit_id)
         //                    ->groupBy('competency_dictionary_id')
         //                    ->take(1)
         //                    ->skip($page)
         //                    ->first();
         //            }
         $this->layout->content = View::make('competency::test.individu', compact('profiles'));
     }
 }
コード例 #4
0
ファイル: peers.blade.php プロジェクト: hendrilara/kemenpan
                            <td>Nomor</td>
                            <td>Nama</td>
                            <td colspan="6">Pilihan</td>
                        </tr>
                        </thead>
                        <tbody>
                        <?php 
$i = 1;
?>
                        @foreach($users as $user)
                            <tr>
                                <td>{{ $i++ }}</td>
                                <td> {{ $user->pegawai->nama_cetak }} </td>
                                <?php 
//mencari value dari jawaban sebelum nya
$answer = \Meniqa\Competency\Models\CompetencyTest::where('competency_id', '=', $competencyId)->where('rater_id', '=', Auth::user()->nip)->where('user_id', '=', $user->pegawai->nip)->where('competency_dictionary_id', '=', $profiles->competencyDictionary->id)->first();
?>
                                @foreach($profiles->competency_dictionary->level as $level)
                                    <td><input type="radio" name="level[{{ $user->pegawai->nip }}]" value="{{ $level->value }}" required  @if((!is_null($answer)) && (!is_null($answer->level)) && ($answer->level == $level->value)) checked="checked" @endif /> {{ $level->id }}</td>
                                @endforeach
                            </tr>
                        @endforeach
                        </tbody>
                    </table>

                </li>

                <li class="list-group-item">
                    <button type="submit" class="btn btn-primary"> Selanjutnya </button>
                </li>
コード例 #5
0
 public static function checkTest($dictionaryId, $userId, $raterId)
 {
     $test = CompetencyTest::with('dictionarylevel')->where('competency_dictionary_id', '=', $dictionaryId)->where('user_id', '=', $userId)->where('rater_id', '=', $raterId)->first();
     return $test;
 }
コード例 #6
0
 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');
     }
 }
コード例 #7
0
ファイル: check.blade.php プロジェクト: hendrilara/kemenpan
                <div class="tab-pane" id="hard">
                    <table class="table table-bordered table-responsive table-striped">
                        <thead>
                        <tr>
                            <th>Kode Kompetensi</th>
                            <th>Nama Kompetensi</th>
                            <th>Level</th>
                            <th>Evidence</th>
                        </tr>
                        </thead>
                        <tbody>
                        @foreach($hardProfiles as $profile)
                        <tr>
                            <th><a href="{{ url('competency/dictionary/detail/'.$profile->competency_dictionary->id.'') }}">{{ $profile->competency_dictionary->code }}</a></th>
                            <th>{{ $profile->competency_dictionary->title }}</th>
                            <?php 
$test = \Meniqa\Competency\Models\CompetencyTest::where('user_id', '=', $userId)->where('rater_id', '=', $userId)->where('competency_dictionary_id', '=', $profile->competency_dictionary->id)->first();
?>
                            <th>@if(is_null($test)) - @else {{ $test->level }}@endif</th>
                            <th>@if(is_null($test)) - @else {{ $test->evidence }}@endif</th>
                        </tr>
                        @endforeach
                        </tbody>
                    </table>
                </div>
            </div>

        </div>
    </section>
</div>
@stop