layanan DPA DPU done

This commit is contained in:
fikyb 2024-03-07 18:13:09 +07:00
parent 1c2c1572f6
commit 9bda449de6
12 changed files with 708 additions and 62 deletions

View File

@ -2,15 +2,21 @@
namespace App\Http\Controllers;
use App\Jobs\layananPengajuanDpuDpaJob;
use App\Models\Mahasiswa;
use App\Models\PengajuanDpuDpa;
use App\Models\User;
use Carbon\Carbon;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Storage;
use PhpParser\Node\Expr\Cast\Object_;
use Spatie\Permission\Models\Role;
class LayananPengajuanDpuDpaController extends Controller
{
//done
public function index(){
$data = PengajuanDpuDpa::
select('pengajuan_dpu_dpas.*',
@ -25,10 +31,54 @@ public function index(){
->get();
return view('layanan-dpudpa.index',['title' => 'Pengajuan DPU/DPA | Admin Dashboard','data' => $data]);
}
//done
public function tambah(){
$dosen = User::role('Dosen')->get();
return view('layanan-dpudpa.tambah',['dosen'=>$dosen]);
}
//done
public function terima(Request $request){
$id = $request->id;
$countcaseid = PengajuanDpuDpa::where('updated_at','<=',Carbon::today())->count();
$caseid = "LS".date_format(date_create(),"ymd").$countcaseid+1;
$cekData = PengajuanDpuDpa::where('caseid',$caseid)->first();
$data = PengajuanDpuDpa::where('id',$id)->first();
//cek apakah ada caseid yang sama sebelum disave
if(!is_null($cekData)){
$data->updated_at = Carbon::now();
$data->save();
return redirect()->route('layanan-dpudpa.index')->with('error','Gagal simpan Data, Cek kembali Detail Data yang akan diterima');
}
//save CASEID dan kirim email
$data->caseid = $caseid;
$data->ttd_operator = Carbon::now();
if($data->save()){
$data_job = [
[
'jenis' => 'mahasiswa',
'id' => $id,
],
[
'jenis' => 'dpu',
'id' => $id,
],
[
'jenis' => 'dpa',
'id' => $id,
],
];
foreach($data_job as $item){
dispatch(new layananPengajuanDpuDpaJob($item));
}
return redirect()->route('layanan-dpudpa.index')->with('success','Data Berhasil Disimpan, Email Akan Dikirimkan ke Mahasiswa, DPU dan DPA');
}
}
//done
public function store(Request $request){
$request->validate([
@ -52,41 +102,202 @@ public function store(Request $request){
'file_transkrip.mimes'=>'Format File Bukan PDF, Cek Ulang file anda',
'file_transkrip.max'=>'Ukuran File Anda lebih dari 4Mb, Cek Ulang File anda',
]);
//Cek Apakah Data Mahasiswa Tersebut sudah ada, jika ada maka diminta untuk menggunakan fitur cari
$mahasiswas_id = Mahasiswa::where('nim',$request->nim)->first();
if(!is_null($mahasiswas_id)){
return redirect()->route('layanan-dpudpa.tambah')->with('error','Data Anda Sudah Ada, Gunakan Fitur Cari');
}
$data_mhs['nim'] = $request->nim;
$data_mhs['nama'] = $request->nama;
$data_mhs['nomor_hp'] = $request->nomor_hp;
$data_mhs['email'] = $request->email;
$data_mhs['judul_seminar_proposal'] = $request->judul_seminar_proposal;
$data_mhs['bagian'] = $request->bagian;
$data_mhs['dosen_dpu_id'] = $request->dosen_dpu;
$data_mhs['dosen_dpa_id'] = $request->dosen_dpa;
//set default to 0
$data_mhs['dosen_penguji1_id'] = 1;
$data_mhs['dosen_penguji2_id'] = 1;
$data_mhs['judul_skripsi_id'] = '-';
$data_mhs['judul_skripsi_en'] = '-';
$data_mhs['judul_jurnal'] = '-';
$data_mhs['judul_artikel'] = '-';
//set penyimpanan file
$file_transkrip = $request->file('file_transkrip');
$file_transkrip_name = 'LS_'.str_replace(' ', '_',$file_transkrip->getClientOriginalName());
$path = $request->nim.'/'.$file_transkrip_name;
//jika berhasil save file maka data mhs akan disimpan, dan pengajuan akan diisi
if(Storage::disk('public')->put($path, file_get_contents($file_transkrip))){
$data_mhs['nim'] = $request->nim;
$data_mhs['nama'] = $request->nama;
$data_mhs['nomor_hp'] = $request->nomor_hp;
$data_mhs['email'] = $request->email;
$data_mhs['judul_seminar_proposal'] = $request->judul_seminar_proposal;
$data_mhs['bagian'] = $request->bagian;
$data_mhs['dosen_dpu_id'] = $request->dosen_dpu;
$data_mhs['dosen_dpa_id'] = $request->dosen_dpa;
//set default to -
$data_mhs['dosen_penguji1_id'] = 1;
$data_mhs['dosen_penguji2_id'] = 1;
$data_mhs['judul_skripsi_id'] = '-';
$data_mhs['judul_skripsi_en'] = '-';
$data_mhs['judul_jurnal'] = '-';
$data_mhs['judul_artikel'] = '-';
if(Mahasiswa::create($data_mhs)){
$mahasiswas_id = Mahasiswa::where('nim',$request->nim)->first();
$data_dpudpa['mahasiswas_id'] = $mahasiswas_id->id;
$data_dpudpa['bukti_transkrip_nilai'] = $file_transkrip_name;
PengajuanDpuDpa::create($data_dpudpa);
return redirect()->route('layanan-dpudpa.tambah')->with('success','Sukses Tambah Data, Silahkan Menunggu Email Konfirmasi setelah disetujui Oleh Operator');
}
return redirect()->route('layanan-dpudpa.tambah')->with('error','Gagal Tambah data, Cek kembali data yang anda masukkan');
//jika berhasil save file dan save data mhs maka pengajuan akan diisi
if(Storage::disk('public')->put($path, file_get_contents($file_transkrip)) && Mahasiswa::create($data_mhs)){
$mahasiswas_id = Mahasiswa::where('nim',$request->nim)->first();
$data_dpudpa['mahasiswas_id'] = $mahasiswas_id->id;
$data_dpudpa['bukti_transkrip_nilai'] = $file_transkrip_name;
PengajuanDpuDpa::create($data_dpudpa);
return redirect()->route('layanan-dpudpa.tambah')->with('success','Sukses Tambah Data, Silahkan Menunggu Email Konfirmasi setelah disetujui Oleh Operator');
}
return redirect()->route('layanan-dpudpa.tambah')->with('error','Gagal Tambah data, Cek kembali data yang anda masukkan');
}
//done
public function destroy(Request $request){
$id = $request->id;
//cari data dan kirim notif sebelum dihapus
$data = PengajuanDpuDpa::where('pengajuan_dpu_dpas.id',$id)
->join('mahasiswas','mahasiswas_id','=','mahasiswas.id')
->first();
$data_job = [
'jenis' => 'penolakan',
'nama' => $data->nama,
'email' => $data->email,
'created_at' => $data->created_at,
'alasan' => $request->alasan,
];
$path = $data->nim."/".$data->bukti_transkrip_nilai;
//hapus file yang diupload mahasiswa
if(Storage::disk('public')->exists($path)){
Storage::disk('public')->delete($path);
//hapus data pengajuan mahasiswa
return redirect()->route('layanan-dpudpa.index')->with('error','Gagal Hapus Data, File Mahasiswa Yang akan dihapus tidak ditemukan');
}
$dataDelete = PengajuanDpuDpa::findOrFail($id);
//kirim notifikasi jika data berhasil dihapus
if($dataDelete->delete()){
dispatch(new layananPengajuanDpuDpaJob($data_job));
return redirect()->route('layanan-dpudpa.index')->with('success','Permintaan Sudah Diproses, Email akan segera dikirim ke penerima');
}
return redirect()->route('layanan-dpudpa.index')->with('error','Gagal Hapus Data, coba cek data yang akan dihapus lalu coba lagi!');
}
public function ettd($url, $caseid){
$role_untuk_ettd = ['dpu','dpa','kombi'];
$data = PengajuanDpuDpa::where('caseid','=',$caseid)
->select('pengajuan_dpu_dpas.id',
'pengajuan_dpu_dpas.caseid',
'mahasiswas.nama',
'mahasiswas.nim',
'mahasiswas.judul_seminar_proposal',
'dosen_dpu.nama_gelar as dosen_dpu_nama_gelar',
'dosen_dpa.nama_gelar as dosen_dpa_nama_gelar',
)
->join('mahasiswas','pengajuan_dpu_dpas.mahasiswas_id','=','mahasiswas.id')
->join('users as dosen_dpu','mahasiswas.dosen_dpu_id','=','dosen_dpu.id')
->join('users as dosen_dpa','mahasiswas.dosen_dpa_id','=','dosen_dpa.id')
->first();
if(in_array($url, $role_untuk_ettd) && !is_null($data)){
//jika URL DPU maka render ini
if($url=='dpu'){
$jenis = 'Dosen Pembimbing Utama';
return view('layanan-dpudpa.ettd',['title'=> 'INPUT E-Signature','jenis'=>$jenis,'data'=> $data]);
}
//jika URL DPA maka render ini
elseif($url=='dpa'){
$jenis = 'Dosen Pembimbing Anggota';
return view('layanan-dpudpa.ettd',['title'=> 'INPUT E-Signature','jenis'=>$jenis,'data'=> $data]);
}
//jika URL Kombi maka render ini
elseif($url=='kombi'){
$jenis = 'Komisi Bimbingan';
$kombiRole = Role::findByName('Ketua Kombi')->users;
$dataKombi = [
'caseid' => $data->caseid,
'nama' => $data->nama,
'nim' => $data->nim,
'judul_seminar_proposal' => $data->judul_seminar_proposal,
'dosen_kombi_nama_gelar' => $kombiRole[0]->nama_gelar,
];
$jenis = 'Komisi Bimbingan';
return view('layanan-dpudpa.ettd',['title'=> 'INPUT E-Signature','jenis'=>$jenis,'data'=> $dataKombi]);
}
}
//jika URL tidak diantara ketika itu maka render ini
return redirect()->route('laman-awal')->with(['error'=>'Invalid CASEID, Atau CaseID Tidak Ditemukan']);
}
public function submitettd($url, $caseid, Request $request){
$role_untuk_ettd = ['dpu','dpa','kombi'];
$data = PengajuanDpuDpa::where('caseid','=',$caseid)->first();
if(in_array($url, $role_untuk_ettd) && !is_null($data)){
//jika URL DPU maka render ini
if($url=='dpu'){
//jika sudah pernah ETTD Akan Dikembalikan Ke laman TTD Dengan error
if($data->ttd_dpu!='-'){
return redirect()->route('layanan-dpudpa.ettd',['url'=>$url, 'caseid'=>$caseid])->with(['error'=>'CaseID Ini Sudah Pernah Anda Tandatangani Pada '.$data->ttd_dpu]);
}
//ambil data ETTD sesuai url
$ttd = Mahasiswa::where('nim',$request->nim)->join('users as dosen_dpu','mahasiswas.dosen_dpu_id','=','dosen_dpu.id')->first();
//jika Belum Pernah maka TTD akan diproses
if($ttd->ettd==$request->ettd){
$data->ttd_dpu = Carbon::now();
$data->save();
$this->cek_dpa_dpu($caseid);
return redirect()->route('laman-awal')->with(['success'=>'Terimakasih Telah Melakukan Tanda Tangan']);
}
//jika ETTD Tidak sesuai Akan Dikembalikan Ke laman TTD Dengan error
else{
return redirect()->route('layanan-dpudpa.ettd',['url'=>$url, 'caseid'=>$caseid])->with(['error'=>'E-TTD Tidak Sesuai, Cek Kembali ETTD Anda']);
}
}
//jika URL DPa maka render ini
if($url=='dpa'){
//jika sudah pernah ETTD Akan Dikembalikan Ke laman TTD Dengan error
if($data->ttd_dpa!='-'){
return redirect()->route('layanan-dpudpa.ettd',['url'=>$url, 'caseid'=>$caseid])->with(['error'=>'CaseID Ini Sudah Pernah Anda Tandatangani Pada '.$data->ttd_dpa]);
}
//ambil data ETTD sesuai url
$ttd = Mahasiswa::where('nim',$request->nim)->join('users as dosen_dpa','mahasiswas.dosen_dpa_id','=','dosen_dpa.id')->first();
//jika Belum Pernah maka TTD akan diproses
if($ttd->ettd==$request->ettd){
$data->ttd_dpa = Carbon::now();
$data->save();
$this->cek_dpa_dpu($caseid);
return redirect()->route('laman-awal')->with(['success'=>'Terimakasih Telah Melakukan Tanda Tangan']);
}
//jika ETTD Tidak sesuai Akan Dikembalikan Ke laman TTD Dengan error
else{
return redirect()->route('layanan-dpudpa.ettd',['url'=>$url, 'caseid'=>$caseid])->with(['error'=>'E-TTD Tidak Sesuai, Cek Kembali ETTD Anda']);
}
}
//jika URL Kombi maka render ini
if($url=='kombi'){
//jika sudah pernah ETTD Akan Dikembalikan Ke laman TTD Dengan error
if($data->ttd_kombi!='-'){
return redirect()->route('layanan-dpudpa.ettd',['url'=>$url, 'caseid'=>$caseid])->with(['error'=>'CaseID Ini Sudah Pernah Anda Tandatangani Pada '.$data->ttd_kombi]);
}
//ambil data ETTD sesuai url
$ttd = Role::findByName('Ketua Kombi')->users;
//jika Belum Pernah maka TTD akan diproses
if($ttd[0]->ettd==$request->ettd){
$data->ttd_kombi = Carbon::now();
$data->save();
$data = [
'jenis' => 'mahasiswa selesai',
'id' => $data->id,
];
dispatch(new layananPengajuanDpuDpaJob($data));
return redirect()->route('laman-awal')->with(['success'=>'Terimakasih Telah Melakukan Tanda Tangan']);
}
//jika ETTD Tidak sesuai Akan Dikembalikan Ke laman TTD Dengan error
else{
return redirect()->route('layanan-dpudpa.ettd',['url'=>$url, 'caseid'=>$caseid])->with(['error'=>'E-TTD Tidak Sesuai, Cek Kembali ETTD Anda']);
}
}
}
}
//cek apakah DPU dan DPU sudah Tanda tangan, jika sudah maka akan mengirim notifikasi ke Kombi
private function cek_dpa_dpu($caseid){
$status = PengajuanDpuDpa::where('caseid',$caseid)
->select('id','ttd_dpu','ttd_dpa')
->first();
if($status->ttd_dpu!='-' && $status->ttd_dpa!='-'){
$data = [
'jenis' => 'kombi',
'id' => $status->id,
];
dispatch(new layananPengajuanDpuDpaJob($data));
}
return redirect()->route('layanan-dpudpa.tambah')->with('error','Gagal Tambah data, Cek kembali data yang anda masukkan');
}
}

View File

@ -99,7 +99,7 @@ public function userroles_index(){
public function userroles_store(Request $request){
$user_roles = new Role;
$user_roles->nama = $request->role_name;
$user_roles->name = $request->role_name;
if($user_roles->save()){
return redirect()->route('users-roles.index')->with('success','Data Telah Berhasil Disimpan');

View File

@ -0,0 +1,94 @@
<?php
namespace App\Jobs;
use App\Models\PengajuanDpuDpa;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Ixudra\Curl\Facades\Curl;
use Spatie\Permission\Models\Role;
class layananPengajuanDpuDpaJob implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
public $data;
public function __construct($data)
{
$this->data = $data;
}
/**
* Execute the job.
*/
public function handle(): void
{
if($this->data['jenis']==="penolakan"){
$text = "BETA\n".
"Penolakan Pengajuan Mahasiswa: ".$this->data['nama']."\n".
"Dengan Email : ".$this->data['email']."\n\n".
"Alasan : ".$this->data['alasan'];
Curl::to('https://api.telegram.org/bot6161516511:AAGZhf_o31HupIogjUbEgvwjukes-3P3zPo/sendMessage')
->withData( array( 'chat_id' => '-1001903808078', 'text' => $text, 'parse_mode' => 'Markdown') )
->get();
}
elseif($this->data['jenis'] == 'dpu'){
$data = PengajuanDpuDpa::where('pengajuan_dpu_dpas.id',$this->data['id'])->select('mahasiswas.nama','mahasiswas.nim','mahasiswas.judul_seminar_proposal','mahasiswas.dosen_dpu_id','users.nama_gelar','users.email')->join('mahasiswas','mahasiswas.id','=','mahasiswas_id')->join('users','users.id','=','dosen_dpu_id')->first();
$text = "BETA\n".
"Kirim Pengajuan A/N Mahasiswa: ".$data->nama."\n".
"Kepada DPU : ".$data->nama_gelar."\n\n".
"Alamat Email : ".$data->email;
Curl::to('https://api.telegram.org/bot6161516511:AAGZhf_o31HupIogjUbEgvwjukes-3P3zPo/sendMessage')
->withData( array( 'chat_id' => '-1001903808078', 'text' => $text, 'parse_mode' => 'Markdown') )
->get();
}
elseif($this->data['jenis'] == 'dpa'){
$data = PengajuanDpuDpa::where('pengajuan_dpu_dpas.id',$this->data['id'])->select('mahasiswas.nama','mahasiswas.nim','mahasiswas.judul_seminar_proposal','mahasiswas.dosen_dpa_id','users.nama_gelar','users.email')->join('mahasiswas','mahasiswas.id','=','mahasiswas_id')->join('users','users.id','=','dosen_dpa_id')->first();
$text = "BETA\n".
"Kirim Pengajuan A/N Mahasiswa: ".$data->nama."\n".
"Kepada DPA : ".$data->nama_gelar."\n\n".
"Alamat Email : ".$data->email;
Curl::to('https://api.telegram.org/bot6161516511:AAGZhf_o31HupIogjUbEgvwjukes-3P3zPo/sendMessage')
->withData( array( 'chat_id' => '-1001903808078', 'text' => $text, 'parse_mode' => 'Markdown') )
->get();
}
elseif($this->data['jenis'] == 'kombi'){
$kombiRole = Role::findByName('Ketua Kombi')->users;
$data = PengajuanDpuDpa::where('pengajuan_dpu_dpas.id',$this->data['id'])->select('mahasiswas.nama','mahasiswas.nim','mahasiswas.judul_seminar_proposal')->join('mahasiswas','mahasiswas.id','=','mahasiswas_id')->first();
$text = "BETA\n".
"Kirim Pengajuan A/N Mahasiswa: ".$data->nama."\n".
"Kepada Komisi Bimbingan : ".$kombiRole[0]->nama_gelar."\n\n".
"Alamat Email : ".$kombiRole[0]->email;
Curl::to('https://api.telegram.org/bot6161516511:AAGZhf_o31HupIogjUbEgvwjukes-3P3zPo/sendMessage')
->withData( array( 'chat_id' => '-1001903808078', 'text' => $text, 'parse_mode' => 'Markdown') )
->get();
}
elseif($this->data['jenis'] == 'mahasiswa'){
$data = PengajuanDpuDpa::where('pengajuan_dpu_dpas.id',$this->data['id'])->select('mahasiswas.nama','mahasiswas.nim','mahasiswas.judul_seminar_proposal','mahasiswas.email')->join('mahasiswas','mahasiswas.id','=','mahasiswas_id')->first();
$text = "BETA\n".
"Kirim Pengajuan A/N Mahasiswa: ".$data->nama."\n".
"Kepada Mahasiswa : ".$data->nama."\n\n".
"Alamat Email : ".$data->email;
Curl::to('https://api.telegram.org/bot6161516511:AAGZhf_o31HupIogjUbEgvwjukes-3P3zPo/sendMessage')
->withData( array( 'chat_id' => '-1001903808078', 'text' => $text, 'parse_mode' => 'Markdown') )
->get();
}
elseif($this->data['jenis'] == 'mahasiswa selesai'){
$data = PengajuanDpuDpa::where('pengajuan_dpu_dpas.id',$this->data['id'])->select('mahasiswas.nama','mahasiswas.nim','mahasiswas.judul_seminar_proposal','mahasiswas.email')->join('mahasiswas','mahasiswas.id','=','mahasiswas_id')->first();
$text = "BETA\n".
"Kirim Notifikasi Pengajuan Selesai A/N Mahasiswa: ".$data->nama."\n".
"Kepada Mahasiswa : ".$data->nama."\n\n".
"Alamat Email : ".$data->email;
Curl::to('https://api.telegram.org/bot6161516511:AAGZhf_o31HupIogjUbEgvwjukes-3P3zPo/sendMessage')
->withData( array( 'chat_id' => '-1001903808078', 'text' => $text, 'parse_mode' => 'Markdown') )
->get();
}
}
}

View File

@ -8,6 +8,7 @@
"php": "^8.1",
"barryvdh/laravel-debugbar": "^3.10",
"guzzlehttp/guzzle": "^7.2",
"ixudra/curl": "^6.22",
"laravel/framework": "^10.10",
"laravel/sanctum": "^3.3",
"laravel/tinker": "^2.8",

62
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "8ea36d387a8498c6177a03aae1a59e91",
"content-hash": "87ff4862c07e8d4eb3091ca090ed4ac9",
"packages": [
{
"name": "barryvdh/laravel-debugbar",
@ -1129,6 +1129,64 @@
],
"time": "2023-12-03T19:50:20+00:00"
},
{
"name": "ixudra/curl",
"version": "6.22.1",
"source": {
"type": "git",
"url": "https://github.com/ixudra/curl.git",
"reference": "0b2cc89ed5eb91d617295e7e745f3acd3ab47180"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/ixudra/curl/zipball/0b2cc89ed5eb91d617295e7e745f3acd3ab47180",
"reference": "0b2cc89ed5eb91d617295e7e745f3acd3ab47180",
"shasum": ""
},
"require": {
"ext-curl": "*",
"illuminate/support": ">=4.0",
"php": ">=5.4.0"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"Ixudra\\Curl\\CurlServiceProvider"
],
"aliases": {
"Curl": "Ixudra\\Curl\\Facades\\Curl"
}
}
},
"autoload": {
"psr-4": {
"Ixudra\\Curl\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jan Oris",
"email": "jan.oris@ixudra.be"
}
],
"description": "Custom PHP Curl library for the Laravel framework - developed by Ixudra",
"homepage": "http://ixudra.be",
"keywords": [
"Ixudra",
"curl",
"laravel"
],
"support": {
"issues": "https://github.com/ixudra/curl/issues",
"source": "https://github.com/ixudra/curl/tree/6.22.1"
},
"time": "2022-07-31T09:58:52+00:00"
},
{
"name": "laravel/framework",
"version": "v10.43.0",
@ -8385,5 +8443,5 @@
"php": "^8.1"
},
"platform-dev": [],
"plugin-api-version": "2.6.0"
"plugin-api-version": "2.2.0"
}

View File

@ -70,7 +70,7 @@
|
*/
'timezone' => 'UTC',
'timezone' => 'Asia/Jakarta',
/*
|--------------------------------------------------------------------------

View File

@ -0,0 +1,20 @@
<?php
namespace Database\Seeders;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
class MahasiswaSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
// DB::table('mahasiswas')->insert([
// 'name' => Str::random(10),
// 'email' => Str::random(10).'@example.com',
// ]);
}
}

View File

@ -18,8 +18,17 @@ public function run(): void
['name'=> 'Super Administrator'],
['name'=> 'Super Administrator'],
);
ModelsRole::create(['name'=> 'Tenaga Kependidikan']);
ModelsRole::create(['name'=> 'Dosen']);
ModelsRole::create(['name'=> 'Operator Akademik']);
ModelsRole::updateOrCreate(
['name'=> 'Tenaga Kependidikan'],
['name'=> 'Tenaga Kependidikan']
);
ModelsRole::updateOrCreate(
['name'=> 'Dosen'],
['name'=> 'Dosen']
);
ModelsRole::updateOrCreate(
['name'=> 'Operator Akademik'],
['name'=> 'Operator Akademik']
);
}
}

View File

@ -0,0 +1,171 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{ $title }}</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700&display=fallback">
<link rel="stylesheet" href="{{asset('/')}}plugins/fontawesome-free/css/all.min.css">
<link rel="stylesheet" href="{{asset('/')}}dist/css/adminlte.min.css?v=3.2.0">
<body class="hold-transition layout-top-nav">
<div class="content-wrapper">
<div class="content-header">
<div class="container">
<div class="text-center">
<h1 class="m-0"> {{ $title }} {{$jenis}}</h1>
</div>
</div>
</div>
@if($jenis!="Komisi Bimbingan")
<div class="content">
<div class="container">
<div class="card card-widget widget-user">
<div class="widget-user-header text-white" style="background: url('{{asset('/')}}dist/img/photo1.png') center center;">
<h3 class="widget-user-username text-right">{{$data->caseid}}</h3>
<h5 class="widget-user-desc text-right">{{$jenis}}</h5>
</div>
<div class="card-footer">
<div class="row">
<div class="col-sm-4 border-right">
<div class="description-block" style="margin-top: 0px; overflow: hidden;">
<h5 class="description-header">CaseID</h5>
<span class="description-text">{{$data->caseid}}</span>
</div>
</div>
<div class="col-sm-4 border-right">
<div class="description-block" style="margin-top: 0px; overflow: hidden;">
<h5 class="description-header">Nama Mahasiswa</h5>
<span class="description-text">{{ $data->nama}}</span>
</div>
</div>
<div class="col-sm-4">
<div class="description-block" style="margin-top: 0px; overflow: hidden;">
<h5 class="description-header">Tanda Tangan Oleh</h5>
<span class="description-text">@if(request('url')=="dpu") {{ $data->dosen_dpu_nama_gelar }} @elseif(request('url')=="dpa") {{ $data->dosen_dpa_nama_gelar }}@endif</span>
</div>
</div>
</div>
</div>
<div class="card-body">
@if(session('success'))
<div class="alert alert-success">
<ul>
<li>{{ session('success') }}</li>
</ul>
</div>
@endif
@if(session('error'))
<div class="alert alert-danger">
<ul>
<li>{{ session('error') }}</li>
</ul>
</div>
@endif
<form action="{{ route('layanan-dpudpa.submitettd',['url'=> request('url'), 'caseid'=>$data->caseid]) }}" method="post">
@csrf
<label for="caseid">CASEID :</label>
<input type="text" name="caseid" id="caseid" class="form-control" readonly value="{{ $data->caseid}}">
<label for="nama">Nama Mahasiswa :</label>
<input type="text" name="nama" id="nama" class="form-control" readonly value="{{ $data->nama}}">
<label for="nim">NIM Mahasiswa :</label>
<input type="text" name="nim" id="nim" class="form-control" readonly value="{{ $data->nim}}">
<label for="judul_seminar_proposal">Judul Skripsi :</label>
<input type="text" name="judul_seminar_proposal" id="judul_seminar_proposal" class="form-control" readonly value="{{ $data->judul_seminar_proposal}}">
<label for="ettd">Masukkan E-TTD {{ $jenis }} :
</label><input type="text" name="ettd" id="ettd" class="form-control" placeholder="Masukkan ETTD Anda Disini...">
<div class="float-right mt-4">
<button type="submit" class="btn btn-success">Submit</button>
</div>
</form>
</div>
</div>
</div>
</div>
@elseif($jenis=="Komisi Bimbingan")
<div class="content">
<div class="container">
<div class="card card-widget widget-user">
<div class="widget-user-header text-white" style="background: url('{{asset('/')}}dist/img/photo1.png') center center;">
<h3 class="widget-user-username text-right">{{$data['caseid']}}</h3>
<h5 class="widget-user-desc text-right">{{$jenis}}</h5>
</div>
<div class="card-footer">
<div class="row">
<div class="col-sm-4 border-right">
<div class="description-block" style="margin-top: 0px; overflow: hidden;">
<h5 class="description-header">CaseID</h5>
<span class="description-text">{{$data['caseid']}}</span>
</div>
</div>
<div class="col-sm-4 border-right">
<div class="description-block" style="margin-top: 0px; overflow: hidden;">
<h5 class="description-header">Nama Mahasiswa</h5>
<span class="description-text">{{ $data['nama']}}</span>
</div>
</div>
<div class="col-sm-4">
<div class="description-block" style="margin-top: 0px; overflow: hidden;">
<h5 class="description-header">Tanda Tangan Oleh</h5>
<span class="description-text">{{$data['dosen_kombi_nama_gelar']}}</span>
</div>
</div>
</div>
</div>
<div class="card-body">
@if(session('success'))
<div class="alert alert-success">
<ul>
<li>{{ session('success') }}</li>
</ul>
</div>
@endif
@if(session('error'))
<div class="alert alert-danger">
<ul>
<li>{{ session('error') }}</li>
</ul>
</div>
@endif
<form action="{{ route('layanan-dpudpa.submitettd',['url'=> request('url'), 'caseid'=>$data['caseid']]) }}" method="post">
@csrf
<label for="caseid">CASEID :</label>
<input type="text" name="caseid" id="caseid" class="form-control" readonly value="{{ $data['caseid']}}">
<label for="nama">Nama Mahasiswa :</label>
<input type="text" name="nama" id="nama" class="form-control" readonly value="{{ $data['nama']}}">
<label for="nim">NIM Mahasiswa :</label>
<input type="text" name="nim" id="nim" class="form-control" readonly value="{{ $data['nim']}}">
<label for="judul_seminar_proposal">Judul Skripsi :</label>
<input type="text" name="judul_seminar_proposal" id="judul_seminar_proposal" class="form-control" readonly value="{{ $data['judul_seminar_proposal']}}">
<label for="ettd">Masukkan E-TTD {{ $jenis }} :
</label><input type="text" name="ettd" id="ettd" class="form-control" placeholder="Masukkan ETTD Anda Disini...">
<div class="float-right mt-4">
<button type="submit" class="btn btn-success">Submit</button>
</div>
</form>
</div>
</div>
</div>
</div>
@endif
</div>
@include('layout.navbars.footer')
</div>
<script src="{{asset('/')}}plugins/jquery/jquery.min.js"></script>
<script src="{{asset('/')}}plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="{{asset('/')}}dist/js/adminlte.min.js?v=3.2.0"></script>
</body>
</html>

View File

@ -38,6 +38,29 @@
<h5><i class="icon fas fa-info"></i> Perhatian!</h5>
<span >CaseID Akan muncul ketika pengajuan telah diterima untuk menghindari data duplikat untuk mahasiswa yang sama.</span>
</div>
@if ($errors->any())
<div class="alert alert-danger">
<ul>
@foreach ($errors->all() as $error )
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
@if(session('success'))
<div class="alert alert-success">
<ul>
<li>{{ session('success') }}</li>
</ul>
</div>
@endif
@if(session('error'))
<div class="alert alert-danger">
<ul>
<li>{{ session('error') }}</li>
</ul>
</div>
@endif
<table id="example1" class="table table-bordered table-striped">
<thead>
<tr>
@ -55,8 +78,14 @@
<td>{{ $datas->nim }} </td>
<td>{{ $datas->dpu_nama_gelar }}</td>
<td>{{ $datas->dpa_nama_gelar }}</td>
<td><button class="btn btn-primary" data-toggle="modal" data-target="#LY{{ $datas->id }}" >Details</button> | <button class="btn btn-success">Terima</button> | <button class="btn btn-danger">Tolak</button></td>
<td class="text-center">
<button class="btn btn-primary" data-toggle="modal" data-target="#LY{{ $datas->id }}" >Details</button> |
@if($datas->ttd_operator=="-")
<button class="btn btn-success" data-toggle="modal" data-target="#LY{{ $datas->id }}" >Terima</button> |
@endif
<button class="btn btn-danger" data-toggle="modal" data-target="#LYDelete{{ $datas->id }}" >Tolak</button></td>
</tr>
<!-- Modal Detail dan Terima -->
<div class="modal fade" id="LY{{$datas->id}}">
<div class="modal-dialog modal-lg">
<div class="modal-content">
@ -85,7 +114,53 @@
</div>
</div>
<div class="modal-footer justify-content-between">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<span>{{$datas->caseid}}</span>
@if($datas->ttd_operator=="-")
<form action="{{ route('layanan-dpudpa.terima')}}" method="post">
@csrf
<input type="hidden" name="id" value="{{$datas->id}}">
<button type="submit" class="btn btn-success">Terima</button>
</form>
@endif
</form>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal-Delete -->
<div class="modal fade" id="LYDelete{{$datas->id}}">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Apa Anda Yakin Ingin Menghapus Data : <b>{{ $datas->caseid }}</b></h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="alert alert-info alert-dismissible">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<h5><i class="icon fas fa-info"></i> Perhatian!</h5>
<span >Alasan yang Dimasukkan Disini, Akan dikirimkan melalui Email Kepada Mahasiswa Terkait.</span>
</div>
<form action="{{ route('layanan-dpudpa.destroy') }}" method="post">
@csrf @method('DELETE')
<div class="row">
<div class="col">
<label for="alasan">Alasan:</label>
<textarea name="alasan" class="form-control" id="alasan" cols="30" rows="10"
placeholder="Masukkan Alasan Disini
Masukkan Alasan Disini"></textarea>
<input type="hidden" name="id" value="{{$datas->id}}">
</div>
</div>
</div>
<div class="modal-footer justify-content-between">
<button type="button" class="btn btn-default" data-dismiss="modal">Batal</button>
<button type="submit" class="btn btn-danger">Kirim</button>
</form>
</div>
</div>

View File

@ -3,5 +3,5 @@
<div class="float-right d-none d-sm-block">
<b>Version</b> 3.2.0
</div>
<strong>Copyright &copy; 2014-2021 <a href="https://adminlte.io">AdminLTE.io</a>.</strong> All rights reserved.
<strong>Copyright &copy; 2014-2021 <a href="https://adminlte.io">AdminLTE.io</a> | tes.</strong> All rights reserved.
</footer>

View File

@ -20,39 +20,46 @@
|
*/
Route::get('/layanan-dpudpa/tambah', [LayananPengajuanDpuDpaController::class, 'tambah'])->name('layanan-dpudpa.tambah');
Route::post('/layanan-dpudpa/tambah', [LayananPengajuanDpuDpaController::class, 'store'])->name('layanan-dpudpa.store');
Route::middleware(['guest'])->group(function () {
route::get('/admin/login',[SesiLoginController::class, 'login'])->name('login');
route::post('/admin/login',[SesiLoginController::class, 'ceklogin'])->name('admin.ceklogin');
route::post('/admin/login',[SesiLoginController::class, 'ceklogin'])->name('admin.ceklogin');
});
route::get('/', function(){
return "PROGRESS";
})->name('laman-awal');
Route::get('/home', function(){
return redirect('/admin');
});
Route::middleware(['auth'])->group( function () {
Route::get('/admin', [AdminController::class, 'index'])->name('admin.dashboard');
Route::get('/admin/logout', [SesiLoginController::class, 'logout'])->name('admin.logout');
Route::get('/admin/layanan-dpudpa', [LayananPengajuanDpuDpaController::class, 'index'])->name('layanan-dpudpa.index');
Route::group(['prefix' => 'admin', 'middleware' => 'auth'], function () {
Route::get('/', [AdminController::class, 'index'])->name('admin.dashboard');
Route::get('/logout', [SesiLoginController::class, 'logout'])->name('admin.logout');
//layanan Pengajuan DPU DPA
Route::get('/layanan-dpudpa', [LayananPengajuanDpuDpaController::class, 'index'])->name('layanan-dpudpa.index');
Route::DELETE('/layanan-dpudpa', [LayananPengajuanDpuDpaController::class, 'destroy'])->name('layanan-dpudpa.destroy');
Route::POST('/layanan-dpudpa', [LayananPengajuanDpuDpaController::class, 'terima'])->name('layanan-dpudpa.terima');
//User
Route::get('/admin/users', [UserController::class, 'index'])->name('users.index');
Route::POST('/admin/users', [UserController::class, 'store'])->name('users.store');
Route::PUT('/admin/users', [UserController::class, 'update'])->name('users.update');
Route::DELETE('/admin/users', [UserController::class, 'destroy'])->name('users.destroy');
Route::get('/users', [UserController::class, 'index'])->name('users.index');
Route::POST('/users', [UserController::class, 'store'])->name('users.store');
Route::PUT('/users', [UserController::class, 'update'])->name('users.update');
Route::DELETE('/users', [UserController::class, 'destroy'])->name('users.destroy');
//Mahasiswa
Route::get('/admin/mahasiswa', [MahasiswaController::class, 'index'])->name('mahasiswa.index');
Route::POST('/admin/mahasiswa', [MahasiswaController::class, 'store'])->name('mahasiswa.store');
Route::PUT('/admin/mahasiswa', [MahasiswaController::class, 'update'])->name('mahasiswa.update');
Route::DELETE('/admin/mahasiswa', [MahasiswaController::class, 'destroy'])->name('mahasiswa.destroy');
Route::get('/mahasiswa', [MahasiswaController::class, 'index'])->name('mahasiswa.index');
Route::POST('/mahasiswa', [MahasiswaController::class, 'store'])->name('mahasiswa.store');
Route::PUT('/mahasiswa', [MahasiswaController::class, 'update'])->name('mahasiswa.update');
Route::DELETE('/mahasiswa', [MahasiswaController::class, 'destroy'])->name('mahasiswa.destroy');
//User Roles
Route::get('/admin/users-roles', [UserController::class, 'userroles_index'])->name('users-roles.index');
Route::POST('/admin/users-roles', [UserController::class, 'userroles_store'])->name('users-roles.store');
Route::POST('/admin/users-roles/assign', [UserController::class, 'userroles_assign'])->name('users-roles.assign');
Route::get('/users-roles', [UserController::class, 'userroles_index'])->name('users-roles.index');
Route::POST('/users-roles', [UserController::class, 'userroles_store'])->name('users-roles.store');
Route::POST('/users-roles/assign', [UserController::class, 'userroles_assign'])->name('users-roles.assign');
});
//Layanan Pengajuan DPU/DPA
Route::get('/layanan-dpudpa/tambah', [LayananPengajuanDpuDpaController::class, 'tambah'])->name('layanan-dpudpa.tambah');
Route::post('/layanan-dpudpa/tambah', [LayananPengajuanDpuDpaController::class, 'store'])->name('layanan-dpudpa.store');
Route::get('/layanan-dpudpa/{url}/{caseid}', [LayananPengajuanDpuDpaController::class, 'ettd'])->name('layanan-dpudpa.ettd');
Route::POST('/layanan-dpudpa/{url}/{caseid}', [LayananPengajuanDpuDpaController::class, 'submitettd'])->name('layanan-dpudpa.submitettd');