Commit 7cd87b37 by Triyah Fatmawati

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

parents bf5d3a51 f5bc11a3
......@@ -3,39 +3,23 @@
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Controller;
use App\Models\Admin\MsKategori;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
class DashboardController extends Controller
{
public function index(){
$kategori = MsKategori::query()->get();
foreach ($kategori as $kat) {
$pengajuan = DB::table('tr_pengajuan')
->select(DB::raw('count(*) as total'))
->where('tr_pengajuan.id_kategori', $kat->id)
->first();
public function index() {
$data['jumlah'] = DB::table("tr_pengajuan")
->select("id_kategori", DB::raw("count (id_kategori) as jumlah"))
->groupBy("id_kategori")
->pluck('jumlah','id_kategori');
$jml[$kat->kode_kategori] = $pengajuan->total;
}
$sudahKategori = DB::table('tr_pengajuan')
->whereNotNull('tr_pengajuan.id_kategori')
->count();
$semua = DB::table('bantuan_pengusul')->count();
$sudah = DB::table('tr_pengajuan')->count();
$belumKategori = DB::table('tr_pengajuan')
->whereNull('tr_pengajuan.id_kategori')
->count();
$data['sudah'] = $sudah;
$data['belum'] = $semua-$sudah;
$data = [
'jml' => $jml,
'sudahKategori' => $sudahKategori,
'belumKategori' => $belumKategori
];
return view('dashboard', $data);
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 @@
namespace App\Http\Controllers\Admin;
use App\Http\Support\ValidationRule;
use App\Http\Controllers\Controller;
use App\Models\Admin\Pengajuan;
use Exception;
......@@ -10,17 +9,18 @@
use Storage;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Redirect;
class SakuController extends Controller
{
public function index() {
// $penelaah = DB::table('tr_penelaah')->orderBy('id_pengajuan')->get();
$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')
->join('tr_pengajuan', 'tr_pengajuan.id', 'tr_penelaah.id_pengajuan')
->join('ms_kategori', 'ms_kategori.id', 'tr_pengajuan.id_kategori')
->orderBy('id_pengajuan')
->get();
if($penelaah){
......
......@@ -95,31 +95,34 @@ public function store(Request $request){
$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');
foreach($reviewer as $r){
$isdm = DB::connection('isdm')->table('v_detil_pegawai')->where('noktp',$r->nik)->select('namalengkap','nip')->first();
// if(!empty($isdm)){
$count = DB::connection('isdm')->table('v_detil_pegawai')->whereIn('noktp',$reviewer)->select('noktp')->get();
if(count($count) >= 2){
foreach($count as $sdm){
$isdm = DB::connection('isdm')->table('v_detil_pegawai')->where('noktp',$sdm->noktp)->select('namalengkap','nip','namaparentsatker')->first();
$saku = [
'id_pengajuan' => $hasil->id,
'nik' => $r->nik,
'nik' => $sdm->noktp,
'nama' => $isdm->namalengkap,
'nip' => $isdm->nip
'nip' => $isdm->nip,
'unit' => $isdm->namaparentsatker
];
// } else {
// $saku = [
// 'id_pengajuan' => $hasil->id,
// 'nik' => $r->nik,
// 'nama' => $r->penelaah,
// 'nip' => 'NIK belum terdaftar di ISDM. Silakan update ke Kepegawaian.'
// ];
// }
Penelaah::query()->create($saku);
}
} else {
foreach($count as $sdm){
$data['kosong'] = DB::table('bantuan_penelaah')->where('id_pengajuan',$request->idpengajuan)->where('nik','!=', $sdm->noktp)->first();
}
return view('transaksi-gagal', $data);
}
DB::commit();
return Redirect::route('transaksi.index')
......@@ -130,7 +133,7 @@ public function store(Request $request){
DB::rollBack();
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
'id_pengajuan',
'nik',
'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,6 +52,18 @@
<p class="card-text font-small-3 mb-0">Mhs S1/D4</p>
</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 class="d-flex flex-row">
......@@ -61,7 +73,14 @@
</div>
</div>
<div class="my-auto">
<h4 class="fw-bolder mb-0">{{$jml['B']}}</h4>
@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>
......@@ -74,7 +93,14 @@
</div>
</div>
<div class="my-auto">
<h4 class="fw-bolder mb-0">{{$jml['C']}}</h4>
@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>
......@@ -87,7 +113,14 @@
</div>
</div>
<div class="my-auto">
<h4 class="fw-bolder mb-0">{{$jml['D']}}</h4>
@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>
......@@ -107,7 +140,7 @@
</div>
</div>
<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>
</div>
</div>
......@@ -120,7 +153,7 @@
</div>
</div>
<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>
</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 @@
</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>
<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>
</ul>
</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 @@
use App\Http\Controllers\Admin\Auth\LoginController;
use App\Http\Controllers\Admin\DashboardController;
use App\Http\Controllers\Admin\KategoriController;
use App\Http\Controllers\Admin\LaporanController;
use App\Http\Controllers\Admin\TransaksiController;
use App\Http\Controllers\Admin\SakuController;
use App\Http\Controllers\Admin\UserController;
......@@ -26,11 +27,12 @@
// Route::get('/home', [TransaksiController::class, 'index'])->name('admin.index-transaksi');
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('transaksi', TransaksiController::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::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