Commit 0b37fad0 by Siti Aisah

add master periode, filter periode, fix dashboard

parent ef9c054f
...@@ -19,22 +19,20 @@ public function index(Request $request) { ...@@ -19,22 +19,20 @@ public function index(Request $request) {
if(empty(Session::get('periode'))) { if(empty(Session::get('periode'))) {
$rs = DB::table('v_saku_new') $periode = DB::table('ms_periode')->where('is_aktif', 1)->first();
->select('nama', 'nip', 'unit', DB::raw('COUNT(id_pengajuan) as jumlah')) Session::put('periode', $periode->periode);
->groupBy('nama', 'nip', 'unit')
->get();
} else { } else {
$periode = DB::table('ms_periode')->where('periode', Session::get('periode'))->first(); $periode = DB::table('ms_periode')->where('periode', Session::get('periode'))->first();
$rs = DB::table('v_saku_new') }
$rs = DB::table('v_saku_new')
->select('nama', 'nip', 'unit', DB::raw('COUNT(id_pengajuan) as jumlah')) ->select('nama', 'nip', 'unit', DB::raw('COUNT(id_pengajuan) as jumlah'))
->whereBetween('tanggal_keputusan', [$periode->tanggal_awal, $periode->tanggal_akhir]) ->whereBetween('tanggal_keputusan', [$periode->tanggal_awal, $periode->tanggal_akhir])
->groupBy('nama', 'nip', 'unit') ->groupBy('nama', 'nip', 'unit')
->get(); ->get();
}
$data = [ $data = [
'rs' => $rs, 'rs' => $rs,
'periode' => $filter_periode 'periode' => $filter_periode
...@@ -47,26 +45,22 @@ public function download(Request $request) { ...@@ -47,26 +45,22 @@ public function download(Request $request) {
if(empty(Session::get('periode'))) { if(empty(Session::get('periode'))) {
$data['rs'] = DB::table('v_saku_new') $periode = DB::table('ms_periode')->where('is_aktif', 1)->first();
->select('nama', 'nip', 'unit', DB::raw('COUNT(id_pengajuan) as jumlah')) Session::put('periode', $periode->periode);
->groupBy('nama', 'nip', 'unit')
->get();
$data['nama_file'] = 'Laporan Reviewer Sipeka Semua Periode';
} else { } else {
$periode = DB::table('ms_periode')->where('periode', Session::get('periode'))->first(); $periode = DB::table('ms_periode')->where('periode', Session::get('periode'))->first();
$data['rs'] = DB::table('v_saku_new') }
$data['nama_file'] = 'Laporan Reviewer Sipeka Periode '. $periode->periode;
$data['rs'] = DB::table('v_saku_new')
->select('nama', 'nip', 'unit', DB::raw('COUNT(id_pengajuan) as jumlah')) ->select('nama', 'nip', 'unit', DB::raw('COUNT(id_pengajuan) as jumlah'))
->whereBetween('tanggal_keputusan', [$periode->tanggal_awal, $periode->tanggal_akhir]) ->whereBetween('tanggal_keputusan', [$periode->tanggal_awal, $periode->tanggal_akhir])
->groupBy('nama', 'nip', 'unit') ->groupBy('nama', 'nip', 'unit')
->get(); ->get();
$data['nama_file'] = 'Laporan Reviewer Sipeka Periode '. $periode->periode;
}
return view('laporan.excel', $data); return view('laporan.excel', $data);
} }
} }
<?php
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Controller;
use App\Http\Support\ValidationRule;
use App\Models\Admin\Periode;
use Exception;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Redirect;
class PeriodeController extends Controller
{
public function index(){
$periode = Periode::query()->get();
$data = [
'periode' => $periode
];
return view('Admin.Periode.index', $data);
}
public function store(Request $request){
DB::beginTransaction();
try{
$rule = [
'periode' => 'required',
'tanggal_awal' => 'required|date',
'tanggal_akhir' => 'required|date',
'is_aktif' => 'required'
];
$request->validate($rule, ValidationRule::getErrorMessage($rule));
$periode = [
'periode' => $request->periode,
'tanggal_awal' => $request->tanggal_awal,
'tanggal_akhir' => $request->tanggal_akhir,
'is_aktif' => $request->is_aktif,
];
Periode::query()->create($periode);
DB::commit();
return Redirect::route('periode.index')
->with('success', 'Periode berhasil ditambahkan');
}
catch(Exception $e){
Log::error($e);
DB::rollBack();
return Redirect::route('periode.index')
->with('error', 'Periode gagal ditambahkan');
}
}
public function update(Request $request, $id){
DB::beginTransaction();
try{
$id = decrypt($id);
$rule = [
'periode' => 'required',
'tanggal_awal' => 'required|date',
'tanggal_akhir' => 'required|date',
'is_aktif' => 'required'
];
$request->validate($rule, ValidationRule::getErrorMessage($rule));
$periode = [
'periode' => $request->periode,
'tanggal_awal' => $request->tanggal_awal,
'tanggal_akhir' => $request->tanggal_akhir,
'is_aktif' => $request->is_aktif,
];
Periode::where('periode', $id)->update($periode);
DB::commit();
return Redirect::route('periode.index')
->with('success', 'Periode berhasil diupdate');
}
catch(Exception $e){
Log::error($e);
DB::rollBack();
return Redirect::route('periode.index')
->with('error', 'Periode gagal diupdate');
}
}
// public function destroy($id) {
// $id = decrypt($id);
// DB::beginTransaction();
// try{
// User::where('id', $id)->delete();
// DB::commit();
// return Redirect::route('user.index')
// ->with('success', 'User berhasil dihapus');
// }
// catch(Exception $e){
// Log::error($e);
// DB::rollBack();
// return Redirect::route('user.index')
// ->with('error', 'User gagal dihapus');
// }
// }
}
...@@ -9,23 +9,37 @@ ...@@ -9,23 +9,37 @@
use Storage; use Storage;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
use Session;
class SakuController extends Controller class SakuController extends Controller
{ {
public function index() { public function index(Request $request) {
// $penelaah = DB::table('tr_penelaah')->orderBy('id_pengajuan')->get(); // $penelaah = DB::table('tr_penelaah')->orderBy('id_pengajuan')->get();
$penelaah = DB::table('tr_penelaah') $filter_periode = DB::table('ms_periode')->orderBy('periode','asc')->get();
->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') Session::put('periode', $request->periode);
->join('ms_kategori', 'ms_kategori.id', 'tr_pengajuan.id_kategori')
->orderBy('id_pengajuan')
->get();
if(empty(Session::get('periode'))) {
$periode = DB::table('ms_periode')->where('is_aktif', 1)->first();
Session::put('periode', $periode->periode);
} else {
$periode = DB::table('ms_periode')->where('periode', Session::get('periode'))->first();
}
$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')
->join('bantuan_pengusul', 'bantuan_pengusul.id_pengajuan', 'tr_pengajuan.id_pengajuan')
->whereBetween('bantuan_pengusul.tanggal_keputusan', [$periode->tanggal_awal, $periode->tanggal_akhir])
->orderBy('id_pengajuan')
->get();
$data = [ $data = [
'penelaah' => $penelaah, 'penelaah' => $penelaah,
'periode' => $filter_periode
]; ];
return view('saku.index', $data); return view('saku.index', $data);
......
...@@ -19,11 +19,23 @@ class TransaksiController extends Controller ...@@ -19,11 +19,23 @@ class TransaksiController extends Controller
public function index(Request $request) { public function index(Request $request) {
$filter_periode = DB::table('ms_periode')->orderBy('periode','asc')->get();
Session::put('status', $request->status); Session::put('status', $request->status);
Session::put('periode', $request->periode);
if(empty(Session::get('status'))) { if(empty(Session::get('status'))) {
if(empty(Session::get('periode'))){
$periode = DB::table('ms_periode')->where('is_aktif', 1)->first();
Session::put('periode', $periode->periode);
} else {
$periode = DB::table('ms_periode')->where('periode', Session::get('periode'))->first();
}
$pengusul = DB::table('bantuan_pengusul')->get(); $pengusul = DB::table('bantuan_pengusul')
->whereBetween('tanggal_keputusan', [$periode->tanggal_awal, $periode->tanggal_akhir])
->get();
} else { } else {
...@@ -35,11 +47,30 @@ public function index(Request $request) { ...@@ -35,11 +47,30 @@ public function index(Request $request) {
if(Session::get('status') == '1'){ if(Session::get('status') == '1'){
$pengusul = DB::table('bantuan_pengusul')->whereIn('id_pengajuan',$list)->get(); if(empty(Session::get('periode'))){
$periode = DB::table('ms_periode')->where('is_aktif', 1)->first();
Session::put('periode', $periode->periode);
} else {
$periode = DB::table('ms_periode')->where('periode', Session::get('periode'))->first();
}
$pengusul = DB::table('bantuan_pengusul')
->whereIn('id_pengajuan',$list)
->whereBetween('tanggal_keputusan', [$periode->tanggal_awal, $periode->tanggal_akhir])
->get();
}elseif(Session::get('status') == '2'){ }elseif(Session::get('status') == '2'){
if(empty(Session::get('periode'))){
$periode = DB::table('ms_periode')->where('is_aktif', 1)->first();
Session::put('periode', $periode->periode);
} else {
$periode = DB::table('ms_periode')->where('periode', Session::get('periode'))->first();
}
$pengusul = DB::table('bantuan_pengusul')->whereNotIn('id_pengajuan',$list)->get(); $pengusul = DB::table('bantuan_pengusul')
->whereNotIn('id_pengajuan',$list)
->whereBetween('tanggal_keputusan', [$periode->tanggal_awal, $periode->tanggal_akhir])
->get();
} }
...@@ -49,7 +80,8 @@ public function index(Request $request) { ...@@ -49,7 +80,8 @@ public function index(Request $request) {
$data = [ $data = [
'pengusul' => $pengusul, 'pengusul' => $pengusul,
'kategori' => $kategori 'kategori' => $kategori,
'periode' => $filter_periode
]; ];
return view('transaksi.index', $data); return view('transaksi.index', $data);
......
...@@ -8,13 +8,12 @@ class ValidationRule{ ...@@ -8,13 +8,12 @@ class ValidationRule{
'numeric' => 'must be a number', 'numeric' => 'must be a number',
'string' => 'must be a string', 'string' => 'must be a string',
'unique' => 'must be unique', 'unique' => 'must be unique',
'required' => 'must be filled',
'numeric' => 'must be numeric',
'regex' => 'must be a combination of uppercase letters, lowercase letters, numbers and characters', 'regex' => 'must be a combination of uppercase letters, lowercase letters, numbers and characters',
'max' => 'must be maximum', 'max' => 'must be maximum',
'min' => 'must be minimum', 'min' => 'must be minimum',
'email' => 'is invalid', 'email' => 'is invalid',
'mimes' => 'file type must pdf', 'mimes' => 'file type must pdf',
'date' => 'must be a valid date', // Menambahkan pesan untuk date
'unique' => 'must be unique' 'unique' => 'must be unique'
]; ];
......
<?php
namespace App\Models\Admin;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Periode extends Model
{
use HasFactory;
public $incrementing = false;
protected $table = 'ms_periode';
protected $keyType = 'string';
protected $fillable = [
'periode',
'tanggal_awal',
'tanggal_akhir',
'is_aktif',
];
}
@extends('layouts.master')
@section('content')
<div class="container-xxl flex-grow-1 container-p-y">
<div class="card">
<div class="row layout-top-spacing" id="cancel-row">
<h5 class="card-header" style="padding-left: 35px">Daftar Periode</h5>
<div class="card-body">
<div class="row">
<div class="col-md-3" style="padding-left: 30px">
<button type="button" class="btn btn-primary text-right" data-bs-toggle="modal" data-bs-target="#addNewUserModal" >
Tambah Periode
</button>
</div>
</div>
</div>
<div class="card-body">
<div class="table-responsive text-nowrap">
<table class="table">
<thead class="table-light" align="center">
<tr>
<th>No.</th>
<th>Periode</th>
<th>Tanggal Awal</th>
<th>Tanggal Akhir</th>
<th>Status AKTIF</th>
<th>Aksi</th>
</tr>
</thead>
<tbody class="table-border-bottom-0">
@php
$no = 1;
@endphp
@foreach ($periode as $data)
<tr style="text-align: center">
<td>{{ $no }}</td>
<td>{{ $data->periode }}</td>
<td>{{ $data->tanggal_awal }}</td>
<td>{{ $data->tanggal_akhir }}</td>
@if($data->is_aktif == 1)
<td>Aktif</td>
@else
<td>Tidak Aktif</td>
@endif
<td>
<button type="button" class="btn btn-primary btn-sm" data-bs-toggle="modal" data-bs-target="#editUserModal{{$data->periode}}">Edit</button>
{{-- <button type="button" class="btn btn-danger btn-sm" data-bs-toggle="modal" data-bs-target="#deleteUserModal{{$data->id}}">Hapus</button> --}}
</td>
</tr>
<!-- Modal Update User -->
<div class="modal fade" id="editUserModal{{$data->periode}}" tabindex="-1" aria-labelledby="tambahAntrian" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<form method="POST" action="{{ route('periode.update', ['periode' => encrypt($data->periode)]) }}" enctype="multipart/form-data" id="registrasi">
@method('PUT')
@csrf
<div class="modal-header">
<h1 class="address-title text-center mb-1" id="addNewUserTitle">Edit Periode</h1>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-12">
<label class="form-label" for="periode">Nama Periode</label>
<input type="number" class="form-control" id="periode" name="periode" placeholder="Periode" data-msg="Masukkan Periode" value="{{$data->periode}}" readonly/>
@if ($errors->has('periode'))
<label id="login-error" class="error" for="periode" style="color: red">{{$errors->first('periode')}}</label>
@endif
</div>
<div class="col-md-12">
<label class="form-label" for="tanggal_awal">Tanggal Awal</label>
<input type="date" id="tanggal_awal" name="tanggal_awal" class="form-control" placeholder="Tanggal Awal" data-msg="Masukkan Tanggal" value="{{$data->tanggal_awal}}" required />
@if ($errors->has('tanggal_awal'))
<label id="login-error" class="error" for="tanggal_awal" style="color: red">{{$errors->first('tanggal_awal')}}</label>
@endif
</div>
<div class="col-md-12">
<label class="form-label" for="tanggal_awal">Tanggal Akhir</label>
<input type="date" id="tanggal_akhir" name="tanggal_akhir" class="form-control" placeholder="Tanggal Akhir" data-msg="Masukkan Tanggal" value="{{$data->tanggal_akhir}}" required />
@if ($errors->has('tanggal_akhir'))
<label id="login-error" class="error" for="tanggal_akhir" style="color: red">{{$errors->first('tanggal_akhir')}}</label>
@endif
</div>
</div>
<hr>
<div class="row">
<div class="col-md-12">
<label class="form-label" for="is_aktif">Status</label>
<select id="is_aktif" name="is_aktif" class="form-control" required>
<option value="">Pilih</option>
<option value="1" {{ old('is_aktif', $data->is_aktif) == '1' ? 'selected' : '' }}>Aktif</option>
<option value="2" {{ old('is_aktif', $data->is_aktif) == '2' ? 'selected' : '' }}>Tidak Aktif</option>
</select>
@if ($errors->has('is_aktif'))
<label id="login-error" class="error" for="is_aktif" style="color: red">{{$errors->first('is_aktif')}}</label>
@endif
</div>
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary">Submit</button>
<button type="reset" class="btn btn-outline-secondary" data-bs-dismiss="modal" aria-label="Close">Cancel</button>
</div>
</form>
</div>
</div>
</div>
<!-- End Modal Update User -->
@php
$no++;
@endphp
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
<!-- Modal Tambah User -->
<div class="modal fade" id="addNewUserModal" tabindex="-1" aria-labelledby="tambahAntrian" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<form method="POST" action="{{ route('periode.store') }}" enctype="multipart/form-data" id="registrasi">
@csrf
<div class="modal-header">
<h1 class="address-title text-center mb-1" id="addNewUserTitle">Tambah Periode</h1>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-12">
<label class="form-label" for="periode">Nama Periode</label>
<input type="number" class="form-control" id="periode" name="periode" placeholder="Periode" data-msg="Masukkan Periode" value="" required />
@if ($errors->has('periode'))
<label id="login-error" class="error" for="periode" style="color: red">{{$errors->first('periode')}}</label>
@endif
</div>
<div class="col-md-12">
<label class="form-label" for="tanggal_awal">Tanggal Awal</label>
<input type="date" id="tanggal_awal" name="tanggal_awal" class="form-control" placeholder="Tanggal Awal" data-msg="Masukkan Tanggal" value="" required />
@if ($errors->has('tanggal_awal'))
<label id="login-error" class="error" for="tanggal_awal" style="color: red">{{$errors->first('tanggal_awal')}}</label>
@endif
</div>
<div class="col-md-12">
<label class="form-label" for="tanggal_akhir">Tanggal Akhir</label>
<input type="date" id="tanggal_akhir" name="tanggal_akhir" class="form-control" placeholder="Tanggal Akhir" data-msg="Masukkan Tanggal" value="" required />
@if ($errors->has('tanggal_akhir'))
<label id="login-error" class="error" for="tanggal_akhir" style="color: red">{{$errors->first('tanggal_akhir')}}</label>
@endif
</div>
</div>
<hr>
<div class="row">
<div class="col-md-12">
<label class="form-label" for="is_aktif">Status Aktif</label>
<select id="is_aktif" name="is_aktif" class="form-control" required>
<option value="">Pilih</option>
<option value="1">Aktif</option>
<option value="2">Tidak Aktif</option>
</select>
@if ($errors->has('is_aktif'))
<label id="login-error" class="error" for="is_aktif" style="color: red">{{$errors->first('is_aktif')}}</label>
@endif
</div>
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary">Submit</button>
<button type="reset" class="btn btn-outline-secondary" data-bs-dismiss="modal" aria-label="Close">Cancel</button>
</div>
</form>
</div>
</div>
</div>
<!-- End Modal Tambah User -->
</div>
@endsection
@push('js')
@endpush
...@@ -39,35 +39,55 @@ ...@@ -39,35 +39,55 @@
<h4 class="card-title">Pengusul</h4> <h4 class="card-title">Pengusul</h4>
</div> </div>
<div class="card-body statistics-body"> <div class="card-body statistics-body">
<div class="row"> <div class="row">
<div class="col-xl-3 col-sm-6 col-12 mb-2 mb-xl-0"> <div class="col-xl-3 col-sm-6 col-12 mb-2 mb-xl-0">
<div class="d-flex flex-row"> <div class="d-flex flex-row">
<div class="avatar bg-light-primary me-2"> <div class="avatar bg-light-primary me-2">
<div class="avatar-content"> <div class="avatar-content">
<i data-feather='users' class="avatar-icon"></i> <i data-feather='users' class="avatar-icon"></i>
</div>
</div> </div>
<div class="my-auto"> </div>
@php <div class="my-auto">
if(isset($jumlah['c6c43201-3f60-43af-968a-75c2984624e7'])){ @php
$jsarjana = $jumlah['c6c43201-3f60-43af-968a-75c2984624e7']; if(isset($jumlah['c6c43201-3f60-43af-968a-75c2984624e7'])){
} else { $jsarjana = $jumlah['c6c43201-3f60-43af-968a-75c2984624e7'];
$jsarjana = 0; } else {
} $jsarjana = 0;
@endphp }
<h4 class="fw-bolder mb-0">{{ $jsarjana }}</h4> @endphp
<p class="card-text font-small-3 mb-0">Mhs S1/D4</p> <h4 class="fw-bolder mb-0">{{ $jsarjana }}</h4>
</div> <p class="card-text font-small-3 mb-0">Mhs S1/D4 Unesa</p>
</div> </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-primary 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>
<div class="my-auto"> </div>
<div class="my-auto">
@php
if(isset($jumlah['e38b64e5-4bc8-49fc-999b-bf4cb6052236'])){
$jsarjanaluar = $jumlah['e38b64e5-4bc8-49fc-999b-bf4cb6052236'];
} else {
$jsarjanaluar = 0;
}
@endphp
<h4 class="fw-bolder mb-0">{{ $jsarjanaluar }}</h4>
<p class="card-text font-small-3 mb-0">Mhs S1/D4 Luar</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">
<div class="avatar bg-light-info me-2">
<div class="avatar-content">
<i data-feather='users' class="avatar-icon"></i>
</div>
</div>
<div class="my-auto">
@php @php
if(isset($jumlah['11459605-89b4-4dfc-9586-519802e989e4'])){ if(isset($jumlah['11459605-89b4-4dfc-9586-519802e989e4'])){
$jpasca = $jumlah['11459605-89b4-4dfc-9586-519802e989e4']; $jpasca = $jumlah['11459605-89b4-4dfc-9586-519802e989e4'];
...@@ -76,18 +96,40 @@ ...@@ -76,18 +96,40 @@
} }
@endphp @endphp
<h4 class="fw-bolder mb-0">{{ $jpasca }}</h4> <h4 class="fw-bolder mb-0">{{ $jpasca }}</h4>
<p class="card-text font-small-3 mb-0">Mhs S2/S3</p> <p class="card-text font-small-3 mb-0">Mhs S2/S3 Unesa</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">
<div class="avatar bg-light-info me-2">
<div class="avatar-content">
<i data-feather="users" class="avatar-icon"></i>
</div> </div>
</div> </div>
<div class="my-auto">
@php
if(isset($jumlah['81814ab3-299d-42c2-aa49-9f3c80d887ca'])){
$jpascaluar = $jumlah['81814ab3-299d-42c2-aa49-9f3c80d887ca'];
} else {
$jpascaluar = 0;
}
@endphp
<h4 class="fw-bolder mb-0">{{ $jpascaluar }}</h4>
<p class="card-text font-small-3 mb-0">Mhs S2/S3 Luar</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><br>
<div class="avatar bg-light-danger me-2"> <div class="row">
<div class="avatar-content"> <div class="col-xl-3 col-sm-6 col-12 mb-2 mb-xl-0">
<i data-feather="users" class="avatar-icon"></i> <div class="d-flex flex-row">
</div> <div class="avatar bg-light-success me-2">
<div class="avatar-content">
<i data-feather='users' class="avatar-icon"></i>
</div> </div>
<div class="my-auto"> </div>
<div class="my-auto">
@php @php
if(isset($jumlah['ec949871-68fa-4357-8084-547db716faf6'])){ if(isset($jumlah['ec949871-68fa-4357-8084-547db716faf6'])){
$jdosen = $jumlah['ec949871-68fa-4357-8084-547db716faf6']; $jdosen = $jumlah['ec949871-68fa-4357-8084-547db716faf6'];
...@@ -96,31 +138,51 @@ ...@@ -96,31 +138,51 @@
} }
@endphp @endphp
<h4 class="fw-bolder mb-0">{{ $jdosen }}</h4> <h4 class="fw-bolder mb-0">{{ $jdosen }}</h4>
<p class="card-text font-small-3 mb-0">Dosen</p> <p class="card-text font-small-3 mb-0">Dosen Unesa</p>
</div>
</div> </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 mb-2 mb-xl-0">
<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>
<div class="my-auto"> </div>
@php <div class="my-auto">
if(isset($jumlah['790fdbb1-36e7-447c-9a38-55b62816395c'])){ @php
$jindustri = $jumlah['790fdbb1-36e7-447c-9a38-55b62816395c']; if(isset($jumlah['53aff26e-c76f-4b7a-b7c5-88d31afe5880'])){
} else { $jdosenluar = $jumlah['53aff26e-c76f-4b7a-b7c5-88d31afe5880'];
$jindustri = 0; } else {
} $jdosenluar = 0;
@endphp }
<h4 class="fw-bolder mb-0">{{ $jindustri }}</h4> @endphp
<p class="card-text font-small-3 mb-0">Industri</p> <h4 class="fw-bolder mb-0">{{ $jdosenluar }}</h4>
<p class="card-text font-small-3 mb-0">Dosen Luar</p>
</div>
</div>
</div>
<div class="col-xl-3 col-sm-6 col-12">
<div class="d-flex flex-row">
<div class="avatar bg-light-danger me-2">
<div class="avatar-content">
<i data-feather="users" class="avatar-icon"></i>
</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>
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
<div class="col-md-3"> <div class="col-md-3">
<label>Periode</label> <label>Periode</label>
<select name="periode" class="form-control"> <select name="periode" class="form-control">
<option value="">Semua</option>
@foreach($periode as $p) @foreach($periode as $p)
<option value={{ $p->periode }} @if( Session::get('periode') == $p->periode) selected="selected" @endif>{{ $p->periode }}</option> <option value={{ $p->periode }} @if( Session::get('periode') == $p->periode) selected="selected" @endif>{{ $p->periode }}</option>
@endforeach @endforeach
...@@ -50,21 +49,25 @@ ...@@ -50,21 +49,25 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@php @if($rs->isNotEmpty())
$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->nip }}</td>
<td style="text-align: left">{{ $item->unit }}</td>
<td style="text-align: left">{{ $item->jumlah }}</td>
</tr>
@php @php
$no++; $no = 1;
@endphp @endphp
@endforeach @foreach($rs as $item)
<tr>
<td>{{ $no }}</td>
<td style="text-align: left">{{ $item->nama }}</td>
<td style="text-align: left">{{ $item->nip }}</td>
<td style="text-align: left">{{ $item->unit }}</td>
<td style="text-align: left">{{ $item->jumlah }}</td>
</tr>
@php
$no++;
@endphp
@endforeach
@else
<td colspan="5" style="text-align: center">Data tidak ditemukan.</td>
@endif
</tbody> </tbody>
</table> </table>
</div> </div>
......
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
</li> </li>
<li data-menu="" class="{{ (request()->getRequestUri() == "/user") ? 'active' : '' }}"><a href="{{route('user.index')}}" class="dropdown-item d-flex align-items-center" data-bs-toggle="" data-i18n="Email" ><i data-feather='user'></i><span data-i18n="Email">Master User</span></a> <li data-menu="" class="{{ (request()->getRequestUri() == "/user") ? 'active' : '' }}"><a href="{{route('user.index')}}" class="dropdown-item d-flex align-items-center" data-bs-toggle="" data-i18n="Email" ><i data-feather='user'></i><span data-i18n="Email">Master User</span></a>
</li> </li>
<li data-menu="" class="{{ (request()->getRequestUri() == "/periode") ? 'active' : '' }}"><a href="{{route('periode.index')}}" class="dropdown-item d-flex align-items-center" data-bs-toggle="" data-i18n="Email" ><i data-feather='calendar'></i><span data-i18n="Email">Master Periode</span></a>
</li>
</ul> </ul>
</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='edit'></i><span data-i18n="Apps">Transaksi</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='edit'></i><span data-i18n="Apps">Transaksi</span></a>
......
...@@ -9,17 +9,25 @@ ...@@ -9,17 +9,25 @@
<div class="card-body"> <div class="card-body">
<div class="card-text"> <div class="card-text">
<div class="row"> <div class="row">
<div class="col-md-8"> <div class="panel panel-info">
{{-- @livewire('admin.masters.registrasi.add-registrasi-component') --}} <div class="panel-body">
</div> <form action="{{ route('saku.index') }}" method="GET">
<div class="col-md-4 text-right"> <div class="row">
{{-- <div class="row"> <div class="col-md-3">
<label class="col-sm-3 col-form-label"></label> <label>Periode</label>
<label class="col-sm-3 col-form-label">Cari : </label> <select name="periode" class="form-control">
<div class="col-sm-6"> @foreach($periode as $p)
<input type="text" class="form-control align-right" placeholder="Search" wire:model="keyword"> <option value={{ $p->periode }} @if( Session::get('periode') == $p->periode) selected="selected" @endif>{{ $p->periode }}</option>
</div> @endforeach
</div> --}} </select>
</div>
<div class="col-md-2">
<br>
<button class="btn btn-info pull-lefts">Cari</button>
</div>
</div>
</form>
</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -41,50 +49,54 @@ ...@@ -41,50 +49,54 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@php @if($penelaah->isNotEmpty())
$no = 1; @php
$nomorsurat = $penelaah[0]->no_sk; $no = 1;
$no_surat = explode('/', $nomorsurat); $nomorsurat = $penelaah[0]->no_sk;
$noagenda = $no_surat[0]; $no_surat = explode('/', $nomorsurat);
$tahun = $no_surat[3]; $noagenda = $no_surat[0];
$nama_file = app(App\Http\Controllers\Admin\SakuController::class)->getFileName($tahun, $noagenda); $tahun = $no_surat[3];
@endphp $nama_file = app(App\Http\Controllers\Admin\SakuController::class)->getFileName($tahun, $noagenda);
@foreach($penelaah as $key => $item) @endphp
@php @foreach($penelaah as $key => $item)
// $pengajuan = DB::table('tr_pengajuan')->where('id',$item->id_pengajuan)->first();
if($item->no_sk == $nomorsurat){
$namafile = $nama_file;
}
else{
$nosurat = explode('/', $item->no_sk);
$noagenda = $nosurat[0];
$tahun = $nosurat[3];
$namafile = app(App\Http\Controllers\Admin\SakuController::class)->getFileName($tahun, $noagenda);
}
@endphp
<tr>
<td>{{ $no }}</td>
{{-- <td>{{ $item->id_pengajuan_epk }}</td> --}}
<td style="text-align: left"><a href="https://e-office.unesa.ac.id/dokumen/surat_keluar/{{$namafile}}" target="_blank"><img src="{{ url('assets/img/icons/misc/pdf.png') }}" alt="pdf" height="60" class="me-3" /></a></td>
<td style="text-align: left">{{ $item->nama }}<br>
<strong>{{ $item->nip }}</strong></td>
<td style="text-align: left">{{ $item->judul }}</td>
<td style="text-align: left">{{ $item->tahun }}</td>
<td style="text-align: left">{{ $item->klasifikasi }}</td>
<td style="text-align: left">
@if(!empty($item->file_ec))
<strong><a href="https://sipeka.unesa.ac.id/sipeka/file/{!!$item->file_ec!!}" target="_blank" class="btn btn-success btn-md">Lihat</a></strong>
@endif
</td>
{{-- @php
$kategori = DB::table('ms_kategori')->where('id',$pengajuan->id_kategori)->first();
@endphp --}}
<td style="text-align: left">{{ $item->nama_kategori }}</td>
</tr>
@php @php
$no++; // $pengajuan = DB::table('tr_pengajuan')->where('id',$item->id_pengajuan)->first();
if($item->no_sk == $nomorsurat){
$namafile = $nama_file;
}
else{
$nosurat = explode('/', $item->no_sk);
$noagenda = $nosurat[0];
$tahun = $nosurat[3];
$namafile = app(App\Http\Controllers\Admin\SakuController::class)->getFileName($tahun, $noagenda);
}
@endphp @endphp
@endforeach <tr>
<td>{{ $no }}</td>
{{-- <td>{{ $item->id_pengajuan_epk }}</td> --}}
<td style="text-align: left"><a href="https://e-office.unesa.ac.id/dokumen/surat_keluar/{{$namafile}}" target="_blank"><img src="{{ url('assets/img/icons/misc/pdf.png') }}" alt="pdf" height="60" class="me-3" /></a></td>
<td style="text-align: left">{{ $item->nama }}<br>
<strong>{{ $item->nip }}</strong></td>
<td style="text-align: left">{{ $item->judul }}</td>
<td style="text-align: left">{{ $item->tahun }}</td>
<td style="text-align: left">{{ $item->klasifikasi }}</td>
<td style="text-align: left">
@if(!empty($item->file_ec))
<strong><a href="https://sipeka.unesa.ac.id/sipeka/file/{!!$item->file_ec!!}" target="_blank" class="btn btn-success btn-md">Lihat</a></strong>
@endif
</td>
{{-- @php
$kategori = DB::table('ms_kategori')->where('id',$pengajuan->id_kategori)->first();
@endphp --}}
<td style="text-align: left">{{ $item->nama_kategori }}</td>
</tr>
@php
$no++;
@endphp
@endforeach
@else
<td colspan="8" style="text-align: center">Data tidak ditemukan.</td>
@endif
</tbody> </tbody>
</table> </table>
</div> </div>
......
...@@ -35,15 +35,14 @@ ...@@ -35,15 +35,14 @@
<option value="2" @if( Session::get('status') =='2') selected="selected" @endif>BELUM</option> <option value="2" @if( Session::get('status') =='2') selected="selected" @endif>BELUM</option>
</select> </select>
</div> </div>
{{-- <div class="col-md-3"> <div class="col-md-3">
<label>Kategori</label> <label>Periode</label>
<select name="kategori" class="form-control"> <select name="periode" class="form-control">
<option value="">Pilih</option> @foreach($periode as $p)
@foreach($kategori as $k) <option value={{ $p->periode }} @if( Session::get('periode') == $p->periode) selected="selected" @endif>{{ $p->periode }}</option>
<option value="{{ $k->id }}" @if( Session::get('kategori') == $k->id) selected="selected" @endif>{{ $k->kode_kategori }} - {{ $k->nama_kategori }}</option>
@endforeach @endforeach
</select> </select>
</div> --}} </div>
<div class="col-md-2"> <div class="col-md-2">
<br> <br>
<button class="btn btn-info pull-lefts">Cari</button> <button class="btn btn-info pull-lefts">Cari</button>
...@@ -73,108 +72,112 @@ ...@@ -73,108 +72,112 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@foreach($pengusul as $item) @if($pengusul->isNotEmpty())
<tr> @foreach($pengusul as $item)
<td>{{ $no }}</td> <tr>
<td style="text-align: left">{{ $item->judul }}</td> <td>{{ $no }}</td>
<td style="text-align: left">{{ $item->peneliti_utama }}</td> <td style="text-align: left">{{ $item->judul }}</td>
<td style="text-align: left">{{ date('Y',strtotime($item->tanggal_keputusan)) }}</td> <td style="text-align: left">{{ $item->peneliti_utama }}</td>
@php <td style="text-align: left">{{ date('Y',strtotime($item->tanggal_keputusan)) }}</td>
$penelaah = DB::table('bantuan_penelaah')->where('id_pengajuan', $item->id_pengajuan)->get();
@endphp
<td style="text-align: left">
@foreach($penelaah as $p)
{{ $p->penelaah.";" }}<br><br>
@endforeach
</td>
<td style="text-align: left">{{ $item->klasifikasi }}</td>
@php
$pengajuan = DB::table('tr_pengajuan')->where('id_pengajuan',$item->id_pengajuan)->first();
@endphp
@if(empty($pengajuan))
<td>
<button type="button" class="btn btn-warning btn-sm" data-bs-toggle="modal" data-bs-target="#updateKategoriModal{{ $item->id_pengajuan }}"><i data-feather='edit'></i></button>
</td>
@else
@php @php
$kat = DB::table('ms_kategori')->where('id',$pengajuan->id_kategori)->first(); $penelaah = DB::table('bantuan_penelaah')->where('id_pengajuan', $item->id_pengajuan)->get();
@endphp @endphp
<td style="text-align: left">{{ $kat->nama_kategori }}</td> <td style="text-align: left">
@endif @foreach($penelaah as $p)
</tr> {{ $p->penelaah.";" }}<br><br>
@endforeach
<!-- edit registrasi modal --> </td>
<div class="modal fade" id="updateKategoriModal{{ $item->id_pengajuan }}" tabindex="-1" aria-labelledby="updateKategori" aria-hidden="true"> <td style="text-align: left">{{ $item->klasifikasi }}</td>
<div class="modal-dialog modal-dialog-centered modal-lg"> @php
<div class="modal-content"> $pengajuan = DB::table('tr_pengajuan')->where('id_pengajuan',$item->id_pengajuan)->first();
<form method="POST" action="{{ route('transaksi.store') }}" enctype="multipart/form-data" id="registrasi"> @endphp
@csrf @if(empty($pengajuan))
<div class="modal-header bg-transparent"> <td>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> <button type="button" class="btn btn-warning btn-sm" data-bs-toggle="modal" data-bs-target="#updateKategoriModal{{ $item->id_pengajuan }}"><i data-feather='edit'></i></button>
</div> </td>
<div class="modal-body pb-5 px-sm-4 mx-50"> @else
<h1 class="address-title text-center mb-1" id="addNewAddressTitle">Update Kategori Peneliti</h1> @php
<div class="row"> $kat = DB::table('ms_kategori')->where('id',$pengajuan->id_kategori)->first();
<input type="hidden" name="idpengajuan" value="{{ $item->id_pengajuan }}"> @endphp
<div class="col-md-12"> <td style="text-align: left">{{ $kat->nama_kategori }}</td>
<label class="form-label" for="judul">Judul</label> @endif
<input type="textarea" class="form-control" id="judul" name="judul" value="{{ $item->judul }}" readonly /> </tr>
<!-- edit registrasi modal -->
<div class="modal fade" id="updateKategoriModal{{ $item->id_pengajuan }}" tabindex="-1" aria-labelledby="updateKategori" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered modal-lg">
<div class="modal-content">
<form method="POST" action="{{ route('transaksi.store') }}" enctype="multipart/form-data" id="registrasi">
@csrf
<div class="modal-header bg-transparent">
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body pb-5 px-sm-4 mx-50">
<h1 class="address-title text-center mb-1" id="addNewAddressTitle">Update Kategori Peneliti</h1>
<div class="row">
<input type="hidden" name="idpengajuan" value="{{ $item->id_pengajuan }}">
<div class="col-md-12">
<label class="form-label" for="judul">Judul</label>
<input type="textarea" class="form-control" id="judul" name="judul" value="{{ $item->judul }}" readonly />
</div>
<div class="col-md-12">
<label class="form-label" for="peneliti">Peneliti</label>
<input type="text" class="form-control" id="peneliti" name="peneliti" value="{{ $item->peneliti_utama }}" readonly />
</div>
<div class="col-md-6">
<label class="form-label" for="tahun">Tahun</label>
<input type="text" class="form-control" id="tahun" name="tahun" value="{{ date('Y',strtotime($item->tanggal_keputusan)) }}" readonly />
</div>
<div class="col-md-6">
<label class="form-label" for="klasifikasi">Klasifikasi</label>
<input type="text" class="form-control" id="klasifikasi" name="klasifikasi" value="{{ $item->klasifikasi }}" readonly />
</div>
<div class="col-md-6">
<label class="form-label" for="kategori">Kategori Peneliti</label>
<select class="form-control" id="kategori" name="kategori" data-msg="Pilih Kategori Yang Sesuai">
<option value="">Pilih Kategori</option>
@foreach($kategori as $k)
<option value="{{ $k->id }}">{{ $k->kode_kategori }} - {{ $k->nama_kategori }}</option>
@endforeach
</select>
@if ($errors->has('kategori'))
<label id="login-error" class="error" for="kategori" style="color: red">{{$errors->first('kategori')}}</label>
@endif
</div>
<div class="col-md-6">
<label class="form-label" for="file_ec">File EC</label>
<input type="file" class="form-control" id="file_ec" name="file_ec" required>
@if ($errors->has('file_ec'))
<label id="login-error" class="error" for="file_ec" style="color: red">{{$errors->first('file_ec')}}</label>
@endif
</div>
</div> </div>
<div class="col-md-12"> <div class="col-md-12">
<label class="form-label" for="peneliti">Peneliti</label> <label class="form-label" for="nosurat">No Surat E-Office</label>
<input type="text" class="form-control" id="peneliti" name="peneliti" value="{{ $item->peneliti_utama }}" readonly /> <input type="text" class="form-control" id="nosurat" name="nosurat" placeholder="Nomor Surat" data-msg="Masukkan Nomor Surat" value="" required />
</div> @if ($errors->has('nosurat'))
<div class="col-md-6"> <label id="login-error" class="error" for="nosurat" style="color: red">{{$errors->first('nosurat')}}</label>
<label class="form-label" for="tahun">Tahun</label>
<input type="text" class="form-control" id="tahun" name="tahun" value="{{ date('Y',strtotime($item->tanggal_keputusan)) }}" readonly />
</div>
<div class="col-md-6">
<label class="form-label" for="klasifikasi">Klasifikasi</label>
<input type="text" class="form-control" id="klasifikasi" name="klasifikasi" value="{{ $item->klasifikasi }}" readonly />
</div>
<div class="col-md-6">
<label class="form-label" for="kategori">Kategori Peneliti</label>
<select class="form-control" id="kategori" name="kategori" data-msg="Pilih Kategori Yang Sesuai">
<option value="">Pilih Kategori</option>
@foreach($kategori as $k)
<option value="{{ $k->id }}">{{ $k->kode_kategori }} - {{ $k->nama_kategori }}</option>
@endforeach
</select>
@if ($errors->has('kategori'))
<label id="login-error" class="error" for="kategori" style="color: red">{{$errors->first('kategori')}}</label>
@endif @endif
</div> </div>
<div class="col-md-6"> <div class="modal-footer">
<label class="form-label" for="file_ec">File EC</label> <button type="submit" class="btn btn-primary me-1 mt-2">Simpan</button>
<input type="file" class="form-control" id="file_ec" name="file_ec" required> <button type="reset" class="btn btn-outline-secondary mt-2" data-bs-dismiss="modal" aria-label="Close">
@if ($errors->has('file_ec')) Batalkan
<label id="login-error" class="error" for="file_ec" style="color: red">{{$errors->first('file_ec')}}</label> </button>
@endif
</div> </div>
</div> </form>
<div class="col-md-12"> </div>
<label class="form-label" for="nosurat">No Surat E-Office</label>
<input type="text" class="form-control" id="nosurat" name="nosurat" placeholder="Nomor Surat" data-msg="Masukkan Nomor Surat" value="" required />
@if ($errors->has('nosurat'))
<label id="login-error" class="error" for="nosurat" style="color: red">{{$errors->first('nosurat')}}</label>
@endif
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary me-1 mt-2">Simpan</button>
<button type="reset" class="btn btn-outline-secondary mt-2" data-bs-dismiss="modal" aria-label="Close">
Batalkan
</button>
</div>
</form>
</div> </div>
</div> </div>
</div> </div>
</div> @php
@php $no++;
$no++; @endphp
@endphp <!-- / edit registrasi modal -->
<!-- / edit registrasi modal --> @endforeach
@endforeach @else
<td colspan="7" style="text-align: center">Data tidak ditemukan.</td>
@endif
</tbody> </tbody>
</table> </table>
</div> </div>
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
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\LaporanController;
use App\Http\Controllers\Admin\PeriodeController;
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;
...@@ -34,5 +35,6 @@ ...@@ -34,5 +35,6 @@
Route::resource('laporan', LaporanController::class); Route::resource('laporan', LaporanController::class);
Route::post('/excel', [LaporanController::class, 'download'])->name('laporan.download'); Route::post('/excel', [LaporanController::class, 'download'])->name('laporan.download');
Route::resource('user', UserController::class); Route::resource('user', UserController::class);
Route::resource('periode', PeriodeController::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