Commit e8683670 by Farendi Giotivano R.P

stafpendukung, penyelengara,kontrakkerja-CRD

parent 288c30f2
......@@ -2,7 +2,10 @@
namespace App\Http\Controllers\User;
use Alert;
use App\Http\Controllers\Controller;
use App\Repositories\User\KontrakKerjaRepository;
use Crypt;
use Illuminate\Http\Request;
class KontrakKerjaController extends Controller
......@@ -50,15 +53,15 @@ class KontrakKerjaController extends Controller
//
$data = $request->except('_token');
$data['user_id'] = auth()->user()->id;
$unitbisnis = $this->unitbisnisRepo->store($data);
$kontrakkerja = $this->kontrakkerjaRepo->store($data);
$data = [
'unitbisnis' => $unitbisnis->id,
'kontrakkerja' => $kontrakkerja->id,
];
Alert::success('Berhasil', 'Unit Bisnis berhasil disimpan');
Alert::success('Berhasil', 'Kontrak Kerja berhasil disimpan');
return redirect()->route('unitbisnis.index', $data);
return redirect()->route('kontrakkerja.index', $data);
}
/**
......@@ -104,11 +107,11 @@ class KontrakKerjaController extends Controller
public function destroy($id)
{
//
$model = $this->unitbisnisRepo->findId(null, Crypt::decrypt($id));
$this->unitbisnisRepo->destroy($model);
$model = $this->kontrakkerjaRepo->findId(null, Crypt::decrypt($id));
$this->kontrakkerjaRepo->destroy($model);
Alert::success('Data berhasil dihapus')->persistent('Ok');
return redirect()->route('unitbisnis.index');
return redirect()->route('kontrakkerja.index');
}
}
......@@ -2,20 +2,32 @@
namespace App\Http\Controllers\User;
use Alert;
use App\Http\Controllers\Controller;
use App\Repositories\User\PenyelenggaraSeminarRepository;
use Crypt;
use Illuminate\Http\Request;
class PenyelenggaraanSeminarController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
private $penyelenggaraseminarRepo;
public function __construct(PenyelenggaraSeminarRepository $penyelenggaraseminarRepo)
{
$this->penyelenggaraseminarRepo = $penyelenggaraseminarRepo;
}
public function index()
{
//
return view('user.penyelenggara.index');
$menu = 'penyelenggaraseminar';
$penyelenggaraseminar = $this->penyelenggaraseminarRepo->get();
$data = [
'penyelenggaraseminar' => $penyelenggaraseminar,
'menu' => $menu
];
return view('user.penyelenggara.index', $data);
}
/**
......@@ -38,6 +50,17 @@ class PenyelenggaraanSeminarController extends Controller
public function store(Request $request)
{
//
$data = $request->except('_token');
$data['user_id'] = auth()->user()->id;
$penyelenggaraseminar = $this->penyelenggaraseminarRepo->store($data);
$data = [
'penyelenggaraseminar' => $penyelenggaraseminar->id,
];
Alert::success('Berhasil', 'Kontrak Kerja berhasil disimpan');
return redirect()->route('penyelenggaraseminar.index', $data);
}
/**
......@@ -83,5 +106,11 @@ class PenyelenggaraanSeminarController extends Controller
public function destroy($id)
{
//
$model = $this->penyelenggaraseminarRepo->findId(null, Crypt::decrypt($id));
$this->penyelenggaraseminarRepo->destroy($model);
Alert::success('Data berhasil dihapus')->persistent('Ok');
return redirect()->route('penyelenggaraseminar.index');
}
}
......@@ -2,20 +2,32 @@
namespace App\Http\Controllers\User;
use Alert;
use App\Http\Controllers\Controller;
use App\Repositories\User\StafPendukungRepository;
use Crypt;
use Illuminate\Http\Request;
class StafPendukungController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
private $stafpendukungRepo;
public function __construct(StafPendukungRepository $stafpendukungRepo)
{
$this->stafpendukungRepo = $stafpendukungRepo;
}
public function index()
{
//
return view('user.stafpendukung.index');
$menu = 'stafpendukung';
$stafpendukung = $this->stafpendukungRepo->get();
$data = [
'stafpendukung' => $stafpendukung,
'menu' => $menu
];
return view('user.stafpendukung.index', $data);
}
/**
......@@ -38,6 +50,17 @@ class StafPendukungController extends Controller
public function store(Request $request)
{
//
$data = $request->except('_token');
$data['user_id'] = auth()->user()->id;
$stafpendukung = $this->stafpendukungRepo->store($data);
$data = [
'stafpendukung' => $stafpendukung->id,
];
Alert::success('Berhasil', 'Kontrak Kerja berhasil disimpan');
return redirect()->route('stafpendukung.index', $data);
}
/**
......@@ -83,5 +106,11 @@ class StafPendukungController extends Controller
public function destroy($id)
{
//
$model = $this->stafpendukungRepo->findId(null, Crypt::decrypt($id));
$this->stafpendukungRepo->destroy($model);
Alert::success('Data berhasil dihapus')->persistent('Ok');
return redirect()->route('stafpendukung.index');
}
}
<?php
namespace App\Models\User;
use App\Traits\UuidTrait;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class PenyelenggaraSeminar extends Model
{
use HasFactory;
use UuidTrait;
public $incrementing = false;
protected $table = 'penyelenggaraan_seminar';
protected $keyType = 'string';
protected $fillable = [
'id', 'nama_seminar', 'unit_pelaksana', 'mitra', 'skala', 'waktu_pelaksanaan_awal', 'waktu_pelaksanaan_akhir', 'tempat', 'url', 'userid_created', 'userid_updated', 'created_at', 'updated_at',
];
}
<?php
namespace App\Models\User;
use App\Traits\UuidTrait;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class StafPendukung extends Model
{
use HasFactory;
use UuidTrait;
public $incrementing = false;
protected $table = 'stafpendukung';
protected $keyType = 'string';
protected $fillable = [
'id', 'nip', 'nama', 'sex', 'jabatan', 'unit_kerja', 'tingkat_pendidikan', 'userid_created', 'userid_updated', 'created_at', 'updated_at',
];
}
<?php
namespace App\Repositories\User;
use App\Models\User\PenyelenggaraSeminar;
use App\Repositories\Repository;
class PenyelenggaraSeminarRepository extends Repository
{
protected $model;
public function __construct(PenyelenggaraSeminar $model)
{
$this->model = $model;
}
public function get($with = null, $search = null, $id = null)
{
return $this->model->when($with, function ($query) use ($with) {
return $query->with($with);
})
->when($search, function ($query) use ($search) {
return $query->where('search', $search);
})
->when($id, function ($query) use ($id) {
return $query->where('id', $id);
})
->get();
}
public function paginate($with = null, $limit = 10, $idlogkeg = null)
{
return Rekognisi::when($with, function ($query) use ($with) {
return $query->with($with);
})
->when($tahun, function ($query) use ($tahun) {
return $query->where('tahun', $tahun);
})
->when($id_kegiatan, function ($query) use ($id_kegiatan) {
return $query->where('id_kegiatan', $id_kegiatan);
})
->paginate($limit);
}
}
<?php
namespace App\Repositories\User;
use App\Models\User\StafPendukung;
use App\Repositories\Repository;
class StafPendukungRepository extends Repository
{
protected $model;
public function __construct(StafPendukung $model)
{
$this->model = $model;
}
public function get($with = null, $search = null, $id = null)
{
return $this->model->when($with, function ($query) use ($with) {
return $query->with($with);
})
->when($search, function ($query) use ($search) {
return $query->where('search', $search);
})
->when($id, function ($query) use ($id) {
return $query->where('id', $id);
})
->get();
}
public function paginate($with = null, $limit = 10, $idlogkeg = null)
{
return Rekognisi::when($with, function ($query) use ($with) {
return $query->with($with);
})
->when($tahun, function ($query) use ($tahun) {
return $query->where('tahun', $tahun);
})
->when($id_kegiatan, function ($query) use ($id_kegiatan) {
return $query->where('id_kegiatan', $id_kegiatan);
})
->paginate($limit);
}
}
......@@ -22,3 +22,13 @@
<link href="{{ url('theme/plugins/sweetalerts/sweetalert2.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ url('theme/plugins/sweetalerts/sweetalert.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ url('theme/assets/css/components/custom-sweetalert.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ url('theme/plugins/flatpickr/flatpickr.css') }}" rel="stylesheet" type="text/css">
<link href="{{ url('theme/plugins/noUiSlider/nouislider.min.css') }}" rel="stylesheet" type="text/css">
<link href="{{ url('theme/assets/css/scrollspyNav.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ url('theme/plugins/flatpickr/custom-flatpickr.css') }}" rel="stylesheet" type="text/css">
<link href="{{ url('theme/plugins/noUiSlider/custom-nouiSlider.css') }}" rel="stylesheet" type="text/css">
<link href="{{ url('theme/plugins/bootstrap-range-Slider/bootstrap-slider.css') }}" rel="stylesheet" type="text/css">
......@@ -60,7 +60,7 @@
</a>
<ul class="collapse submenu list-unstyled" id="components" data-parent="#topAccordion">
<li>
<a href="{{ url('penyelengaraseminar') }}"> Penyelenggaraan Seminar/Conference </a>
<a href="{{ url('penyelenggaraseminar') }}"> Penyelenggaraan Seminar/Conference </a>
</li>
<li>
<a href="{{ url('manajemenpenelitian') }}"> Manajemen Penelitian </a>
......
......@@ -15,55 +15,53 @@
$menu = 'dashboard';
@endphp
<div class="account-settings-container layout-top-spacing">
{{ Form::open(['url' => route('kontrakkerja.store'), 'method' => 'post', 'class' => 'section general-info', 'id' => 'kontrakkerja']) }}
<div class="account-content">
<div class="scrollspy-example" data-spy="scroll" data-target="#account-settings-scroll" data-offset="-100">
<div class="row">
<div class="col-xl-12 col-lg-12 col-md-12 layout-spacing">
<form id="contact" class="section contact">
<div class="info">
<h5 class="">Data Kegiatan Kontrak Kerja Non Penelitian</h5>
<div class="row">
<div class="col-md-11 mx-auto">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label>Unit Pelaksanaan</label>
<input type="text" class="form-control mb-4" id="unit_pelaksanaan" placeholder="Unit Pelaksanaan">
</div>
<div class="info">
<h5 class="">Data Kegiatan Kontrak Kerja Non Penelitian</h5>
<div class="row">
<div class="col-md-11 mx-auto">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label>Unit Pelaksanaan</label>
<input type="text" class="form-control mb-4" id="unit_pelaksanaan" name="unit_pelaksanaan" placeholder="Unit Pelaksanaan">
</div>
<div class="col-md-12">
<div class="form-group">
<label>Nama Kegiatan</label>
<textarea class="form-control" id="nama_kegiatan" placeholder="Nama Kegiatan" rows="2"></textarea>
</div>
</div>
<div class="col-md-12">
<div class="form-group">
<label>Nama Kegiatan</label>
<textarea class="form-control" id="nama_kegiatan" name="nama_kegiatan" placeholder="Nama Kegiatan" rows="2"></textarea>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Institusi Mitra</label>
<input type="text" class="form-control mb-4" id="no_sk" placeholder="Institusi Mitra">
<small class="form-text text-muted">Diperbolehkan lebih dari satu mitra dipisahkan dengan koma (,)</small>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Institusi Mitra</label>
<input type="text" class="form-control mb-4" id="institusi_mitra" name="institusi_mitra" placeholder="Institusi Mitra">
<small class="form-text text-muted">Diperbolehkan lebih dari satu mitra dipisahkan dengan koma (,)</small>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Nomor Kontrak</label>
<input type="text" class="form-control mb-4" id="nomor_kontrak" placeholder="Nomor Kontrak">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Nomor Kontrak</label>
<input type="text" class="form-control mb-4" id="nokontrak" name="nokontrak" placeholder="Nomor Kontrak">
</div>
<div class="col-md-6">
<div class="form-group">
<label>Nilai Kontrak</label>
<input type="text" class="form-control mb-4" id="nilai_kontrak" placeholder="Nilai Kontrak">
<small class="form-text text-muted">Nilai Kontrak dalam Rupiah</small>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Nilai Kontrak</label>
<input type="text" class="form-control mb-4" id="nilaikontrak" name="nilaikontrak" placeholder="Nilai Kontrak">
<small class="form-text text-muted">Nilai Kontrak dalam Rupiah</small>
</div>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
......@@ -73,9 +71,10 @@
<div class="account-settings-footer">
<div class="as-footer-container">
<button id="multiple-reset" class="btn btn-warning">Batal</button>
<button id="multiple-messages" class="btn btn-primary">Save Changes</button>
<button type="submit" id="multiple-messages" class="btn btn-primary">Save Changes</button>
</div>
</div>
{{ Form::close() }}
</div>
@endsection
......
......@@ -18,6 +18,7 @@
<div class="col-xl-12 col-lg-12 col-sm-12 layout-spacing">
<div class="widget-content widget-content-area br-6">
<div class="table-responsive mb-4 mt-4">
<a href="{{ url('kontrakkerja/create') }}" class="btn btn-primary mb-2"><i data-feather="file-plus"></i> Tambah</a>
<table id="zero-config" class="table table-hover" style="width:100%">
<thead>
<tr>
......@@ -39,9 +40,9 @@
<td>{{$value->institusi_mitra}}</td>
<td>{{$value->nokontrak}}</td>
<td>
<a href="{{ url('unitbisnis/'.$value->id.'/edit') }}" class="btn btn-warning mb-2"><i data-feather="edit"></i> Edit</a> |
<a href="{{ url('kontrakkerja/'.$value->id.'/edit') }}" class="btn btn-warning mb-2"><i data-feather="edit"></i> Edit</a> |
<button class="btn btn-danger mb-2 delete" data-id="{{ $value->id }}" data-file="{{$value->id}}"><i data-feather="trash-2"></i> Delete</button>
{{ Form::open(['url'=>route('unitbisnis.destroy', [Crypt::encrypt($value->id)]), 'method'=>'delete', 'id' => $value->id, 'style' => 'display: none;']) }}
{{ Form::open(['url'=>route('kontrakkerja.destroy', [Crypt::encrypt($value->id)]), 'method'=>'delete', 'id' => $value->id, 'style' => 'display: none;']) }}
{{ csrf_field() }}
{{ Form::close() }}
</td
......@@ -72,5 +73,29 @@
"lengthMenu": [10, 20, 50],
"pageLength": 10
});
var url = "{{ route('kontrakkerja.index') }}";
$("body").on("click", ".delete", function (e) {
e.preventDefault();
var id = $(this).data('id');
Swal.fire({
title: "Apakah Anda Yakin?",
text: "Anda akan menghapus data ini!",
icon: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "Yes",
cancelButtonText: "No"
}).then((result) => {
if (result.value) {
Swal.close();
$("#"+id).submit();
} else if (result.dismiss === Swal.DismissReason.cancel) {
Swal.fire('Dibatalkan', 'Data batal dihapus', 'error');
}
});
});
</script>
@endsection
......@@ -18,130 +18,36 @@
<div class="col-xl-12 col-lg-12 col-sm-12 layout-spacing">
<div class="widget-content widget-content-area br-6">
<div class="table-responsive mb-4 mt-4">
<a href="{{ url('penyelenggaraseminar/create') }}" class="btn btn-primary mb-2"><i data-feather="file-plus"></i> Tambah</a>
<table id="zero-config" class="table table-hover" style="width:100%">
<thead>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Age</th>
<th>Start date</th>
<th>Salary</th>
<th>No</th>
<th>Nama Seminar</th>
<th>Unit Pelaksana</th>
<th>Mitra</th>
<th>Skala Conference</th>
<th>Aksi</th>
</tr>
</thead>
<tbody>
@php $no = 1; @endphp
@foreach ($penyelenggaraseminar as $value)
<tr>
<td>Tiger Nixon</td>
<td>System Architect</td>
<td>Edinburgh</td>
<td>61</td>
<td>2011/04/25</td>
<td>$320,800</td>
</tr>
<tr>
<td>Garrett Winters</td>
<td>Accountant</td>
<td>Tokyo</td>
<td>63</td>
<td>2011/07/25</td>
<td>$170,750</td>
</tr>
<tr>
<td>Ashton Cox</td>
<td>Junior Technical Author</td>
<td>San Francisco</td>
<td>66</td>
<td>2009/01/12</td>
<td>$86,000</td>
</tr>
<tr>
<td>Cedric Kelly</td>
<td>Senior Javascript Developer</td>
<td>Edinburgh</td>
<td>22</td>
<td>2012/03/29</td>
<td>$433,060</td>
</tr>
<tr>
<td>Airi Satou</td>
<td>Accountant</td>
<td>Tokyo</td>
<td>33</td>
<td>2008/11/28</td>
<td>$162,700</td>
</tr>
<tr>
<td>Brielle Williamson</td>
<td>Integration Specialist</td>
<td>New York</td>
<td>61</td>
<td>2012/12/02</td>
<td>$372,000</td>
</tr>
<tr>
<td>Herrod Chandler</td>
<td>Sales Assistant</td>
<td>San Francisco</td>
<td>59</td>
<td>2012/08/06</td>
<td>$137,500</td>
</tr>
<tr>
<td>Rhona Davidson</td>
<td>Integration Specialist</td>
<td>Tokyo</td>
<td>55</td>
<td>2010/10/14</td>
<td>$327,900</td>
</tr>
<tr>
<td>Colleen Hurst</td>
<td>Javascript Developer</td>
<td>San Francisco</td>
<td>39</td>
<td>2009/09/15</td>
<td>$205,500</td>
</tr>
<tr>
<td>Sonya Frost</td>
<td>Software Engineer</td>
<td>Edinburgh</td>
<td>23</td>
<td>2008/12/13</td>
<td>$103,600</td>
</tr>
<tr>
<td>Jena Gaines</td>
<td>Office Manager</td>
<td>London</td>
<td>30</td>
<td>2008/12/19</td>
<td>$90,560</td>
</tr>
<tr>
<td>Quinn Flynn</td>
<td>Support Lead</td>
<td>Edinburgh</td>
<td>22</td>
<td>2013/03/03</td>
<td>$342,000</td>
</tr>
<tr>
<td>Charde Marshall</td>
<td>Regional Director</td>
<td>San Francisco</td>
<td>36</td>
<td>2008/10/16</td>
<td>$470,600</td>
</tr>
<tr>
<td>Haley Kennedy</td>
<td>Senior Marketing Designer</td>
<td>London</td>
<td>43</td>
<td>2012/12/18</td>
<td>$313,500</td>
<td>{{$no++}}</td>
<td>{{$value->nama_seminar}}</td>
<td>{{$value->unit_pelaksana}}</td>
<td>{{$value->mitra}}</td>
<td>{{$value->skala}}</td>
<td>
<a href="{{ url('penyelenggaraseminar/'.$value->id.'/edit') }}" class="btn btn-warning mb-2"><i data-feather="edit"></i> Edit</a> |
<button class="btn btn-danger mb-2 delete" data-id="{{ $value->id }}" data-file="{{$value->id}}"><i data-feather="trash-2"></i> Delete</button>
{{ Form::open(['url'=>route('penyelenggaraseminar.destroy', [Crypt::encrypt($value->id)]), 'method'=>'delete', 'id' => $value->id, 'style' => 'display: none;']) }}
{{ csrf_field() }}
{{ Form::close() }}
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
......@@ -167,5 +73,29 @@
"lengthMenu": [10, 20, 50],
"pageLength": 10
});
var url = "{{ route('penyelenggaraseminar.index') }}";
$("body").on("click", ".delete", function (e) {
e.preventDefault();
var id = $(this).data('id');
Swal.fire({
title: "Apakah Anda Yakin?",
text: "Anda akan menghapus data ini!",
icon: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "Yes",
cancelButtonText: "No"
}).then((result) => {
if (result.value) {
Swal.close();
$("#"+id).submit();
} else if (result.dismiss === Swal.DismissReason.cancel) {
Swal.fire('Dibatalkan', 'Data batal dihapus', 'error');
}
});
});
</script>
@endsection
\ No newline at end of file
@endsection
......@@ -18,130 +18,38 @@
<div class="col-xl-12 col-lg-12 col-sm-12 layout-spacing">
<div class="widget-content widget-content-area br-6">
<div class="table-responsive mb-4 mt-4">
<a href="{{ url('stafpendukung/create') }}" class="btn btn-primary mb-2"><i data-feather="file-plus"></i> Tambah</a>
<table id="zero-config" class="table table-hover" style="width:100%">
<thead>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Age</th>
<th>Start date</th>
<th>Salary</th>
<th>No</th>
<th>Nama</th>
<th>Jenis Kelamin</th>
<th>Jabatan</th>
<th>Unit Kerja</th>
<th>Tingkat Pendidikan</th>
<th>Aksi</th>
</tr>
</thead>
<tbody>
@php $no = 1; @endphp
@foreach ($stafpendukung as $value)
<tr>
<td>Tiger Nixon</td>
<td>System Architect</td>
<td>Edinburgh</td>
<td>61</td>
<td>2011/04/25</td>
<td>$320,800</td>
</tr>
<tr>
<td>Garrett Winters</td>
<td>Accountant</td>
<td>Tokyo</td>
<td>63</td>
<td>2011/07/25</td>
<td>$170,750</td>
</tr>
<tr>
<td>Ashton Cox</td>
<td>Junior Technical Author</td>
<td>San Francisco</td>
<td>66</td>
<td>2009/01/12</td>
<td>$86,000</td>
</tr>
<tr>
<td>Cedric Kelly</td>
<td>Senior Javascript Developer</td>
<td>Edinburgh</td>
<td>22</td>
<td>2012/03/29</td>
<td>$433,060</td>
</tr>
<tr>
<td>Airi Satou</td>
<td>Accountant</td>
<td>Tokyo</td>
<td>33</td>
<td>2008/11/28</td>
<td>$162,700</td>
</tr>
<tr>
<td>Brielle Williamson</td>
<td>Integration Specialist</td>
<td>New York</td>
<td>61</td>
<td>2012/12/02</td>
<td>$372,000</td>
</tr>
<tr>
<td>Herrod Chandler</td>
<td>Sales Assistant</td>
<td>San Francisco</td>
<td>59</td>
<td>2012/08/06</td>
<td>$137,500</td>
</tr>
<tr>
<td>Rhona Davidson</td>
<td>Integration Specialist</td>
<td>Tokyo</td>
<td>55</td>
<td>2010/10/14</td>
<td>$327,900</td>
</tr>
<tr>
<td>Colleen Hurst</td>
<td>Javascript Developer</td>
<td>San Francisco</td>
<td>39</td>
<td>2009/09/15</td>
<td>$205,500</td>
</tr>
<tr>
<td>Sonya Frost</td>
<td>Software Engineer</td>
<td>Edinburgh</td>
<td>23</td>
<td>2008/12/13</td>
<td>$103,600</td>
</tr>
<tr>
<td>Jena Gaines</td>
<td>Office Manager</td>
<td>London</td>
<td>30</td>
<td>2008/12/19</td>
<td>$90,560</td>
</tr>
<tr>
<td>Quinn Flynn</td>
<td>Support Lead</td>
<td>Edinburgh</td>
<td>22</td>
<td>2013/03/03</td>
<td>$342,000</td>
</tr>
<tr>
<td>Charde Marshall</td>
<td>Regional Director</td>
<td>San Francisco</td>
<td>36</td>
<td>2008/10/16</td>
<td>$470,600</td>
</tr>
<tr>
<td>Haley Kennedy</td>
<td>Senior Marketing Designer</td>
<td>London</td>
<td>43</td>
<td>2012/12/18</td>
<td>$313,500</td>
<td>{{$no++}}</td>
<td>{{$value->nip}}</td>
<td>{{$value->nama}}</td>
<td>{{$value->sex}}</td>
<td>{{$value->jabatan}}</td>
<td>{{$value->unit_kerja}}</td>
<td>
<a href="{{ url('stafpendukung/'.$value->id.'/edit') }}" class="btn btn-warning mb-2"><i data-feather="edit"></i> Edit</a> |
<button class="btn btn-danger mb-2 delete" data-id="{{ $value->id }}" data-file="{{$value->id}}"><i data-feather="trash-2"></i> Delete</button>
{{ Form::open(['url'=>route('stafpendukung.destroy', [Crypt::encrypt($value->id)]), 'method'=>'delete', 'id' => $value->id, 'style' => 'display: none;']) }}
{{ csrf_field() }}
{{ Form::close() }}
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
......@@ -167,5 +75,29 @@
"lengthMenu": [10, 20, 50],
"pageLength": 10
});
var url = "{{ route('stafpendukung.index') }}";
$("body").on("click", ".delete", function (e) {
e.preventDefault();
var id = $(this).data('id');
Swal.fire({
title: "Apakah Anda Yakin?",
text: "Anda akan menghapus data ini!",
icon: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "Yes",
cancelButtonText: "No"
}).then((result) => {
if (result.value) {
Swal.close();
$("#"+id).submit();
} else if (result.dismiss === Swal.DismissReason.cancel) {
Swal.fire('Dibatalkan', 'Data batal dihapus', 'error');
}
});
});
</script>
@endsection
......@@ -50,7 +50,7 @@ Route::middleware(['auth:sanctum', 'verified'])->group(function () {
Route::resource('/penelitiasing', PenelitiAsingController::class);
Route::resource('/publikasiartikel', PublikasiArtikelController::class);
Route::resource('/publikasijurnal', PublikasiJurnalController::class);
Route::resource('/penyelengaraseminar', PenyelenggaraanSeminarController::class);
Route::resource('/penyelenggaraseminar', PenyelenggaraanSeminarController::class);
Route::resource('/stafpendukung', StafPendukungController::class);
Route::resource('/unitbisnis', UnitBisnisController::class);
});
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