diff --git a/ppl2/app/Http/Controllers/PendFormalController.php b/ppl2/app/Http/Controllers/PendFormalController.php index b25ea01af485594d261f0c2c1e571f0681d4d2e5..3ff71d6beae42cc9985efeb1b2266d1280226259 100644 --- a/ppl2/app/Http/Controllers/PendFormalController.php +++ b/ppl2/app/Http/Controllers/PendFormalController.php @@ -10,6 +10,8 @@ use App\PendidikanFormal; use Session; +use DB; + class PendFormalController extends Controller { // @@ -21,9 +23,19 @@ class PendFormalController extends Controller public function getPendidikan($nip) { $pend = PendidikanFormal::where('nip',$nip)->get(); - return view('pages.pendidikanPegawai',compact('pend','nip'));; + return view('pages.pendidikanPegawai',compact('pend','nip')); } + public function getStatistikStrata() { + $pend = DB::table('pendidikan_formal') + ->select(DB::raw('count(*) as jumlah, tingkatan')) + ->groupBy('tingkatan') + ->get(); + $nip = null; + return $pend; + } + + public function edit($id) { $pend = PendidikanFormal::find($id); return view('pages.editFormal', compact('pend')); diff --git a/ppl2/app/Http/routes.php b/ppl2/app/Http/routes.php index d9d6066c516824d8112f53d7f12e171089842bde..a353246f7980a0f3212a0454a10e514bce0cbcce 100644 --- a/ppl2/app/Http/routes.php +++ b/ppl2/app/Http/routes.php @@ -27,6 +27,8 @@ Route::get('pendidikan-formal/{id}/edit','PendFormalController@edit'); Route::get('pendidikan-formal/all/{nip}','PendFormalController@getPendidikan'); +Route::get('pendidikan-formal/statistik','PendFormalController@getStatistikStrata'); + Route::post('pendidikan-formal/add', 'PendFormalController@store'); Route::get('pendidikan-formal', 'PendFormalController@getAll'); diff --git a/ppl2/resources/views/pages/statistikStrata.blade.php b/ppl2/resources/views/pages/statistikStrata.blade.php new file mode 100644 index 0000000000000000000000000000000000000000..5025a696ed6d77225e300f68a33f505a60158ab3 --- /dev/null +++ b/ppl2/resources/views/pages/statistikStrata.blade.php @@ -0,0 +1,68 @@ +@extends('app_template') + +@section('title') + Pendidikan Formal Pegawai +@stop + +@section('page_title') + <h2>Pendidikan Formal Pegawai</h2> +@stop + +@section('head_content') + @if (Session::has('message')) + <div class="alert alert-info fade in">{{ Session::get('message') }} + <a href="#" class="close" data-dismiss="alert" aria-label="close" title="close">×</a> + </div> + @endif + <div class="row"> + <div class="col-md-3"> + <button class="btn m-b-sm m-r-sm btn-success" onclick="location.href = '{{URL::to('/')}}/pendidikan-formal/new';"><i class="m-r-xs fa fa-plus"></i>Tambahkan Pendidikan</button> + </div> + <div class="col-md-6"> + <form action = "{{URL::to('/')}}/pendidikan-formal/search" method="GET"> + <div class="input-group"> + <input type="text" class="form-control" placeholder="Cari berdasarkan NIP" name="query" required> + <span class="input-group-btn"> + <button class="btn btn-default" type="submit">Go!</button> + </span> + </div> + </form> + </div> + </div> +@stop + +@section('content') +<div class="panel panel-default"> + <div class="panel-heading font-semibold"> + <!-- Tampilkan Pesan --> + Tabel Pendidikan + @if($nip == null) + Semua Pegawai + @else + Pegawai NIP : {{$nip}} + @endif + </div> + <div> + <table class="table" ui-jq="footable" ui-options='{ + "paging": { + "enabled": true + }}'> + <thead> + <tr> + <th data-breakpoints="xs">tingkatan</th> + <th>strata</th> + </tr> + </thead> + <tbody> + <?php $i = 1; ?> + @foreach($pend as $pendidikan) + <tr data-expanded="true"> + <td>{{$pendidikan -> jumlah}}</td> + <td>{{$pendidikan -> tingkatan}}</td> + </tr> + <?php $i++ ;?> + @endforeach + </tbody> + </table> + </div> +@stop \ No newline at end of file