Commit 1dfe0c6e by Triyah Fatmawati

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

parents 4dfc5d34 dfe1a845
<?php
namespace App\Http\Controllers;
namespace App\Http\Controllers\Admin;
use App\Http\Support\ValidationRule;
use Illuminate\Support\Facades\Hash;
use App\Http\Controllers\Controller;
use App\Models\Kegiatan;
use App\Models\KegiatanPeserta;
use App\Models\Konferensi;
use App\Models\Registrasi;
use App\Models\User;
use App\Models\VRegistrasi;
use App\Models\Admin\Pengajuan;
use Exception;
use Storage;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Redirect;
class TransaksiController extends Controller
class SakuController extends Controller
{
public function index() {
$tr = DB::connection('epk')->table('v_penelaah')->get();
$penelaah = DB::table('tr_penelaah')->get();
dd($tr);
$data = [
'semua' => $tr,
'penelaah' => $penelaah
];
return view('transaksi.index', $data);
return view('saku.index', $data);
}
}
<?php
namespace App\Http\Controllers\Admin;
use App\Http\Support\ValidationRule;
use App\Http\Controllers\Controller;
use App\Models\Admin\Penelaah;
use App\Models\Admin\Pengajuan;
use Exception;
use Storage;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Redirect;
class TransaksiController extends Controller
{
public function index() {
$pengusul = DB::table('bantuan_pengusul')->get();
$kategori = DB::table('ms_kategori')->orderBy('kode_kategori','asc')->get();
$data = [
'pengusul' => $pengusul,
'kategori' => $kategori
];
return view('transaksi.index', $data);
}
public function store(Request $request){
$rule = [
'kategori' => 'required',
'file_ec' => 'required',
'nosurat' => 'required'
];
$request->validate($rule, ValidationRule::getErrorMessage($rule));
DB::beginTransaction();
// if($request->hasFile('file_ec')){
// $file = $request->file('file_ec');
// $filename = $file->getClientOriginalName();
// Storage::disk('uploads')->put('sipeka/'.$filename, file_get_contents($file->getRealPath()));
// }
try{
$transaksi = [
'id_pengajuan' => $request->idpengajuan,
'judul' => $request->judul,
'pengusul' => $request->pengusul,
'klasifikasi' => $request->klasifikasi,
'tahun' => $request->tahun,
'id_kategori' => $request->kategori,
// 'file_ec' => $filename,
'no_sk' => $request->nosurat,
];
Pengajuan::query()->create($transaksi);
$hasil = DB::table('tr_pengajuan')->where('id_pengajuan',$request->idpengajuan)->first();
$reviewer = DB::table('bantuan_penelaah')->where('id_pengajuan',$request->idpengajuan)->get();
foreach($reviewer as $r){
$isdm = DB::connection('isdm')->table('v_detil_pegawai')->where('noktp',$r->nik)->select('namalengkap','nip')->first();
$saku = [
'id_pengajuan' => $hasil->id,
'nik' => $r->nik,
'nama' => $isdm->namalengkap,
'nip' => $isdm->nip
];
Penelaah::query()->create($saku);
}
DB::commit();
return Redirect::route('transaksi.index')
->with('success', 'Data kategori berhasil diupdate');
}
catch(Exception $e){
Log::error($e);
DB::rollBack();
return Redirect::route('transaksi.index')
->with('error', 'Data kategori gagal diupdate');
}
}
}
<?php
namespace App\Models\Admin;
use App\Traits\Uuid;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Penelaah extends Model
{
use HasFactory;
use Uuid;
public $incrementing = false;
protected $table = 'tr_penelaah';
protected $keyType = 'string';
protected $fillable = [
'id',
'id_pengajuan',
'nik',
'nama',
'nip'
];
}
<?php
namespace App\Models\Admin;
use App\Traits\Uuid;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Pengajuan extends Model
{
use HasFactory;
use Uuid;
public $incrementing = false;
protected $table = 'tr_pengajuan';
protected $keyType = 'string';
protected $fillable = [
'id',
'id_pengajuan',
'judul',
'pengusul',
'klasifikasi',
'tahun',
'id_kategori',
'file_ec',
'no_sk'
];
}
......@@ -117,8 +117,19 @@
'prefix' => '',
'strict' => false,
'engine' => null,
'options' => [
\PDO::MYSQL_ATTR_LOCAL_INFILE => true,
],
],
'ssh' => [
'host' => env('SSH_HOST'),
'port' => env('SSH_PORT'),
'username' => env('SSH_USER'),
'key' => env('SSH_KEY'),
],
],
/*
......
......@@ -56,6 +56,14 @@
'throw' => false,
],
'uploads' => [
'driver' => 'ftp',
'host' => 'statik.unesa.ac.id',
'username' => 'anchuz',
'password' => 'k0nt3nstatik@un3s4ppt1!)@(#*',
'ssl' => true,
],
],
/*
......
......@@ -11,9 +11,9 @@
</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>
<ul class="dropdown-menu" data-bs-popper="none">
<li data-menu="" class="{{ (request()->is('/transaksi')) ? 'active' : '' }}"><a href="{{ route('admin.index-transaksi') }}" class="dropdown-item d-flex align-items-center" data-bs-toggle="" data-i18n="Email" ><i data-feather="check-square"></i><span data-i18n="Email">Update Kategori</span></a>
<li data-menu="" class="{{ (request()->getRequestUri() == "/transaksi") ? 'active' : '' }}"><a href="{{ route('transaksi.index') }}" class="dropdown-item d-flex align-items-center" data-bs-toggle="" data-i18n="Email" ><i data-feather="check-square"></i><span data-i18n="Email">Update Kategori</span></a>
</li>
<li data-menu="" class="{{ (request()->is('pasien/antrian')) ? 'active' : '' }}"><a href="#" class="dropdown-item d-flex align-items-center" data-bs-toggle="" data-i18n="Todo" ><i data-feather='log-in'></i><span data-i18n="Todo">Tarik Data SAKU</span></a>
<li data-menu="" class="{{ (request()->getRequestUri() == "/saku") ? 'active' : '' }}"><a href="{{ route('saku.index') }}" class="dropdown-item d-flex align-items-center" data-bs-toggle="" data-i18n="Todo" ><i data-feather='log-in'></i><span data-i18n="Todo">Tarik Data SAKU</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">
<h4 class="card-title">Daftar Reviewer</h4>
</div>
<div class="card-body">
<div class="card-text">
<div class="row">
<div class="col-md-8">
{{-- @livewire('admin.masters.registrasi.add-registrasi-component') --}}
</div>
<div class="col-md-4 text-right">
{{-- <div class="row">
<label class="col-sm-3 col-form-label"></label>
<label class="col-sm-3 col-form-label">Cari : </label>
<div class="col-sm-6">
<input type="text" class="form-control align-right" placeholder="Search" wire:model="keyword">
</div>
</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. Pengajuan</th>
<th style="text-align: left">File SK</th>
<th style="text-align: left">Nama</th>
<th style="text-align: left">Judul</th>
<th style="text-align: left">Tahun</th>
<th style="text-align: left">Klasifikasi</th>
<th style="text-align: left">File EC</th>
<th style="text-align: left">Kategori</th>
</tr>
</thead>
<tbody>
@foreach($penelaah as $item)
@php
$pengajuan = DB::table('tr_pengajuan')->where('id',$item->id_pengajuan)->first();
@endphp
<tr>
<td>{{ $pengajuan->id_pengajuan }}</td>
<td style="text-align: left">SURAT</td>
<td style="text-align: left">{{ $item->nama }}</td>
<td style="text-align: left">{{ $pengajuan->judul }}</td>
<td style="text-align: left">{{ $pengajuan->tahun }}</td>
<td style="text-align: left">{{ $pengajuan->klasifikasi }}</td>
<td style="text-align: left">FILE EC</td>
@php
$kategori = DB::table('ms_kategori')->where('id',$pengajuan->id_kategori)->first();
@endphp
<td style="text-align: left">{{ $kategori->nama_kategori }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
@push('js')
@endpush
@stop
......@@ -2,7 +2,8 @@
use App\Http\Controllers\Admin\Auth\LoginController;
use App\Http\Controllers\Admin\KategoriController;
use App\Http\Controllers\TransaksiController;
use App\Http\Controllers\Admin\TransaksiController;
use App\Http\Controllers\Admin\SakuController;
use Illuminate\Support\Facades\Route;
/*
......@@ -20,12 +21,14 @@
return view('Admin.login');
});
Route::get('/transaksi', [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::get('/home', function () {
return view('dashboard');
});
Route::resource('kategori', KategoriController::class);
Route::resource('transaksi', TransaksiController::class);
Route::resource('saku', SakuController::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