Commit f6f5fe63 by Siti Aisah

laporan reviewer

parent de953028
...@@ -2,15 +2,8 @@ ...@@ -2,15 +2,8 @@
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 Exception;
use Storage;
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 DashboardController extends Controller class DashboardController extends Controller
{ {
......
<?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,15 +2,8 @@ ...@@ -2,15 +2,8 @@
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 Exception;
use Storage;
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
{ {
......
...@@ -95,23 +95,20 @@ public function store(Request $request){ ...@@ -95,23 +95,20 @@ 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');
foreach($reviewer as $r){ $count = DB::connection('isdm')->table('v_detil_pegawai')->whereIn('noktp',$reviewer)->select('noktp')->get();
$rev[$r->nik] = $r->nik;
}
$count = DB::connection('isdm')->table('v_detil_pegawai')->whereIn('noktp',$rev)->select('namalengkap','nip','noktp')->get();
if(count($count) >= 2){ if(count($count) >= 2){
foreach($count as $sdm){ foreach($count as $sdm){
$isdm = DB::connection('isdm')->table('v_detil_pegawai')->where('noktp',$sdm->noktp)->select('namalengkap','nip')->first(); $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' => $sdm->noktp, 'nik' => $sdm->noktp,
'nama' => $isdm->namalengkap, 'nama' => $isdm->namalengkap,
'nip' => $isdm->nip 'nip' => $isdm->nip,
'unit' =>$isdm->namaparentsatker
]; ];
Penelaah::query()->create($saku); Penelaah::query()->create($saku);
......
<?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 = [];
}
<?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>
......
...@@ -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;
...@@ -30,6 +31,8 @@ ...@@ -30,6 +31,8 @@
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::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