Commit 7cd87b37 by Triyah Fatmawati

Merge branch 'master' of http://git.unesa.ac.id/aisah/sipeka

parents bf5d3a51 f5bc11a3
...@@ -3,39 +3,23 @@ ...@@ -3,39 +3,23 @@
namespace App\Http\Controllers\Admin; namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use App\Models\Admin\MsKategori;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
class DashboardController extends Controller class DashboardController extends Controller
{ {
public function index(){
$kategori = MsKategori::query()->get();
foreach ($kategori as $kat) { public function index() {
$pengajuan = DB::table('tr_pengajuan') $data['jumlah'] = DB::table("tr_pengajuan")
->select(DB::raw('count(*) as total')) ->select("id_kategori", DB::raw("count (id_kategori) as jumlah"))
->where('tr_pengajuan.id_kategori', $kat->id) ->groupBy("id_kategori")
->first(); ->pluck('jumlah','id_kategori');
$jml[$kat->kode_kategori] = $pengajuan->total; $semua = DB::table('bantuan_pengusul')->count();
} $sudah = DB::table('tr_pengajuan')->count();
$sudahKategori = DB::table('tr_pengajuan') $data['sudah'] = $sudah;
->whereNotNull('tr_pengajuan.id_kategori') $data['belum'] = $semua-$sudah;
->count();
$belumKategori = DB::table('tr_pengajuan') return view('dashboard',$data);
->whereNull('tr_pengajuan.id_kategori')
->count();
$data = [
'jml' => $jml,
'sudahKategori' => $sudahKategori,
'belumKategori' => $belumKategori
];
return view('dashboard', $data);
} }
} }
<?php
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Controller;
use App\Models\Admin\Vsaku;
use Illuminate\Http\Request;
class LaporanController extends Controller
{
public function index() {
$data['rs'] = Vsaku::get();
return view('laporan.index', $data);
}
public function download(Request $request) {
$data['nama_file'] = 'Laporan Reviewer Sipeka '.date('Y-m-d');
$data['rs'] = Vsaku::get();
return view('laporan.excel', $data);
}
}
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
namespace App\Http\Controllers\Admin; namespace App\Http\Controllers\Admin;
use App\Http\Support\ValidationRule;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use App\Models\Admin\Pengajuan; use App\Models\Admin\Pengajuan;
use Exception; use Exception;
...@@ -10,17 +9,18 @@ ...@@ -10,17 +9,18 @@
use Storage; use Storage;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Redirect;
class SakuController extends Controller class SakuController extends Controller
{ {
public function index() { public function index() {
// $penelaah = DB::table('tr_penelaah')->orderBy('id_pengajuan')->get();
$penelaah = DB::table('tr_penelaah') $penelaah = DB::table('tr_penelaah')
->select('tr_penelaah.*', 'tr_pengajuan.id_pengajuan as id_pengajuan_epk', 'tr_pengajuan.no_sk', 'tr_pengajuan.judul', 'tr_pengajuan.peneliti', 'tr_pengajuan.tahun', 'tr_pengajuan.klasifikasi', 'tr_pengajuan.file_ec', 'ms_kategori.nama_kategori') ->select('tr_penelaah.*', 'tr_pengajuan.id_pengajuan as id_pengajuan_epk', 'tr_pengajuan.no_sk', 'tr_pengajuan.judul', 'tr_pengajuan.peneliti', 'tr_pengajuan.tahun', 'tr_pengajuan.klasifikasi', 'tr_pengajuan.file_ec', 'ms_kategori.nama_kategori')
->join('tr_pengajuan', 'tr_pengajuan.id', 'tr_penelaah.id_pengajuan') ->join('tr_pengajuan', 'tr_pengajuan.id', 'tr_penelaah.id_pengajuan')
->join('ms_kategori', 'ms_kategori.id', 'tr_pengajuan.id_kategori') ->join('ms_kategori', 'ms_kategori.id', 'tr_pengajuan.id_kategori')
->orderBy('id_pengajuan')
->get(); ->get();
if($penelaah){ if($penelaah){
...@@ -51,7 +51,7 @@ public function index() { ...@@ -51,7 +51,7 @@ public function index() {
$data = [ $data = [
'penelaah' => $arrPenelaah, 'penelaah' => $arrPenelaah,
]; ];
return view('saku.index', $data); return view('saku.index', $data);
} }
......
...@@ -95,31 +95,34 @@ public function store(Request $request){ ...@@ -95,31 +95,34 @@ public function store(Request $request){
$hasil = DB::table('tr_pengajuan')->where('id_pengajuan',$request->idpengajuan)->first(); $hasil = DB::table('tr_pengajuan')->where('id_pengajuan',$request->idpengajuan)->first();
$reviewer = DB::table('bantuan_penelaah')->where('id_pengajuan',$request->idpengajuan)->get(); $reviewer = DB::table('bantuan_penelaah')->where('id_pengajuan',$request->idpengajuan)->pluck('nik');
$count = DB::connection('isdm')->table('v_detil_pegawai')->whereIn('noktp',$reviewer)->select('noktp')->get();
foreach($reviewer as $r){ if(count($count) >= 2){
$isdm = DB::connection('isdm')->table('v_detil_pegawai')->where('noktp',$r->nik)->select('namalengkap','nip')->first(); foreach($count as $sdm){
// if(!empty($isdm)){ $isdm = DB::connection('isdm')->table('v_detil_pegawai')->where('noktp',$sdm->noktp)->select('namalengkap','nip','namaparentsatker')->first();
$saku = [ $saku = [
'id_pengajuan' => $hasil->id, 'id_pengajuan' => $hasil->id,
'nik' => $r->nik, 'nik' => $sdm->noktp,
'nama' => $isdm->namalengkap, 'nama' => $isdm->namalengkap,
'nip' => $isdm->nip 'nip' => $isdm->nip,
]; 'unit' => $isdm->namaparentsatker
];
Penelaah::query()->create($saku);
}
// } else {
// $saku = [ } else {
// 'id_pengajuan' => $hasil->id, foreach($count as $sdm){
// 'nik' => $r->nik, $data['kosong'] = DB::table('bantuan_penelaah')->where('id_pengajuan',$request->idpengajuan)->where('nik','!=', $sdm->noktp)->first();
// 'nama' => $r->penelaah, }
// 'nip' => 'NIK belum terdaftar di ISDM. Silakan update ke Kepegawaian.'
// ]; return view('transaksi-gagal', $data);
// }
Penelaah::query()->create($saku);
} }
DB::commit(); DB::commit();
return Redirect::route('transaksi.index') return Redirect::route('transaksi.index')
...@@ -128,9 +131,9 @@ public function store(Request $request){ ...@@ -128,9 +131,9 @@ public function store(Request $request){
catch(Exception $e){ catch(Exception $e){
Log::error($e); Log::error($e);
DB::rollBack(); DB::rollBack();
return Redirect::route('transaksi.index') return Redirect::route('transaksi.index')
->with('error', 'NIK tidak terdaftar, silakan update di ISDM'); ->with('error', 'Data Kategori gagal diupdate');
} }
} }
} }
...@@ -20,6 +20,7 @@ class Penelaah extends Model ...@@ -20,6 +20,7 @@ class Penelaah extends Model
'id_pengajuan', 'id_pengajuan',
'nik', 'nik',
'nama', 'nama',
'nip' 'nip',
'unit'
]; ];
} }
<?php
namespace App\Models\Admin;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Vsaku extends Model
{
use HasFactory;
public $incrementing = false;
protected $table = 'v_saku';
protected $keyType = 'string';
protected $guarded = [];
}
...@@ -52,47 +52,80 @@ ...@@ -52,47 +52,80 @@
<p class="card-text font-small-3 mb-0">Mhs S1/D4</p> <p class="card-text font-small-3 mb-0">Mhs S1/D4</p>
</div> </div>
</div> </div>
<div class="my-auto">
@php
if(isset($jumlah['c6c43201-3f60-43af-968a-75c2984624e7'])){
$jsarjana = $jumlah['c6c43201-3f60-43af-968a-75c2984624e7'];
} else {
$jsarjana = 0;
}
@endphp
<h4 class="fw-bolder mb-0">{{ $jsarjana }}</h4>
<p class="card-text font-small-3 mb-0">Mhs S1/D4</p>
</div>
</div> </div>
<div class="col-xl-3 col-sm-6 col-12 mb-2 mb-xl-0"> </div>
<div class="d-flex flex-row"> <div class="col-xl-3 col-sm-6 col-12 mb-2 mb-xl-0">
<div class="avatar bg-light-info me-2"> <div class="d-flex flex-row">
<div class="avatar-content"> <div class="avatar bg-light-info me-2">
<i data-feather="users" class="avatar-icon"></i> <div class="avatar-content">
</div> <i data-feather="users" class="avatar-icon"></i>
</div>
<div class="my-auto">
<h4 class="fw-bolder mb-0">{{$jml['B']}}</h4>
<p class="card-text font-small-3 mb-0">Mhs S2/S3</p>
</div> </div>
</div> </div>
<div class="my-auto">
@php
if(isset($jumlah['11459605-89b4-4dfc-9586-519802e989e4'])){
$jpasca = $jumlah['11459605-89b4-4dfc-9586-519802e989e4'];
} else {
$jpasca = 0;
}
@endphp
<h4 class="fw-bolder mb-0">{{ $jpasca }}</h4>
<p class="card-text font-small-3 mb-0">Mhs S2/S3</p>
</div>
</div> </div>
<div class="col-xl-3 col-sm-6 col-12 mb-2 mb-sm-0"> </div>
<div class="d-flex flex-row"> <div class="col-xl-3 col-sm-6 col-12 mb-2 mb-sm-0">
<div class="avatar bg-light-danger me-2"> <div class="d-flex flex-row">
<div class="avatar-content"> <div class="avatar bg-light-danger me-2">
<i data-feather="users" class="avatar-icon"></i> <div class="avatar-content">
</div> <i data-feather="users" class="avatar-icon"></i>
</div>
<div class="my-auto">
<h4 class="fw-bolder mb-0">{{$jml['C']}}</h4>
<p class="card-text font-small-3 mb-0">Dosen</p>
</div> </div>
</div> </div>
<div class="my-auto">
@php
if(isset($jumlah['ec949871-68fa-4357-8084-547db716faf6'])){
$jdosen = $jumlah['ec949871-68fa-4357-8084-547db716faf6'];
} else {
$jdosen = 0;
}
@endphp
<h4 class="fw-bolder mb-0">{{ $jdosen }}</h4>
<p class="card-text font-small-3 mb-0">Dosen</p>
</div>
</div> </div>
<div class="col-xl-3 col-sm-6 col-12"> </div>
<div class="d-flex flex-row"> <div class="col-xl-3 col-sm-6 col-12">
<div class="avatar bg-light-success me-2"> <div class="d-flex flex-row">
<div class="avatar-content"> <div class="avatar bg-light-success me-2">
<i data-feather="users" class="avatar-icon"></i> <div class="avatar-content">
</div> <i data-feather="users" class="avatar-icon"></i>
</div>
<div class="my-auto">
<h4 class="fw-bolder mb-0">{{$jml['D']}}</h4>
<p class="card-text font-small-3 mb-0">Industri</p>
</div> </div>
</div> </div>
<div class="my-auto">
@php
if(isset($jumlah['790fdbb1-36e7-447c-9a38-55b62816395c'])){
$jindustri = $jumlah['790fdbb1-36e7-447c-9a38-55b62816395c'];
} else {
$jindustri = 0;
}
@endphp
<h4 class="fw-bolder mb-0">{{ $jindustri }}</h4>
<p class="card-text font-small-3 mb-0">Industri</p>
</div>
</div> </div>
</div> </div>
</div>
</div> </div>
<div class="card-header"> <div class="card-header">
<h4 class="card-title">Kategori</h4> <h4 class="card-title">Kategori</h4>
...@@ -107,7 +140,7 @@ ...@@ -107,7 +140,7 @@
</div> </div>
</div> </div>
<div class="my-auto"> <div class="my-auto">
<h4 class="fw-bolder mb-0">{{$sudahKategori}}</h4> <h4 class="fw-bolder mb-0">{{ $sudah }}</h4>
<p class="card-text font-small-3 mb-0">Sudah dikategorikan</p> <p class="card-text font-small-3 mb-0">Sudah dikategorikan</p>
</div> </div>
</div> </div>
...@@ -120,7 +153,7 @@ ...@@ -120,7 +153,7 @@
</div> </div>
</div> </div>
<div class="my-auto"> <div class="my-auto">
<h4 class="fw-bolder mb-0">{{$belumKategori}}</h4> <h4 class="fw-bolder mb-0">{{ $belum }}</h4>
<p class="card-text font-small-3 mb-0">Belum dikategorikan</p> <p class="card-text font-small-3 mb-0">Belum dikategorikan</p>
</div> </div>
</div> </div>
......
<?php
header("Content-type: application/vnd-ms-excel");
header("Content-Disposition: attachment; filename=$nama_file.xls");
?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Data Pendaftar</title>
<style type="text/css">
body{ background-color: #FFF; }
.num {
mso-number-format:"\@";
}
.title-sm{
/*font-family: 'myriadproregular'; */
font-size: 15pt; font-weight: bold;
}
.title-lg{
/*font-family: 'myriadproregular'; */
font-size: 24pt; font-weight: bold;
}
body{ font-size: 11pt;
/*font-family: 'myriadproregular'; */
}
.title-jurusan{
/*font-family: 'myriadproregular'; */
font-size: 20pt; font-weight: bold;
}
#head-title{
/*font-family: MyriadPro-Regular; */
src: url("{{ asset('assets/font/MyriadPro-Regular.otf') }}");
font-family:MyriadPro-Regular;
font-weight:bold;
}
#head-big{
/*font-family:MyriadPro-Cond; */
font-weight:bold;
font-size:22pt;
}
#container td{
/*font-family:MyriadPro-Regular;*/
}
.page-break {
page-break-after: always;
}
div.ui-menu li {
list-style:none;
background-image:none;
background-repeat:none;
background-position:0;
}
ul
{
list-style-type:none;
padding:0px;
margin:0px;
}
li
{
background-image:url(sqpurple.gif);
background-repeat:no-repeat;
background-position:0px 5px;
padding-left:14px;
}
.responsive {
width: 100%;
height: auto;
}
.kotak {
border: 1px solid #000;
width: 15px;
height: 15px;
font-weight: bold;
font-size:9pt
}
</style>
<style> .str{ mso-number-format:\@; } </style>
<center>
<h3>Data Reviewer SIPEKA @php echo date('d-m-Y'); @endphp</h3>
</center>
<table>
<tbody>
<tr style="font-size:10pt;" align="center">
<td>No.</td>
<td>Penelaah</td>
<td>NIK</td>
<td>NIP</td>
<td>Unit Kerja</td>
<td>Judul</td>
<td>Peneliti</td>
</tr>
</tbody>
<tbody>
@php $no=1;@endphp
@foreach($rs as $data)
<tr style="font-size:10pt;">
<td align="center">{{$no++}}</td>
<td>{{$data->nama}}</td>
<td class="str">{{$data->nik}}</td>
<td class="str">{{$data->nip}}</td>
<td>{{$data->unit}}</td>
<td>{{$data->judul}}</td>
<td>{{$data->peneliti}}</td>
</tr>
@endforeach
</tbody>
</table>
@extends('layouts.master')
@section('content')
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-header">
<h4 class="card-title">SAKU Reviewer</h4>
</div>
<div class="card-body">
<div class="card-text">
<div class="row">
<div class="panel panel-info">
<div class="panel-body">
<form action="{{ route('laporan.download') }}" method="POST">
@csrf
<button type="submit" class="btn btn-success pull-lefts">Download Excel</button>
</form>
</div>
</div>
</div>
</div>
</div>
<div class="table-responsive mb-4">
<table id="zero-config" class="table table-hover" style="width:100%">
<thead>
<tr>
<th>No.</th>
<th style="text-align: left">Penelaah</th>
<th style="text-align: left">NIK</th>
<th style="text-align: left">NIP</th>
<th style="text-align: left">Unit Kerja</th>
<th style="text-align: left">Judul</th>
<th style="text-align: left">Peneliti</th>
</tr>
</thead>
<tbody>
@php
$no = 1;
@endphp
@foreach($rs as $item)
<tr>
<td>{{ $no }}</td>
<td style="text-align: left">{{ $item->nama }}</td>
<td style="text-align: left">{{ $item->nik }}</td>
<td style="text-align: left">{{ $item->nip }}</td>
<td style="text-align: left">{{ $item->unit }}</td>
<td style="text-align: left">{{ $item->judul }}</td>
<td style="text-align: left">{{ $item->peneliti }}</td>
</tr>
@php
$no++;
@endphp
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
@push('js')
@endpush
@stop
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
</li> </li>
<li class="dropdown nav-item" data-menu="dropdown"><a class="dropdown-toggle nav-link d-flex align-items-center" href="#" data-bs-toggle="dropdown"><i data-feather='file-text'></i><span data-i18n="Dashboards">Laporan</span></a> <li class="dropdown nav-item" data-menu="dropdown"><a class="dropdown-toggle nav-link d-flex align-items-center" href="#" data-bs-toggle="dropdown"><i data-feather='file-text'></i><span data-i18n="Dashboards">Laporan</span></a>
<ul class="dropdown-menu" data-bs-popper="none"> <ul class="dropdown-menu" data-bs-popper="none">
<li data-menu="" class="{{ (request()->is('admin/laporan-transaksi')) ? 'active' : '' }}"><a class="dropdown-item d-flex align-items-center" href="#" data-bs-toggle="" data-i18n="pembayaran"><i data-feather='clipboard'></i><span data-i18n="pembayaran">SAKU Reviewer</span></a> <li data-menu="" class="{{ (request()->getRequestUri() == "/laporan") ? 'active' : '' }}"><a class="dropdown-item d-flex align-items-center" href="{{ route('laporan.index') }}" data-bs-toggle="" data-i18n="pembayaran"><i data-feather='clipboard'></i><span data-i18n="pembayaran">SAKU Reviewer</span></a>
</li> </li>
</ul> </ul>
</li> </li>
......
@extends('layouts.master')
@section('content')
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-header">
<h3 class="card-title">Notifikasi</h3>
</div>
<div class="card-body">
<h4>{{ $kosong->penelaah }} gagal update karena:<br>
NIK {{ $kosong->nik }} belum terdaftar di ISDM. Silakan update ke Kepegawaian.</h4><br>
<a href="{{ route('transaksi.index') }}">Kembali</a>
</div>
</div>
</div>
</div>
@push('js')
@endpush
@stop
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
use App\Http\Controllers\Admin\Auth\LoginController; use App\Http\Controllers\Admin\Auth\LoginController;
use App\Http\Controllers\Admin\DashboardController; use App\Http\Controllers\Admin\DashboardController;
use App\Http\Controllers\Admin\KategoriController; use App\Http\Controllers\Admin\KategoriController;
use App\Http\Controllers\Admin\LaporanController;
use App\Http\Controllers\Admin\TransaksiController; use App\Http\Controllers\Admin\TransaksiController;
use App\Http\Controllers\Admin\SakuController; use App\Http\Controllers\Admin\SakuController;
use App\Http\Controllers\Admin\UserController; use App\Http\Controllers\Admin\UserController;
...@@ -26,11 +27,12 @@ ...@@ -26,11 +27,12 @@
// Route::get('/home', [TransaksiController::class, 'index'])->name('admin.index-transaksi'); // Route::get('/home', [TransaksiController::class, 'index'])->name('admin.index-transaksi');
Route::middleware(['auth','prevent-back-history'])->group(function(){ Route::middleware(['auth','prevent-back-history'])->group(function(){
Route::get('/home', [DashboardController::class, 'index'])->name('admin.home'); Route::get('/home', [DashboardController::class, 'index']);
Route::resource('kategori', KategoriController::class); Route::resource('kategori', KategoriController::class);
Route::resource('transaksi', TransaksiController::class); Route::resource('transaksi', TransaksiController::class);
Route::resource('saku', SakuController::class); Route::resource('saku', SakuController::class);
Route::get('file/{tahun}/{nosurat}', [SakuController::class, 'getFileName'])->name('admin.filename'); Route::resource('laporan', LaporanController::class);
Route::post('/excel', [LaporanController::class, 'download'])->name('laporan.download');
Route::resource('user', UserController::class); Route::resource('user', UserController::class);
Route::get('/logout', [LoginController::class, 'logout'])->name('admin.logout'); Route::get('/logout', [LoginController::class, 'logout'])->name('admin.logout');
}); });
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment