Web FT UNTAN (Laravel 8) versi lama + dump database ftuntan_web_profil
Kode dari ftuntan_main dengan dependensi diperbarui untuk PHP 8.3 (perbaikan insiden 27 Okt 2026). Dump database di database/sql/. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,338 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Akreditasi')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Akreditasi</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
<!-- /.content-header -->
|
||||
|
||||
<!-- Alert Status -->
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('alert'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('alert') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Data Akreditasi</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-12 text-left">
|
||||
<a type="button" href="#formModalAdd" data-toggle="modal"
|
||||
class="btn btn-success mb-3"><i class="fa fa-plus-circle"></i>
|
||||
Tambah Data Akreditasi
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table id="tabel_akreditasi" class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nomor</th>
|
||||
<th>Program Studi</th>
|
||||
<th>Strata</th>
|
||||
<th>Peringkat</th>
|
||||
<th>Tanggal Kadaluarsa</th>
|
||||
<th>Nomor SK</th>
|
||||
<th>PDF</th>
|
||||
<th>Tanggal Rilis</th>
|
||||
<th>Status</th>
|
||||
<th>Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($akreditasis as $akreditasi)
|
||||
<tr>
|
||||
<td>{{ $loop->iteration }}</td>
|
||||
<td>{{ $akreditasi->program_studi }}</td>
|
||||
<td>{{ $akreditasi->strata }}</td>
|
||||
<td>{{ $akreditasi->peringkat }}</td>
|
||||
<td>{{ $akreditasi->tanggal_kadaluarsa }}</td>
|
||||
<td>{{ $akreditasi->nomor_sk }}</td>
|
||||
<td>
|
||||
<a href="{{ url($akreditasi->nama_file) }}"
|
||||
target="_blank">{{ $akreditasi->nama_file }}</a>
|
||||
</td>
|
||||
<td>{{ $akreditasi->release_date }}</td>
|
||||
<td>
|
||||
@if ($akreditasi->deleted_at != '')
|
||||
Terhapus
|
||||
@else
|
||||
Rilis
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if ($akreditasi->deleted_at != '')
|
||||
<form
|
||||
action="{{ url('/admin/akreditasi/' . $akreditasi->id . '/restore') }}"
|
||||
method="post">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-primary"
|
||||
onclick="return confirm('Apakah anda yakin ingin mengembalikan data?')"><i
|
||||
class="fas fa-trash-restore"></i> Restore
|
||||
</button>
|
||||
</form>
|
||||
<form
|
||||
action="{{ url('/admin/akreditasi/' . $akreditasi->id . '/delete_permanen') }}"
|
||||
method="post">
|
||||
@csrf
|
||||
<input type="hidden" name="thumbnail"
|
||||
value="{{ $hasilKarya->thumbnail }}">
|
||||
<button type="submit" class="btn btn-danger"
|
||||
onclick="return confirm('Apakah anda yakin ingin menghapus permanen data?')"><i
|
||||
class="fa fa-trash"></i> Delete Permanent
|
||||
</button>
|
||||
</form>
|
||||
@else
|
||||
<button href="#formModalEdit" role="button" data-toggle="modal"
|
||||
data-id="{{ $akreditasi->id }}"
|
||||
data-program_studi="{{ $akreditasi->program_studi }}"
|
||||
data-strata="{{ $akreditasi->strata }}"
|
||||
data-peringkat="{{ $akreditasi->peringkat }}"
|
||||
data-tanggal_kadaluarsa="{{ $akreditasi->tanggal_kadaluarsa }}"
|
||||
data-nomor_sk="{{ $akreditasi->nomor_sk }}"
|
||||
data-release_date="{{ $akreditasi->release_date }}"
|
||||
class="btn btn-warning open-formModalEdit"><i
|
||||
class="fa fa-edit"></i> Edit</button>
|
||||
<form action="{{ route('akreditasi.destroy', $akreditasi) }}"
|
||||
method="post">
|
||||
@method('delete')
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-danger"
|
||||
onclick="return confirm('Apakah anda yakin ingin menghapus data?')"><i
|
||||
class="fa fa-trash"></i> Delete</button>
|
||||
</form>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<!-- Modal Add -->
|
||||
<div class="modal fade" id="formModalAdd" tabindex="-1" aria-labelledby="formModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="formModalLabel">Tambah Data Akreditasi</h5>
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal" aria-label="Close">X</button>
|
||||
</div>
|
||||
|
||||
<form id="formAdd" action="{{ url('/admin/akreditasi') }}" method="post" enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="modal-body">
|
||||
<div class="form-group mt-2">
|
||||
<label for="program_studi">Program Studi</label>
|
||||
<input type="text" class="form-control mt-0" name="program_studi" required maxlength="255"
|
||||
placeholder=". . .">
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="strata">Strata</label>
|
||||
<input type="text" class="form-control mt-0" name="strata" required maxlength="10"
|
||||
placeholder=". . .">
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="peringkat">Peringkat</label>
|
||||
<input type="text" class="form-control mt-0" name="peringkat" required maxlength="20"
|
||||
placeholder=". . .">
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="tanggal_kadaluarsa">Tanggal Kadaluarsa</label>
|
||||
<input type="text" class="form-control mt-0" name="tanggal_kadaluarsa" required maxlength="255"
|
||||
placeholder=". . .">
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="nomor_sk">Nomor SK</label>
|
||||
<input type="text" class="form-control mt-0" name="nomor_sk" required maxlength="255"
|
||||
placeholder=". . .">
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="nama_file">PDF</label>
|
||||
<input type="file" id="input_pdf_add" class="form-control" name="nama_file" required
|
||||
accept="application/pdf">
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="release_date">Tanggal Rilis</label>
|
||||
<input type="date" class="form-control" name="release_date" required>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal"
|
||||
aria-label="Close">Batal</button>
|
||||
<button id="submitAdd" class="btn btn-primary from-prevent-multiple-submitsAdd" type="submit">Tambah Data</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@foreach ($akreditasis as $akreditasi)
|
||||
<!-- Modal Edit -->
|
||||
<div class="modal fade" id="formModalEdit" tabindex="-1" aria-labelledby="formModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="formModalLabel">Ubah Data Akreditasi</h5>
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal" aria-label="Close">X</button>
|
||||
</div>
|
||||
<form id="formEdit" action="{{ route('akreditasi.update', $akreditasi->id) }}" method="POST" enctype="multipart/form-data">
|
||||
@method('patch')
|
||||
@csrf
|
||||
<div class="modal-body">
|
||||
<input type="hidden" name="id" id="id">
|
||||
<div class="form-group mt-2">
|
||||
<label for="program_studi">Program Studi</label>
|
||||
<input type="text" class="form-control mt-0" name="program_studi" id="program_studi"
|
||||
required maxlength="255" placeholder=". . .">
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="strata">Strata</label>
|
||||
<input type="text" class="form-control mt-0" name="strata" id="strata" required
|
||||
maxlength="10" placeholder=". . .">
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="peringkat">Peringkat</label>
|
||||
<input type="text" class="form-control mt-0" name="peringkat" id="peringkat" required
|
||||
maxlength="20" placeholder=". . .">
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="tanggal_kadaluarsa">Tanggal Kadaluarsa</label>
|
||||
<input type="text" class="form-control mt-0" name="tanggal_kadaluarsa"
|
||||
id="tanggal_kadaluarsa" required maxlength="255" placeholder=". . .">
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="nomor_sk">Nomor SK</label>
|
||||
<input type="text" class="form-control mt-0" name="nomor_sk" id="nomor_sk" required
|
||||
maxlength="255" placeholder=". . .">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="nama_file">PDF</label>
|
||||
<input type="file" id="input_pdf_edit" class="form-control mt-0" name="nama_file"
|
||||
accept="application/pdf">
|
||||
<input type="hidden" name="old_file" id="old_file" value="{{ $akreditasi->nama_file }}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="release_date">Tanggal Rilis</label>
|
||||
<input type="date" class="form-control mt-0" name="release_date" id="release_date" required>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal"
|
||||
aria-label="Close">Batal</button>
|
||||
<button id="submitEdit" class="btn btn-primary from-prevent-multiple-submitsEdit" type="submit">Ubah Data</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
|
||||
<script type="text/javascript">
|
||||
var $formAdd = $("#formAdd");
|
||||
$formAdd.submit(function(){
|
||||
$formAdd.submit(function(){
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var $formEdit = $("#formEdit");
|
||||
$formEdit.submit(function(){
|
||||
$formEdit.submit(function(){
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<!--Data Table -->
|
||||
<script>
|
||||
$(function() {
|
||||
$("#tabel_akreditasi").DataTable({
|
||||
"paging": true,
|
||||
"lengthChange": false,
|
||||
"searching": true,
|
||||
"ordering": true,
|
||||
"info": true,
|
||||
"autoWidth": false,
|
||||
"responsive": false,
|
||||
"buttons": ["copy", "csv", "excel", "pdf", "print", "colvis"]
|
||||
}).buttons().container().appendTo('#tabel_akreditasi_wrapper .col-md-6:eq(0)');
|
||||
});
|
||||
</script>
|
||||
|
||||
<!--Modal Edit -->
|
||||
<script type="text/javascript">
|
||||
$(document).on("click", ".open-formModalEdit", function() {
|
||||
var id = $(this).data('id');
|
||||
var program_studi = $(this).data('program_studi');
|
||||
var strata = $(this).data('strata');
|
||||
var peringkat = $(this).data('peringkat');
|
||||
var tanggal_kadaluarsa = $(this).data('tanggal_kadaluarsa');
|
||||
var nomor_sk = $(this).data('nomor_sk');
|
||||
var release_date = $(this).data('release_date');
|
||||
var old_file = $(this).data('old_file');
|
||||
|
||||
$(".modal-body #id").val(id);
|
||||
$(".modal-body #program_studi").val(program_studi);
|
||||
$(".modal-body #strata").val(strata);
|
||||
$(".modal-body #peringkat").val(peringkat);
|
||||
$(".modal-body #tanggal_kadaluarsa").val(tanggal_kadaluarsa);
|
||||
$(".modal-body #nomor_sk").val(nomor_sk);
|
||||
$(".modal-body #release_date").val(release_date);
|
||||
$(".modal-body #input_pdf_edit").val("");
|
||||
$(".modal-body #old_file").val(old_file);
|
||||
});
|
||||
|
||||
//Form add image validation
|
||||
var uploadField = document.getElementById("input_pdf_add");
|
||||
uploadField.onchange = function() {
|
||||
if (this.files[0].size > 2000000) {
|
||||
alert("Batas maksimum 2MB!");
|
||||
this.value = "";
|
||||
};
|
||||
};
|
||||
|
||||
//Form edit image validation
|
||||
var uploadField = document.getElementById("input_pdf_edit");
|
||||
uploadField.onchange = function() {
|
||||
if (this.files[0].size > 2000000) {
|
||||
alert("Batas maksimum 2MB!");
|
||||
this.value = "";
|
||||
};
|
||||
};
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,338 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Aplikasi Terintegrasi')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Aplikasi Terintegrasi</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
|
||||
<!-- Alert Status -->
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('alert'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('alert') }}
|
||||
</div>
|
||||
@endif
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Data Aplikasi Terintegrasi</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-12 text-left">
|
||||
<a type="button" href="#formModalAdd" data-toggle="modal"
|
||||
class="btn btn-success mb-3"><i class="fa fa-plus-circle"></i>
|
||||
Tambah Data Aplikasi Terintegrasi
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table id="tabel_aplikasi_integrasi" class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nomor</th>
|
||||
<th>Nama</th>
|
||||
<th>Thumbnail</th>
|
||||
<th>Teks</th>
|
||||
<th>Link</th>
|
||||
<th>Jadwal Rilis</th>
|
||||
<th>Status</th>
|
||||
<th>Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($aplikasiIntegrasis as $aplikasiIntegrasi)
|
||||
<tr>
|
||||
<td>{{ $loop->iteration }}</td>
|
||||
<td>{{ $aplikasiIntegrasi->nama }}</td>
|
||||
<td><img src="{{ url($aplikasiIntegrasi->thumbnail) }}"
|
||||
style="width:100px"></td>
|
||||
<td>{{ $aplikasiIntegrasi->teks }}</td>
|
||||
<td>{{ $aplikasiIntegrasi->url }}</td>
|
||||
<td>{{ $aplikasiIntegrasi->release_date }}</td>
|
||||
@if ($aplikasiIntegrasi->deleted_at == '')
|
||||
@if ($aplikasiIntegrasi->release_date <= date('Y-m-d'))
|
||||
<td>Rilis</td>
|
||||
@else
|
||||
<td>Belum Rilis</td>
|
||||
@endif
|
||||
@else ($aplikasiIntegrasi->deleted_at != "")
|
||||
<td>Terhapus</td>
|
||||
@endif
|
||||
@if ($aplikasiIntegrasi->deleted_at == '')
|
||||
<td>
|
||||
<button href="#formModalEdit" role="button" data-toggle="modal"
|
||||
data-id="{{ $aplikasiIntegrasi->id }}"
|
||||
data-nama="{{ $aplikasiIntegrasi->nama }}"
|
||||
data-thumbnail="{{ url($aplikasiIntegrasi->thumbnail) }}"
|
||||
data-teks="{{ $aplikasiIntegrasi->teks }}"
|
||||
data-url="{{ $aplikasiIntegrasi->url }}"
|
||||
data-release_date="{{ $aplikasiIntegrasi->release_date }}"
|
||||
class="btn btn-warning open-formModalEdit"><i
|
||||
class="fa fa-edit"></i> Edit</button>
|
||||
<form
|
||||
action="{{ route('aplikasi_integrasi.destroy', $aplikasiIntegrasi) }}"
|
||||
method="post">
|
||||
@method('delete')
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-danger"
|
||||
onclick="return confirm('Apakah anda yakin ingin menghapus data?')"><i
|
||||
class="fa fa-trash"></i> Delete</button>
|
||||
</form>
|
||||
</td>
|
||||
@else
|
||||
<td>
|
||||
<form
|
||||
action="{{ url('/admin/aplikasi_integrasi/' . $aplikasiIntegrasi->id . '/restore') }}"
|
||||
method="post">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-primary"
|
||||
onclick="return confirm('Apakah anda yakin ingin mengembalikan data?')"><i
|
||||
class="fas fa-trash-restore"></i> Restore
|
||||
</button>
|
||||
</form>
|
||||
<form
|
||||
action="{{ url('/admin/aplikasi_integrasi/' . $aplikasiIntegrasi->id . '/delete') }}"
|
||||
method="post">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-danger"
|
||||
onclick="return confirm('Apakah anda yakin ingin menghapus permanen data?')"><i
|
||||
class="fa fa-trash"></i> Delete Permanent
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<!-- Modal Add -->
|
||||
<div class="modal fade" id="formModalAdd" tabindex="-1" aria-labelledby="formModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="formModalLabel">Tambah Data Aplikasi Terintegrasi</h5>
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal" aria-label="Close">X</button>
|
||||
</div>
|
||||
<form id="formAdd" action="{{ url('/admin/aplikasi_integrasi') }}" method="post" enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="modal-body">
|
||||
<div class="form-group mt-2">
|
||||
<label for="nama">Nama Aplikasi</label>
|
||||
<input type="text" class="form-control mt-0" name="nama" required maxlength="255"
|
||||
placeholder=". . .">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="nama_foto">Thumbnail (Maksimal 2MB)</label>
|
||||
<div class="form-group">
|
||||
<img id="img_preview_add" style="max-width: 200px;" class="mt-2" />
|
||||
</div>
|
||||
<input type="file" accept="image/*" class="form-control mt-0" name="thumbnail"
|
||||
id="input_foto_add" required>
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="url">Teks</label>
|
||||
<input type="text" class="form-control mt-0" name="teks" required maxlength="255"
|
||||
placeholder=". . .">
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="url">Link Aplikasi</label>
|
||||
<input type="text" class="form-control mt-0" name="url" required maxlength="255"
|
||||
placeholder=". . .">
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="release_date">Jadwal Rilis</label>
|
||||
<input type="date" class="form-control mt-0" name="release_date" required>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal"
|
||||
aria-label="Close">Batal</button>
|
||||
<button type="submit" class="btn btn-primary">Tambah Data</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@foreach ($aplikasiIntegrasis as $aplikasiIntegrasi)
|
||||
<!-- Modal Edit -->
|
||||
<div class="modal fade" id="formModalEdit" tabindex="-1" aria-labelledby="formModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="formModalLabel">Ubah Data Aplikasi Terintegrasi</h5>
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal" aria-label="Close">X</button>
|
||||
</div>
|
||||
<form id="formEdit" action="{{ route('aplikasi_integrasi.update', $aplikasiIntegrasi->id) }}" method="POST"
|
||||
enctype="multipart/form-data">
|
||||
@method('patch')
|
||||
@csrf
|
||||
<div class="modal-body">
|
||||
<input type="hidden" name="id" id="id">
|
||||
<div class="form-group mt-2">
|
||||
<label for="nama">Nama</label>
|
||||
<input type="text" class="form-control mt-0" name="nama" id="nama" required maxlength="255"
|
||||
placeholder=". . .">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="nama_foto">Thumbnail (Maksimal 2MB)</label>
|
||||
<div class="form-group">
|
||||
<img src="" alt="Image Missing" id="old_thumbnail" style="max-width: 200px;"
|
||||
class="mt-2" />
|
||||
</div>
|
||||
<input type="file" accept="image/*" class="form-control mt-0" name="thumbnail"
|
||||
id="input_foto_edit">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="teks">Teks (Foto Maksimal 2MB)</label>
|
||||
<input type="text" class="form-control mt-0" placeholder=". . ." name="teks" id="teks"
|
||||
required maxlength="255">
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="url">Link Aplikasi</label>
|
||||
<input type="text" class="form-control mt-0" name="url" id="url" required maxlength="255"
|
||||
placeholder=". . .">
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="release_date">Jadwal Rilis</label>
|
||||
<input type="date" class="form-control mt-0" name="release_date" id="release_date" required>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal"
|
||||
aria-label="Close">Batal</button>
|
||||
<button type="submit" class="btn btn-primary">Ubah Data</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
|
||||
<script type="text/javascript">
|
||||
var $formAdd = $("#formAdd");
|
||||
$formAdd.submit(function(){
|
||||
$formAdd.submit(function(){
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var $formEdit = $("#formEdit");
|
||||
$formEdit.submit(function(){
|
||||
$formEdit.submit(function(){
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<!--Data Table -->
|
||||
<script>
|
||||
$(function() {
|
||||
$("#tabel_aplikasi_integrasi").DataTable({
|
||||
"paging": true,
|
||||
"lengthChange": false,
|
||||
"searching": true,
|
||||
"ordering": true,
|
||||
"info": true,
|
||||
"autoWidth": false,
|
||||
"responsive": false,
|
||||
"buttons": ["copy", "csv", "excel", "pdf", "print", "colvis"]
|
||||
}).buttons().container().appendTo('#tabel_aplikasi_integrasi_wrapper .col-md-6:eq(0)');
|
||||
});
|
||||
|
||||
$(document).on("click", ".open-formModalEdit", function() {
|
||||
var id = $(this).data('id');
|
||||
var nama = $(this).data('nama');
|
||||
var url = $(this).data('url');
|
||||
var thumbnail = $(this).data('thumbnail');
|
||||
var teks = $(this).data('teks');
|
||||
var release_date = $(this).data('release_date');
|
||||
|
||||
$(".modal-body #id").val(id);
|
||||
$(".modal-body #old_thumbnail").attr("src", thumbnail);
|
||||
$(".modal-body #teks").val(teks);
|
||||
$(".modal-body #nama").val(nama);
|
||||
$(".modal-body #url").val(url);
|
||||
$(".modal-body #release_date").val(release_date);
|
||||
$(".modal-body #input_foto_edit").val("");
|
||||
});
|
||||
|
||||
//Form add image validation
|
||||
var uploadField = document.getElementById("input_foto_add");
|
||||
uploadField.onchange = function() {
|
||||
if (this.files[0].size > 2000000) {
|
||||
alert("Batas maksimum 2MB!");
|
||||
this.value = "";
|
||||
} else {
|
||||
//Ubah Img Preview
|
||||
var reader = new FileReader();
|
||||
reader.onload = function() {
|
||||
var output = document.getElementById('img_preview_add');
|
||||
output.src = reader.result;
|
||||
}
|
||||
reader.readAsDataURL(event.target.files[0]);
|
||||
};
|
||||
};
|
||||
|
||||
//Form edit image validation
|
||||
var uploadField = document.getElementById("input_foto_edit");
|
||||
uploadField.onchange = function() {
|
||||
if (this.files[0].size > 2000000) {
|
||||
alert("Batas maksimum 2MB!");
|
||||
this.value = "";
|
||||
} else {
|
||||
//Ubah Img Preview
|
||||
var reader = new FileReader();
|
||||
reader.onload = function() {
|
||||
var output = document.getElementById('old_thumbnail');
|
||||
output.src = reader.result;
|
||||
}
|
||||
reader.readAsDataURL(event.target.files[0]);
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function(){
|
||||
$('.from-prevent-multiple-submits').on('submit', function(){
|
||||
$('.from-prevent-multiple-submits').attr('disabled','true');
|
||||
})
|
||||
})();
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,294 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Banner')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Banner</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
|
||||
<!-- Alert Status -->
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('alert'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('alert') }}
|
||||
</div>
|
||||
@endif
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Data Banner</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-12 text-left">
|
||||
<a type="button" href="#formModalAdd" data-toggle="modal"
|
||||
class="btn btn-success mb-3"><i class="fa fa-plus-circle"></i>
|
||||
Tambah Data Banner
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table id="tabel_banner" class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nomor</th>
|
||||
<th>Foto</th>
|
||||
<th>Jadwal Rilis</th>
|
||||
<th>Status</th>
|
||||
<th>Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($banners as $banner)
|
||||
<tr>
|
||||
<td>{{ $loop->iteration }}</td>
|
||||
<td><img src="{{ url($banner->nama_foto) }}"
|
||||
style="width:300px;height:auto;object-fit:cover"></td>
|
||||
<td>{{ $banner->release_date }}</td>
|
||||
@if ($banner->deleted_at == '')
|
||||
@if ($banner->release_date <= date('Y-m-d'))
|
||||
<td>Rilis</td>
|
||||
@else
|
||||
<td>Belum Rilis</td>
|
||||
@endif
|
||||
@else ($banner->deleted_at != "")
|
||||
<td>Terhapus</td>
|
||||
@endif
|
||||
@if ($banner->deleted_at == '')
|
||||
<td>
|
||||
<button href="#formModalEdit" role="button" data-toggle="modal"
|
||||
data-id="{{ $banner->id }}"
|
||||
data-teks="{{ $banner->teks }}"
|
||||
data-nama_foto="{{ url($banner->nama_foto) }}"
|
||||
data-sumber="{{ $banner->sumber }}"
|
||||
data-release_date="{{ $banner->release_date }}"
|
||||
class="btn btn-warning open-formModalEdit"><i
|
||||
class="fa fa-edit"></i> Edit</button>
|
||||
<form action="{{ route('banner.destroy', $banner) }}"
|
||||
method="post">
|
||||
@method('delete')
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-danger"
|
||||
onclick="return confirm('Apakah anda yakin ingin menghapus data?')"><i
|
||||
class="fa fa-trash"></i> Delete</button>
|
||||
</form>
|
||||
</td>
|
||||
@else
|
||||
<td>
|
||||
<form
|
||||
action="{{ url('/admin/banner/' . $banner->id . '/restore') }}"
|
||||
method="post">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-primary"
|
||||
onclick="return confirm('Apakah anda yakin ingin mengembalikan data?')"><i
|
||||
class="fas fa-trash-restore"></i> Restore
|
||||
</button>
|
||||
</form>
|
||||
<form
|
||||
action="{{ url('/admin/banner/' . $banner->id . '/delete') }}"
|
||||
method="post">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-danger"
|
||||
onclick="return confirm('Apakah anda yakin ingin menghapus permanen data?')"><i
|
||||
class="fa fa-trash"></i> Delete Permanent
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<!-- Modal Add -->
|
||||
<div class="modal fade" id="formModalAdd" tabindex="-1" aria-labelledby="formModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="formModalLabel">Tambah Data Banner</h5>
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal" aria-label="Close">X</button>
|
||||
</div>
|
||||
<form id="formAdd" action="{{ url('/admin/banner') }}" method="post" enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
<label for="nama_foto">Foto (Maksimal 2MB)</label>
|
||||
<div class="form-group">
|
||||
<img id="img_preview_add" style="max-width: 200px;" class="mt-2" />
|
||||
</div>
|
||||
<input type="file" accept="image/*" class="form-control mt-0" name="nama_foto"
|
||||
id="input_foto_add" required>
|
||||
</div>
|
||||
<div class=" form-group mt-2">
|
||||
<label for="release_date">Jadwal Rilis</label>
|
||||
<input type="date" class="form-control mt-0" name="release_date" required>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal"
|
||||
aria-label="Close">Batal</button>
|
||||
<button type="submit" class="btn btn-primary">Tambah Data</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@foreach ($banners as $banner)
|
||||
<!-- Modal Edit -->
|
||||
<div class="modal fade" id="formModalEdit" tabindex="-1" aria-labelledby="formModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="formModalLabel">Ubah Data Banner</h5>
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal" aria-label="Close">X</button>
|
||||
</div>
|
||||
<form id="formEdit" action="{{ route('banner.update', $banner->id) }}" method="POST" enctype="multipart/form-data">
|
||||
@method('patch')
|
||||
@csrf
|
||||
<div class="modal-body">
|
||||
<input type="hidden" name="id" id="id">
|
||||
<div class="form-group">
|
||||
<label for="nama_foto">Foto (Maksimal 2MB)</label>
|
||||
<div class="form-group">
|
||||
<img src="" alt="Image Missing" id="old_nama_foto" style="max-width: 200px;"
|
||||
class="mt-2" />
|
||||
</div>
|
||||
<input type="file" accept="image/*" class="form-control mt-0" name="nama_foto"
|
||||
id="input_foto_edit">
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="release_date">Jadwal Rilis</label>
|
||||
<input type="date" class="form-control mt-0" name="release_date" id="release_date" required>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal"
|
||||
aria-label="Close">Batal</button>
|
||||
<button type="submit" class="btn btn-primary">Ubah Data</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
|
||||
<script type="text/javascript">
|
||||
var $formAdd = $("#formAdd");
|
||||
$formAdd.submit(function(){
|
||||
$formAdd.submit(function(){
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var $formEdit = $("#formEdit");
|
||||
$formEdit.submit(function(){
|
||||
$formEdit.submit(function(){
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<!--Data Table -->
|
||||
<script>
|
||||
$(function() {
|
||||
$("#tabel_banner").DataTable({
|
||||
"paging": true,
|
||||
"lengthChange": false,
|
||||
"searching": true,
|
||||
"ordering": true,
|
||||
"info": true,
|
||||
"autoWidth": false,
|
||||
"responsive": false,
|
||||
"buttons": ["copy", "csv", "excel", "pdf", "print", "colvis"]
|
||||
}).buttons().container().appendTo('#tabel_banner_wrapper .col-md-6:eq(0)');
|
||||
});
|
||||
|
||||
$(document).on("click", ".open-formModalEdit", function() {
|
||||
var id = $(this).data('id');
|
||||
var teks = $(this).data('teks');
|
||||
var sumber = $(this).data('sumber');
|
||||
var nama_foto = $(this).data('nama_foto');
|
||||
var release_date = $(this).data('release_date');
|
||||
|
||||
$(".modal-body #id").val(id);
|
||||
$(".modal-body #teks").val(teks);
|
||||
$(".modal-body #sumber").val(sumber);
|
||||
$(".modal-body #release_date").val(release_date);
|
||||
$(".modal-body #input_foto_edit").val("");
|
||||
$(".modal-body #old_nama_foto").attr('src', nama_foto);
|
||||
});
|
||||
|
||||
//Form add image validation
|
||||
var uploadField = document.getElementById("input_foto_add");
|
||||
uploadField.onchange = function() {
|
||||
if (this.files[0].size > 2000000) {
|
||||
alert("Batas maksimum 2MB!");
|
||||
this.value = "";
|
||||
} else {
|
||||
//Ubah Img Preview
|
||||
var reader = new FileReader();
|
||||
reader.onload = function() {
|
||||
var output = document.getElementById('img_preview_add');
|
||||
output.src = reader.result;
|
||||
}
|
||||
reader.readAsDataURL(event.target.files[0]);
|
||||
};
|
||||
};
|
||||
|
||||
//Form edit image validation
|
||||
var uploadField = document.getElementById("input_foto_edit");
|
||||
uploadField.onchange = function() {
|
||||
if (this.files[0].size > 2000000) {
|
||||
alert("Batas maksimum 2MB!");
|
||||
this.value = "";
|
||||
} else {
|
||||
//Ubah Img Preview
|
||||
var reader = new FileReader();
|
||||
reader.onload = function() {
|
||||
var output = document.getElementById('old_nama_foto');
|
||||
output.src = reader.result;
|
||||
}
|
||||
reader.readAsDataURL(event.target.files[0]);
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function(){
|
||||
$('.from-prevent-multiple-submits').on('submit', function(){
|
||||
$('.from-prevent-multiple-submits').attr('disabled','true');
|
||||
})
|
||||
})();
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,220 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Berita')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Berita</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Tambah Data Berita</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<!-- form start -->
|
||||
<form class="from-prevent-multiple-submits" action="{{ route('berita.store') }}" method="POST" id="ckeditorForm"
|
||||
enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<label for="judul">Judul</label>
|
||||
<input type="text" class="form-control" id="judul" name="judul"
|
||||
placeholder="Masukkan Judul" value="" required maxlength="255">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="nama_foto">Thumbnail (Maksimal 2MB)</label>
|
||||
<div class="form-group">
|
||||
<img id="img_preview_add" style="max-width: 200px;"
|
||||
class="mt-2" />
|
||||
</div>
|
||||
<input type="file" accept="image/*" class="form-control mt-0"
|
||||
name="thumbnail" id="input_foto_add" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="teks">Teks (Foto Maksimal 2MB)</label>
|
||||
<textarea id="teks" placeholder="Masukkan Teks Berita" name="teks"
|
||||
class="ck_editor_txt" id="ck_editor_txt"></textarea>
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="release_date">Tanggal Rilis</label>
|
||||
<input type="date" class="form-control mt-0" name="release_date" required>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
|
||||
<div class="card-footer">
|
||||
<button id="submit" type="submit" class="btn btn-primary from-prevent-multiple-submits">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
//Define an adapter to upload the files
|
||||
class MyUploadAdapter {
|
||||
constructor(loader) {
|
||||
// The file loader instance to use during the upload. It sounds scary but do not
|
||||
// worry — the loader will be passed into the adapter later on in this guide.
|
||||
this.loader = loader;
|
||||
|
||||
// URL where to send files.
|
||||
this.url = '{{ route('ckeditor.upload') }}';
|
||||
|
||||
//
|
||||
}
|
||||
// Starts the upload process.
|
||||
upload() {
|
||||
return this.loader.file.then(
|
||||
(file) =>
|
||||
new Promise((resolve, reject) => {
|
||||
this._initRequest();
|
||||
this._initListeners(resolve, reject, file);
|
||||
this._sendRequest(file);
|
||||
})
|
||||
);
|
||||
}
|
||||
// Aborts the upload process.
|
||||
abort() {
|
||||
if (this.xhr) {
|
||||
this.xhr.abort();
|
||||
}
|
||||
}
|
||||
// Initializes the XMLHttpRequest object using the URL passed to the constructor.
|
||||
_initRequest() {
|
||||
const xhr = (this.xhr = new XMLHttpRequest());
|
||||
// Note that your request may look different. It is up to you and your editor
|
||||
// integration to choose the right communication channel. This example uses
|
||||
// a POST request with JSON as a data structure but your configuration
|
||||
// could be different.
|
||||
// xhr.open('POST', this.url, true);
|
||||
xhr.open("POST", this.url, true);
|
||||
xhr.setRequestHeader("x-csrf-token", "{{ csrf_token() }}");
|
||||
xhr.responseType = "json";
|
||||
}
|
||||
// Initializes XMLHttpRequest listeners.
|
||||
_initListeners(resolve, reject, file) {
|
||||
const xhr = this.xhr;
|
||||
const loader = this.loader;
|
||||
const genericErrorText = `Couldn't upload file: ${file.name}.`;
|
||||
xhr.addEventListener("error", () => reject(genericErrorText));
|
||||
xhr.addEventListener("abort", () => reject());
|
||||
xhr.addEventListener("load", () => {
|
||||
const response = xhr.response;
|
||||
// This example assumes the XHR server's "response" object will come with
|
||||
// an "error" which has its own "message" that can be passed to reject()
|
||||
// in the upload promise.
|
||||
//
|
||||
// Your integration may handle upload errors in a different way so make sure
|
||||
// it is done properly. The reject() function must be called when the upload fails.
|
||||
if (!response || response.error) {
|
||||
return reject(response && response.error ? response.error.message : genericErrorText);
|
||||
}
|
||||
// If the upload is successful, resolve the upload promise with an object containing
|
||||
// at least the "default" URL, pointing to the image on the server.
|
||||
// This URL will be used to display the image in the content. Learn more in the
|
||||
// UploadAdapter#upload documentation.
|
||||
resolve({
|
||||
default: response.url,
|
||||
});
|
||||
});
|
||||
// Upload progress when it is supported. The file loader has the #uploadTotal and #uploaded
|
||||
// properties which are used e.g. to display the upload progress bar in the editor
|
||||
// user interface.
|
||||
if (xhr.upload) {
|
||||
xhr.upload.addEventListener("progress", (evt) => {
|
||||
if (evt.lengthComputable) {
|
||||
loader.uploadTotal = evt.total;
|
||||
loader.uploaded = evt.loaded;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// Prepares the data and sends the request.
|
||||
_sendRequest(file) {
|
||||
// Prepare the form data.
|
||||
const data = new FormData();
|
||||
data.append("upload", file);
|
||||
// Important note: This is the right place to implement security mechanisms
|
||||
// like authentication and CSRF protection. For instance, you can use
|
||||
// XMLHttpRequest.setRequestHeader() to set the request headers containing
|
||||
// the CSRF token generated earlier by your application.
|
||||
// Send the request.
|
||||
this.xhr.send(data);
|
||||
}
|
||||
// ...
|
||||
}
|
||||
|
||||
function SimpleUploadAdapterPlugin(editor) {
|
||||
editor.plugins.get("FileRepository").createUploadAdapter = (loader) => {
|
||||
// Configure the URL to the upload script in your back-end here!
|
||||
return new MyUploadAdapter(loader);
|
||||
};
|
||||
}
|
||||
|
||||
var allEditors = document.querySelector('.ck_editor_txt');
|
||||
|
||||
//Initialize the ckeditor
|
||||
ClassicEditor.create(document.querySelector("#teks"), {
|
||||
extraPlugins: [SimpleUploadAdapterPlugin],
|
||||
}).catch((error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
$("#ckeditorForm").submit(function(e) {
|
||||
var content = $('.ck_editor_txt').val();
|
||||
html = $(content).text();
|
||||
if ($.trim(html) == '') {
|
||||
alert("Teks Tidak Boleh Kosong!");
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
//Form add image validation
|
||||
var uploadField = document.getElementById("input_foto_add");
|
||||
uploadField.onchange = function() {
|
||||
if (this.files[0].size > 2000000) {
|
||||
alert("Batas maksimum 2MB!");
|
||||
this.value = "";
|
||||
} else {
|
||||
//Ubah Img Preview
|
||||
var reader = new FileReader();
|
||||
reader.onload = function() {
|
||||
var output = document.getElementById('img_preview_add');
|
||||
output.src = reader.result;
|
||||
}
|
||||
reader.readAsDataURL(event.target.files[0]);
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function(){
|
||||
$('.from-prevent-multiple-submits').on('submit', function(){
|
||||
$('.from-prevent-multiple-submits').attr('disabled','true');
|
||||
})
|
||||
})();
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,217 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Berita')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Berita</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
<!-- /.content-header -->
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Edit Data Berita</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<!-- form start -->
|
||||
<form class="from-prevent-multiple-submits"
|
||||
action="{{ route('berita.update', $berita) }}" method="POST"
|
||||
enctype="multipart/form-data">
|
||||
@method('patch')
|
||||
@csrf
|
||||
<div class="card-body">
|
||||
<input type="hidden" value="{{ $berita->id }}" name="id">
|
||||
<div class="form-group">
|
||||
<label for="judul">Judul</label>
|
||||
<input type="text" class="form-control" id="judul" name="judul"
|
||||
maxlength="255" placeholder="Masukkan Judul"
|
||||
value="{{ $berita->judul }}" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="nama_foto">Thumbnail (Maksimal 2MB)</label>
|
||||
<div class="form-group">
|
||||
<img src="{{ url($berita->thumbnail) }}" alt="Image Missing"
|
||||
id="old_nama_foto" style="max-width: 200px;"
|
||||
class="mt-2" />
|
||||
</div>
|
||||
<input type="file" accept="image/*" class="form-control mt-0"
|
||||
name="thumbnail" id="input_foto_edit">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="teks">Teks (Foto Maksimal 2MB)</label>
|
||||
<textarea id="teks" placeholder="Masukkan Deskripsi Video"
|
||||
name="teks">{{ $berita->teks }}</textarea>
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="release_date">Tanggal Rilis</label>
|
||||
<input type="date" class="form-control mt-0" name="release_date"
|
||||
value="{{ $berita->release_date }}" required>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
|
||||
<div class="card-footer">
|
||||
<button id="submit" type="submit"
|
||||
class="btn btn-primary from-prevent-multiple-submits">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
//Define an adapter to upload the files
|
||||
class MyUploadAdapter {
|
||||
constructor(loader) {
|
||||
// The file loader instance to use during the upload. It sounds scary but do not
|
||||
// worry — the loader will be passed into the adapter later on in this guide.
|
||||
this.loader = loader;
|
||||
|
||||
// URL where to send files.
|
||||
this.url = '{{ route('ckeditor.upload') }}';
|
||||
|
||||
//
|
||||
}
|
||||
// Starts the upload process.
|
||||
upload() {
|
||||
return this.loader.file.then(
|
||||
(file) =>
|
||||
new Promise((resolve, reject) => {
|
||||
this._initRequest();
|
||||
this._initListeners(resolve, reject, file);
|
||||
this._sendRequest(file);
|
||||
})
|
||||
);
|
||||
}
|
||||
// Aborts the upload process.
|
||||
abort() {
|
||||
if (this.xhr) {
|
||||
this.xhr.abort();
|
||||
}
|
||||
}
|
||||
// Initializes the XMLHttpRequest object using the URL passed to the constructor.
|
||||
_initRequest() {
|
||||
const xhr = (this.xhr = new XMLHttpRequest());
|
||||
// Note that your request may look different. It is up to you and your editor
|
||||
// integration to choose the right communication channel. This example uses
|
||||
// a POST request with JSON as a data structure but your configuration
|
||||
// could be different.
|
||||
// xhr.open('POST', this.url, true);
|
||||
xhr.open("POST", this.url, true);
|
||||
xhr.setRequestHeader("x-csrf-token", "{{ csrf_token() }}");
|
||||
xhr.responseType = "json";
|
||||
}
|
||||
// Initializes XMLHttpRequest listeners.
|
||||
_initListeners(resolve, reject, file) {
|
||||
const xhr = this.xhr;
|
||||
const loader = this.loader;
|
||||
const genericErrorText = `Couldn't upload file: ${file.name}.`;
|
||||
xhr.addEventListener("error", () => reject(genericErrorText));
|
||||
xhr.addEventListener("abort", () => reject());
|
||||
xhr.addEventListener("load", () => {
|
||||
const response = xhr.response;
|
||||
// This example assumes the XHR server's "response" object will come with
|
||||
// an "error" which has its own "message" that can be passed to reject()
|
||||
// in the upload promise.
|
||||
//
|
||||
// Your integration may handle upload errors in a different way so make sure
|
||||
// it is done properly. The reject() function must be called when the upload fails.
|
||||
if (!response || response.error) {
|
||||
return reject(response && response.error ? response.error.message : genericErrorText);
|
||||
}
|
||||
// If the upload is successful, resolve the upload promise with an object containing
|
||||
// at least the "default" URL, pointing to the image on the server.
|
||||
// This URL will be used to display the image in the content. Learn more in the
|
||||
// UploadAdapter#upload documentation.
|
||||
resolve({
|
||||
default: response.url,
|
||||
});
|
||||
});
|
||||
// Upload progress when it is supported. The file loader has the #uploadTotal and #uploaded
|
||||
// properties which are used e.g. to display the upload progress bar in the editor
|
||||
// user interface.
|
||||
if (xhr.upload) {
|
||||
xhr.upload.addEventListener("progress", (evt) => {
|
||||
if (evt.lengthComputable) {
|
||||
loader.uploadTotal = evt.total;
|
||||
loader.uploaded = evt.loaded;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// Prepares the data and sends the request.
|
||||
_sendRequest(file) {
|
||||
// Prepare the form data.
|
||||
const data = new FormData();
|
||||
data.append("upload", file);
|
||||
// Important note: This is the right place to implement security mechanisms
|
||||
// like authentication and CSRF protection. For instance, you can use
|
||||
// XMLHttpRequest.setRequestHeader() to set the request headers containing
|
||||
// the CSRF token generated earlier by your application.
|
||||
// Send the request.
|
||||
this.xhr.send(data);
|
||||
}
|
||||
// ...
|
||||
}
|
||||
|
||||
function SimpleUploadAdapterPlugin(editor) {
|
||||
editor.plugins.get("FileRepository").createUploadAdapter = (loader) => {
|
||||
// Configure the URL to the upload script in your back-end here!
|
||||
return new MyUploadAdapter(loader);
|
||||
};
|
||||
}
|
||||
|
||||
//Initialize the ckeditor
|
||||
ClassicEditor.create(document.querySelector("#teks"), {
|
||||
extraPlugins: [SimpleUploadAdapterPlugin],
|
||||
}).catch((error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
//Form edit image validation
|
||||
var uploadField = document.getElementById("input_foto_edit");
|
||||
uploadField.onchange = function() {
|
||||
if (this.files[0].size > 2000000) {
|
||||
alert("Batas maksimum 2MB!");
|
||||
this.value = "";
|
||||
} else {
|
||||
//Ubah Img Preview
|
||||
var reader = new FileReader();
|
||||
reader.onload = function() {
|
||||
var output = document.getElementById('old_nama_foto');
|
||||
output.src = reader.result;
|
||||
}
|
||||
reader.readAsDataURL(event.target.files[0]);
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function() {
|
||||
$('.from-prevent-multiple-submits').on('submit', function() {
|
||||
$('.from-prevent-multiple-submits').attr('disabled', 'true');
|
||||
})
|
||||
})();
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,152 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Berita')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Berita</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
<!-- /.content-header -->
|
||||
|
||||
<!-- Alert Status -->
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('alert'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('alert') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Data Berita</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-12 text-left">
|
||||
<a href="{{ url('/admin/berita/create') }}" type="button"
|
||||
class="btn btn-success mb-3">
|
||||
<i class="fa fa-plus-circle mr-2"></i>Tambah Data
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table id="tabel_berita" class="table table-bordered table-striped mt-2">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>No</th>
|
||||
<th>Judul</th>
|
||||
<th>Thumbnail</th>
|
||||
<th>Teks</th>
|
||||
<th>Jadwal Rilis</th>
|
||||
<th>Status</th>
|
||||
<th>Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@foreach ($beritas as $berita)
|
||||
<tr id="{{ $berita->id }}">
|
||||
<td>{{ $loop->iteration }}</td>
|
||||
<td>{{ $berita->judul }}</td>
|
||||
<td><img src="{{ url($berita->thumbnail) }}" style="width:100px"></td>
|
||||
<td>
|
||||
@if (strlen(strip_tags($berita->teks)) > 100)
|
||||
{{ str_replace(' ', '', substr(strip_tags($berita->teks), 0, 100) . '...') }}
|
||||
@else
|
||||
{{ str_replace(' ', '', substr(strip_tags($berita->teks), 0, 100)) }}
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ $berita->release_date }}</td>
|
||||
@if ($berita->deleted_at == '')
|
||||
@if ($berita->release_date <= date('Y-m-d'))
|
||||
<td>Rilis</td>
|
||||
@else
|
||||
<td>Belum Rilis</td>
|
||||
@endif
|
||||
@else
|
||||
($berita->deleted_at != "")
|
||||
<td>Terhapus</td>
|
||||
@endif
|
||||
@if ($berita->deleted_at == '')
|
||||
<td>
|
||||
<a href="{{ url('admin/berita/' . $berita->id . '/edit') }}"
|
||||
class="btn btn-warning open-formModalEdit"><i
|
||||
class="fa fa-edit"></i> Edit</a>
|
||||
<form action="{{ route('berita.destroy', $berita) }}"
|
||||
method="post">
|
||||
@method('delete')
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-danger"
|
||||
onclick="return confirm('Apakah anda yakin ingin menghapus data?')"><i
|
||||
class="fa fa-trash"></i> Delete</button>
|
||||
</form>
|
||||
</td>
|
||||
@else
|
||||
<td>
|
||||
<form
|
||||
action="{{ url('/admin/berita/' . $berita->id . '/restore') }}"
|
||||
method="post">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-primary"
|
||||
onclick="return confirm('Apakah anda yakin ingin mengembalikan data?')"><i
|
||||
class="fas fa-trash-restore"></i> Restore
|
||||
</button>
|
||||
</form>
|
||||
<form
|
||||
action="{{ url('/admin/berita/' . $berita->id . '/delete') }}"
|
||||
method="post">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-danger"
|
||||
onclick="return confirm('Apakah anda yakin ingin menghapus permanen data?')"><i
|
||||
class="fa fa-trash"></i> Delete Permanent
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<!--Data Table -->
|
||||
<script>
|
||||
$(function() {
|
||||
$("#tabel_berita").DataTable({
|
||||
"paging": true,
|
||||
"lengthChange": false,
|
||||
"searching": true,
|
||||
"ordering": true,
|
||||
"info": true,
|
||||
"autoWidth": false,
|
||||
"responsive": false,
|
||||
"buttons": ["copy", "csv", "excel", "pdf", "print", "colvis"]
|
||||
}).buttons().container().appendTo('#tabel_berita_wrapper .col-md-6:eq(0)');
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,254 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Blog')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Blog</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
|
||||
<!-- Alert Status -->
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('alert'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('alert') }}
|
||||
</div>
|
||||
@endif
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Data Blog</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-12 text-left">
|
||||
<a type="button" href="#formModalAdd" data-toggle="modal"
|
||||
class="btn btn-success mb-3"><i class="fa fa-plus-circle"></i>
|
||||
Tambah Data Blog
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table id="tabel_blog" class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nomor</th>
|
||||
<th>Nama Dosen</th>
|
||||
<th>Link Blog</th>
|
||||
<th>Jadwal Rilis</th>
|
||||
<th>Status</th>
|
||||
<th>Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($blogs as $blog)
|
||||
<tr>
|
||||
<td>{{ $loop->iteration }}</td>
|
||||
<td>{{ $blog->nama }}</td>
|
||||
<td><a href="{{ $blog->url }}" download
|
||||
target="_blank">{{ $blog->url }}</a></td>
|
||||
<td>{{ $blog->release_date }}</td>
|
||||
@if ($blog->deleted_at == '')
|
||||
@if ($blog->release_date <= date('Y-m-d'))
|
||||
<td>Rilis</td>
|
||||
@else
|
||||
<td>Belum Rilis</td>
|
||||
@endif
|
||||
@else ($blog->deleted_at != "")
|
||||
<td>Terhapus</td>
|
||||
@endif
|
||||
@if ($blog->deleted_at == '')
|
||||
<td>
|
||||
<button href="#formModalEdit" role="button" data-toggle="modal"
|
||||
data-id="{{ $blog->id }}"
|
||||
data-nama="{{ $blog->nama }}"
|
||||
data-url="{{ $blog->url }}"
|
||||
data-release_date="{{ $blog->release_date }}"
|
||||
class="btn btn-warning open-formModalEdit"><i
|
||||
class="fa fa-edit"></i> Edit</button>
|
||||
<form action="{{ route('blog.destroy', $blog) }}"
|
||||
method="post">
|
||||
@method('delete')
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-danger"
|
||||
onclick="return confirm('Apakah anda yakin ingin menghapus data?')"><i
|
||||
class="fa fa-trash"></i> Delete</button>
|
||||
</form>
|
||||
</td>
|
||||
@else
|
||||
<td>
|
||||
<form
|
||||
action="{{ url('/admin/blog/' . $blog->id . '/restore') }}"
|
||||
method="post">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-primary"
|
||||
onclick="return confirm('Apakah anda yakin ingin mengembalikan data?')"><i
|
||||
class="fas fa-trash-restore"></i> Restore
|
||||
</button>
|
||||
</form>
|
||||
<form
|
||||
action="{{ url('/admin/blog/' . $blog->id . '/delete') }}"
|
||||
method="post">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-danger"
|
||||
onclick="return confirm('Apakah anda yakin ingin menghapus permanen data?')"><i
|
||||
class="fa fa-trash"></i> Delete Permanent
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<!-- Modal Add -->
|
||||
<div class="modal fade" id="formModalAdd" tabindex="-1" aria-labelledby="formModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="formModalLabel">Tambah Data Blog</h5>
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal" aria-label="Close">X</button>
|
||||
</div>
|
||||
<form id="formAdd" action="{{ url('/admin/blog') }}" method="post" enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="modal-body">
|
||||
<div class="form-group mt-2">
|
||||
<label for="nama">Nama Dosen</label>
|
||||
<input type="text" class="form-control mt-0" name="nama" required maxlength="255"
|
||||
placeholder=". . .">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="url">Link Blog</label>
|
||||
<input type="text" class="form-control mt-0" name="url" required placeholder=". . .">
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="release_date">Jadwal Rilis</label>
|
||||
<input type="date" class="form-control mt-0" name="release_date" required>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal"
|
||||
aria-label="Close">Batal</button>
|
||||
<button type="submit" class="btn btn-primary">Tambah Data</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@foreach ($blogs as $blog)
|
||||
<!-- Modal Edit -->
|
||||
<div class="modal fade" id="formModalEdit" tabindex="-1" aria-labelledby="formModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="formModalLabel">Ubah Data Blog</h5>
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal" aria-label="Close">X</button>
|
||||
</div>
|
||||
<form id="formEdit" action="{{ route('blog.update', $blog->id) }}" method="POST" enctype="multipart/form-data">
|
||||
@method('patch')
|
||||
@csrf
|
||||
<div class="modal-body">
|
||||
<input type="hidden" name="id" id="id">
|
||||
<div class="form-group mt-2">
|
||||
<label for="nama">Nama Dosen</label>
|
||||
<input type="text" class="form-control mt-0" name="nama" id="nama" required maxlength="255"
|
||||
placeholder=". . .">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="url">Link Blog</label>
|
||||
<input type="text" class="form-control mt-0" name="url" id="url" required
|
||||
placeholder=". . .">
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="release_date">Jadwal Rilis</label>
|
||||
<input type="date" class="form-control mt-0" name="release_date" id="release_date" required>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal"
|
||||
aria-label="Close">Batal</button>
|
||||
<button type="submit" class="btn btn-primary">Ubah Data</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
|
||||
<script type="text/javascript">
|
||||
var $formAdd = $("#formAdd");
|
||||
$formAdd.submit(function(){
|
||||
$formAdd.submit(function(){
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var $formEdit = $("#formEdit");
|
||||
$formEdit.submit(function(){
|
||||
$formEdit.submit(function(){
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<!--Data Table -->
|
||||
<script>
|
||||
$(function() {
|
||||
$("#tabel_blog").DataTable({
|
||||
"paging": true,
|
||||
"lengthChange": false,
|
||||
"searching": true,
|
||||
"ordering": true,
|
||||
"info": true,
|
||||
"autoWidth": false,
|
||||
"responsive": false,
|
||||
"buttons": ["copy", "csv", "excel", "pdf", "print", "colvis"]
|
||||
}).buttons().container().appendTo('#tabel_blog_wrapper .col-md-6:eq(0)');
|
||||
});
|
||||
|
||||
$(document).on("click", ".open-formModalEdit", function() {
|
||||
var id = $(this).data('id');
|
||||
var nama = $(this).data('nama');
|
||||
var url = $(this).data('url');
|
||||
var release_date = $(this).data('release_date');
|
||||
|
||||
$(".modal-body #id").val(id);
|
||||
$(".modal-body #nama").val(nama);
|
||||
$(".modal-body #release_date").val(release_date);
|
||||
$(".modal-body #url").val(url);
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,247 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Dashboard')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Dashboard</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
<!-- /.content-header -->
|
||||
|
||||
<!-- Alert Status -->
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('alert'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('alert') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="col-12">
|
||||
<div class="card p-3">
|
||||
<div class="row">
|
||||
<div class="col-12 text-left">
|
||||
<button type="button" class="btn btn-warning mb-3 open-formModalEditData"
|
||||
data-toggle="modal" data-target="#modal-edit-data" data-id="{{ $session_user->id }}"
|
||||
data-name="{{ $session_user->name }}" data-email="{{ $session_user->email }}"
|
||||
data-posisi_jabatan="{{ $session_user->posisi_jabatan }}"
|
||||
data-telepon="{{ $session_user->telepon }}">
|
||||
<i class="fa fa-list mr-2"></i>Ubah Data
|
||||
</button>
|
||||
<button type="button" class="btn btn-warning mb-3 ml-2 open-formModalEditPassword"
|
||||
data-toggle="modal" data-target="#modal-edit-password"
|
||||
data-id="{{ $session_user->id }}" data-name="{{ $session_user->name }}"
|
||||
data-email="{{ $session_user->email }}"
|
||||
data-posisi_jabatan="{{ $session_user->posisi_jabatan }}"
|
||||
data-telepon="{{ $session_user->telepon }}">
|
||||
<i class="fa fa-key mr-2"></i>Ubah Password
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-3 col-6">
|
||||
<!-- small box -->
|
||||
<div class="small-box bg-info">
|
||||
<div class="inner">
|
||||
<h3>Nama</h3>
|
||||
<p>{{ $session_user->name }}</p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="far fa-user"></i>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- ./col -->
|
||||
<div class="col-lg-3 col-6">
|
||||
<!-- small box -->
|
||||
<div class="small-box bg-success">
|
||||
<div class="inner">
|
||||
<h3>Email</h3>
|
||||
<p>{{ $session_user->email }}</p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="far fa-envelope"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- ./col -->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
|
||||
<!-- Modal Edit Data -->
|
||||
<div class="modal fade" id="modal-edit-data">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title">Ubah Data User</h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<form action="{{ url('admin/dashboard') }}/{{ $session_user->id }}" method="post"
|
||||
enctype="multipart/form-data">
|
||||
@method('patch')
|
||||
@csrf
|
||||
<div class="modal-body">
|
||||
|
||||
<input type="hidden" name="id" id="id">
|
||||
|
||||
<div class="form-group mt-2">
|
||||
<label for="name">Nama</label>
|
||||
<input type="text" class="form-control mt-0" id="name" name="name" maxlength="50" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group mt-2">
|
||||
<label for="email">Email</label>
|
||||
<input type="email" class="form-control mt-0" id="email" name="email" maxlength="50" required>
|
||||
</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-primary">Ubah Data</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
|
||||
<!-- Modal Edit Password -->
|
||||
<div class="modal fade" id="modal-edit-password">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title">Ubah Password Pengguna</h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<form action="{{ url('admin/dashboard') }}/{{ $session_user->id }}" method="post"
|
||||
enctype="multipart/form-data">
|
||||
@method('patch')
|
||||
@csrf
|
||||
<div class="modal-body">
|
||||
|
||||
<input type="hidden" name="id" id="id">
|
||||
|
||||
<input type="hidden" name="name" id="name">
|
||||
|
||||
<input type="hidden" name="email" id="email">
|
||||
|
||||
<div class="form-group mt-2">
|
||||
<label for="name">Password Baru</label>
|
||||
<input type="password" class="form-control mt-0" placeholder="Masukkan Password Baru"
|
||||
name="password" id="password_edit" maxlength="255" required onchange="check_pass1()">
|
||||
<input type="checkbox" onclick="myFunction1()">Tampilkan Password
|
||||
</div>
|
||||
|
||||
<div class="form-group mt-2">
|
||||
<label for="email">Konfirmasi Password Baru</label>
|
||||
<input type="password" class="form-control mt-0" placeholder="Konfirmasi Password Baru"
|
||||
name="password_confirm" id="password_confirm_edit" maxlength="255" required
|
||||
onchange="check_pass1()">
|
||||
<input type="checkbox" onclick="myFunction2()">Tampilkan Password
|
||||
</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-primary" id="submit_edit">Ubah Password</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('script')
|
||||
<script type="text/javascript">
|
||||
$(document).on("click", ".open-formModalEditData", function() {
|
||||
var id = $(this).data('id');
|
||||
var name = $(this).data('name');
|
||||
var email = $(this).data('email');
|
||||
var telepon = $(this).data('telepon');
|
||||
|
||||
$(".modal-body #id").val(id);
|
||||
$(".modal-body #name").val(name);
|
||||
$(".modal-body #email").val(email);
|
||||
$(".modal-body #telepon").val(telepon);
|
||||
});
|
||||
|
||||
$(document).on("click", ".open-formModalEditPassword", function() {
|
||||
var id = $(this).data('id');
|
||||
var name = $(this).data('name');
|
||||
var email = $(this).data('email');
|
||||
var telepon = $(this).data('telepon');
|
||||
|
||||
$(".modal-body #id").val(id);
|
||||
$(".modal-body #name").val(name);
|
||||
$(".modal-body #email").val(email);
|
||||
$(".modal-body #telepon").val(telepon);
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
function myFunction1() {
|
||||
var x = document.getElementById("password_edit");
|
||||
if (x.type === "password") {
|
||||
x.type = "text";
|
||||
} else {
|
||||
x.type = "password";
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
function myFunction2() {
|
||||
var x = document.getElementById("password_confirm_edit");
|
||||
if (x.type === "password") {
|
||||
x.type = "text";
|
||||
} else {
|
||||
x.type = "password";
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
function check_pass1() {
|
||||
if (document.getElementById('password_edit').value ===
|
||||
document.getElementById('password_confirm_edit').value) {
|
||||
document.getElementById('submit_edit').disabled = false;
|
||||
} else {
|
||||
document.getElementById('submit_edit').disabled = true;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,276 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Dokumen Akademik')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Dokumen Akademik</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
|
||||
<!-- Alert Status -->
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('alert'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('alert') }}
|
||||
</div>
|
||||
@endif
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Data Dokumen Akademik</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-12 text-left">
|
||||
<a type="button" href="#formModalAdd" data-toggle="modal"
|
||||
class="btn btn-success mb-3"><i class="fa fa-plus-circle"></i>
|
||||
Tambah Data Dokumen Akademik
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table id="tabel_dokumen_akademik" class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nomor</th>
|
||||
<th>Judul</th>
|
||||
<th>File</th>
|
||||
<th>Jadwal Rilis</th>
|
||||
<th>Status</th>
|
||||
<th>Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($dokumenAkademiks as $dokumenAkademik)
|
||||
<tr>
|
||||
<td>{{ $loop->iteration }}</td>
|
||||
<td>{{ $dokumenAkademik->judul }}</td>
|
||||
<td><a href="{{ url($dokumenAkademik->nama_file) }}" download
|
||||
target="_blank">{{ $dokumenAkademik->nama_file }}</a></td>
|
||||
<td>{{ $dokumenAkademik->release_date }}</td>
|
||||
@if ($dokumenAkademik->deleted_at == '')
|
||||
@if ($dokumenAkademik->release_date <= date('Y-m-d'))
|
||||
<td>Rilis</td>
|
||||
@else
|
||||
<td>Belum Rilis</td>
|
||||
@endif
|
||||
@else ($dokumenAkademik->deleted_at != "")
|
||||
<td>Terhapus</td>
|
||||
@endif
|
||||
@if ($dokumenAkademik->deleted_at == '')
|
||||
<td>
|
||||
<button href="#formModalEdit" role="button" data-toggle="modal"
|
||||
data-id="{{ $dokumenAkademik->id }}"
|
||||
data-judul="{{ $dokumenAkademik->judul }}"
|
||||
data-nama_file="{{ $dokumenAkademik->nama_file }}"
|
||||
data-release_date="{{ $dokumenAkademik->release_date }}"
|
||||
class="btn btn-warning open-formModalEdit"><i
|
||||
class="fa fa-edit"></i> Edit</button>
|
||||
<form
|
||||
action="{{ route('dokumen_akademik.destroy', $dokumenAkademik) }}"
|
||||
method="post">
|
||||
@method('delete')
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-danger"
|
||||
onclick="return confirm('Apakah anda yakin ingin menghapus data?')"><i
|
||||
class="fa fa-trash"></i> Delete</button>
|
||||
</form>
|
||||
</td>
|
||||
@else
|
||||
<td>
|
||||
<form
|
||||
action="{{ url('/admin/dokumen_akademik/' . $dokumenAkademik->id . '/restore') }}"
|
||||
method="post">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-primary"
|
||||
onclick="return confirm('Apakah anda yakin ingin mengembalikan data?')"><i
|
||||
class="fas fa-trash-restore"></i> Restore
|
||||
</button>
|
||||
</form>
|
||||
<form
|
||||
action="{{ url('/admin/dokumen_akademik/' . $dokumenAkademik->id . '/delete') }}"
|
||||
method="post">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-danger"
|
||||
onclick="return confirm('Apakah anda yakin ingin menghapus permanen data?')"><i
|
||||
class="fa fa-trash"></i> Delete Permanent
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<!-- Modal Add -->
|
||||
<div class="modal fade" id="formModalAdd" tabindex="-1" aria-labelledby="formModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="formModalLabel">Tambah Data Dokumen Akademik</h5>
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal" aria-label="Close">X</button>
|
||||
</div>
|
||||
<form id="formAdd" action="{{ url('/admin/dokumen_akademik') }}" method="post" enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="modal-body">
|
||||
<div class="form-group mt-2">
|
||||
<label for="judul">Judul</label>
|
||||
<input type="text" class="form-control mt-0" name="judul" required maxlength="255"
|
||||
placeholder=". . .">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="nama_file">File Dokumen Akademik</label>
|
||||
<input type="file" id="input_file_add" class="form-control mt-0" name="nama_file"
|
||||
required>
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="release_date">Jadwal Rilis</label>
|
||||
<input type="date" class="form-control mt-0" name="release_date" required>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal"
|
||||
aria-label="Close">Batal</button>
|
||||
<button type="submit" class="btn btn-primary">Tambah Data</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@foreach ($dokumenAkademiks as $dokumenAkademik)
|
||||
<!-- Modal Edit -->
|
||||
<div class="modal fade" id="formModalEdit" tabindex="-1" aria-labelledby="formModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="formModalLabel">Ubah Data Dokumen Akademik</h5>
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal" aria-label="Close">X</button>
|
||||
</div>
|
||||
<form id="formEdit" action="{{ route('dokumen_akademik.update', $dokumenAkademik->id) }}" method="POST"
|
||||
enctype="multipart/form-data">
|
||||
@method('patch')
|
||||
@csrf
|
||||
<div class="modal-body">
|
||||
<input type="hidden" name="id" id="id">
|
||||
<div class="form-group mt-2">
|
||||
<label for="judul">Nama</label>
|
||||
<input type="text" class="form-control mt-0" name="judul" id="judul" required
|
||||
maxlength="255" placeholder=". . .">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="nama_file">File Dokumen Akademik</label>
|
||||
<input type="file" id="input_file_edit" class="form-control mt-0" name="nama_file"
|
||||
id="nama_file">
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="release_date">Jadwal Rilis</label>
|
||||
<input type="date" class="form-control mt-0" name="release_date" id="release_date" required>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal"
|
||||
aria-label="Close">Batal</button>
|
||||
<button type="submit" class="btn btn-primary">Ubah Data</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
|
||||
<script type="text/javascript">
|
||||
var $formAdd = $("#formAdd");
|
||||
$formAdd.submit(function(){
|
||||
$formAdd.submit(function(){
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var $formEdit = $("#formEdit");
|
||||
$formEdit.submit(function(){
|
||||
$formEdit.submit(function(){
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<!--Data Table -->
|
||||
<script>
|
||||
$(function() {
|
||||
$("#tabel_dokumen_akademik").DataTable({
|
||||
"paging": true,
|
||||
"lengthChange": false,
|
||||
"searching": true,
|
||||
"ordering": true,
|
||||
"info": true,
|
||||
"autoWidth": false,
|
||||
"responsive": false,
|
||||
"buttons": ["copy", "csv", "excel", "pdf", "print", "colvis"]
|
||||
}).buttons().container().appendTo('#tabel_dokumen_akademik_wrapper .col-md-6:eq(0)');
|
||||
});
|
||||
|
||||
$(document).on("click", ".open-formModalEdit", function() {
|
||||
var id = $(this).data('id');
|
||||
var judul = $(this).data('judul');
|
||||
var nama_file = $(this).data('nama_file');
|
||||
var release_date = $(this).data('release_date');
|
||||
|
||||
$(".modal-body #id").val(id);
|
||||
$(".modal-body #judul").val(judul);
|
||||
$(".modal-body #release_date").val(release_date);
|
||||
$(".modal-body #nama_file").val(nama_file);
|
||||
$(".modal-body #input_file_edit").val("");
|
||||
});
|
||||
|
||||
//Form add image validation
|
||||
var uploadField = document.getElementById("input_file_add");
|
||||
uploadField.onchange = function() {
|
||||
if (this.files[0].size > 2000000) {
|
||||
alert("Batas maksimum 2MB!");
|
||||
this.value = "";
|
||||
};
|
||||
};
|
||||
|
||||
//Form edit image validation
|
||||
var uploadField = document.getElementById("input_file_edit");
|
||||
uploadField.onchange = function() {
|
||||
if (this.files[0].size > 2000000) {
|
||||
alert("Batas maksimum 2MB!");
|
||||
this.value = "";
|
||||
};
|
||||
};
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,224 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Dosen')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Dosen</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
<!-- /.content-header -->
|
||||
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('alert'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('alert') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Data Dosen</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-12 text-left">
|
||||
<a type="button" href="#formModalAdd" data-toggle="modal"
|
||||
class="btn btn-success mb-3"><i class="fa fa-plus-circle"></i>
|
||||
Tambah Data Dosen
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table id="tabel_dosen" class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nomor</th>
|
||||
<th>Nama</th>
|
||||
<th>NIP</th>
|
||||
<th>Pangkat/Golongan</th>
|
||||
<th>Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($dosens as $dosen)
|
||||
<tr>
|
||||
<td>{{ $loop->iteration }}</td>
|
||||
<td>{{ $dosen->nama }}</td>
|
||||
<td>{{ $dosen->nip }}</td>
|
||||
<td>{{ $dosen->pangkat_golongan }}</td>
|
||||
<td>
|
||||
<button href="#formModalEdit" role="button" data-toggle="modal"
|
||||
data-id="{{ $dosen->id }}" data-nama="{{ $dosen->nama }}"
|
||||
data-nip="{{ $dosen->nip }}"
|
||||
data-pangkat_golongan="{{ $dosen->pangkat_golongan }}"
|
||||
class="btn btn-warning open-formModalEdit"><i
|
||||
class="fa fa-edit"></i> Edit</button>
|
||||
<form action="{{ route('dosen.destroy', $dosen) }}"
|
||||
method="post">
|
||||
@method('delete')
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-danger"
|
||||
onclick="return confirm('Apakah anda yakin ingin menghapus data?')"><i
|
||||
class="fa fa-trash"></i> Delete</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<!-- Modal Add -->
|
||||
<div class="modal fade" id="formModalAdd" tabindex="-1" aria-labelledby="formModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="formModalLabel">Tambah Data Dosen</h5>
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal" aria-label="Close">X</button>
|
||||
</div>
|
||||
<form id="formAdd" action="{{ url('/admin/dosen') }}" method="post">
|
||||
@csrf
|
||||
<div class="modal-body">
|
||||
<div class="form-group mt-2">
|
||||
<label for="nama">Nama</label>
|
||||
<input type="text" class="form-control mt-0" name="nama" required maxlength="255"
|
||||
placeholder=". . .">
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="nip">NIP</label>
|
||||
<input type="text" class="form-control mt-0" name="nip" required maxlength="25"
|
||||
placeholder=". . .">
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="pangkat_golongan">Pangkat/Golongan</label>
|
||||
<input type="text" class="form-control mt-0" name="pangkat_golongan"
|
||||
required maxlength="100" placeholder=". . .">
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal"
|
||||
aria-label="Close">Batal</button>
|
||||
<button type="submit" class="btn btn-primary">Tambah Data</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@foreach ($dosens as $dosen)
|
||||
<!-- Modal Edit -->
|
||||
<div class="modal fade" id="formModalEdit" tabindex="-1" aria-labelledby="formModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="formModalLabel">Ubah Data Dosen</h5>
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal" aria-label="Close">X</button>
|
||||
</div>
|
||||
<form id="formEdit" action="{{ route('dosen.update', $dosen->id) }}" method="POST">
|
||||
@method('patch')
|
||||
@csrf
|
||||
<div class="modal-body">
|
||||
<input type="hidden" name="id" id="id">
|
||||
<div class="form-group mt-2">
|
||||
<label for="nama">Nama</label>
|
||||
<input type="text" class="form-control mt-0" name="nama" id="nama" required maxlength="255"
|
||||
placeholder=". . .">
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="nip">NIP</label>
|
||||
<input type="text" class="form-control mt-0" name="nip" id="nip" required maxlength="25"
|
||||
placeholder=". . .">
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="pangkat_golongan">Pangkat Golongan</label>
|
||||
<input type="text" class="form-control mt-0" name="pangkat_golongan" id="pangkat_golongan"
|
||||
required maxlength="100" placeholder=". . .">
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal"
|
||||
aria-label="Close">Batal</button>
|
||||
<button type="submit" class="btn btn-primary">Ubah Data</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
|
||||
<script type="text/javascript">
|
||||
var $formAdd = $("#formAdd");
|
||||
$formAdd.submit(function(){
|
||||
$formAdd.submit(function(){
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var $formEdit = $("#formEdit");
|
||||
$formEdit.submit(function(){
|
||||
$formEdit.submit(function(){
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<!--Data Table -->
|
||||
<script>
|
||||
$(function() {
|
||||
$("#tabel_dosen").DataTable({
|
||||
"paging": true,
|
||||
"lengthChange": false,
|
||||
"searching": true,
|
||||
"ordering": true,
|
||||
"info": true,
|
||||
"autoWidth": false,
|
||||
"responsive": false,
|
||||
"buttons": ["copy", "csv", "excel", "pdf", "print", "colvis"]
|
||||
}).buttons().container().appendTo('#tabel_dosen_wrapper .col-md-6:eq(0)');
|
||||
});
|
||||
</script>
|
||||
|
||||
<!--Modal Edit -->
|
||||
<script type="text/javascript">
|
||||
$(document).on("click", ".open-formModalEdit", function() {
|
||||
var id = $(this).data('id');
|
||||
var nama = $(this).data('nama');
|
||||
var nip = $(this).data('nip');
|
||||
var pangkat_golongan = $(this).data('pangkat_golongan');
|
||||
|
||||
$(".modal-body #id").val(id);
|
||||
$(".modal-body #nama").val(nama);
|
||||
$(".modal-body #nip").val(nip);
|
||||
$(".modal-body #pangkat_golongan").val(pangkat_golongan);
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,70 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'FAQ (Frequently Asked Questions)')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">FAQ (Frequently Asked Questions)</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Tambah Data FAQ (Frequently Asked Questions)</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<!-- form start -->
|
||||
<form class="from-prevent-multiple-submits" action="{{ route('faq.store') }}" method="POST" id="ckeditorForm"
|
||||
enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<label for="question">Question</label>
|
||||
<textarea class="form-control mt-0 text-faq"
|
||||
style="width : 65vw;height:150px" name="question" required
|
||||
placeholder=". . ."></textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="answer">Answer</label>
|
||||
<textarea class="form-control mt-0" style="width : 65vw;height:150px"
|
||||
name="answer" required placeholder=". . ."></textarea>
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="status">Status</label>
|
||||
<select class="form-control mt-0" name="status" id="status" required>
|
||||
<option value="Rilis">Rilis</option>
|
||||
<option value="Tidak Rilis">Tidak Rilis</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
|
||||
<div class="card-footer">
|
||||
<button id="submit" type="submit" class="btn btn-primary from-prevent-multiple-submits">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
@@ -0,0 +1,74 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'FAQ (Frequently Asked Questions)')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">FAQ (Frequently Asked Questions)</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
<!-- /.content-header -->
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Edit Data FAQ (Frequently Asked Questions)</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<!-- form start -->
|
||||
<form class="from-prevent-multiple-submits" action="{{ route('faq.update', $faq) }}" method="POST"
|
||||
enctype="multipart/form-data">
|
||||
@method('patch')
|
||||
@csrf
|
||||
<div class="card-body">
|
||||
<input type="hidden" value="{{ $faq->id }}" name="id">
|
||||
<div class="form-group">
|
||||
<label for="question">Question</label>
|
||||
<textarea class="form-control mt-0 text-faq"
|
||||
style="width : 65vw;height:150px" name="question" required
|
||||
placeholder=". . .">{{ $faq->question }}</textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="answer">Answer</label>
|
||||
<textarea class="form-control mt-0" style="width : 65vw;height:150px"
|
||||
name="answer" required
|
||||
placeholder=". . .">{{ $faq->answer }}</textarea>
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="status">Status</label>
|
||||
<select class="form-control mt-0" name="status" id="status" required
|
||||
value="{{ $faq->status }}">
|
||||
<option value="Rilis">Rilis</option>
|
||||
<option value="Tidak Rilis">Tidak Rilis</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
|
||||
<div class="card-footer">
|
||||
<button id="submit" type="submit" class="btn btn-primary from-prevent-multiple-submits">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,149 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'FAQ (Frequently Asked Questions)')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">FAQ (Frequently Asked Questions)</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
<!-- /.content-header -->
|
||||
|
||||
<!-- Alert Status -->
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('alert'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('alert') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Data FAQ (Frequently Asked Questions)</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-12 text-left">
|
||||
<a href="{{ url('/admin/faq/create') }}" type="button"
|
||||
class="btn btn-success mb-3">
|
||||
<i class="fa fa-plus-circle mr-2"></i>Tambah Data
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table id="tabel_faq" class="table table-bordered table-striped mt-2">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>No</th>
|
||||
<th>Question</th>
|
||||
<th>Answer</th>
|
||||
<th>Status</th>
|
||||
<th>Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@foreach ($faqs as $faq)
|
||||
<tr id="{{ $faq->id }}">
|
||||
<td>{{ $loop->iteration }}</td>
|
||||
@if (strlen($faq->question) > 100)
|
||||
<td>
|
||||
{!! substr(strip_tags($faq->question), 0, 100) . '...' !!}
|
||||
</td>
|
||||
@else
|
||||
<td>
|
||||
{!! substr(strip_tags($faq->question), 0, 100) !!}
|
||||
</td>
|
||||
@endif
|
||||
@if (strlen($faq->answer) > 100)
|
||||
<td>
|
||||
{!! substr(strip_tags($faq->answer), 0, 100) . '...' !!}
|
||||
</td>
|
||||
@else
|
||||
<td>
|
||||
{!! substr(strip_tags($faq->answer), 0, 100) !!}
|
||||
</td>
|
||||
@endif
|
||||
<td>{{ $faq->status }}</td>
|
||||
@if ($faq->deleted_at == '')
|
||||
<td>
|
||||
<a href="{{ url('admin/faq/' . $faq->id . '/edit') }}"
|
||||
class="btn btn-warning open-formModalEdit"><i
|
||||
class="fa fa-edit"></i> Edit</a>
|
||||
<form action="{{ route('faq.destroy', $faq) }}"
|
||||
method="post">
|
||||
@method('delete')
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-danger"
|
||||
onclick="return confirm('Apakah anda yakin ingin menghapus data?')"><i
|
||||
class="fa fa-trash"></i> Delete</button>
|
||||
</form>
|
||||
</td>
|
||||
@else
|
||||
<td>
|
||||
<form
|
||||
action="{{ url('/admin/faq/' . $faq->id . '/restore') }}"
|
||||
method="post">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-primary"
|
||||
onclick="return confirm('Apakah anda yakin ingin mengembalikan data?')"><i
|
||||
class="fas fa-trash-restore"></i> Restore
|
||||
</button>
|
||||
</form>
|
||||
<form
|
||||
action="{{ url('/admin/faq/' . $faq->id . '/delete') }}"
|
||||
method="post">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-danger"
|
||||
onclick="return confirm('Apakah anda yakin ingin menghapus permanen data?')"><i
|
||||
class="fa fa-trash"></i> Delete Permanent
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<!--Data Table -->
|
||||
<script>
|
||||
$(function() {
|
||||
$("#tabel_faq").DataTable({
|
||||
"paging": true,
|
||||
"lengthChange": false,
|
||||
"searching": true,
|
||||
"ordering": true,
|
||||
"info": true,
|
||||
"autoWidth": false,
|
||||
"responsive": false,
|
||||
"buttons": ["copy", "csv", "excel", "pdf", "print", "colvis"]
|
||||
}).buttons().container().appendTo('#tabel_faq_wrapper .col-md-6:eq(0)');
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,297 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Galeri')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Galeri</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
|
||||
<!-- Alert Status -->
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('alert'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('alert') }}
|
||||
</div>
|
||||
@endif
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Data Galeri</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-12 text-left">
|
||||
<a type="button" href="#formModalAdd" data-toggle="modal"
|
||||
class="btn btn-success mb-3"><i class="fa fa-plus-circle"></i>
|
||||
Tambah Data Galeri
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table id="tabel_galeri" class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nomor</th>
|
||||
<th>Foto</th>
|
||||
<th>Jadwal Rilis</th>
|
||||
<th>Status</th>
|
||||
<th>Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($galeris as $galeri)
|
||||
<tr>
|
||||
<td>{{ $loop->iteration }}</td>
|
||||
<td><img src="{{ url($galeri->nama_foto) }}"
|
||||
style="width:300px;height:auto;object-fit:cover"></td>
|
||||
<td>{{ $galeri->release_date }}</td>
|
||||
@if ($galeri->deleted_at == '')
|
||||
@if ($galeri->release_date <= date('Y-m-d'))
|
||||
<td>Rilis</td>
|
||||
@else
|
||||
<td>Belum Rilis</td>
|
||||
@endif
|
||||
@else ($galeri->deleted_at != "")
|
||||
<td>Terhapus</td>
|
||||
@endif
|
||||
@if ($galeri->deleted_at == '')
|
||||
<td>
|
||||
<button href="#formModalEdit" role="button" data-toggle="modal"
|
||||
data-id="{{ $galeri->id }}"
|
||||
data-teks="{{ $galeri->teks }}"
|
||||
data-nama_foto="{{ url($galeri->nama_foto) }}"
|
||||
data-sumber="{{ $galeri->sumber }}"
|
||||
data-release_date="{{ $galeri->release_date }}"
|
||||
class="btn btn-warning open-formModalEdit"><i
|
||||
class="fa fa-edit"></i> Edit</button>
|
||||
<form action="{{ route('galeri.destroy', $galeri) }}"
|
||||
method="post">
|
||||
@method('delete')
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-danger"
|
||||
onclick="return confirm('Apakah anda yakin ingin menghapus data?')"><i
|
||||
class="fa fa-trash"></i> Delete</button>
|
||||
</form>
|
||||
</td>
|
||||
@else
|
||||
<td>
|
||||
<form
|
||||
action="{{ url('/admin/galeri/' . $galeri->id . '/restore') }}"
|
||||
method="post">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-primary"
|
||||
onclick="return confirm('Apakah anda yakin ingin mengembalikan data?')"><i
|
||||
class="fas fa-trash-restore"></i> Restore
|
||||
</button>
|
||||
</form>
|
||||
<form
|
||||
action="{{ url('/admin/galeri/' . $galeri->id . '/delete') }}"
|
||||
method="post">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-danger"
|
||||
onclick="return confirm('Apakah anda yakin ingin menghapus permanen data?')"><i
|
||||
class="fa fa-trash"></i> Delete Permanent
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<!-- Modal Add -->
|
||||
<div class="modal fade" id="formModalAdd" tabindex="-1" aria-labelledby="formModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="formModalLabel">Tambah Data Galeri</h5>
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal" aria-label="Close">X</button>
|
||||
</div>
|
||||
<form id="formAdd" action="{{ url('/admin/galeri') }}" method="post" enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
<label for="nama_foto">Foto (Maksimal 2MB)</label>
|
||||
<div class="form-group">
|
||||
<img id="img_preview_add" style="max-width: 200px;" class="mt-2" />
|
||||
</div>
|
||||
<input type="file" accept="image/*" class="form-control mt-0" name="nama_foto"
|
||||
id="input_foto_add" required>
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="release_date">Jadwal Rilis</label>
|
||||
<input type="date" class="form-control mt-0" name="release_date" required>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal"
|
||||
aria-label="Close">Batal</button>
|
||||
<button type="submit" class="btn btn-primary">Tambah Data</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@foreach ($galeris as $galeri)
|
||||
<!-- Modal Edit -->
|
||||
<div class="modal fade" id="formModalEdit" tabindex="-1" aria-labelledby="formModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="formModalLabel">Ubah Data Galeri</h5>
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal" aria-label="Close">X</button>
|
||||
</div>
|
||||
<form id="formEdit" action="{{ route('galeri.update', $galeri->id) }}" method="POST" enctype="multipart/form-data">
|
||||
@method('patch')
|
||||
@csrf
|
||||
<div class="modal-body">
|
||||
<input type="hidden" name="id" id="id">
|
||||
<div class="form-group">
|
||||
<label for="nama_foto">Foto (Maksimal 2MB)</label>
|
||||
<div class="form-group">
|
||||
<img src="" alt="Image Missing" id="old_nama_foto" style="max-width: 200px;"
|
||||
class="mt-2" />
|
||||
</div>
|
||||
<input type="file" accept="image/*" class="form-control mt-0" name="nama_foto"
|
||||
id="input_foto_edit">
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="release_date">Jadwal Rilis</label>
|
||||
<input type="date" class="form-control mt-0" name="release_date" id="release_date" required>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal"
|
||||
aria-label="Close">Batal</button>
|
||||
<button type="submit" class="btn btn-primary">Ubah Data</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
|
||||
<script type="text/javascript">
|
||||
var $formAdd = $("#formAdd");
|
||||
$formAdd.submit(function(){
|
||||
$formAdd.submit(function(){
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var $formEdit = $("#formEdit");
|
||||
$formEdit.submit(function(){
|
||||
$formEdit.submit(function(){
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<!--Data Table -->
|
||||
<script>
|
||||
$(function() {
|
||||
$("#tabel_galeri").DataTable({
|
||||
"paging": true,
|
||||
"lengthChange": false,
|
||||
"searching": true,
|
||||
"ordering": true,
|
||||
"info": true,
|
||||
"autoWidth": false,
|
||||
"responsive": false,
|
||||
"buttons": ["copy", "csv", "excel", "pdf", "print", "colvis"]
|
||||
}).buttons().container().appendTo('#tabel_galeri_wrapper .col-md-6:eq(0)');
|
||||
});
|
||||
|
||||
$(document).on("click", ".open-formModalEdit", function() {
|
||||
var id = $(this).data('id');
|
||||
var teks = $(this).data('teks');
|
||||
var sumber = $(this).data('sumber');
|
||||
var nama_foto = $(this).data('nama_foto');
|
||||
var release_date = $(this).data('release_date');
|
||||
|
||||
$(".modal-body #id").val(id);
|
||||
$(".modal-body #teks").val(teks);
|
||||
$(".modal-body #sumber").val(sumber);
|
||||
$(".modal-body #release_date").val(release_date);
|
||||
$(".modal-body #input_foto_edit").val("");
|
||||
$(".modal-body #old_nama_foto").attr('src', nama_foto);
|
||||
});
|
||||
|
||||
//Form add image validation
|
||||
var uploadField = document.getElementById("input_foto_add");
|
||||
uploadField.onchange = function() {
|
||||
if (this.files[0].size > 2000000) {
|
||||
alert("Batas maksimum 2MB!");
|
||||
this.value = "";
|
||||
} else {
|
||||
//Ubah Img Preview
|
||||
var reader = new FileReader();
|
||||
reader.onload = function() {
|
||||
var output = document.getElementById('img_preview_add');
|
||||
output.src = reader.result;
|
||||
}
|
||||
reader.readAsDataURL(event.target.files[0]);
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
//Form edit image validation
|
||||
var uploadField = document.getElementById("input_foto_edit");
|
||||
uploadField.onchange = function() {
|
||||
if (this.files[0].size > 2000000) {
|
||||
alert("Batas maksimum 2MB!");
|
||||
this.value = "";
|
||||
} else {
|
||||
//Ubah Img Preview
|
||||
var reader = new FileReader();
|
||||
reader.onload = function() {
|
||||
var output = document.getElementById('old_nama_foto');
|
||||
output.src = reader.result;
|
||||
}
|
||||
reader.readAsDataURL(event.target.files[0]);
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function(){
|
||||
$('.from-prevent-multiple-submits').on('submit', function(){
|
||||
$('.from-prevent-multiple-submits').attr('disabled','true');
|
||||
})
|
||||
})();
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,233 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Hasil Karya')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Hasil Karya</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
<!-- /.content-header -->
|
||||
|
||||
<!-- Alert Status -->
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('alert'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('alert') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Tambah Data Hasil Karya</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<!-- form start -->
|
||||
<form class="from-prevent-multiple-submits" action="{{ route('hasil_karya.store') }}" method="POST" id="ckeditorForm"
|
||||
enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<label for="judul">Judul</label>
|
||||
<input type="text" class="form-control" id="judul" name="judul"
|
||||
placeholder="Masukkan Judul" value="" required maxlength="255">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="nama_foto">Thumbnail (Maksimal 2MB)</label>
|
||||
<div class="form-group">
|
||||
<img id="img_preview_add" style="max-width: 200px;"
|
||||
class="mt-2" />
|
||||
</div>
|
||||
<input type="file" accept="image/*" class="form-control mt-0"
|
||||
name="thumbnail" id="input_foto_add" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="teks">Teks (Foto Maksimal 2MB)</label>
|
||||
<textarea id="teks" placeholder="Masukkan Teks" name="teks"
|
||||
class="ck_editor_txt" id="ck_editor_txt"></textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="release_date">Tanggal Rilis</label>
|
||||
<input type="date" class="form-control" name="release_date" required>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
|
||||
<div class="card-footer">
|
||||
<button id="submit" type="submit" class="btn btn-primary from-prevent-multiple-submits">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
//Define an adapter to upload the files
|
||||
class MyUploadAdapter {
|
||||
constructor(loader) {
|
||||
// The file loader instance to use during the upload. It sounds scary but do not
|
||||
// worry — the loader will be passed into the adapter later on in this guide.
|
||||
this.loader = loader;
|
||||
|
||||
// URL where to send files.
|
||||
this.url = '{{ route('ckeditor.upload') }}';
|
||||
|
||||
//
|
||||
}
|
||||
// Starts the upload process.
|
||||
upload() {
|
||||
return this.loader.file.then(
|
||||
(file) =>
|
||||
new Promise((resolve, reject) => {
|
||||
this._initRequest();
|
||||
this._initListeners(resolve, reject, file);
|
||||
this._sendRequest(file);
|
||||
})
|
||||
);
|
||||
}
|
||||
// Aborts the upload process.
|
||||
abort() {
|
||||
if (this.xhr) {
|
||||
this.xhr.abort();
|
||||
}
|
||||
}
|
||||
// Initializes the XMLHttpRequest object using the URL passed to the constructor.
|
||||
_initRequest() {
|
||||
const xhr = (this.xhr = new XMLHttpRequest());
|
||||
// Note that your request may look different. It is up to you and your editor
|
||||
// integration to choose the right communication channel. This example uses
|
||||
// a POST request with JSON as a data structure but your configuration
|
||||
// could be different.
|
||||
// xhr.open('POST', this.url, true);
|
||||
xhr.open("POST", this.url, true);
|
||||
xhr.setRequestHeader("x-csrf-token", "{{ csrf_token() }}");
|
||||
xhr.responseType = "json";
|
||||
}
|
||||
// Initializes XMLHttpRequest listeners.
|
||||
_initListeners(resolve, reject, file) {
|
||||
const xhr = this.xhr;
|
||||
const loader = this.loader;
|
||||
const genericErrorText = `Couldn't upload file: ${file.name}.`;
|
||||
xhr.addEventListener("error", () => reject(genericErrorText));
|
||||
xhr.addEventListener("abort", () => reject());
|
||||
xhr.addEventListener("load", () => {
|
||||
const response = xhr.response;
|
||||
// This example assumes the XHR server's "response" object will come with
|
||||
// an "error" which has its own "message" that can be passed to reject()
|
||||
// in the upload promise.
|
||||
//
|
||||
// Your integration may handle upload errors in a different way so make sure
|
||||
// it is done properly. The reject() function must be called when the upload fails.
|
||||
if (!response || response.error) {
|
||||
return reject(response && response.error ? response.error.message : genericErrorText);
|
||||
}
|
||||
// If the upload is successful, resolve the upload promise with an object containing
|
||||
// at least the "default" URL, pointing to the image on the server.
|
||||
// This URL will be used to display the image in the content. Learn more in the
|
||||
// UploadAdapter#upload documentation.
|
||||
resolve({
|
||||
default: response.url,
|
||||
});
|
||||
});
|
||||
// Upload progress when it is supported. The file loader has the #uploadTotal and #uploaded
|
||||
// properties which are used e.g. to display the upload progress bar in the editor
|
||||
// user interface.
|
||||
if (xhr.upload) {
|
||||
xhr.upload.addEventListener("progress", (evt) => {
|
||||
if (evt.lengthComputable) {
|
||||
loader.uploadTotal = evt.total;
|
||||
loader.uploaded = evt.loaded;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// Prepares the data and sends the request.
|
||||
_sendRequest(file) {
|
||||
// Prepare the form data.
|
||||
const data = new FormData();
|
||||
data.append("upload", file);
|
||||
// Important note: This is the right place to implement security mechanisms
|
||||
// like authentication and CSRF protection. For instance, you can use
|
||||
// XMLHttpRequest.setRequestHeader() to set the request headers containing
|
||||
// the CSRF token generated earlier by your application.
|
||||
// Send the request.
|
||||
this.xhr.send(data);
|
||||
}
|
||||
// ...
|
||||
}
|
||||
|
||||
function SimpleUploadAdapterPlugin(editor) {
|
||||
editor.plugins.get("FileRepository").createUploadAdapter = (loader) => {
|
||||
// Configure the URL to the upload script in your back-end here!
|
||||
return new MyUploadAdapter(loader);
|
||||
};
|
||||
}
|
||||
|
||||
var allEditors = document.querySelector('.ck_editor_txt');
|
||||
|
||||
//Initialize the ckeditor
|
||||
ClassicEditor.create(document.querySelector("#teks"), {
|
||||
extraPlugins: [SimpleUploadAdapterPlugin],
|
||||
}).catch((error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
$("#ckeditorForm").submit(function(e) {
|
||||
var content = $('.ck_editor_txt').val();
|
||||
html = $(content).text();
|
||||
if ($.trim(html) == '') {
|
||||
alert("Teks Tidak Boleh Kosong!");
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
//Form add image validation
|
||||
var uploadField = document.getElementById("input_foto_add");
|
||||
uploadField.onchange = function() {
|
||||
if (this.files[0].size > 2000000) {
|
||||
alert("Batas maksimum 2MB!");
|
||||
this.value = "";
|
||||
} else {
|
||||
//Ubah Img Preview
|
||||
var reader = new FileReader();
|
||||
reader.onload = function() {
|
||||
var output = document.getElementById('img_preview_add');
|
||||
output.src = reader.result;
|
||||
}
|
||||
reader.readAsDataURL(event.target.files[0]);
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function(){
|
||||
$('.from-prevent-multiple-submits').on('submit', function(){
|
||||
$('.from-prevent-multiple-submits').attr('disabled','true');
|
||||
})
|
||||
})();
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,233 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Hasil Karya')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Hasil Karya</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
<!-- /.content-header -->
|
||||
|
||||
<!-- Alert Status -->
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('alert'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('alert') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Edit Data Hasil Karya</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<!-- form start -->
|
||||
<form class="from-prevent-multiple-submits"
|
||||
action="{{ route('hasil_karya.update', $hasilKarya) }}" method="POST"
|
||||
enctype="multipart/form-data">
|
||||
@method('patch')
|
||||
@csrf
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<label for="judul">Judul</label>
|
||||
<input type="text" class="form-control" id="judul" name="judul"
|
||||
maxlength="255" placeholder="Masukkan Judul"
|
||||
value="{{ $hasilKarya->judul }}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="form-group">
|
||||
<label for="nama_foto">Foto (Maksimal 2MB)</label>
|
||||
<div class="form-group">
|
||||
<img src="{{ url($hasilKarya->thumbnail) }}"
|
||||
alt="Image Missing" id="old_nama_foto"
|
||||
style="max-width: 200px;" class="mt-2" />
|
||||
</div>
|
||||
<input type="file" accept="image/*" class="form-control mt-0"
|
||||
name="thumbnail" id="input_foto_edit">
|
||||
</div>
|
||||
<input type="hidden" name="old_thumbnail"
|
||||
value="{{ $hasilKarya->thumbnail }}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="teks">Teks (Foto Maksimal 2MB)</label>
|
||||
<textarea id="teks" placeholder="Masukkan Deskripsi Video"
|
||||
name="teks">{{ $hasilKarya->teks }}</textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="release_date">Tanggal Rilis</label>
|
||||
<input type="date" class="form-control" name="release_date"
|
||||
value="{{ $hasilKarya->release_date }}" required>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
|
||||
<div class="card-footer">
|
||||
<button id="submit" type="submit"
|
||||
class="btn btn-primary from-prevent-multiple-submits">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
//Define an adapter to upload the files
|
||||
class MyUploadAdapter {
|
||||
constructor(loader) {
|
||||
// The file loader instance to use during the upload. It sounds scary but do not
|
||||
// worry — the loader will be passed into the adapter later on in this guide.
|
||||
this.loader = loader;
|
||||
|
||||
// URL where to send files.
|
||||
this.url = '{{ route('ckeditor.upload') }}';
|
||||
|
||||
//
|
||||
}
|
||||
// Starts the upload process.
|
||||
upload() {
|
||||
return this.loader.file.then(
|
||||
(file) =>
|
||||
new Promise((resolve, reject) => {
|
||||
this._initRequest();
|
||||
this._initListeners(resolve, reject, file);
|
||||
this._sendRequest(file);
|
||||
})
|
||||
);
|
||||
}
|
||||
// Aborts the upload process.
|
||||
abort() {
|
||||
if (this.xhr) {
|
||||
this.xhr.abort();
|
||||
}
|
||||
}
|
||||
// Initializes the XMLHttpRequest object using the URL passed to the constructor.
|
||||
_initRequest() {
|
||||
const xhr = (this.xhr = new XMLHttpRequest());
|
||||
// Note that your request may look different. It is up to you and your editor
|
||||
// integration to choose the right communication channel. This example uses
|
||||
// a POST request with JSON as a data structure but your configuration
|
||||
// could be different.
|
||||
// xhr.open('POST', this.url, true);
|
||||
xhr.open("POST", this.url, true);
|
||||
xhr.setRequestHeader("x-csrf-token", "{{ csrf_token() }}");
|
||||
xhr.responseType = "json";
|
||||
}
|
||||
// Initializes XMLHttpRequest listeners.
|
||||
_initListeners(resolve, reject, file) {
|
||||
const xhr = this.xhr;
|
||||
const loader = this.loader;
|
||||
const genericErrorText = `Couldn't upload file: ${file.name}.`;
|
||||
xhr.addEventListener("error", () => reject(genericErrorText));
|
||||
xhr.addEventListener("abort", () => reject());
|
||||
xhr.addEventListener("load", () => {
|
||||
const response = xhr.response;
|
||||
// This example assumes the XHR server's "response" object will come with
|
||||
// an "error" which has its own "message" that can be passed to reject()
|
||||
// in the upload promise.
|
||||
//
|
||||
// Your integration may handle upload errors in a different way so make sure
|
||||
// it is done properly. The reject() function must be called when the upload fails.
|
||||
if (!response || response.error) {
|
||||
return reject(response && response.error ? response.error.message : genericErrorText);
|
||||
}
|
||||
// If the upload is successful, resolve the upload promise with an object containing
|
||||
// at least the "default" URL, pointing to the image on the server.
|
||||
// This URL will be used to display the image in the content. Learn more in the
|
||||
// UploadAdapter#upload documentation.
|
||||
resolve({
|
||||
default: response.url,
|
||||
});
|
||||
});
|
||||
// Upload progress when it is supported. The file loader has the #uploadTotal and #uploaded
|
||||
// properties which are used e.g. to display the upload progress bar in the editor
|
||||
// user interface.
|
||||
if (xhr.upload) {
|
||||
xhr.upload.addEventListener("progress", (evt) => {
|
||||
if (evt.lengthComputable) {
|
||||
loader.uploadTotal = evt.total;
|
||||
loader.uploaded = evt.loaded;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// Prepares the data and sends the request.
|
||||
_sendRequest(file) {
|
||||
// Prepare the form data.
|
||||
const data = new FormData();
|
||||
data.append("upload", file);
|
||||
// Important note: This is the right place to implement security mechanisms
|
||||
// like authentication and CSRF protection. For instance, you can use
|
||||
// XMLHttpRequest.setRequestHeader() to set the request headers containing
|
||||
// the CSRF token generated earlier by your application.
|
||||
// Send the request.
|
||||
this.xhr.send(data);
|
||||
}
|
||||
// ...
|
||||
}
|
||||
|
||||
function SimpleUploadAdapterPlugin(editor) {
|
||||
editor.plugins.get("FileRepository").createUploadAdapter = (loader) => {
|
||||
// Configure the URL to the upload script in your back-end here!
|
||||
return new MyUploadAdapter(loader);
|
||||
};
|
||||
}
|
||||
|
||||
//Initialize the ckeditor
|
||||
ClassicEditor.create(document.querySelector("#teks"), {
|
||||
extraPlugins: [SimpleUploadAdapterPlugin],
|
||||
}).catch((error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
//Form edit image validation
|
||||
var uploadField = document.getElementById("input_foto_edit");
|
||||
uploadField.onchange = function() {
|
||||
if (this.files[0].size > 2000000) {
|
||||
alert("Batas maksimum 2MB!");
|
||||
this.value = "";
|
||||
} else {
|
||||
//Ubah Img Preview
|
||||
var reader = new FileReader();
|
||||
reader.onload = function() {
|
||||
var output = document.getElementById('old_nama_foto');
|
||||
output.src = reader.result;
|
||||
}
|
||||
reader.readAsDataURL(event.target.files[0]);
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function() {
|
||||
$('.from-prevent-multiple-submits').on('submit', function() {
|
||||
$('.from-prevent-multiple-submits').attr('disabled', 'true');
|
||||
})
|
||||
})();
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,158 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Hasil Karya')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Hasil Karya</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
<!-- /.content-header -->
|
||||
|
||||
<!-- Alert Status -->
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('alert'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('alert') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Data Hasil Karya</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-12 text-left">
|
||||
<a type="button" href="{{ url('/admin/hasil_karya/create') }}"
|
||||
class="btn btn-success mb-3"><i class="fa fa-plus-circle"></i>
|
||||
Tambah Data Hasil Karya
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table id="tabel_hasil_karya" class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nomor</th>
|
||||
<th>Judul</th>
|
||||
<th>Thumbnail</th>
|
||||
<th>Teks</th>
|
||||
<th>Jadwal Rilis</th>
|
||||
<th>Status</th>
|
||||
<th>Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($hasilKaryas as $hasilKarya)
|
||||
<tr>
|
||||
<td>{{ $loop->iteration }}</td>
|
||||
<td>{{ $hasilKarya->judul }}</td>
|
||||
<td>
|
||||
<img src="{{ url($hasilKarya->thumbnail) }}" alt="Image Missing"
|
||||
style="width: 100px;">
|
||||
</td>
|
||||
<td>
|
||||
@if (strlen(strip_tags($hasilKarya->teks)) > 100)
|
||||
{{ str_replace(' ', '', substr(strip_tags($hasilKarya->teks), 0, 100) . '...') }}
|
||||
@else
|
||||
{{ str_replace(' ', '', substr(strip_tags($hasilKarya->teks), 0, 100)) }}
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ $hasilKarya->release_date }}</td>
|
||||
<td>
|
||||
@if ($hasilKarya->deleted_at != '')
|
||||
Terhapus
|
||||
@elseif ($hasilKarya->release_date > date('Y-m-d'))
|
||||
Belum Rilis
|
||||
@else
|
||||
Rilis
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if ($hasilKarya->deleted_at != '')
|
||||
<form
|
||||
action="{{ url('/admin/hasil_karya/' . $hasilKarya->id . '/restore') }}"
|
||||
method="post">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-primary"
|
||||
onclick="return confirm('Apakah anda yakin ingin mengembalikan data?')"><i
|
||||
class="fas fa-trash-restore"></i> Restore
|
||||
</button>
|
||||
</form>
|
||||
<form
|
||||
action="{{ url('/admin/hasil_karya/' . $hasilKarya->id . '/delete_permanen') }}"
|
||||
method="post">
|
||||
@csrf
|
||||
<input type="hidden" name="thumbnail"
|
||||
value="{{ $hasilKarya->thumbnail }}">
|
||||
<button type="submit" class="btn btn-danger"
|
||||
onclick="return confirm('Apakah anda yakin ingin menghapus permanen data?')"><i
|
||||
class="fa fa-trash"></i> Delete Permanent
|
||||
</button>
|
||||
</form>
|
||||
@else
|
||||
<a href="{{ route('hasil_karya.edit', $hasilKarya) }}"
|
||||
class="btn btn-warning open-formModalEdit">
|
||||
<i class="fa fa-edit"></i> Edit
|
||||
</a>
|
||||
<form
|
||||
action="{{ route('hasil_karya.destroy', $hasilKarya) }}"
|
||||
method="post">
|
||||
@method('delete')
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-danger"
|
||||
onclick="return confirm('Apakah anda yakin ingin menghapus data?')"><i
|
||||
class="fa fa-trash"></i> Delete
|
||||
</button>
|
||||
</form>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<!--Data Table -->
|
||||
<script>
|
||||
$(function() {
|
||||
$("#tabel_hasil_karya").DataTable({
|
||||
"paging": true,
|
||||
"lengthChange": false,
|
||||
"searching": true,
|
||||
"ordering": true,
|
||||
"info": true,
|
||||
"autoWidth": false,
|
||||
"responsive": false,
|
||||
"buttons": ["copy", "csv", "excel", "pdf", "print", "colvis"]
|
||||
}).buttons().container().appendTo('#tabel_hasil_karya_wrapper .col-md-6:eq(0)');
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,282 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Himpunan Mahasiswa')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Himpunan Mahasiswa</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
<!-- /.content-header -->
|
||||
|
||||
<!-- Alert Status -->
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('alert'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('alert') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Tambah Data Himpunan Mahasiswa</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<!-- form start -->
|
||||
<form class="from-prevent-multiple-submits"
|
||||
action="{{ route('himpunan_mahasiswa.store') }}" method="POST"
|
||||
id="ckeditorForm" enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<label for="nama">Nama Himpunan</label>
|
||||
<input type="text" class="form-control" id="nama" name="nama"
|
||||
maxlength="255" placeholder="Masukkan Nama Himpunan" value=""
|
||||
required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="nama_foto">Thumbnail (Maksimal 2MB)</label>
|
||||
<div class="form-group">
|
||||
<img id="img_preview_add" style="max-width: 200px;"
|
||||
class="mt-2" />
|
||||
</div>
|
||||
<input type="file" accept="image/*" class="form-control mt-0"
|
||||
name="thumbnail" id="input_foto_add" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="teks">Teks (Foto Maksimal 2MB)</label>
|
||||
<textarea id="teks" placeholder="Masukkan Teks" name="teks"
|
||||
class="ck_editor_txt" id="ck_editor_txt"></textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="facebook">Nama Pengguna Facebook</label>
|
||||
<input type="text" class="form-control" id="facebook" name="facebook"
|
||||
placeholder="Masukkan Nama Pengguna Facebook" value="">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="url_facebook">Link Facebook</label>
|
||||
<input type="text" class="form-control" id="url_facebook"
|
||||
name="url_facebook" placeholder="Masukkan Link Facebook" value="">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="instagram">Nama Pengguna Instagram</label>
|
||||
<input type="text" class="form-control" id="instagram"
|
||||
name="instagram" placeholder="Masukkan Nama Pengguna Instagram"
|
||||
value="">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="url_instagram">Link Instagram</label>
|
||||
<input type="text" class="form-control" id="url_instagram"
|
||||
name="url_instagram" placeholder="Masukkan Link Instagram" value="">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="youtube">Nama Pengguna Youtube</label>
|
||||
<input type="text" class="form-control" id="youtube" name="youtube"
|
||||
placeholder="Masukkan Nama Pengguna Youtube" value="">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="url_youtube">Link Youtube</label>
|
||||
<input type="text" class="form-control" id="url_youtube"
|
||||
name="url_youtube" placeholder="Masukkan Link Youtube" value="">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="twitter">Nama Pengguna Twitter</label>
|
||||
<input type="text" class="form-control" id="twitter" name="twitter"
|
||||
placeholder="Masukkan Nama Pengguna Twitter" value="">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="url_twitter">Link Twitter</label>
|
||||
<input type="text" class="form-control" id="url_twitter"
|
||||
name="url_twitter" placeholder="Masukkan Link Twitter" value="">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="release_date">Tanggal Rilis</label>
|
||||
<input type="date" class="form-control" name="release_date" value=""
|
||||
required>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
|
||||
<div class="card-footer">
|
||||
<button id="submit" type="submit"
|
||||
class="btn btn-primary from-prevent-multiple-submits">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
//Define an adapter to upload the files
|
||||
class MyUploadAdapter {
|
||||
constructor(loader) {
|
||||
// The file loader instance to use during the upload. It sounds scary but do not
|
||||
// worry — the loader will be passed into the adapter later on in this guide.
|
||||
this.loader = loader;
|
||||
|
||||
// URL where to send files.
|
||||
this.url = '{{ route('ckeditor.upload') }}';
|
||||
|
||||
//
|
||||
}
|
||||
// Starts the upload process.
|
||||
upload() {
|
||||
return this.loader.file.then(
|
||||
(file) =>
|
||||
new Promise((resolve, reject) => {
|
||||
this._initRequest();
|
||||
this._initListeners(resolve, reject, file);
|
||||
this._sendRequest(file);
|
||||
})
|
||||
);
|
||||
}
|
||||
// Aborts the upload process.
|
||||
abort() {
|
||||
if (this.xhr) {
|
||||
this.xhr.abort();
|
||||
}
|
||||
}
|
||||
// Initializes the XMLHttpRequest object using the URL passed to the constructor.
|
||||
_initRequest() {
|
||||
const xhr = (this.xhr = new XMLHttpRequest());
|
||||
// Note that your request may look different. It is up to you and your editor
|
||||
// integration to choose the right communication channel. This example uses
|
||||
// a POST request with JSON as a data structure but your configuration
|
||||
// could be different.
|
||||
// xhr.open('POST', this.url, true);
|
||||
xhr.open("POST", this.url, true);
|
||||
xhr.setRequestHeader("x-csrf-token", "{{ csrf_token() }}");
|
||||
xhr.responseType = "json";
|
||||
}
|
||||
// Initializes XMLHttpRequest listeners.
|
||||
_initListeners(resolve, reject, file) {
|
||||
const xhr = this.xhr;
|
||||
const loader = this.loader;
|
||||
const genericErrorText = `Couldn't upload file: ${file.name}.`;
|
||||
xhr.addEventListener("error", () => reject(genericErrorText));
|
||||
xhr.addEventListener("abort", () => reject());
|
||||
xhr.addEventListener("load", () => {
|
||||
const response = xhr.response;
|
||||
// This example assumes the XHR server's "response" object will come with
|
||||
// an "error" which has its own "message" that can be passed to reject()
|
||||
// in the upload promise.
|
||||
//
|
||||
// Your integration may handle upload errors in a different way so make sure
|
||||
// it is done properly. The reject() function must be called when the upload fails.
|
||||
if (!response || response.error) {
|
||||
return reject(response && response.error ? response.error.message : genericErrorText);
|
||||
}
|
||||
// If the upload is successful, resolve the upload promise with an object containing
|
||||
// at least the "default" URL, pointing to the image on the server.
|
||||
// This URL will be used to display the image in the content. Learn more in the
|
||||
// UploadAdapter#upload documentation.
|
||||
resolve({
|
||||
default: response.url,
|
||||
});
|
||||
});
|
||||
// Upload progress when it is supported. The file loader has the #uploadTotal and #uploaded
|
||||
// properties which are used e.g. to display the upload progress bar in the editor
|
||||
// user interface.
|
||||
if (xhr.upload) {
|
||||
xhr.upload.addEventListener("progress", (evt) => {
|
||||
if (evt.lengthComputable) {
|
||||
loader.uploadTotal = evt.total;
|
||||
loader.uploaded = evt.loaded;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// Prepares the data and sends the request.
|
||||
_sendRequest(file) {
|
||||
// Prepare the form data.
|
||||
const data = new FormData();
|
||||
data.append("upload", file);
|
||||
// Important note: This is the right place to implement security mechanisms
|
||||
// like authentication and CSRF protection. For instance, you can use
|
||||
// XMLHttpRequest.setRequestHeader() to set the request headers containing
|
||||
// the CSRF token generated earlier by your application.
|
||||
// Send the request.
|
||||
this.xhr.send(data);
|
||||
}
|
||||
// ...
|
||||
}
|
||||
|
||||
function SimpleUploadAdapterPlugin(editor) {
|
||||
editor.plugins.get("FileRepository").createUploadAdapter = (loader) => {
|
||||
// Configure the URL to the upload script in your back-end here!
|
||||
return new MyUploadAdapter(loader);
|
||||
};
|
||||
}
|
||||
|
||||
var allEditors = document.querySelector('.ck_editor_txt');
|
||||
|
||||
//Initialize the ckeditor
|
||||
ClassicEditor.create(document.querySelector("#teks"), {
|
||||
extraPlugins: [SimpleUploadAdapterPlugin],
|
||||
}).catch((error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
$("#ckeditorForm").submit(function(e) {
|
||||
var content = $('.ck_editor_txt').val();
|
||||
html = $(content).text();
|
||||
if ($.trim(html) == '') {
|
||||
alert("Teks Tidak Boleh Kosong!");
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
//Form add image validation
|
||||
var uploadField = document.getElementById("input_foto_add");
|
||||
uploadField.onchange = function() {
|
||||
if (this.files[0].size > 2000000) {
|
||||
alert("Batas maksimum 2MB!");
|
||||
this.value = "";
|
||||
} else {
|
||||
//Ubah Img Preview
|
||||
var reader = new FileReader();
|
||||
reader.onload = function() {
|
||||
var output = document.getElementById('img_preview_add');
|
||||
output.src = reader.result;
|
||||
}
|
||||
reader.readAsDataURL(event.target.files[0]);
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function() {
|
||||
$('.from-prevent-multiple-submits').on('submit', function() {
|
||||
$('.from-prevent-multiple-submits').attr('disabled', 'true');
|
||||
})
|
||||
})();
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,283 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Himpunan Mahasiswa')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Himpunan Mahasiswa</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
<!-- /.content-header -->
|
||||
|
||||
<!-- Alert Status -->
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('alert'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('alert') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Edit Data Himpunan Mahasiswa</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<!-- form start -->
|
||||
<form class="from-prevent-multiple-submits"
|
||||
action="{{ route('himpunan_mahasiswa.update', $himpunanMahasiswa) }}"
|
||||
method="POST" enctype="multipart/form-data">
|
||||
@method('patch')
|
||||
@csrf
|
||||
<div class="card-body">
|
||||
<input type="hidden" value="{{ $himpunanMahasiswa->id }}" name="id">
|
||||
<div class="form-group">
|
||||
<label for="nama">Nama Himpunan</label>
|
||||
<input type="text" class="form-control" id="nama" name="nama"
|
||||
placeholder="Masukkan Nama Himpunan" maxlength="255"
|
||||
value="{{ $himpunanMahasiswa->nama }}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="nama_foto">Thumbnail (Maksimal 2MB)</label>
|
||||
<div class="form-group">
|
||||
<img src="{{ url($himpunanMahasiswa->thumbnail) }}"
|
||||
alt="Image Missing" id="old_nama_foto" style="max-width: 200px;"
|
||||
class="mt-2" />
|
||||
</div>
|
||||
<input type="file" accept="image/*" class="form-control mt-0"
|
||||
name="thumbnail" id="input_foto_edit">
|
||||
<input type="hidden" name="old_thumbnail"
|
||||
value="{{ $himpunanMahasiswa->thumbnail }}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="teks">Teks (Foto Maksimal 2MB)</label>
|
||||
<textarea id="teks" placeholder="Masukkan Deskripsi Video"
|
||||
name="teks">{{ $himpunanMahasiswa->teks }}</textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="facebook">Nama Pengguna Facebook</label>
|
||||
<input type="text" class="form-control" id="facebook" name="facebook"
|
||||
placeholder="Masukkan Nama Pengguna Facebook"
|
||||
value="{{ $himpunanMahasiswa->facebook }}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="url_facebook">Link Facebook</label>
|
||||
<input type="text" class="form-control" id="url_facebook"
|
||||
name="url_facebook" placeholder="Masukkan Link Facebook"
|
||||
value="{{ $himpunanMahasiswa->url_facebook }}">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="instagram">Nama Pengguna Instagram</label>
|
||||
<input type="text" class="form-control" id="instagram"
|
||||
name="instagram" placeholder="Masukkan Nama Pengguna Instagram"
|
||||
value="{{ $himpunanMahasiswa->instagram }}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="url_instagram">Link Instagram</label>
|
||||
<input type="text" class="form-control" id="url_instagram"
|
||||
name="url_instagram" placeholder="Masukkan Link Instagram"
|
||||
value="{{ $himpunanMahasiswa->url_instagram }}">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="youtube">Nama Pengguna Youtube</label>
|
||||
<input type="text" class="form-control" id="youtube" name="youtube"
|
||||
placeholder="Masukkan Nama Pengguna Youtube"
|
||||
value="{{ $himpunanMahasiswa->youtube }}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="url_youtube">Link Youtube</label>
|
||||
<input type="text" class="form-control" id="url_youtube"
|
||||
name="url_youtube" placeholder="Masukkan Link Youtube"
|
||||
value="{{ $himpunanMahasiswa->url_youtube }}">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="twitter">Nama Pengguna Twitter</label>
|
||||
<input type="text" class="form-control" id="twitter" name="twitter"
|
||||
placeholder="Masukkan Nama Pengguna Twitter"
|
||||
value="{{ $himpunanMahasiswa->twitter }}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="url_twitter">Link Twitter</label>
|
||||
<input type="text" class="form-control" id="url_twitter"
|
||||
name="url_twitter" placeholder="Masukkan Link Twitter"
|
||||
value="{{ $himpunanMahasiswa->url_twitter }}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="release_date">Tanggal Rilis</label>
|
||||
<input type="date" class="form-control" name="release_date"
|
||||
value="{{ $himpunanMahasiswa->release_date }}" required>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
|
||||
<div class="card-footer">
|
||||
<button id="submit" type="submit"
|
||||
class="btn btn-primary from-prevent-multiple-submits">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
//Define an adapter to upload the files
|
||||
class MyUploadAdapter {
|
||||
constructor(loader) {
|
||||
// The file loader instance to use during the upload. It sounds scary but do not
|
||||
// worry — the loader will be passed into the adapter later on in this guide.
|
||||
this.loader = loader;
|
||||
|
||||
// URL where to send files.
|
||||
this.url = '{{ route('ckeditor.upload') }}';
|
||||
|
||||
//
|
||||
}
|
||||
// Starts the upload process.
|
||||
upload() {
|
||||
return this.loader.file.then(
|
||||
(file) =>
|
||||
new Promise((resolve, reject) => {
|
||||
this._initRequest();
|
||||
this._initListeners(resolve, reject, file);
|
||||
this._sendRequest(file);
|
||||
})
|
||||
);
|
||||
}
|
||||
// Aborts the upload process.
|
||||
abort() {
|
||||
if (this.xhr) {
|
||||
this.xhr.abort();
|
||||
}
|
||||
}
|
||||
// Initializes the XMLHttpRequest object using the URL passed to the constructor.
|
||||
_initRequest() {
|
||||
const xhr = (this.xhr = new XMLHttpRequest());
|
||||
// Note that your request may look different. It is up to you and your editor
|
||||
// integration to choose the right communication channel. This example uses
|
||||
// a POST request with JSON as a data structure but your configuration
|
||||
// could be different.
|
||||
// xhr.open('POST', this.url, true);
|
||||
xhr.open("POST", this.url, true);
|
||||
xhr.setRequestHeader("x-csrf-token", "{{ csrf_token() }}");
|
||||
xhr.responseType = "json";
|
||||
}
|
||||
// Initializes XMLHttpRequest listeners.
|
||||
_initListeners(resolve, reject, file) {
|
||||
const xhr = this.xhr;
|
||||
const loader = this.loader;
|
||||
const genericErrorText = `Couldn't upload file: ${file.name}.`;
|
||||
xhr.addEventListener("error", () => reject(genericErrorText));
|
||||
xhr.addEventListener("abort", () => reject());
|
||||
xhr.addEventListener("load", () => {
|
||||
const response = xhr.response;
|
||||
// This example assumes the XHR server's "response" object will come with
|
||||
// an "error" which has its own "message" that can be passed to reject()
|
||||
// in the upload promise.
|
||||
//
|
||||
// Your integration may handle upload errors in a different way so make sure
|
||||
// it is done properly. The reject() function must be called when the upload fails.
|
||||
if (!response || response.error) {
|
||||
return reject(response && response.error ? response.error.message : genericErrorText);
|
||||
}
|
||||
// If the upload is successful, resolve the upload promise with an object containing
|
||||
// at least the "default" URL, pointing to the image on the server.
|
||||
// This URL will be used to display the image in the content. Learn more in the
|
||||
// UploadAdapter#upload documentation.
|
||||
resolve({
|
||||
default: response.url,
|
||||
});
|
||||
});
|
||||
// Upload progress when it is supported. The file loader has the #uploadTotal and #uploaded
|
||||
// properties which are used e.g. to display the upload progress bar in the editor
|
||||
// user interface.
|
||||
if (xhr.upload) {
|
||||
xhr.upload.addEventListener("progress", (evt) => {
|
||||
if (evt.lengthComputable) {
|
||||
loader.uploadTotal = evt.total;
|
||||
loader.uploaded = evt.loaded;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// Prepares the data and sends the request.
|
||||
_sendRequest(file) {
|
||||
// Prepare the form data.
|
||||
const data = new FormData();
|
||||
data.append("upload", file);
|
||||
// Important note: This is the right place to implement security mechanisms
|
||||
// like authentication and CSRF protection. For instance, you can use
|
||||
// XMLHttpRequest.setRequestHeader() to set the request headers containing
|
||||
// the CSRF token generated earlier by your application.
|
||||
// Send the request.
|
||||
this.xhr.send(data);
|
||||
}
|
||||
// ...
|
||||
}
|
||||
|
||||
function SimpleUploadAdapterPlugin(editor) {
|
||||
editor.plugins.get("FileRepository").createUploadAdapter = (loader) => {
|
||||
// Configure the URL to the upload script in your back-end here!
|
||||
return new MyUploadAdapter(loader);
|
||||
};
|
||||
}
|
||||
|
||||
//Initialize the ckeditor
|
||||
ClassicEditor.create(document.querySelector("#teks"), {
|
||||
extraPlugins: [SimpleUploadAdapterPlugin],
|
||||
}).catch((error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
//Form edit image validation
|
||||
var uploadField = document.getElementById("input_foto_edit");
|
||||
uploadField.onchange = function() {
|
||||
if (this.files[0].size > 2000000) {
|
||||
alert("Batas maksimum 2MB!");
|
||||
this.value = "";
|
||||
} else {
|
||||
//Ubah Img Preview
|
||||
var reader = new FileReader();
|
||||
reader.onload = function() {
|
||||
var output = document.getElementById('old_nama_foto');
|
||||
output.src = reader.result;
|
||||
}
|
||||
reader.readAsDataURL(event.target.files[0]);
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function() {
|
||||
$('.from-prevent-multiple-submits').on('submit', function() {
|
||||
$('.from-prevent-multiple-submits').attr('disabled', 'true');
|
||||
})
|
||||
})();
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,174 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Himpunan Mahasiswa')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Himpunan Mahasiswa</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
<!-- /.content-header -->
|
||||
|
||||
<!-- Alert Status -->
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('alert'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('alert') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Data Himpunan Mahasiswa</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-12 text-left">
|
||||
<a type="button" href="{{ url('/admin/himpunan_mahasiswa/create') }}"
|
||||
class="btn btn-success mb-3"><i class="fa fa-plus-circle"></i>
|
||||
Tambah Data Himpunan Mahasiswa
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table id="tabel_himpunan_mahasiswa" class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nomor</th>
|
||||
<th>Judul</th>
|
||||
<th>Thumbnail</th>
|
||||
<th>Teks</th>
|
||||
<th>Nama Pengguna Facebook</th>
|
||||
<th>Link Facebook</th>
|
||||
<th>Nama Pengguna Instagram</th>
|
||||
<th>Link Instagram</th>
|
||||
<th>Nama Pengguna Youtube</th>
|
||||
<th>Link Youtube</th>
|
||||
<th>Nama Pengguna Twitter</th>
|
||||
<th>Link Twitter</th>
|
||||
<th>Jadwal Rilis</th>
|
||||
<th>Status</th>
|
||||
<th>Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($himpunanMahasiswas as $himpunanMahasiswa)
|
||||
<tr>
|
||||
<td>{{ $loop->iteration }}</td>
|
||||
<td>{{ $himpunanMahasiswa->nama }}</td>
|
||||
<td>
|
||||
<img src="{{ url($himpunanMahasiswa->thumbnail) }}"
|
||||
alt="Image Missing" style="width: 100px;">
|
||||
</td>
|
||||
<td>
|
||||
@if (strlen(strip_tags($himpunanMahasiswa->teks)) > 100)
|
||||
{{ str_replace(' ', '', substr(strip_tags($himpunanMahasiswa->teks), 0, 100) . '...') }}
|
||||
@else
|
||||
{{ str_replace(' ', '', substr(strip_tags($himpunanMahasiswa->teks), 0, 100)) }}
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ $himpunanMahasiswa->facebook }}</td>
|
||||
<td>{{ $himpunanMahasiswa->url_facebook }}</td>
|
||||
<td>{{ $himpunanMahasiswa->instagram }}</td>
|
||||
<td>{{ $himpunanMahasiswa->url_instagram }}</td>
|
||||
<td>{{ $himpunanMahasiswa->youtube }}</td>
|
||||
<td>{{ $himpunanMahasiswa->url_youtube }}</td>
|
||||
<td>{{ $himpunanMahasiswa->twitter }}</td>
|
||||
<td>{{ $himpunanMahasiswa->url_twitter }}</td>
|
||||
<td>{{ $himpunanMahasiswa->release_date }}</td>
|
||||
<td>
|
||||
@if ($himpunanMahasiswa->deleted_at != '')
|
||||
Terhapus
|
||||
@elseif ($himpunanMahasiswa->release_date > date('Y-m-d'))
|
||||
Belum Rilis
|
||||
@else
|
||||
Rilis
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if ($himpunanMahasiswa->deleted_at != '')
|
||||
<form
|
||||
action="{{ url('/admin/himpunan_mahasiswa/' . $himpunanMahasiswa->id . '/restore') }}"
|
||||
method="post">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-primary"
|
||||
onclick="return confirm('Apakah anda yakin ingin mengembalikan data?')"><i
|
||||
class="fas fa-trash-restore"></i> Restore
|
||||
</button>
|
||||
</form>
|
||||
<form
|
||||
action="{{ url('/admin/himpunan_mahasiswa/' . $himpunanMahasiswa->id . '/delete_permanen') }}"
|
||||
method="post">
|
||||
@csrf
|
||||
<input type="hidden" name="thumbnail"
|
||||
value="{{ $himpunanMahasiswa->thumbnail }}">
|
||||
<button type="submit" class="btn btn-danger"
|
||||
onclick="return confirm('Apakah anda yakin ingin menghapus permanen data?')"><i
|
||||
class="fa fa-trash"></i> Delete Permanent
|
||||
</button>
|
||||
</form>
|
||||
@else
|
||||
<a href="{{ route('himpunan_mahasiswa.edit', $himpunanMahasiswa) }}"
|
||||
class="btn btn-warning open-formModalEdit">
|
||||
<i class="fa fa-edit"></i> Edit
|
||||
</a>
|
||||
<form
|
||||
action="{{ route('himpunan_mahasiswa.destroy', $himpunanMahasiswa) }}"
|
||||
method="post">
|
||||
@method('delete')
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-danger"
|
||||
onclick="return confirm('Apakah anda yakin ingin menghapus data?')"><i
|
||||
class="fa fa-trash"></i> Delete
|
||||
</button>
|
||||
</form>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<!--Data Table -->
|
||||
<script>
|
||||
$(function() {
|
||||
$("#tabel_himpunan_mahasiswa").DataTable({
|
||||
"paging": true,
|
||||
"lengthChange": false,
|
||||
"searching": true,
|
||||
"ordering": true,
|
||||
"info": true,
|
||||
"autoWidth": false,
|
||||
"responsive": false,
|
||||
"buttons": ["copy", "csv", "excel", "pdf", "print", "colvis"]
|
||||
}).buttons().container().appendTo('#tabel_himpunan_mahasiswa_wrapper .col-md-6:eq(0)');
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,221 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Informasi Beasiswa')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Informasi Beasiswa</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Tambah Data Informasi Beasiswa</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<!-- form start -->
|
||||
<form class="from-prevent-multiple-submits" action="{{ route('informasi_beasiswa.store') }}" method="POST" id="ckeditorForm"
|
||||
enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<label for="judul">Judul</label>
|
||||
<input type="text" class="form-control" id="judul" name="judul"
|
||||
placeholder="Masukkan Judul" value="" required maxlength="255">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="nama_foto">Thumbnail (Maksimal 2MB)</label>
|
||||
<div class="form-group">
|
||||
<img id="img_preview_add" style="max-width: 200px;"
|
||||
class="mt-2" />
|
||||
</div>
|
||||
<input type="file" accept="image/*" class="form-control mt-0"
|
||||
name="thumbnail" id="input_foto_add" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="teks">Teks (Foto Maksimal 2MB)</label>
|
||||
<textarea id="teks" placeholder="Masukkan Teks Informasi Beasiswa"
|
||||
name="teks" class="ck_editor_txt" id="ck_editor_txt"></textarea>
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="release_date">Tanggal Rilis</label>
|
||||
<input type="date" class="form-control mt-0" name="release_date" required>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
|
||||
<div class="card-footer">
|
||||
<button id="submit" type="submit" class="btn btn-primary from-prevent-multiple-submits">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
//Define an adapter to upload the files
|
||||
class MyUploadAdapter {
|
||||
constructor(loader) {
|
||||
// The file loader instance to use during the upload. It sounds scary but do not
|
||||
// worry — the loader will be passed into the adapter later on in this guide.
|
||||
this.loader = loader;
|
||||
|
||||
// URL where to send files.
|
||||
this.url = '{{ route('ckeditor.upload') }}';
|
||||
|
||||
//
|
||||
}
|
||||
// Starts the upload process.
|
||||
upload() {
|
||||
return this.loader.file.then(
|
||||
(file) =>
|
||||
new Promise((resolve, reject) => {
|
||||
this._initRequest();
|
||||
this._initListeners(resolve, reject, file);
|
||||
this._sendRequest(file);
|
||||
})
|
||||
);
|
||||
}
|
||||
// Aborts the upload process.
|
||||
abort() {
|
||||
if (this.xhr) {
|
||||
this.xhr.abort();
|
||||
}
|
||||
}
|
||||
// Initializes the XMLHttpRequest object using the URL passed to the constructor.
|
||||
_initRequest() {
|
||||
const xhr = (this.xhr = new XMLHttpRequest());
|
||||
// Note that your request may look different. It is up to you and your editor
|
||||
// integration to choose the right communication channel. This example uses
|
||||
// a POST request with JSON as a data structure but your configuration
|
||||
// could be different.
|
||||
// xhr.open('POST', this.url, true);
|
||||
xhr.open("POST", this.url, true);
|
||||
xhr.setRequestHeader("x-csrf-token", "{{ csrf_token() }}");
|
||||
xhr.responseType = "json";
|
||||
}
|
||||
// Initializes XMLHttpRequest listeners.
|
||||
_initListeners(resolve, reject, file) {
|
||||
const xhr = this.xhr;
|
||||
const loader = this.loader;
|
||||
const genericErrorText = `Couldn't upload file: ${file.name}.`;
|
||||
xhr.addEventListener("error", () => reject(genericErrorText));
|
||||
xhr.addEventListener("abort", () => reject());
|
||||
xhr.addEventListener("load", () => {
|
||||
const response = xhr.response;
|
||||
// This example assumes the XHR server's "response" object will come with
|
||||
// an "error" which has its own "message" that can be passed to reject()
|
||||
// in the upload promise.
|
||||
//
|
||||
// Your integration may handle upload errors in a different way so make sure
|
||||
// it is done properly. The reject() function must be called when the upload fails.
|
||||
if (!response || response.error) {
|
||||
return reject(response && response.error ? response.error.message : genericErrorText);
|
||||
}
|
||||
// If the upload is successful, resolve the upload promise with an object containing
|
||||
// at least the "default" URL, pointing to the image on the server.
|
||||
// This URL will be used to display the image in the content. Learn more in the
|
||||
// UploadAdapter#upload documentation.
|
||||
resolve({
|
||||
default: response.url,
|
||||
});
|
||||
});
|
||||
// Upload progress when it is supported. The file loader has the #uploadTotal and #uploaded
|
||||
// properties which are used e.g. to display the upload progress bar in the editor
|
||||
// user interface.
|
||||
if (xhr.upload) {
|
||||
xhr.upload.addEventListener("progress", (evt) => {
|
||||
if (evt.lengthComputable) {
|
||||
loader.uploadTotal = evt.total;
|
||||
loader.uploaded = evt.loaded;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// Prepares the data and sends the request.
|
||||
_sendRequest(file) {
|
||||
// Prepare the form data.
|
||||
const data = new FormData();
|
||||
data.append("upload", file);
|
||||
// Important note: This is the right place to implement security mechanisms
|
||||
// like authentication and CSRF protection. For instance, you can use
|
||||
// XMLHttpRequest.setRequestHeader() to set the request headers containing
|
||||
// the CSRF token generated earlier by your application.
|
||||
// Send the request.
|
||||
this.xhr.send(data);
|
||||
}
|
||||
// ...
|
||||
}
|
||||
|
||||
function SimpleUploadAdapterPlugin(editor) {
|
||||
editor.plugins.get("FileRepository").createUploadAdapter = (loader) => {
|
||||
// Configure the URL to the upload script in your back-end here!
|
||||
return new MyUploadAdapter(loader);
|
||||
};
|
||||
}
|
||||
|
||||
var allEditors = document.querySelector('.ck_editor_txt');
|
||||
|
||||
//Initialize the ckeditor
|
||||
ClassicEditor.create(document.querySelector("#teks"), {
|
||||
extraPlugins: [SimpleUploadAdapterPlugin],
|
||||
}).catch((error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
$("#ckeditorForm").submit(function(e) {
|
||||
var content = $('.ck_editor_txt').val();
|
||||
html = $(content).text();
|
||||
if ($.trim(html) == '') {
|
||||
alert("Teks Tidak Boleh Kosong!");
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
//Form add image validation
|
||||
var uploadField = document.getElementById("input_foto_add");
|
||||
uploadField.onchange = function() {
|
||||
if (this.files[0].size > 2000000) {
|
||||
alert("Batas maksimum 2MB!");
|
||||
this.value = "";
|
||||
} else {
|
||||
//Ubah Img Preview
|
||||
var reader = new FileReader();
|
||||
reader.onload = function() {
|
||||
var output = document.getElementById('img_preview_add');
|
||||
output.src = reader.result;
|
||||
}
|
||||
reader.readAsDataURL(event.target.files[0]);
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function(){
|
||||
$('.from-prevent-multiple-submits').on('submit', function(){
|
||||
$('.from-prevent-multiple-submits').attr('disabled','true');
|
||||
})
|
||||
})();
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,226 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Informasi Beasiswa')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Informasi Beasiswa</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
<!-- /.content-header -->
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Edit Data Informasi Beasiswa</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<!-- form start -->
|
||||
<form class="from-prevent-multiple-submits"
|
||||
action="{{ route('informasi_beasiswa.update', $informasiBeasiswa) }}"
|
||||
method="POST" enctype="multipart/form-data">
|
||||
@method('patch')
|
||||
@csrf
|
||||
<div class="card-body">
|
||||
<input type="hidden" value="{{ $informasiBeasiswa->id }}" name="id">
|
||||
<div class="form-group">
|
||||
<label for="judul">Judul</label>
|
||||
<input type="text" class="form-control" id="judul" name="judul"
|
||||
maxlength="255" placeholder="Masukkan Judul"
|
||||
value="{{ $informasiBeasiswa->judul }}" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="nama_foto">Thumbnail (Maksimal 2MB)</label>
|
||||
<div class="form-group">
|
||||
<img src="{{ url($informasiBeasiswa->thumbnail) }}"
|
||||
alt="Image Missing" id="old_nama_foto" style="max-width: 200px;"
|
||||
class="mt-2" />
|
||||
</div>
|
||||
<input type="file" accept="image/*" class="form-control mt-0"
|
||||
name="thumbnail" id="input_foto_edit">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="teks">Teks (Foto Maksimal 2MB)</label>
|
||||
<textarea id="teks" placeholder="Masukkan Deskripsi Video"
|
||||
name="teks">{{ $informasiBeasiswa->teks }}</textarea>
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="release_date">Tanggal Rilis</label>
|
||||
<input type="date" class="form-control mt-0" name="release_date"
|
||||
value="{{ $informasiBeasiswa->release_date }}" required>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
|
||||
<div class="card-footer">
|
||||
<button id="submit" type="submit"
|
||||
class="btn btn-primary from-prevent-multiple-submits">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
//Define an adapter to upload the files
|
||||
class MyUploadAdapter {
|
||||
constructor(loader) {
|
||||
// The file loader instance to use during the upload. It sounds scary but do not
|
||||
// worry — the loader will be passed into the adapter later on in this guide.
|
||||
this.loader = loader;
|
||||
|
||||
// URL where to send files.
|
||||
this.url = '{{ route('ckeditor.upload') }}';
|
||||
|
||||
//
|
||||
}
|
||||
// Starts the upload process.
|
||||
upload() {
|
||||
return this.loader.file.then(
|
||||
(file) =>
|
||||
new Promise((resolve, reject) => {
|
||||
this._initRequest();
|
||||
this._initListeners(resolve, reject, file);
|
||||
this._sendRequest(file);
|
||||
})
|
||||
);
|
||||
}
|
||||
// Aborts the upload process.
|
||||
abort() {
|
||||
if (this.xhr) {
|
||||
this.xhr.abort();
|
||||
}
|
||||
}
|
||||
// Initializes the XMLHttpRequest object using the URL passed to the constructor.
|
||||
_initRequest() {
|
||||
const xhr = (this.xhr = new XMLHttpRequest());
|
||||
// Note that your request may look different. It is up to you and your editor
|
||||
// integration to choose the right communication channel. This example uses
|
||||
// a POST request with JSON as a data structure but your configuration
|
||||
// could be different.
|
||||
// xhr.open('POST', this.url, true);
|
||||
xhr.open("POST", this.url, true);
|
||||
xhr.setRequestHeader("x-csrf-token", "{{ csrf_token() }}");
|
||||
xhr.responseType = "json";
|
||||
}
|
||||
// Initializes XMLHttpRequest listeners.
|
||||
_initListeners(resolve, reject, file) {
|
||||
const xhr = this.xhr;
|
||||
const loader = this.loader;
|
||||
const genericErrorText = `Couldn't upload file: ${file.name}.`;
|
||||
xhr.addEventListener("error", () => reject(genericErrorText));
|
||||
xhr.addEventListener("abort", () => reject());
|
||||
xhr.addEventListener("load", () => {
|
||||
const response = xhr.response;
|
||||
// This example assumes the XHR server's "response" object will come with
|
||||
// an "error" which has its own "message" that can be passed to reject()
|
||||
// in the upload promise.
|
||||
//
|
||||
// Your integration may handle upload errors in a different way so make sure
|
||||
// it is done properly. The reject() function must be called when the upload fails.
|
||||
if (!response || response.error) {
|
||||
return reject(response && response.error ? response.error.message : genericErrorText);
|
||||
}
|
||||
// If the upload is successful, resolve the upload promise with an object containing
|
||||
// at least the "default" URL, pointing to the image on the server.
|
||||
// This URL will be used to display the image in the content. Learn more in the
|
||||
// UploadAdapter#upload documentation.
|
||||
resolve({
|
||||
default: response.url,
|
||||
});
|
||||
});
|
||||
// Upload progress when it is supported. The file loader has the #uploadTotal and #uploaded
|
||||
// properties which are used e.g. to display the upload progress bar in the editor
|
||||
// user interface.
|
||||
if (xhr.upload) {
|
||||
xhr.upload.addEventListener("progress", (evt) => {
|
||||
if (evt.lengthComputable) {
|
||||
loader.uploadTotal = evt.total;
|
||||
loader.uploaded = evt.loaded;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// Prepares the data and sends the request.
|
||||
_sendRequest(file) {
|
||||
// Prepare the form data.
|
||||
const data = new FormData();
|
||||
data.append("upload", file);
|
||||
// Important note: This is the right place to implement security mechanisms
|
||||
// like authentication and CSRF protection. For instance, you can use
|
||||
// XMLHttpRequest.setRequestHeader() to set the request headers containing
|
||||
// the CSRF token generated earlier by your application.
|
||||
// Send the request.
|
||||
this.xhr.send(data);
|
||||
}
|
||||
// ...
|
||||
}
|
||||
|
||||
function SimpleUploadAdapterPlugin(editor) {
|
||||
editor.plugins.get("FileRepository").createUploadAdapter = (loader) => {
|
||||
// Configure the URL to the upload script in your back-end here!
|
||||
return new MyUploadAdapter(loader);
|
||||
};
|
||||
}
|
||||
|
||||
//Initialize the ckeditor
|
||||
ClassicEditor.create(document.querySelector("#teks"), {
|
||||
extraPlugins: [SimpleUploadAdapterPlugin],
|
||||
}).catch((error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
$("#ckeditorForm").submit(function(e) {
|
||||
var content = $('.ck_editor_txt').val();
|
||||
html = $(content).text();
|
||||
if ($.trim(html) == '') {
|
||||
alert("Teks Tidak Boleh Kosong!");
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
//Form edit image validation
|
||||
var uploadField = document.getElementById("input_foto_edit");
|
||||
uploadField.onchange = function() {
|
||||
if (this.files[0].size > 2000000) {
|
||||
alert("Batas maksimum 2MB!");
|
||||
this.value = "";
|
||||
} else {
|
||||
//Ubah Img Preview
|
||||
var reader = new FileReader();
|
||||
reader.onload = function() {
|
||||
var output = document.getElementById('old_nama_foto');
|
||||
output.src = reader.result;
|
||||
}
|
||||
reader.readAsDataURL(event.target.files[0]);
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function() {
|
||||
$('.from-prevent-multiple-submits').on('submit', function() {
|
||||
$('.from-prevent-multiple-submits').attr('disabled', 'true');
|
||||
})
|
||||
})();
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,155 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Informasi Beasiswa')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Informasi Beasiswa</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
<!-- /.content-header -->
|
||||
|
||||
<!-- Alert Status -->
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('alert'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('alert') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Data Informasi Beasiswa</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-12 text-left">
|
||||
<a href="{{ url('/admin/informasi_beasiswa/create') }}" type="button"
|
||||
class="btn btn-success mb-3">
|
||||
<i class="fa fa-plus-circle mr-2"></i>Tambah Data
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table id="tabel_informasi_beasiswa" class="table table-bordered table-striped mt-2">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>No</th>
|
||||
<th>Judul</th>
|
||||
<th>Thumbnail</th>
|
||||
<th>Teks</th>
|
||||
<th>Jadwal Rilis</th>
|
||||
<th>Status</th>
|
||||
<th>Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@foreach ($informasiBeasiswas as $informasiBeasiswa)
|
||||
<tr id="{{ $informasiBeasiswa->id }}">
|
||||
<td>{{ $loop->iteration }}</td>
|
||||
<td>{{ $informasiBeasiswa->judul }}</td>
|
||||
<td><img src="{{ url($informasiBeasiswa->thumbnail) }}"
|
||||
style="width:100px">
|
||||
</td>
|
||||
<td>
|
||||
@if (strlen(strip_tags($informasiBeasiswa->teks)) > 100)
|
||||
{{ str_replace(' ', '', substr(strip_tags($informasiBeasiswa->teks), 0, 100) . '...') }}
|
||||
@else
|
||||
{{ str_replace(' ', '', substr(strip_tags($informasiBeasiswa->teks), 0, 100)) }}
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ $informasiBeasiswa->release_date }}</td>
|
||||
@if ($informasiBeasiswa->deleted_at == '')
|
||||
@if ($informasiBeasiswa->release_date <= date('Y-m-d'))
|
||||
<td>Rilis</td>
|
||||
@else
|
||||
<td>Belum Rilis</td>
|
||||
@endif
|
||||
@else
|
||||
($informasiBeasiswa->deleted_at != "")
|
||||
<td>Terhapus</td>
|
||||
@endif
|
||||
@if ($informasiBeasiswa->deleted_at == '')
|
||||
<td>
|
||||
<a href="{{ route('informasi_beasiswa.edit', $informasiBeasiswa) }}"
|
||||
class="btn btn-warning open-formModalEdit"><i
|
||||
class="fa fa-edit"></i> Edit</a>
|
||||
<form
|
||||
action="{{ route('informasi_beasiswa.destroy', $informasiBeasiswa) }}"
|
||||
method="post">
|
||||
@method('delete')
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-danger"
|
||||
onclick="return confirm('Apakah anda yakin ingin menghapus data?')"><i
|
||||
class="fa fa-trash"></i> Delete</button>
|
||||
</form>
|
||||
</td>
|
||||
@else
|
||||
<td>
|
||||
<form
|
||||
action="{{ url('/admin/informasi_beasiswa/' . $informasiBeasiswa->id . '/restore') }}"
|
||||
method="post">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-primary"
|
||||
onclick="return confirm('Apakah anda yakin ingin mengembalikan data?')"><i
|
||||
class="fas fa-trash-restore"></i> Restore
|
||||
</button>
|
||||
</form>
|
||||
<form
|
||||
action="{{ url('/admin/informasi_beasiswa/' . $informasiBeasiswa->id . '/delete') }}"
|
||||
method="post">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-danger"
|
||||
onclick="return confirm('Apakah anda yakin ingin menghapus permanen data?')"><i
|
||||
class="fa fa-trash"></i> Delete Permanent
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<!--Data Table -->
|
||||
<script>
|
||||
$(function() {
|
||||
$("#tabel_informasi_beasiswa").DataTable({
|
||||
"paging": true,
|
||||
"lengthChange": false,
|
||||
"searching": true,
|
||||
"ordering": true,
|
||||
"info": true,
|
||||
"autoWidth": false,
|
||||
"responsive": false,
|
||||
"buttons": ["copy", "csv", "excel", "pdf", "print", "colvis"]
|
||||
}).buttons().container().appendTo('#tabel_informasi_beasiswa_wrapper .col-md-6:eq(0)');
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,254 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Jurnal')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Jurnal</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
|
||||
<!-- Alert Status -->
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('alert'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('alert') }}
|
||||
</div>
|
||||
@endif
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Data Jurnal</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-12 text-left">
|
||||
<a type="button" href="#formModalAdd" data-toggle="modal"
|
||||
class="btn btn-success mb-3"><i class="fa fa-plus-circle"></i>
|
||||
Tambah Data Jurnal
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table id="tabel_jurnal" class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nomor</th>
|
||||
<th>Nama Jurnal</th>
|
||||
<th>Link Jurnal</th>
|
||||
<th>Jadwal Rilis</th>
|
||||
<th>Status</th>
|
||||
<th>Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($jurnals as $jurnal)
|
||||
<tr>
|
||||
<td>{{ $loop->iteration }}</td>
|
||||
<td>{{ $jurnal->nama }}</td>
|
||||
<td><a href="{{ $jurnal->url }}" download
|
||||
target="_blank">{{ $jurnal->url }}</a></td>
|
||||
<td>{{ $jurnal->release_date }}</td>
|
||||
@if ($jurnal->deleted_at == '')
|
||||
@if ($jurnal->release_date <= date('Y-m-d'))
|
||||
<td>Rilis</td>
|
||||
@else
|
||||
<td>Belum Rilis</td>
|
||||
@endif
|
||||
@else ($jurnal->deleted_at != "")
|
||||
<td>Terhapus</td>
|
||||
@endif
|
||||
@if ($jurnal->deleted_at == '')
|
||||
<td>
|
||||
<button href="#formModalEdit" role="button" data-toggle="modal"
|
||||
data-id="{{ $jurnal->id }}"
|
||||
data-nama="{{ $jurnal->nama }}"
|
||||
data-url="{{ $jurnal->url }}"
|
||||
data-release_date="{{ $jurnal->release_date }}"
|
||||
class="btn btn-warning open-formModalEdit"><i
|
||||
class="fa fa-edit"></i> Edit</button>
|
||||
<form action="{{ route('jurnal.destroy', $jurnal) }}"
|
||||
method="post">
|
||||
@method('delete')
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-danger"
|
||||
onclick="return confirm('Apakah anda yakin ingin menghapus data?')"><i
|
||||
class="fa fa-trash"></i> Delete</button>
|
||||
</form>
|
||||
</td>
|
||||
@else
|
||||
<td>
|
||||
<form
|
||||
action="{{ url('/admin/jurnal/' . $jurnal->id . '/restore') }}"
|
||||
method="post">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-primary"
|
||||
onclick="return confirm('Apakah anda yakin ingin mengembalikan data?')"><i
|
||||
class="fas fa-trash-restore"></i> Restore
|
||||
</button>
|
||||
</form>
|
||||
<form
|
||||
action="{{ url('/admin/jurnal/' . $jurnal->id . '/delete') }}"
|
||||
method="post">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-danger"
|
||||
onclick="return confirm('Apakah anda yakin ingin menghapus permanen data?')"><i
|
||||
class="fa fa-trash"></i> Delete Permanent
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<!-- Modal Add -->
|
||||
<div class="modal fade" id="formModalAdd" tabindex="-1" aria-labelledby="formModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="formModalLabel">Tambah Data Jurnal</h5>
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal" aria-label="Close">X</button>
|
||||
</div>
|
||||
<form id="formAdd" action="{{ url('/admin/jurnal') }}" method="post" enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="modal-body">
|
||||
<div class="form-group mt-2">
|
||||
<label for="nama">Nama Jurnal</label>
|
||||
<input type="text" class="form-control mt-0" name="nama" required maxlength="255"
|
||||
placeholder=". . .">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="url">Link Jurnal</label>
|
||||
<input type="text" class="form-control mt-0" name="url" required placeholder=". . .">
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="release_date">Jadwal Rilis</label>
|
||||
<input type="date" class="form-control mt-0" name="release_date" required>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal"
|
||||
aria-label="Close">Batal</button>
|
||||
<button type="submit" class="btn btn-primary">Tambah Data</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@foreach ($jurnals as $jurnal)
|
||||
<!-- Modal Edit -->
|
||||
<div class="modal fade" id="formModalEdit" tabindex="-1" aria-labelledby="formModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="formModalLabel">Ubah Data Jurnal</h5>
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal" aria-label="Close">X</button>
|
||||
</div>
|
||||
<form id="formEdit" action="{{ route('jurnal.update', $jurnal->id) }}" method="POST" enctype="multipart/form-data">
|
||||
@method('patch')
|
||||
@csrf
|
||||
<div class="modal-body">
|
||||
<input type="hidden" name="id" id="id">
|
||||
<div class="form-group mt-2">
|
||||
<label for="nama">Nama Jurnal</label>
|
||||
<input type="text" class="form-control mt-0" name="nama" id="nama" required maxlength="255"
|
||||
placeholder=". . .">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="url">Link Jurnal</label>
|
||||
<input type="text" class="form-control mt-0" name="url" id="url" required
|
||||
placeholder=". . .">
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="release_date">Jadwal Rilis</label>
|
||||
<input type="date" class="form-control mt-0" name="release_date" id="release_date" required>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal"
|
||||
aria-label="Close">Batal</button>
|
||||
<button type="submit" class="btn btn-primary">Ubah Data</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
|
||||
<script type="text/javascript">
|
||||
var $formAdd = $("#formAdd");
|
||||
$formAdd.submit(function(){
|
||||
$formAdd.submit(function(){
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var $formEdit = $("#formEdit");
|
||||
$formEdit.submit(function(){
|
||||
$formEdit.submit(function(){
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<!--Data Table -->
|
||||
<script>
|
||||
$(function() {
|
||||
$("#tabel_jurnal").DataTable({
|
||||
"paging": true,
|
||||
"lengthChange": false,
|
||||
"searching": true,
|
||||
"ordering": true,
|
||||
"info": true,
|
||||
"autoWidth": false,
|
||||
"responsive": false,
|
||||
"buttons": ["copy", "csv", "excel", "pdf", "print", "colvis"]
|
||||
}).buttons().container().appendTo('#tabel_jurnal_wrapper .col-md-6:eq(0)');
|
||||
});
|
||||
|
||||
$(document).on("click", ".open-formModalEdit", function() {
|
||||
var id = $(this).data('id');
|
||||
var nama = $(this).data('nama');
|
||||
var url = $(this).data('url');
|
||||
var release_date = $(this).data('release_date');
|
||||
|
||||
$(".modal-body #id").val(id);
|
||||
$(".modal-body #nama").val(nama);
|
||||
$(".modal-body #release_date").val(release_date);
|
||||
$(".modal-body #url").val(url);
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,283 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Kalender Akademik')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Kalender Akademik</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
<!-- /.content-header -->
|
||||
|
||||
<!-- Alert Status -->
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('alert'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('alert') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Data Kalender Akademik</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<a type="button" href="#formModalAdd" data-toggle="modal"
|
||||
class="btn btn-success mb-3"><i class="fa fa-plus-circle"></i>
|
||||
Tambah Data Kalender Akademik
|
||||
</a>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table id="tabel_kalender_akademik" class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nomor</th>
|
||||
<th>Judul</th>
|
||||
<th>PDF</th>
|
||||
<th>Jadwal Rilis</th>
|
||||
<th>Status</th>
|
||||
<th>Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($kalenderAkademiks as $kalenderAkademik)
|
||||
<tr>
|
||||
<td>{{ $loop->iteration }}</td>
|
||||
<td>{{ $kalenderAkademik->judul }}</td>
|
||||
<td>
|
||||
<a href="{{ url($kalenderAkademik->nama_file) }}"
|
||||
target="_blank">{{ $kalenderAkademik->nama_file }}</a>
|
||||
</td>
|
||||
<td>{{ $kalenderAkademik->release_date }}</td>
|
||||
<td>
|
||||
@if ($kalenderAkademik->deleted_at != '')
|
||||
Terhapus
|
||||
@elseif ($kalenderAkademik->release_date > date('Y-m-d'))
|
||||
Belum Rilis
|
||||
@else
|
||||
Rilis
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if ($kalenderAkademik->deleted_at != '')
|
||||
<form
|
||||
action="{{ url('/admin/kalender_akademik/' . $kalenderAkademik->id . '/restore') }}"
|
||||
method="post">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-primary"
|
||||
onclick="return confirm('Apakah anda yakin ingin mengembalikan data?')"><i
|
||||
class="fas fa-trash-restore"></i> Restore
|
||||
</button>
|
||||
</form>
|
||||
<form
|
||||
action="{{ url('/admin/kalender_akademik/' . $kalenderAkademik->id . '/delete_permanen') }}"
|
||||
method="post">
|
||||
@csrf
|
||||
<input type="hidden" name="nama_file"
|
||||
value="{{ $kalenderAkademik->nama_file }}">
|
||||
<button type="submit" class="btn btn-danger"
|
||||
onclick="return confirm('Apakah anda yakin ingin menghapus permanen data?')"><i
|
||||
class="fa fa-trash"></i> Delete Permanent
|
||||
</button>
|
||||
</form>
|
||||
@else
|
||||
<button href="#formModalEdit" role="button" data-toggle="modal"
|
||||
data-id="{{ $kalenderAkademik->id }}"
|
||||
data-judul="{{ $kalenderAkademik->judul }}"
|
||||
data-release_date="{{ $kalenderAkademik->release_date }}"
|
||||
data-old_file="{{ $kalenderAkademik->nama_file }}"
|
||||
class="btn btn-warning open-formModalEdit"><i
|
||||
class="fa fa-edit"></i> Edit</button>
|
||||
<form
|
||||
action="{{ route('kalender_akademik.destroy', $kalenderAkademik) }}"
|
||||
method="post">
|
||||
@method('delete')
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-danger"
|
||||
onclick="return confirm('Apakah anda yakin ingin menghapus data?')"><i
|
||||
class="fa fa-trash"></i> Delete
|
||||
</button>
|
||||
</form>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<!-- Modal Add -->
|
||||
<div class="modal fade" id="formModalAdd" tabindex="-1" aria-labelledby="formModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="formModalLabel">Tambah Data Kalender Akademik</h5>
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal" aria-label="Close">X</button>
|
||||
</div>
|
||||
<form id="formAdd" action="{{ url('/admin/kalender_akademik') }}" method="post"
|
||||
enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="modal-body">
|
||||
<div class="form-group mt-2">
|
||||
<label for="judul">Judul</label>
|
||||
<input type="text" class="form-control" name="judul" placeholder="Masukkan Judul" value=""
|
||||
required maxlength="255">
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="nama_file">PDF (Maksimal 2MB)</label>
|
||||
<input type="file" id="input_pdf_add" class="form-control" name="nama_file" required
|
||||
accept="application/pdf">
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="release_date">Tanggal Rilis</label>
|
||||
<input type="date" class="form-control" name="release_date" required>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal"
|
||||
aria-label="Close">Batal</button>
|
||||
<button type="submit" class="btn btn-primary">Tambah Data</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@foreach ($kalenderAkademiks as $kalenderAkademik)
|
||||
<!-- Modal Edit -->
|
||||
<div class="modal fade" id="formModalEdit" tabindex="-1" aria-labelledby="formModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="formModalLabel">Ubah Data Kalender Akademik</h5>
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal" aria-label="Close">X</button>
|
||||
</div>
|
||||
<form id="formEdit" action="{{ route('kalender_akademik.update', $kalenderAkademik->id) }}"
|
||||
method="POST" enctype="multipart/form-data">
|
||||
@method('patch')
|
||||
@csrf
|
||||
<div class="modal-body">
|
||||
<input type="hidden" name="id" id="id">
|
||||
<div class="form-group">
|
||||
<label for="judul">Judul</label>
|
||||
<input type="text" class="form-control mt-0" id="judul" name="judul" maxlength="255"
|
||||
placeholder="Masukkan Judul">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="nama_file">PDF (Maksimal 2MB)</label>
|
||||
<input type="file" id="input_pdf_edit" class="form-control mt-0" name="nama_file"
|
||||
accept="application/pdf">
|
||||
<input type="hidden" name="old_file" id="old_file"
|
||||
value="{{ $kalenderAkademik->nama_file }}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="release_date">Tanggal Rilis</label>
|
||||
<input type="date" class="form-control mt-0" name="release_date" id="release_date" required>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal"
|
||||
aria-label="Close">Batal</button>
|
||||
<button type="submit" class="btn btn-primary">Ubah Data</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
|
||||
<script type="text/javascript">
|
||||
var $formAdd = $("#formAdd");
|
||||
$formAdd.submit(function() {
|
||||
$formAdd.submit(function() {
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var $formEdit = $("#formEdit");
|
||||
$formEdit.submit(function() {
|
||||
$formEdit.submit(function() {
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<!--Data Table -->
|
||||
<script>
|
||||
$(function() {
|
||||
$("#tabel_kalender_akademik").DataTable({
|
||||
"paging": true,
|
||||
"lengthChange": false,
|
||||
"searching": true,
|
||||
"ordering": true,
|
||||
"info": true,
|
||||
"autoWidth": false,
|
||||
"responsive": false,
|
||||
"buttons": ["copy", "csv", "excel", "pdf", "print", "colvis"]
|
||||
}).buttons().container().appendTo('#tabel_kalender_akademik_wrapper .col-md-6:eq(0)');
|
||||
});
|
||||
</script>
|
||||
|
||||
<!--Modal Edit -->
|
||||
<script type="text/javascript">
|
||||
$(document).on("click", ".open-formModalEdit", function() {
|
||||
var id = $(this).data('id');
|
||||
var judul = $(this).data('judul');
|
||||
var release_date = $(this).data('release_date');
|
||||
var old_file = $(this).data('old_file');
|
||||
|
||||
$(".modal-body #id").val(id);
|
||||
$(".modal-body #judul").val(judul);
|
||||
$(".modal-body #release_date").val(release_date);
|
||||
$(".modal-body #input_pdf_edit").val("");
|
||||
$(".modal-body #old_file").val(old_file);
|
||||
});
|
||||
|
||||
//Form add image validation
|
||||
var uploadField = document.getElementById("input_pdf_add");
|
||||
uploadField.onchange = function() {
|
||||
if (this.files[0].size > 2000000) {
|
||||
alert("Batas maksimum 2MB!");
|
||||
this.value = "";
|
||||
};
|
||||
};
|
||||
|
||||
//Form edit image validation
|
||||
var uploadField = document.getElementById("input_pdf_edit");
|
||||
uploadField.onchange = function() {
|
||||
if (this.files[0].size > 2000000) {
|
||||
alert("Batas maksimum 2MB!");
|
||||
this.value = "";
|
||||
};
|
||||
};
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,234 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Kegiatan Eksternal Kampus')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Kegiatan Eksternal Kampus</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
<!-- /.content-header -->
|
||||
|
||||
<!-- Alert Status -->
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('alert'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('alert') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Tambah Data Kegiatan Eksternal Kampus</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<!-- form start -->
|
||||
<form class="from-prevent-multiple-submits" action="{{ route('kegiatan_eksternal_kampus.store') }}" method="POST"
|
||||
id="ckeditorForm" enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<label for="judul">Judul</label>
|
||||
<input type="text" class="form-control" id="judul" name="judul"
|
||||
placeholder="Masukkan Judul" value="" required maxlength="255">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="nama_foto">Thumbnail (Maksimal 2MB)</label>
|
||||
<div class="form-group">
|
||||
<img id="img_preview_add" style="max-width: 200px;"
|
||||
class="mt-2" />
|
||||
</div>
|
||||
<input type="file" accept="image/*" class="form-control mt-0"
|
||||
name="thumbnail" id="input_foto_add" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="teks">Teks (Foto Maksimal 2MB)</label>
|
||||
<textarea id="teks" placeholder="Masukkan Teks" name="teks"
|
||||
class="ck_editor_txt" id="ck_editor_txt"></textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="release_date">Tanggal Rilis</label>
|
||||
<input type="date" class="form-control" name="release_date" required>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
|
||||
<div class="card-footer">
|
||||
<button id="submit" type="submit" class="btn btn-primary from-prevent-multiple-submits">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
//Define an adapter to upload the files
|
||||
class MyUploadAdapter {
|
||||
constructor(loader) {
|
||||
// The file loader instance to use during the upload. It sounds scary but do not
|
||||
// worry — the loader will be passed into the adapter later on in this guide.
|
||||
this.loader = loader;
|
||||
|
||||
// URL where to send files.
|
||||
this.url = '{{ route('ckeditor.upload') }}';
|
||||
|
||||
//
|
||||
}
|
||||
// Starts the upload process.
|
||||
upload() {
|
||||
return this.loader.file.then(
|
||||
(file) =>
|
||||
new Promise((resolve, reject) => {
|
||||
this._initRequest();
|
||||
this._initListeners(resolve, reject, file);
|
||||
this._sendRequest(file);
|
||||
})
|
||||
);
|
||||
}
|
||||
// Aborts the upload process.
|
||||
abort() {
|
||||
if (this.xhr) {
|
||||
this.xhr.abort();
|
||||
}
|
||||
}
|
||||
// Initializes the XMLHttpRequest object using the URL passed to the constructor.
|
||||
_initRequest() {
|
||||
const xhr = (this.xhr = new XMLHttpRequest());
|
||||
// Note that your request may look different. It is up to you and your editor
|
||||
// integration to choose the right communication channel. This example uses
|
||||
// a POST request with JSON as a data structure but your configuration
|
||||
// could be different.
|
||||
// xhr.open('POST', this.url, true);
|
||||
xhr.open("POST", this.url, true);
|
||||
xhr.setRequestHeader("x-csrf-token", "{{ csrf_token() }}");
|
||||
xhr.responseType = "json";
|
||||
}
|
||||
// Initializes XMLHttpRequest listeners.
|
||||
_initListeners(resolve, reject, file) {
|
||||
const xhr = this.xhr;
|
||||
const loader = this.loader;
|
||||
const genericErrorText = `Couldn't upload file: ${file.name}.`;
|
||||
xhr.addEventListener("error", () => reject(genericErrorText));
|
||||
xhr.addEventListener("abort", () => reject());
|
||||
xhr.addEventListener("load", () => {
|
||||
const response = xhr.response;
|
||||
// This example assumes the XHR server's "response" object will come with
|
||||
// an "error" which has its own "message" that can be passed to reject()
|
||||
// in the upload promise.
|
||||
//
|
||||
// Your integration may handle upload errors in a different way so make sure
|
||||
// it is done properly. The reject() function must be called when the upload fails.
|
||||
if (!response || response.error) {
|
||||
return reject(response && response.error ? response.error.message : genericErrorText);
|
||||
}
|
||||
// If the upload is successful, resolve the upload promise with an object containing
|
||||
// at least the "default" URL, pointing to the image on the server.
|
||||
// This URL will be used to display the image in the content. Learn more in the
|
||||
// UploadAdapter#upload documentation.
|
||||
resolve({
|
||||
default: response.url,
|
||||
});
|
||||
});
|
||||
// Upload progress when it is supported. The file loader has the #uploadTotal and #uploaded
|
||||
// properties which are used e.g. to display the upload progress bar in the editor
|
||||
// user interface.
|
||||
if (xhr.upload) {
|
||||
xhr.upload.addEventListener("progress", (evt) => {
|
||||
if (evt.lengthComputable) {
|
||||
loader.uploadTotal = evt.total;
|
||||
loader.uploaded = evt.loaded;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// Prepares the data and sends the request.
|
||||
_sendRequest(file) {
|
||||
// Prepare the form data.
|
||||
const data = new FormData();
|
||||
data.append("upload", file);
|
||||
// Important note: This is the right place to implement security mechanisms
|
||||
// like authentication and CSRF protection. For instance, you can use
|
||||
// XMLHttpRequest.setRequestHeader() to set the request headers containing
|
||||
// the CSRF token generated earlier by your application.
|
||||
// Send the request.
|
||||
this.xhr.send(data);
|
||||
}
|
||||
// ...
|
||||
}
|
||||
|
||||
function SimpleUploadAdapterPlugin(editor) {
|
||||
editor.plugins.get("FileRepository").createUploadAdapter = (loader) => {
|
||||
// Configure the URL to the upload script in your back-end here!
|
||||
return new MyUploadAdapter(loader);
|
||||
};
|
||||
}
|
||||
|
||||
var allEditors = document.querySelector('.ck_editor_txt');
|
||||
|
||||
//Initialize the ckeditor
|
||||
ClassicEditor.create(document.querySelector("#teks"), {
|
||||
extraPlugins: [SimpleUploadAdapterPlugin],
|
||||
}).catch((error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
$("#ckeditorForm").submit(function(e) {
|
||||
var content = $('.ck_editor_txt').val();
|
||||
html = $(content).text();
|
||||
if ($.trim(html) == '') {
|
||||
alert("Teks Tidak Boleh Kosong!");
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
//Form add image validation
|
||||
var uploadField = document.getElementById("input_foto_add");
|
||||
uploadField.onchange = function() {
|
||||
if (this.files[0].size > 2000000) {
|
||||
alert("Batas maksimum 2MB!");
|
||||
this.value = "";
|
||||
} else {
|
||||
//Ubah Img Preview
|
||||
var reader = new FileReader();
|
||||
reader.onload = function() {
|
||||
var output = document.getElementById('img_preview_add');
|
||||
output.src = reader.result;
|
||||
}
|
||||
reader.readAsDataURL(event.target.files[0]);
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function(){
|
||||
$('.from-prevent-multiple-submits').on('submit', function(){
|
||||
$('.from-prevent-multiple-submits').attr('disabled','true');
|
||||
})
|
||||
})();
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,230 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Kegiatan Eksternal Kampus')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Kegiatan Eksternal Kampus</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
<!-- /.content-header -->
|
||||
|
||||
<!-- Alert Status -->
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('alert'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('alert') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Edit Data Kegiatan Eksternal Kampus</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<!-- form start -->
|
||||
<form class="from-prevent-multiple-submits"
|
||||
action="{{ route('kegiatan_eksternal_kampus.update', $kegiatanEksternalKampu) }}"
|
||||
method="POST" enctype="multipart/form-data">
|
||||
@method('patch')
|
||||
@csrf
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<label for="judul">Judul</label>
|
||||
<input type="text" class="form-control" id="judul" name="judul"
|
||||
placeholder="Masukkan Judul" maxlength="255"
|
||||
value="{{ $kegiatanEksternalKampu->judul }}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="nama_foto">Thumbnail (Maksimal 2MB)</label>
|
||||
<div class="form-group">
|
||||
<img src="{{ url($kegiatanEksternalKampu->thumbnail) }}"
|
||||
alt="Image Missing" id="old_nama_foto" style="max-width: 200px;"
|
||||
class="mt-2" />
|
||||
</div>
|
||||
<input type="file" accept="image/*" class="form-control mt-0"
|
||||
name="thumbnail" id="input_foto_edit">
|
||||
<input type="hidden" name="old_thumbnail"
|
||||
value="{{ $kegiatanEksternalKampu->thumbnail }}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="teks">Teks (Foto Maksimal 2MB)</label>
|
||||
<textarea id="teks" placeholder="Masukkan Deskripsi Video"
|
||||
name="teks">{{ $kegiatanEksternalKampu->teks }}</textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="release_date">Tanggal Rilis</label>
|
||||
<input type="date" class="form-control" name="release_date"
|
||||
value="{{ $kegiatanEksternalKampu->release_date }}" required>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
|
||||
<div class="card-footer">
|
||||
<button id="submit" type="submit"
|
||||
class="btn btn-primary from-prevent-multiple-submits">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
//Define an adapter to upload the files
|
||||
class MyUploadAdapter {
|
||||
constructor(loader) {
|
||||
// The file loader instance to use during the upload. It sounds scary but do not
|
||||
// worry — the loader will be passed into the adapter later on in this guide.
|
||||
this.loader = loader;
|
||||
|
||||
// URL where to send files.
|
||||
this.url = '{{ route('ckeditor.upload') }}';
|
||||
|
||||
//
|
||||
}
|
||||
// Starts the upload process.
|
||||
upload() {
|
||||
return this.loader.file.then(
|
||||
(file) =>
|
||||
new Promise((resolve, reject) => {
|
||||
this._initRequest();
|
||||
this._initListeners(resolve, reject, file);
|
||||
this._sendRequest(file);
|
||||
})
|
||||
);
|
||||
}
|
||||
// Aborts the upload process.
|
||||
abort() {
|
||||
if (this.xhr) {
|
||||
this.xhr.abort();
|
||||
}
|
||||
}
|
||||
// Initializes the XMLHttpRequest object using the URL passed to the constructor.
|
||||
_initRequest() {
|
||||
const xhr = (this.xhr = new XMLHttpRequest());
|
||||
// Note that your request may look different. It is up to you and your editor
|
||||
// integration to choose the right communication channel. This example uses
|
||||
// a POST request with JSON as a data structure but your configuration
|
||||
// could be different.
|
||||
// xhr.open('POST', this.url, true);
|
||||
xhr.open("POST", this.url, true);
|
||||
xhr.setRequestHeader("x-csrf-token", "{{ csrf_token() }}");
|
||||
xhr.responseType = "json";
|
||||
}
|
||||
// Initializes XMLHttpRequest listeners.
|
||||
_initListeners(resolve, reject, file) {
|
||||
const xhr = this.xhr;
|
||||
const loader = this.loader;
|
||||
const genericErrorText = `Couldn't upload file: ${file.name}.`;
|
||||
xhr.addEventListener("error", () => reject(genericErrorText));
|
||||
xhr.addEventListener("abort", () => reject());
|
||||
xhr.addEventListener("load", () => {
|
||||
const response = xhr.response;
|
||||
// This example assumes the XHR server's "response" object will come with
|
||||
// an "error" which has its own "message" that can be passed to reject()
|
||||
// in the upload promise.
|
||||
//
|
||||
// Your integration may handle upload errors in a different way so make sure
|
||||
// it is done properly. The reject() function must be called when the upload fails.
|
||||
if (!response || response.error) {
|
||||
return reject(response && response.error ? response.error.message : genericErrorText);
|
||||
}
|
||||
// If the upload is successful, resolve the upload promise with an object containing
|
||||
// at least the "default" URL, pointing to the image on the server.
|
||||
// This URL will be used to display the image in the content. Learn more in the
|
||||
// UploadAdapter#upload documentation.
|
||||
resolve({
|
||||
default: response.url,
|
||||
});
|
||||
});
|
||||
// Upload progress when it is supported. The file loader has the #uploadTotal and #uploaded
|
||||
// properties which are used e.g. to display the upload progress bar in the editor
|
||||
// user interface.
|
||||
if (xhr.upload) {
|
||||
xhr.upload.addEventListener("progress", (evt) => {
|
||||
if (evt.lengthComputable) {
|
||||
loader.uploadTotal = evt.total;
|
||||
loader.uploaded = evt.loaded;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// Prepares the data and sends the request.
|
||||
_sendRequest(file) {
|
||||
// Prepare the form data.
|
||||
const data = new FormData();
|
||||
data.append("upload", file);
|
||||
// Important note: This is the right place to implement security mechanisms
|
||||
// like authentication and CSRF protection. For instance, you can use
|
||||
// XMLHttpRequest.setRequestHeader() to set the request headers containing
|
||||
// the CSRF token generated earlier by your application.
|
||||
// Send the request.
|
||||
this.xhr.send(data);
|
||||
}
|
||||
// ...
|
||||
}
|
||||
|
||||
function SimpleUploadAdapterPlugin(editor) {
|
||||
editor.plugins.get("FileRepository").createUploadAdapter = (loader) => {
|
||||
// Configure the URL to the upload script in your back-end here!
|
||||
return new MyUploadAdapter(loader);
|
||||
};
|
||||
}
|
||||
|
||||
//Initialize the ckeditor
|
||||
ClassicEditor.create(document.querySelector("#teks"), {
|
||||
extraPlugins: [SimpleUploadAdapterPlugin],
|
||||
}).catch((error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
//Form edit image validation
|
||||
var uploadField = document.getElementById("input_foto_edit");
|
||||
uploadField.onchange = function() {
|
||||
if (this.files[0].size > 2000000) {
|
||||
alert("Batas maksimum 2MB!");
|
||||
this.value = "";
|
||||
} else {
|
||||
//Ubah Img Preview
|
||||
var reader = new FileReader();
|
||||
reader.onload = function() {
|
||||
var output = document.getElementById('old_nama_foto');
|
||||
output.src = reader.result;
|
||||
}
|
||||
reader.readAsDataURL(event.target.files[0]);
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function() {
|
||||
$('.from-prevent-multiple-submits').on('submit', function() {
|
||||
$('.from-prevent-multiple-submits').attr('disabled', 'true');
|
||||
})
|
||||
})();
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,158 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Kegiatan Eksternal Kampus')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Kegiatan Eksternal Kampus</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
<!-- /.content-header -->
|
||||
|
||||
<!-- Alert Status -->
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('alert'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('alert') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Data Kegiatan Eksternal Kampus</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-12 text-left">
|
||||
<a type="button" href="{{ url('/admin/kegiatan_eksternal_kampus/create') }}"
|
||||
class="btn btn-success mb-3"><i class="fa fa-plus-circle"></i>
|
||||
Tambah Data Kegiatan Eksternal Kampus
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table id="tabel_kegiatan_eksternal_kampus" class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nomor</th>
|
||||
<th>Judul</th>
|
||||
<th>Thumbnail</th>
|
||||
<th>Teks</th>
|
||||
<th>Jadwal Rilis</th>
|
||||
<th>Status</th>
|
||||
<th>Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($kegiatanEksternalKampus as $kegiatanEksternalKampu)
|
||||
<tr>
|
||||
<td>{{ $loop->iteration }}</td>
|
||||
<td>{{ $kegiatanEksternalKampu->judul }}</td>
|
||||
<td>
|
||||
<img src="{{ url($kegiatanEksternalKampu->thumbnail) }}"
|
||||
alt="Image Missing" style="width: 100px;">
|
||||
</td>
|
||||
<td>
|
||||
@if (strlen(strip_tags($kegiatanEksternalKampu->teks)) > 100)
|
||||
{{ str_replace(' ', '', substr(strip_tags($kegiatanEksternalKampu->teks), 0, 100) . '...') }}
|
||||
@else
|
||||
{{ str_replace(' ', '', substr(strip_tags($kegiatanEksternalKampu->teks), 0, 100)) }}
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ $kegiatanEksternalKampu->release_date }}</td>
|
||||
<td>
|
||||
@if ($kegiatanEksternalKampu->deleted_at != '')
|
||||
Terhapus
|
||||
@elseif ($kegiatanEksternalKampu->release_date > date('Y-m-d'))
|
||||
Belum Rilis
|
||||
@else
|
||||
Rilis
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if ($kegiatanEksternalKampu->deleted_at != '')
|
||||
<form
|
||||
action="{{ url('/admin/kegiatan_eksternal_kampus/' . $kegiatanEksternalKampu->id . '/restore') }}"
|
||||
method="post">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-primary"
|
||||
onclick="return confirm('Apakah anda yakin ingin mengembalikan data?')"><i
|
||||
class="fas fa-trash-restore"></i> Restore
|
||||
</button>
|
||||
</form>
|
||||
<form
|
||||
action="{{ url('/admin/kegiatan_eksternal_kampus/' . $kegiatanEksternalKampu->id . '/delete_permanen') }}"
|
||||
method="post">
|
||||
@csrf
|
||||
<input type="hidden" name="thumbnail"
|
||||
value="{{ $kegiatanEksternalKampu->thumbnail }}">
|
||||
<button type="submit" class="btn btn-danger"
|
||||
onclick="return confirm('Apakah anda yakin ingin menghapus permanen data?')"><i
|
||||
class="fa fa-trash"></i> Delete Permanent
|
||||
</button>
|
||||
</form>
|
||||
@else
|
||||
<a href="{{ route('kegiatan_eksternal_kampus.edit', $kegiatanEksternalKampu) }}"
|
||||
class="btn btn-warning open-formModalEdit">
|
||||
<i class="fa fa-edit"></i> Edit
|
||||
</a>
|
||||
<form
|
||||
action="{{ route('kegiatan_eksternal_kampus.destroy', $kegiatanEksternalKampu) }}"
|
||||
method="post">
|
||||
@method('delete')
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-danger"
|
||||
onclick="return confirm('Apakah anda yakin ingin menghapus data?')"><i
|
||||
class="fa fa-trash"></i> Delete
|
||||
</button>
|
||||
</form>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<!--Data Table -->
|
||||
<script>
|
||||
$(function() {
|
||||
$("#tabel_kegiatan_eksternal_kampus").DataTable({
|
||||
"paging": true,
|
||||
"lengthChange": false,
|
||||
"searching": true,
|
||||
"ordering": true,
|
||||
"info": true,
|
||||
"autoWidth": false,
|
||||
"responsive": false,
|
||||
"buttons": ["copy", "csv", "excel", "pdf", "print", "colvis"]
|
||||
}).buttons().container().appendTo('#tabel_kegiatan_eksternal_kampus_wrapper .col-md-6:eq(0)');
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,235 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Kegiatan Internal Kampus')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Kegiatan Internal Kampus</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
<!-- /.content-header -->
|
||||
|
||||
<!-- Alert Status -->
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('alert'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('alert') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Tambah Data Kegiatan Internal Kampus</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<!-- form start -->
|
||||
<form class="from-prevent-multiple-submits" action="{{ route('kegiatan_internal_kampus.store') }}" method="POST"
|
||||
id="ckeditorForm" enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<label for="judul">Judul</label>
|
||||
<input type="text" class="form-control" id="judul" name="judul"
|
||||
placeholder="Masukkan Judul" value="" required maxlength="255">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="nama_foto">Thumbnail (Maksimal 2MB)</label>
|
||||
<div class="form-group">
|
||||
<img id="img_preview_add" style="max-width: 200px;"
|
||||
class="mt-2" />
|
||||
</div>
|
||||
<input type="file" accept="image/*" class="form-control mt-0"
|
||||
name="thumbnail" id="input_foto_add" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="teks">Teks (Foto Maksimal 2MB)</label>
|
||||
<textarea id="teks" placeholder="Masukkan Teks" name="teks"
|
||||
class="ck_editor_txt" id="ck_editor_txt"></textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="release_date">Tanggal Rilis</label>
|
||||
<input type="date" class="form-control" name="release_date" required>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
|
||||
<div class="card-footer">
|
||||
<button id="submit" type="submit" class="btn btn-primary from-prevent-multiple-submits">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
//Define an adapter to upload the files
|
||||
class MyUploadAdapter {
|
||||
constructor(loader) {
|
||||
// The file loader instance to use during the upload. It sounds scary but do not
|
||||
// worry — the loader will be passed into the adapter later on in this guide.
|
||||
this.loader = loader;
|
||||
|
||||
// URL where to send files.
|
||||
this.url = '{{ route('ckeditor.upload') }}';
|
||||
|
||||
//
|
||||
}
|
||||
// Starts the upload process.
|
||||
upload() {
|
||||
return this.loader.file.then(
|
||||
(file) =>
|
||||
new Promise((resolve, reject) => {
|
||||
this._initRequest();
|
||||
this._initListeners(resolve, reject, file);
|
||||
this._sendRequest(file);
|
||||
})
|
||||
);
|
||||
}
|
||||
// Aborts the upload process.
|
||||
abort() {
|
||||
if (this.xhr) {
|
||||
this.xhr.abort();
|
||||
}
|
||||
}
|
||||
// Initializes the XMLHttpRequest object using the URL passed to the constructor.
|
||||
_initRequest() {
|
||||
const xhr = (this.xhr = new XMLHttpRequest());
|
||||
// Note that your request may look different. It is up to you and your editor
|
||||
// integration to choose the right communication channel. This example uses
|
||||
// a POST request with JSON as a data structure but your configuration
|
||||
// could be different.
|
||||
// xhr.open('POST', this.url, true);
|
||||
xhr.open("POST", this.url, true);
|
||||
xhr.setRequestHeader("x-csrf-token", "{{ csrf_token() }}");
|
||||
xhr.responseType = "json";
|
||||
}
|
||||
// Initializes XMLHttpRequest listeners.
|
||||
_initListeners(resolve, reject, file) {
|
||||
const xhr = this.xhr;
|
||||
const loader = this.loader;
|
||||
const genericErrorText = `Couldn't upload file: ${file.name}.`;
|
||||
xhr.addEventListener("error", () => reject(genericErrorText));
|
||||
xhr.addEventListener("abort", () => reject());
|
||||
xhr.addEventListener("load", () => {
|
||||
const response = xhr.response;
|
||||
// This example assumes the XHR server's "response" object will come with
|
||||
// an "error" which has its own "message" that can be passed to reject()
|
||||
// in the upload promise.
|
||||
//
|
||||
// Your integration may handle upload errors in a different way so make sure
|
||||
// it is done properly. The reject() function must be called when the upload fails.
|
||||
if (!response || response.error) {
|
||||
return reject(response && response.error ? response.error.message : genericErrorText);
|
||||
}
|
||||
// If the upload is successful, resolve the upload promise with an object containing
|
||||
// at least the "default" URL, pointing to the image on the server.
|
||||
// This URL will be used to display the image in the content. Learn more in the
|
||||
// UploadAdapter#upload documentation.
|
||||
resolve({
|
||||
default: response.url,
|
||||
});
|
||||
});
|
||||
// Upload progress when it is supported. The file loader has the #uploadTotal and #uploaded
|
||||
// properties which are used e.g. to display the upload progress bar in the editor
|
||||
// user interface.
|
||||
if (xhr.upload) {
|
||||
xhr.upload.addEventListener("progress", (evt) => {
|
||||
if (evt.lengthComputable) {
|
||||
loader.uploadTotal = evt.total;
|
||||
loader.uploaded = evt.loaded;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// Prepares the data and sends the request.
|
||||
_sendRequest(file) {
|
||||
// Prepare the form data.
|
||||
const data = new FormData();
|
||||
data.append("upload", file);
|
||||
// Important note: This is the right place to implement security mechanisms
|
||||
// like authentication and CSRF protection. For instance, you can use
|
||||
// XMLHttpRequest.setRequestHeader() to set the request headers containing
|
||||
// the CSRF token generated earlier by your application.
|
||||
// Send the request.
|
||||
this.xhr.send(data);
|
||||
}
|
||||
// ...
|
||||
}
|
||||
|
||||
function SimpleUploadAdapterPlugin(editor) {
|
||||
editor.plugins.get("FileRepository").createUploadAdapter = (loader) => {
|
||||
// Configure the URL to the upload script in your back-end here!
|
||||
return new MyUploadAdapter(loader);
|
||||
};
|
||||
}
|
||||
|
||||
var allEditors = document.querySelector('.ck_editor_txt');
|
||||
|
||||
//Initialize the ckeditor
|
||||
ClassicEditor.create(document.querySelector("#teks"), {
|
||||
extraPlugins: [SimpleUploadAdapterPlugin],
|
||||
}).catch((error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
$("#ckeditorForm").submit(function(e) {
|
||||
var content = $('.ck_editor_txt').val();
|
||||
html = $(content).text();
|
||||
if ($.trim(html) == '') {
|
||||
alert("Teks Tidak Boleh Kosong!");
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
//Form add image validation
|
||||
var uploadField = document.getElementById("input_foto_add");
|
||||
uploadField.onchange = function() {
|
||||
if (this.files[0].size > 2000000) {
|
||||
alert("Batas maksimum 2MB!");
|
||||
this.value = "";
|
||||
} else {
|
||||
//Ubah Img Preview
|
||||
var reader = new FileReader();
|
||||
reader.onload = function() {
|
||||
var output = document.getElementById('img_preview_add');
|
||||
output.src = reader.result;
|
||||
}
|
||||
reader.readAsDataURL(event.target.files[0]);
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function(){
|
||||
$('.from-prevent-multiple-submits').on('submit', function(){
|
||||
$('.from-prevent-multiple-submits').attr('disabled','true');
|
||||
})
|
||||
})();
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,232 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Kegiatan Internal Kampus')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Kegiatan Internal Kampus</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
<!-- /.content-header -->
|
||||
|
||||
<!-- Alert Status -->
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('alert'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('alert') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Edit Data Kegiatan Internal Kampus</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<!-- form start -->
|
||||
<form class="from-prevent-multiple-submits"
|
||||
action="{{ route('kegiatan_internal_kampus.update', $kegiatanInternalKampu) }}"
|
||||
method="POST" enctype="multipart/form-data">
|
||||
@method('patch')
|
||||
@csrf
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<label for="judul">Judul</label>
|
||||
<input type="text" class="form-control" id="judul" name="judul"
|
||||
placeholder="Masukkan Judul" maxlength="255"
|
||||
value="{{ $kegiatanInternalKampu->judul }}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="nama_foto">Thumbnail (Maksimal 2MB)</label>
|
||||
<div class="form-group">
|
||||
<img src="{{ url($kegiatanInternalKampu->thumbnail) }}"
|
||||
alt="Image Missing" id="old_nama_foto" style="max-width: 200px;"
|
||||
class="mt-2" />
|
||||
</div>
|
||||
<input type="file" accept="image/*" class="form-control mt-0"
|
||||
name="thumbnail" id="input_foto_edit">
|
||||
<input type="hidden" name="old_thumbnail"
|
||||
value="{{ $kegiatanInternalKampu->thumbnail }}">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="teks">Teks (Foto Maksimal 2MB)</label>
|
||||
<textarea id="teks" placeholder="Masukkan Deskripsi Video"
|
||||
name="teks">{{ $kegiatanInternalKampu->teks }}</textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="release_date">Tanggal Rilis</label>
|
||||
<input type="date" class="form-control" name="release_date"
|
||||
value="{{ $kegiatanInternalKampu->release_date }}" required>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
|
||||
<div class="card-footer">
|
||||
<button id="submit" type="submit"
|
||||
class="btn btn-primary from-prevent-multiple-submits">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
//Define an adapter to upload the files
|
||||
class MyUploadAdapter {
|
||||
constructor(loader) {
|
||||
// The file loader instance to use during the upload. It sounds scary but do not
|
||||
// worry — the loader will be passed into the adapter later on in this guide.
|
||||
this.loader = loader;
|
||||
|
||||
// URL where to send files.
|
||||
this.url = '{{ route('ckeditor.upload') }}';
|
||||
|
||||
//
|
||||
}
|
||||
// Starts the upload process.
|
||||
upload() {
|
||||
return this.loader.file.then(
|
||||
(file) =>
|
||||
new Promise((resolve, reject) => {
|
||||
this._initRequest();
|
||||
this._initListeners(resolve, reject, file);
|
||||
this._sendRequest(file);
|
||||
})
|
||||
);
|
||||
}
|
||||
// Aborts the upload process.
|
||||
abort() {
|
||||
if (this.xhr) {
|
||||
this.xhr.abort();
|
||||
}
|
||||
}
|
||||
// Initializes the XMLHttpRequest object using the URL passed to the constructor.
|
||||
_initRequest() {
|
||||
const xhr = (this.xhr = new XMLHttpRequest());
|
||||
// Note that your request may look different. It is up to you and your editor
|
||||
// integration to choose the right communication channel. This example uses
|
||||
// a POST request with JSON as a data structure but your configuration
|
||||
// could be different.
|
||||
// xhr.open('POST', this.url, true);
|
||||
xhr.open("POST", this.url, true);
|
||||
xhr.setRequestHeader("x-csrf-token", "{{ csrf_token() }}");
|
||||
xhr.responseType = "json";
|
||||
}
|
||||
// Initializes XMLHttpRequest listeners.
|
||||
_initListeners(resolve, reject, file) {
|
||||
const xhr = this.xhr;
|
||||
const loader = this.loader;
|
||||
const genericErrorText = `Couldn't upload file: ${file.name}.`;
|
||||
xhr.addEventListener("error", () => reject(genericErrorText));
|
||||
xhr.addEventListener("abort", () => reject());
|
||||
xhr.addEventListener("load", () => {
|
||||
const response = xhr.response;
|
||||
// This example assumes the XHR server's "response" object will come with
|
||||
// an "error" which has its own "message" that can be passed to reject()
|
||||
// in the upload promise.
|
||||
//
|
||||
// Your integration may handle upload errors in a different way so make sure
|
||||
// it is done properly. The reject() function must be called when the upload fails.
|
||||
if (!response || response.error) {
|
||||
return reject(response && response.error ? response.error.message : genericErrorText);
|
||||
}
|
||||
// If the upload is successful, resolve the upload promise with an object containing
|
||||
// at least the "default" URL, pointing to the image on the server.
|
||||
// This URL will be used to display the image in the content. Learn more in the
|
||||
// UploadAdapter#upload documentation.
|
||||
resolve({
|
||||
default: response.url,
|
||||
});
|
||||
});
|
||||
// Upload progress when it is supported. The file loader has the #uploadTotal and #uploaded
|
||||
// properties which are used e.g. to display the upload progress bar in the editor
|
||||
// user interface.
|
||||
if (xhr.upload) {
|
||||
xhr.upload.addEventListener("progress", (evt) => {
|
||||
if (evt.lengthComputable) {
|
||||
loader.uploadTotal = evt.total;
|
||||
loader.uploaded = evt.loaded;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// Prepares the data and sends the request.
|
||||
_sendRequest(file) {
|
||||
// Prepare the form data.
|
||||
const data = new FormData();
|
||||
data.append("upload", file);
|
||||
// Important note: This is the right place to implement security mechanisms
|
||||
// like authentication and CSRF protection. For instance, you can use
|
||||
// XMLHttpRequest.setRequestHeader() to set the request headers containing
|
||||
// the CSRF token generated earlier by your application.
|
||||
// Send the request.
|
||||
this.xhr.send(data);
|
||||
}
|
||||
// ...
|
||||
}
|
||||
|
||||
function SimpleUploadAdapterPlugin(editor) {
|
||||
editor.plugins.get("FileRepository").createUploadAdapter = (loader) => {
|
||||
// Configure the URL to the upload script in your back-end here!
|
||||
return new MyUploadAdapter(loader);
|
||||
};
|
||||
}
|
||||
|
||||
//Initialize the ckeditor
|
||||
ClassicEditor.create(document.querySelector("#teks"), {
|
||||
extraPlugins: [SimpleUploadAdapterPlugin],
|
||||
}).catch((error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
//Form edit image validation
|
||||
var uploadField = document.getElementById("input_foto_edit");
|
||||
uploadField.onchange = function() {
|
||||
if (this.files[0].size > 2000000) {
|
||||
alert("Batas maksimum 2MB!");
|
||||
this.value = "";
|
||||
} else {
|
||||
//Ubah Img Preview
|
||||
var reader = new FileReader();
|
||||
reader.onload = function() {
|
||||
var output = document.getElementById('old_nama_foto');
|
||||
output.src = reader.result;
|
||||
}
|
||||
reader.readAsDataURL(event.target.files[0]);
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function() {
|
||||
$('.from-prevent-multiple-submits').on('submit', function() {
|
||||
$('.from-prevent-multiple-submits').attr('disabled', 'true');
|
||||
})
|
||||
})();
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,158 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Kegiatan Internal Kampus')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Kegiatan Internal Kampus</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
<!-- /.content-header -->
|
||||
|
||||
<!-- Alert Status -->
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('alert'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('alert') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Data Kegiatan Internal Kampus</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-12 text-left">
|
||||
<a type="button" href="{{ url('/admin/kegiatan_internal_kampus/create') }}"
|
||||
class="btn btn-success mb-3"><i class="fa fa-plus-circle"></i>
|
||||
Tambah Data Kegiatan Internal Kampus
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table id="tabel_kegiatan_internal_kampus" class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nomor</th>
|
||||
<th>Judul</th>
|
||||
<th>Thumbnail</th>
|
||||
<th>Teks</th>
|
||||
<th>Jadwal Rilis</th>
|
||||
<th>Status</th>
|
||||
<th>Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($kegiatanInternalKampus as $kegiatanInternalKampu)
|
||||
<tr>
|
||||
<td>{{ $loop->iteration }}</td>
|
||||
<td>{{ $kegiatanInternalKampu->judul }}</td>
|
||||
<td>
|
||||
<img src="{{ url($kegiatanInternalKampu->thumbnail) }}"
|
||||
alt="Image Missing" style="width: 100px;">
|
||||
</td>
|
||||
<td>
|
||||
@if (strlen(strip_tags($kegiatanInternalKampu->teks)) > 100)
|
||||
{{ str_replace(' ', '', substr(strip_tags($kegiatanInternalKampu->teks), 0, 100) . '...') }}
|
||||
@else
|
||||
{{ str_replace(' ', '', substr(strip_tags($kegiatanInternalKampu->teks), 0, 100)) }}
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ $kegiatanInternalKampu->release_date }}</td>
|
||||
<td>
|
||||
@if ($kegiatanInternalKampu->deleted_at != '')
|
||||
Terhapus
|
||||
@elseif ($kegiatanInternalKampu->release_date > date('Y-m-d'))
|
||||
Belum Rilis
|
||||
@else
|
||||
Rilis
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if ($kegiatanInternalKampu->deleted_at != '')
|
||||
<form
|
||||
action="{{ url('/admin/kegiatan_internal_kampus/' . $kegiatanInternalKampu->id . '/restore') }}"
|
||||
method="post">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-primary"
|
||||
onclick="return confirm('Apakah anda yakin ingin mengembalikan data?')"><i
|
||||
class="fas fa-trash-restore"></i> Restore
|
||||
</button>
|
||||
</form>
|
||||
<form
|
||||
action="{{ url('/admin/kegiatan_internal_kampus/' . $kegiatanInternalKampu->id . '/delete_permanen') }}"
|
||||
method="post">
|
||||
@csrf
|
||||
<input type="hidden" name="thumbnail"
|
||||
value="{{ $kegiatanInternalKampu->thumbnail }}">
|
||||
<button type="submit" class="btn btn-danger"
|
||||
onclick="return confirm('Apakah anda yakin ingin menghapus permanen data?')"><i
|
||||
class="fa fa-trash"></i> Delete Permanent
|
||||
</button>
|
||||
</form>
|
||||
@else
|
||||
<a href="{{ route('kegiatan_internal_kampus.edit', $kegiatanInternalKampu) }}"
|
||||
class="btn btn-warning open-formModalEdit">
|
||||
<i class="fa fa-edit"></i> Edit
|
||||
</a>
|
||||
<form
|
||||
action="{{ route('kegiatan_internal_kampus.destroy', $kegiatanInternalKampu) }}"
|
||||
method="post">
|
||||
@method('delete')
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-danger"
|
||||
onclick="return confirm('Apakah anda yakin ingin menghapus data?')"><i
|
||||
class="fa fa-trash"></i> Delete
|
||||
</button>
|
||||
</form>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<!--Data Table -->
|
||||
<script>
|
||||
$(function() {
|
||||
$("#tabel_kegiatan_internal_kampus").DataTable({
|
||||
"paging": true,
|
||||
"lengthChange": false,
|
||||
"searching": true,
|
||||
"ordering": true,
|
||||
"info": true,
|
||||
"autoWidth": false,
|
||||
"responsive": false,
|
||||
"buttons": ["copy", "csv", "excel", "pdf", "print", "colvis"]
|
||||
}).buttons().container().appendTo('#tabel_kegiatan_internal_kampus_wrapper .col-md-6:eq(0)');
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,299 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Kemitraan')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Kemitraan</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
|
||||
<!-- Alert Status -->
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('alert'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('alert') }}
|
||||
</div>
|
||||
@endif
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Data Kemitraan</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-12 text-left">
|
||||
<a type="button" href="#formModalAdd" data-toggle="modal"
|
||||
class="btn btn-success mb-3"><i class="fa fa-plus-circle"></i>
|
||||
Tambah Data Kemitraan
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table id="tabel_kemitraan" class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nomor</th>
|
||||
<th>Foto</th>
|
||||
<th>Jadwal Rilis</th>
|
||||
<th>Status</th>
|
||||
<th>Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($kemitraans as $kemitraan)
|
||||
<tr>
|
||||
<td>{{ $loop->iteration }}</td>
|
||||
<td><img src="{{ url($kemitraan->nama_foto) }}"
|
||||
style="width:300px;height:auto;object-fit:cover"></td>
|
||||
<td>{{ $kemitraan->release_date }}</td>
|
||||
@if ($kemitraan->deleted_at == '')
|
||||
@if ($kemitraan->release_date <= date('Y-m-d'))
|
||||
<td>Rilis</td>
|
||||
@else
|
||||
<td>Belum Rilis</td>
|
||||
@endif
|
||||
@else ($kemitraan->deleted_at != "")
|
||||
<td>Terhapus</td>
|
||||
@endif
|
||||
@if ($kemitraan->deleted_at == '')
|
||||
<td>
|
||||
<button href="#formModalEdit" role="button" data-toggle="modal"
|
||||
data-id="{{ $kemitraan->id }}"
|
||||
data-teks="{{ $kemitraan->teks }}"
|
||||
data-nama_foto="{{ url($kemitraan->nama_foto) }}"
|
||||
data-sumber="{{ $kemitraan->sumber }}"
|
||||
data-release_date="{{ $kemitraan->release_date }}"
|
||||
class="btn btn-warning open-formModalEdit"><i
|
||||
class="fa fa-edit"></i> Edit</button>
|
||||
<form action="{{ route('kemitraan.destroy', $kemitraan) }}"
|
||||
method="post">
|
||||
@method('delete')
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-danger"
|
||||
onclick="return confirm('Apakah anda yakin ingin menghapus data?')"><i
|
||||
class="fa fa-trash"></i> Delete</button>
|
||||
</form>
|
||||
</td>
|
||||
@else
|
||||
<td>
|
||||
<form
|
||||
action="{{ url('/admin/kemitraan/' . $kemitraan->id . '/restore') }}"
|
||||
method="post">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-primary"
|
||||
onclick="return confirm('Apakah anda yakin ingin mengembalikan data?')"><i
|
||||
class="fas fa-trash-restore"></i> Restore
|
||||
</button>
|
||||
</form>
|
||||
<form
|
||||
action="{{ url('/admin/kemitraan/' . $kemitraan->id . '/delete') }}"
|
||||
method="post">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-danger"
|
||||
onclick="return confirm('Apakah anda yakin ingin menghapus permanen data?')"><i
|
||||
class="fa fa-trash"></i> Delete Permanent
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<!-- Modal Add -->
|
||||
<div class="modal fade" id="formModalAdd" tabindex="-1" aria-labelledby="formModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="formModalLabel">Tambah Data Kemitraan</h5>
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal" aria-label="Close">X</button>
|
||||
</div>
|
||||
<form id="formAdd" action="{{ url('/admin/kemitraan') }}" method="post" enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
<label for="nama_foto">Foto (Maksimal 2MB)</label>
|
||||
<div class="form-group">
|
||||
<img id="img_preview_add" style="max-width: 200px;" class="mt-2" />
|
||||
</div>
|
||||
<input type="file" accept="image/*" class="form-control mt-0" name="nama_foto"
|
||||
id="input_foto_add" required>
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="release_date">Jadwal Rilis</label>
|
||||
<input type="date" class="form-control mt-0" name="release_date" required>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal"
|
||||
aria-label="Close">Batal</button>
|
||||
<button type="submit" class="btn btn-primary">Tambah Data</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@foreach ($kemitraans as $kemitraan)
|
||||
<!-- Modal Edit -->
|
||||
<div class="modal fade" id="formModalEdit" tabindex="-1" aria-labelledby="formModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="formModalLabel">Ubah Data Kemitraan</h5>
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal" aria-label="Close">X</button>
|
||||
</div>
|
||||
<form id="formEdit" action="{{ route('kemitraan.update', $kemitraan->id) }}" method="POST"
|
||||
enctype="multipart/form-data">
|
||||
@method('patch')
|
||||
@csrf
|
||||
<div class="modal-body">
|
||||
<input type="hidden" name="id" id="id">
|
||||
<div class="form-group">
|
||||
<label for="nama_foto">Foto (Maksimal 2MB)</label>
|
||||
<div class="form-group">
|
||||
<img src="" alt="Image Missing" id="old_nama_foto" style="max-width: 200px;"
|
||||
class="mt-2" />
|
||||
</div>
|
||||
<input type="file" accept="image/*" class="form-control mt-0" name="nama_foto"
|
||||
id="input_foto_edit">
|
||||
</div>
|
||||
|
||||
<div class="form-group mt-2">
|
||||
<label for="release_date">Jadwal Rilis</label>
|
||||
<input type="date" class="form-control mt-0" name="release_date" id="release_date" required>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal"
|
||||
aria-label="Close">Batal</button>
|
||||
<button type="submit" class="btn btn-primary">Ubah Data</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
|
||||
<script type="text/javascript">
|
||||
var $formAdd = $("#formAdd");
|
||||
$formAdd.submit(function(){
|
||||
$formAdd.submit(function(){
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var $formEdit = $("#formEdit");
|
||||
$formEdit.submit(function(){
|
||||
$formEdit.submit(function(){
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<!--Data Table -->
|
||||
<script>
|
||||
$(function() {
|
||||
$("#tabel_kemitraan").DataTable({
|
||||
"paging": true,
|
||||
"lengthChange": false,
|
||||
"searching": true,
|
||||
"ordering": true,
|
||||
"info": true,
|
||||
"autoWidth": false,
|
||||
"responsive": false,
|
||||
"buttons": ["copy", "csv", "excel", "pdf", "print", "colvis"]
|
||||
}).buttons().container().appendTo('#tabel_kemitraan_wrapper .col-md-6:eq(0)');
|
||||
});
|
||||
|
||||
$(document).on("click", ".open-formModalEdit", function() {
|
||||
var id = $(this).data('id');
|
||||
var teks = $(this).data('teks');
|
||||
var sumber = $(this).data('sumber');
|
||||
var nama_foto = $(this).data('nama_foto');
|
||||
var release_date = $(this).data('release_date');
|
||||
|
||||
$(".modal-body #id").val(id);
|
||||
$(".modal-body #teks").val(teks);
|
||||
$(".modal-body #sumber").val(sumber);
|
||||
$(".modal-body #release_date").val(release_date);
|
||||
$(".modal-body #input_foto_edit").val("");
|
||||
$(".modal-body #old_nama_foto").attr('src', nama_foto);
|
||||
});
|
||||
|
||||
//Form add image validation
|
||||
var uploadField = document.getElementById("input_foto_add");
|
||||
uploadField.onchange = function() {
|
||||
if (this.files[0].size > 2000000) {
|
||||
alert("Batas maksimum 2MB!");
|
||||
this.value = "";
|
||||
} else {
|
||||
//Ubah Img Preview
|
||||
var reader = new FileReader();
|
||||
reader.onload = function() {
|
||||
var output = document.getElementById('img_preview_add');
|
||||
output.src = reader.result;
|
||||
}
|
||||
reader.readAsDataURL(event.target.files[0]);
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
//Form edit image validation
|
||||
var uploadField = document.getElementById("input_foto_edit");
|
||||
uploadField.onchange = function() {
|
||||
if (this.files[0].size > 2000000) {
|
||||
alert("Batas maksimum 2MB!");
|
||||
this.value = "";
|
||||
} else {
|
||||
//Ubah Img Preview
|
||||
var reader = new FileReader();
|
||||
reader.onload = function() {
|
||||
var output = document.getElementById('old_nama_foto');
|
||||
output.src = reader.result;
|
||||
}
|
||||
reader.readAsDataURL(event.target.files[0]);
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function(){
|
||||
$('.from-prevent-multiple-submits').on('submit', function(){
|
||||
$('.from-prevent-multiple-submits').attr('disabled','true');
|
||||
})
|
||||
})();
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,234 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Kerjasama Mitra Kolaborasi')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Kerjasama Mitra Kolaborasi</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
<!-- /.content-header -->
|
||||
|
||||
<!-- Alert Status -->
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('alert'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('alert') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Tambah Data Kerjasama Mitra Kolaborasi</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<!-- form start -->
|
||||
<form class="from-prevent-multiple-submits" action="{{ route('kerjasama_mitra_kolaborasi.store') }}" method="POST"
|
||||
id="ckeditorForm" enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<label for="judul">Judul</label>
|
||||
<input type="text" class="form-control" id="judul" name="judul"
|
||||
placeholder="Masukkan Judul" value="" required maxlength="255">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="nama_foto">Thumbnail (Maksimal 2MB)</label>
|
||||
<div class="form-group">
|
||||
<img id="img_preview_add" style="max-width: 200px;"
|
||||
class="mt-2" />
|
||||
</div>
|
||||
<input type="file" accept="image/*" class="form-control mt-0"
|
||||
name="thumbnail" id="input_foto_add" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="teks">Teks (Foto Maksimal 2MB)</label>
|
||||
<textarea id="teks" placeholder="Masukkan Teks" name="teks"
|
||||
class="ck_editor_txt" id="ck_editor_txt"></textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="release_date">Tanggal Rilis</label>
|
||||
<input type="date" class="form-control" name="release_date" required>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
|
||||
<div class="card-footer">
|
||||
<button id="submit" type="submit" class="btn btn-primary from-prevent-multiple-submits">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
//Define an adapter to upload the files
|
||||
class MyUploadAdapter {
|
||||
constructor(loader) {
|
||||
// The file loader instance to use during the upload. It sounds scary but do not
|
||||
// worry — the loader will be passed into the adapter later on in this guide.
|
||||
this.loader = loader;
|
||||
|
||||
// URL where to send files.
|
||||
this.url = '{{ route('ckeditor.upload') }}';
|
||||
|
||||
//
|
||||
}
|
||||
// Starts the upload process.
|
||||
upload() {
|
||||
return this.loader.file.then(
|
||||
(file) =>
|
||||
new Promise((resolve, reject) => {
|
||||
this._initRequest();
|
||||
this._initListeners(resolve, reject, file);
|
||||
this._sendRequest(file);
|
||||
})
|
||||
);
|
||||
}
|
||||
// Aborts the upload process.
|
||||
abort() {
|
||||
if (this.xhr) {
|
||||
this.xhr.abort();
|
||||
}
|
||||
}
|
||||
// Initializes the XMLHttpRequest object using the URL passed to the constructor.
|
||||
_initRequest() {
|
||||
const xhr = (this.xhr = new XMLHttpRequest());
|
||||
// Note that your request may look different. It is up to you and your editor
|
||||
// integration to choose the right communication channel. This example uses
|
||||
// a POST request with JSON as a data structure but your configuration
|
||||
// could be different.
|
||||
// xhr.open('POST', this.url, true);
|
||||
xhr.open("POST", this.url, true);
|
||||
xhr.setRequestHeader("x-csrf-token", "{{ csrf_token() }}");
|
||||
xhr.responseType = "json";
|
||||
}
|
||||
// Initializes XMLHttpRequest listeners.
|
||||
_initListeners(resolve, reject, file) {
|
||||
const xhr = this.xhr;
|
||||
const loader = this.loader;
|
||||
const genericErrorText = `Couldn't upload file: ${file.name}.`;
|
||||
xhr.addEventListener("error", () => reject(genericErrorText));
|
||||
xhr.addEventListener("abort", () => reject());
|
||||
xhr.addEventListener("load", () => {
|
||||
const response = xhr.response;
|
||||
// This example assumes the XHR server's "response" object will come with
|
||||
// an "error" which has its own "message" that can be passed to reject()
|
||||
// in the upload promise.
|
||||
//
|
||||
// Your integration may handle upload errors in a different way so make sure
|
||||
// it is done properly. The reject() function must be called when the upload fails.
|
||||
if (!response || response.error) {
|
||||
return reject(response && response.error ? response.error.message : genericErrorText);
|
||||
}
|
||||
// If the upload is successful, resolve the upload promise with an object containing
|
||||
// at least the "default" URL, pointing to the image on the server.
|
||||
// This URL will be used to display the image in the content. Learn more in the
|
||||
// UploadAdapter#upload documentation.
|
||||
resolve({
|
||||
default: response.url,
|
||||
});
|
||||
});
|
||||
// Upload progress when it is supported. The file loader has the #uploadTotal and #uploaded
|
||||
// properties which are used e.g. to display the upload progress bar in the editor
|
||||
// user interface.
|
||||
if (xhr.upload) {
|
||||
xhr.upload.addEventListener("progress", (evt) => {
|
||||
if (evt.lengthComputable) {
|
||||
loader.uploadTotal = evt.total;
|
||||
loader.uploaded = evt.loaded;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// Prepares the data and sends the request.
|
||||
_sendRequest(file) {
|
||||
// Prepare the form data.
|
||||
const data = new FormData();
|
||||
data.append("upload", file);
|
||||
// Important note: This is the right place to implement security mechanisms
|
||||
// like authentication and CSRF protection. For instance, you can use
|
||||
// XMLHttpRequest.setRequestHeader() to set the request headers containing
|
||||
// the CSRF token generated earlier by your application.
|
||||
// Send the request.
|
||||
this.xhr.send(data);
|
||||
}
|
||||
// ...
|
||||
}
|
||||
|
||||
function SimpleUploadAdapterPlugin(editor) {
|
||||
editor.plugins.get("FileRepository").createUploadAdapter = (loader) => {
|
||||
// Configure the URL to the upload script in your back-end here!
|
||||
return new MyUploadAdapter(loader);
|
||||
};
|
||||
}
|
||||
|
||||
var allEditors = document.querySelector('.ck_editor_txt');
|
||||
|
||||
//Initialize the ckeditor
|
||||
ClassicEditor.create(document.querySelector("#teks"), {
|
||||
extraPlugins: [SimpleUploadAdapterPlugin],
|
||||
}).catch((error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
$("#ckeditorForm").submit(function(e) {
|
||||
var content = $('.ck_editor_txt').val();
|
||||
html = $(content).text();
|
||||
if ($.trim(html) == '') {
|
||||
alert("Teks Tidak Boleh Kosong!");
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
//Form add image validation
|
||||
var uploadField = document.getElementById("input_foto_add");
|
||||
uploadField.onchange = function() {
|
||||
if (this.files[0].size > 2000000) {
|
||||
alert("Batas maksimum 2MB!");
|
||||
this.value = "";
|
||||
} else {
|
||||
//Ubah Img Preview
|
||||
var reader = new FileReader();
|
||||
reader.onload = function() {
|
||||
var output = document.getElementById('img_preview_add');
|
||||
output.src = reader.result;
|
||||
}
|
||||
reader.readAsDataURL(event.target.files[0]);
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function(){
|
||||
$('.from-prevent-multiple-submits').on('submit', function(){
|
||||
$('.from-prevent-multiple-submits').attr('disabled','true');
|
||||
})
|
||||
})();
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,230 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Kerjasma Mitra Kolaborasi')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Kerjasma Mitra Kolaborasi</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
<!-- /.content-header -->
|
||||
|
||||
<!-- Alert Status -->
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('alert'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('alert') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Edit Data Kerjasma Mitra Kolaborasi</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<!-- form start -->
|
||||
<form
|
||||
action="{{ route('kerjasama_mitra_kolaborasi.update', $kerjasamaMitraKolaborasi) }}"
|
||||
method="POST" enctype="multipart/form-data">
|
||||
@method('patch')
|
||||
@csrf
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<label for="judul">Judul</label>
|
||||
<input type="text" class="form-control" id="judul" name="judul"
|
||||
placeholder="Masukkan Judul" maxlength="255"
|
||||
value="{{ $kerjasamaMitraKolaborasi->judul }}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="nama_foto">Thumbnail (Maksimal 2MB)</label>
|
||||
<div class="form-group">
|
||||
<img src="{{ url($kerjasamaMitraKolaborasi->thumbnail) }}"
|
||||
alt="Image Missing" id="old_nama_foto" style="max-width: 200px;"
|
||||
class="mt-2" />
|
||||
</div>
|
||||
<input type="file" accept="image/*" class="form-control mt-0"
|
||||
name="thumbnail" id="input_foto_edit">
|
||||
<input type="hidden" name="old_thumbnail"
|
||||
value="{{ $kerjasamaMitraKolaborasi->thumbnail }}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="teks">Teks (Foto Maksimal 2MB)</label>
|
||||
<textarea id="teks" placeholder="Masukkan Deskripsi Video"
|
||||
name="teks">{{ $kerjasamaMitraKolaborasi->teks }}</textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="release_date">Tanggal Rilis</label>
|
||||
<input type="date" class="form-control" name="release_date"
|
||||
value="{{ $kerjasamaMitraKolaborasi->release_date }}" required>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
|
||||
<div class="card-footer">
|
||||
<button id="submit" type="submit"
|
||||
class="btn btn-primary from-prevent-multiple-submits">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
//Define an adapter to upload the files
|
||||
class MyUploadAdapter {
|
||||
constructor(loader) {
|
||||
// The file loader instance to use during the upload. It sounds scary but do not
|
||||
// worry — the loader will be passed into the adapter later on in this guide.
|
||||
this.loader = loader;
|
||||
|
||||
// URL where to send files.
|
||||
this.url = '{{ route('ckeditor.upload') }}';
|
||||
|
||||
//
|
||||
}
|
||||
// Starts the upload process.
|
||||
upload() {
|
||||
return this.loader.file.then(
|
||||
(file) =>
|
||||
new Promise((resolve, reject) => {
|
||||
this._initRequest();
|
||||
this._initListeners(resolve, reject, file);
|
||||
this._sendRequest(file);
|
||||
})
|
||||
);
|
||||
}
|
||||
// Aborts the upload process.
|
||||
abort() {
|
||||
if (this.xhr) {
|
||||
this.xhr.abort();
|
||||
}
|
||||
}
|
||||
// Initializes the XMLHttpRequest object using the URL passed to the constructor.
|
||||
_initRequest() {
|
||||
const xhr = (this.xhr = new XMLHttpRequest());
|
||||
// Note that your request may look different. It is up to you and your editor
|
||||
// integration to choose the right communication channel. This example uses
|
||||
// a POST request with JSON as a data structure but your configuration
|
||||
// could be different.
|
||||
// xhr.open('POST', this.url, true);
|
||||
xhr.open("POST", this.url, true);
|
||||
xhr.setRequestHeader("x-csrf-token", "{{ csrf_token() }}");
|
||||
xhr.responseType = "json";
|
||||
}
|
||||
// Initializes XMLHttpRequest listeners.
|
||||
_initListeners(resolve, reject, file) {
|
||||
const xhr = this.xhr;
|
||||
const loader = this.loader;
|
||||
const genericErrorText = `Couldn't upload file: ${file.name}.`;
|
||||
xhr.addEventListener("error", () => reject(genericErrorText));
|
||||
xhr.addEventListener("abort", () => reject());
|
||||
xhr.addEventListener("load", () => {
|
||||
const response = xhr.response;
|
||||
// This example assumes the XHR server's "response" object will come with
|
||||
// an "error" which has its own "message" that can be passed to reject()
|
||||
// in the upload promise.
|
||||
//
|
||||
// Your integration may handle upload errors in a different way so make sure
|
||||
// it is done properly. The reject() function must be called when the upload fails.
|
||||
if (!response || response.error) {
|
||||
return reject(response && response.error ? response.error.message : genericErrorText);
|
||||
}
|
||||
// If the upload is successful, resolve the upload promise with an object containing
|
||||
// at least the "default" URL, pointing to the image on the server.
|
||||
// This URL will be used to display the image in the content. Learn more in the
|
||||
// UploadAdapter#upload documentation.
|
||||
resolve({
|
||||
default: response.url,
|
||||
});
|
||||
});
|
||||
// Upload progress when it is supported. The file loader has the #uploadTotal and #uploaded
|
||||
// properties which are used e.g. to display the upload progress bar in the editor
|
||||
// user interface.
|
||||
if (xhr.upload) {
|
||||
xhr.upload.addEventListener("progress", (evt) => {
|
||||
if (evt.lengthComputable) {
|
||||
loader.uploadTotal = evt.total;
|
||||
loader.uploaded = evt.loaded;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// Prepares the data and sends the request.
|
||||
_sendRequest(file) {
|
||||
// Prepare the form data.
|
||||
const data = new FormData();
|
||||
data.append("upload", file);
|
||||
// Important note: This is the right place to implement security mechanisms
|
||||
// like authentication and CSRF protection. For instance, you can use
|
||||
// XMLHttpRequest.setRequestHeader() to set the request headers containing
|
||||
// the CSRF token generated earlier by your application.
|
||||
// Send the request.
|
||||
this.xhr.send(data);
|
||||
}
|
||||
// ...
|
||||
}
|
||||
|
||||
function SimpleUploadAdapterPlugin(editor) {
|
||||
editor.plugins.get("FileRepository").createUploadAdapter = (loader) => {
|
||||
// Configure the URL to the upload script in your back-end here!
|
||||
return new MyUploadAdapter(loader);
|
||||
};
|
||||
}
|
||||
|
||||
//Initialize the ckeditor
|
||||
ClassicEditor.create(document.querySelector("#teks"), {
|
||||
extraPlugins: [SimpleUploadAdapterPlugin],
|
||||
}).catch((error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
//Form edit image validation
|
||||
var uploadField = document.getElementById("input_foto_edit");
|
||||
uploadField.onchange = function() {
|
||||
if (this.files[0].size > 2000000) {
|
||||
alert("Batas maksimum 2MB!");
|
||||
this.value = "";
|
||||
} else {
|
||||
//Ubah Img Preview
|
||||
var reader = new FileReader();
|
||||
reader.onload = function() {
|
||||
var output = document.getElementById('old_nama_foto');
|
||||
output.src = reader.result;
|
||||
}
|
||||
reader.readAsDataURL(event.target.files[0]);
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function() {
|
||||
$('.from-prevent-multiple-submits').on('submit', function() {
|
||||
$('.from-prevent-multiple-submits').attr('disabled', 'true');
|
||||
})
|
||||
})();
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,158 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Kerjasama Mitra Kolaborasi')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Kerjasama Mitra Kolaborasi</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
<!-- /.content-header -->
|
||||
|
||||
<!-- Alert Status -->
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('alert'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('alert') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Data Kerjasama Mitra Kolaborasi</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-12 text-left">
|
||||
<a type="button" href="{{ url('/admin/kerjasama_mitra_kolaborasi/create') }}"
|
||||
class="btn btn-success mb-3"><i class="fa fa-plus-circle"></i>
|
||||
Tambah Data Kerjasama Mitra Kolaborasi
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table id="tabel_kerjasama_mitra_kolaborasi" class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nomor</th>
|
||||
<th>Judul</th>
|
||||
<th>Thumbnail</th>
|
||||
<th>Teks</th>
|
||||
<th>Jadwal Rilis</th>
|
||||
<th>Status</th>
|
||||
<th>Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($kerjasamaMitraKolaborasis as $kerjasamaMitraKolaborasi)
|
||||
<tr>
|
||||
<td>{{ $loop->iteration }}</td>
|
||||
<td>{{ $kerjasamaMitraKolaborasi->judul }}</td>
|
||||
<td>
|
||||
<img src="{{ url($kerjasamaMitraKolaborasi->thumbnail) }}"
|
||||
alt="Image Missing" style="width: 100px;">
|
||||
</td>
|
||||
<td>
|
||||
@if (strlen(strip_tags($kerjasamaMitraKolaborasi->teks)) > 100)
|
||||
{{ str_replace(' ', '', substr(strip_tags($kerjasamaMitraKolaborasi->teks), 0, 100) . '...') }}
|
||||
@else
|
||||
{{ str_replace(' ', '', substr(strip_tags($kerjasamaMitraKolaborasi->teks), 0, 100)) }}
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ $kerjasamaMitraKolaborasi->release_date }}</td>
|
||||
<td>
|
||||
@if ($kerjasamaMitraKolaborasi->deleted_at != '')
|
||||
Terhapus
|
||||
@elseif ($kerjasamaMitraKolaborasi->release_date > date('Y-m-d'))
|
||||
Belum Rilis
|
||||
@else
|
||||
Rilis
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if ($kerjasamaMitraKolaborasi->deleted_at != '')
|
||||
<form
|
||||
action="{{ url('/admin/kerjasama_mitra_kolaborasi/' . $kerjasamaMitraKolaborasi->id . '/restore') }}"
|
||||
method="post">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-primary"
|
||||
onclick="return confirm('Apakah anda yakin ingin mengembalikan data?')"><i
|
||||
class="fas fa-trash-restore"></i> Restore
|
||||
</button>
|
||||
</form>
|
||||
<form
|
||||
action="{{ url('/admin/kerjasama_mitra_kolaborasi/' . $kerjasamaMitraKolaborasi->id . '/delete_permanen') }}"
|
||||
method="post">
|
||||
@csrf
|
||||
<input type="hidden" name="thumbnail"
|
||||
value="{{ $kerjasamaMitraKolaborasi->thumbnail }}">
|
||||
<button type="submit" class="btn btn-danger"
|
||||
onclick="return confirm('Apakah anda yakin ingin menghapus permanen data?')"><i
|
||||
class="fa fa-trash"></i> Delete Permanent
|
||||
</button>
|
||||
</form>
|
||||
@else
|
||||
<a href="{{ route('kerjasama_mitra_kolaborasi.edit', $kerjasamaMitraKolaborasi) }}"
|
||||
class="btn btn-warning open-formModalEdit">
|
||||
<i class="fa fa-edit"></i> Edit
|
||||
</a>
|
||||
<form
|
||||
action="{{ route('kerjasama_mitra_kolaborasi.destroy', $kerjasamaMitraKolaborasi) }}"
|
||||
method="post">
|
||||
@method('delete')
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-danger"
|
||||
onclick="return confirm('Apakah anda yakin ingin menghapus data?')"><i
|
||||
class="fa fa-trash"></i> Delete
|
||||
</button>
|
||||
</form>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<!--Data Table -->
|
||||
<script>
|
||||
$(function() {
|
||||
$("#tabel_kerjasama_mitra_kolaborasi").DataTable({
|
||||
"paging": true,
|
||||
"lengthChange": false,
|
||||
"searching": true,
|
||||
"ordering": true,
|
||||
"info": true,
|
||||
"autoWidth": false,
|
||||
"responsive": false,
|
||||
"buttons": ["copy", "csv", "excel", "pdf", "print", "colvis"]
|
||||
}).buttons().container().appendTo('#tabel_kerjasama_mitra_kolaborasi_wrapper .col-md-6:eq(0)');
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,153 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Kontak')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Kontak</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
|
||||
<!-- Alert Status -->
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('alert'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('alert') }}
|
||||
</div>
|
||||
@endif
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Edit Menu Kontak</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<!-- form start -->
|
||||
<form class="from-prevent-multiple-submits" action="{{ route('kontak.update', $kontak->id) }}" method="POST">
|
||||
@method('patch')
|
||||
@csrf
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<label for="email">Email</label>
|
||||
<input type="text" class="form-control" id="email" name="email"
|
||||
value="{{ $kontak->email }}" required maxlength="255">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="fax">Fax</label>
|
||||
<input type="text" class="form-control" id="fax" name="fax"
|
||||
value="{{ $kontak->fax }}" required maxlength="255">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="alamat">Alamat</label>
|
||||
<input type="text" class="form-control" id="alamat" name="alamat"
|
||||
value="{{ $kontak->alamat }}" required maxlength="255">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="nomor_telepon">Nomor Telepon</label>
|
||||
<input type="number" class="form-control" id="nomor_telepon"
|
||||
name="nomor_telepon" value="{{ $kontak->nomor_telepon }}" required
|
||||
maxlength="255">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="youtube">Nama Channel Youtube</label>
|
||||
<input type="text" class="form-control" id="youtube" name="youtube"
|
||||
value="{{ $kontak->youtube }}" maxlength="255">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="url_youtube">Link Channel Youtube</label>
|
||||
<input type="text" class="form-control" id="url_youtube"
|
||||
name="url_youtube" value="{{ $kontak->url_youtube }}" maxlength="255">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="twitter">Nama Pengguna Twitter</label>
|
||||
<input type="text" class="form-control" id="twitter" name="twitter"
|
||||
value="{{ $kontak->twitter }}" maxlength="255">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="url_twitter">Link Twitter</label>
|
||||
<input type="text" class="form-control" id="url_twitter"
|
||||
name="url_twitter" value="{{ $kontak->url_twitter }}"
|
||||
maxlength="255">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="facebook">Nama Pengguna Facebook</label>
|
||||
<input type="text" class="form-control" id="facebook" name="facebook"
|
||||
value="{{ $kontak->facebook }}" maxlength="255">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="url_facebook">Link Facebook</label>
|
||||
<input type="text" class="form-control" id="url_facebook"
|
||||
name="url_facebook" value="{{ $kontak->url_facebook }}"
|
||||
maxlength="255">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="instagram">Nama Pengguna Instagram</label>
|
||||
<input type="text" class="form-control" id="instagram" name="instagram"
|
||||
value="{{ $kontak->instagram }}" maxlength="255">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="url_instagram">Link Instagram</label>
|
||||
<input type="text" class="form-control" id="url_instagram"
|
||||
name="url_instagram" value="{{ $kontak->url_instagram }}"
|
||||
maxlength="255">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="whatsapp">Nomor Whatsapp</label>
|
||||
<div class="row">
|
||||
<input type="text" value="+62" readonly
|
||||
class="form-control ml-2 col-lg-2">
|
||||
<input type="number" class="form-control mt-0 ml-2 col-lg-9"
|
||||
id="whatsapp" name="whatsapp" value="{{ $kontak->whatsapp }}"
|
||||
maxlength="255">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
|
||||
<div class="card-footer">
|
||||
<button id="submit" type="submit" class="btn btn-primary from-prevent-multiple-submits">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,246 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Kurikulum')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Kurikulum</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
|
||||
<!-- Alert Status -->
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('alert'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('alert') }}
|
||||
</div>
|
||||
@endif
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Data Kurikulum</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-12 text-left">
|
||||
<a type="button" href="#formModalAdd" data-toggle="modal"
|
||||
class="btn btn-success mb-3"><i class="fa fa-plus-circle"></i>
|
||||
Tambah Data Kurikulum
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table id="tabel_kurikulum" class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nomor</th>
|
||||
<th>Nama Prodi</th>
|
||||
<th>Strata</th>
|
||||
<th>Link Kurikulum</th>
|
||||
<th>Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($kurikulums as $kurikulum)
|
||||
<tr>
|
||||
<td>{{ $loop->iteration }}</td>
|
||||
<td>{{ $kurikulum->nama }}</td>
|
||||
<td>{{ $kurikulum->strata }}</td>
|
||||
<td>
|
||||
<a href="{{ $kurikulum->url }}">{{ $kurikulum->url }}</a>
|
||||
</td>
|
||||
@if ($kurikulum->deleted_at == '')
|
||||
<td>
|
||||
<button href="#formModalEdit" role="button" data-toggle="modal"
|
||||
data-id="{{ $kurikulum->id }}"
|
||||
data-nama="{{ $kurikulum->nama }}"
|
||||
data-strata="{{ $kurikulum->strata }}"
|
||||
data-url="{{ $kurikulum->url }}"
|
||||
class="btn btn-warning open-formModalEdit"><i
|
||||
class="fa fa-edit"></i> Edit</button>
|
||||
<form action="{{ route('kurikulum.destroy', $kurikulum) }}"
|
||||
method="post">
|
||||
@method('delete')
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-danger"
|
||||
onclick="return confirm('Apakah anda yakin ingin menghapus data?')"><i
|
||||
class="fa fa-trash"></i> Delete</button>
|
||||
</form>
|
||||
</td>
|
||||
@else
|
||||
<td>
|
||||
<form
|
||||
action="{{ url('/admin/kurikulum/' . $kurikulum->id . '/restore') }}"
|
||||
method="post">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-primary"
|
||||
onclick="return confirm('Apakah anda yakin ingin mengembalikan data?')"><i
|
||||
class="fas fa-trash-restore"></i> Restore
|
||||
</button>
|
||||
</form>
|
||||
<form
|
||||
action="{{ url('/admin/kurikulum/' . $kurikulum->id . '/delete') }}"
|
||||
method="post">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-danger"
|
||||
onclick="return confirm('Apakah anda yakin ingin menghapus permanen data?')"><i
|
||||
class="fa fa-trash"></i> Delete Permanent
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<!-- Modal Add -->
|
||||
<div class="modal fade" id="formModalAdd" tabindex="-1" aria-labelledby="formModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="formModalLabel">Tambah Data Kurikulum</h5>
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal" aria-label="Close">X</button>
|
||||
</div>
|
||||
<form id="formAdd" action="{{ url('/admin/kurikulum') }}" method="post">
|
||||
@csrf
|
||||
<div class="modal-body">
|
||||
<div class="form-group mt-2">
|
||||
<label for="nama">Nama Prodi</label>
|
||||
<input type="text" class="form-control mt-0" name="nama" required maxlength="255"
|
||||
placeholder=". . .">
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="strata">Strata</label>
|
||||
<input type="text" class="form-control mt-0" name="strata" required maxlength="10"
|
||||
placeholder=". . .">
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="url">Link Kurikulum</label>
|
||||
<input type="text" class="form-control mt-0" name="url" required placeholder=". . .">
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal"
|
||||
aria-label="Close">Batal</button>
|
||||
<button type="submit" class="btn btn-primary">Tambah Data</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@foreach ($kurikulums as $kurikulum)
|
||||
<!-- Modal Edit -->
|
||||
<div class="modal fade" id="formModalEdit" tabindex="-1" aria-labelledby="formModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="formModalLabel">Ubah Data Kurikulum</h5>
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal" aria-label="Close">X</button>
|
||||
</div>
|
||||
<form id="formEdit" action="{{ route('kurikulum.update', $kurikulum->id) }}" method="POST">
|
||||
@method('patch')
|
||||
@csrf
|
||||
<div class="modal-body">
|
||||
<input type="hidden" name="id" id="id">
|
||||
<div class="form-group mt-2">
|
||||
<label for="nama">Nama Prodi</label>
|
||||
<input type="text" class="form-control mt-0" name="nama" id="nama" required maxlength="255"
|
||||
placeholder=". . .">
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="strata">Strata</label>
|
||||
<input type="text" class="form-control mt-0" name="strata" id="strata" required
|
||||
maxlength="10" placeholder=". . .">
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="url">Link Kurikulum</label>
|
||||
<input type="text" class="form-control mt-0" name="url" id="url" required
|
||||
placeholder=". . .">
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal"
|
||||
aria-label="Close">Batal</button>
|
||||
<button type="submit" class="btn btn-primary">Ubah Data</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
|
||||
<script type="text/javascript">
|
||||
var $formAdd = $("#formAdd");
|
||||
$formAdd.submit(function() {
|
||||
$formAdd.submit(function() {
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var $formEdit = $("#formEdit");
|
||||
$formEdit.submit(function() {
|
||||
$formEdit.submit(function() {
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<!--Data Table -->
|
||||
<script>
|
||||
$(function() {
|
||||
$("#tabel_kurikulum").DataTable({
|
||||
"paging": true,
|
||||
"lengthChange": false,
|
||||
"searching": true,
|
||||
"ordering": true,
|
||||
"info": true,
|
||||
"autoWidth": false,
|
||||
"responsive": false,
|
||||
"buttons": ["copy", "csv", "excel", "pdf", "print", "colvis"]
|
||||
}).buttons().container().appendTo('#tabel_kurikulum_wrapper .col-md-6:eq(0)');
|
||||
});
|
||||
|
||||
$(document).on("click", ".open-formModalEdit", function() {
|
||||
var id = $(this).data('id');
|
||||
var nama = $(this).data('nama');
|
||||
var strata = $(this).data('strata');
|
||||
var url = $(this).data('url');
|
||||
|
||||
$(".modal-body #id").val(id);
|
||||
$(".modal-body #nama").val(nama);
|
||||
$(".modal-body #strata").val(strata);
|
||||
$(".modal-body #url").val(url);
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,221 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Layanan Mahasiswa')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Layanan Mahasiswa</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Tambah Data Layanan Mahasiswa</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<!-- form start -->
|
||||
<form class="from-prevent-multiple-submits" action="{{ route('layanan_mahasiswa.store') }}" method="POST" id="ckeditorForm"
|
||||
enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<label for="judul">Judul</label>
|
||||
<input type="text" class="form-control" id="judul" name="judul"
|
||||
placeholder="Masukkan Judul" value="" required maxlength="255">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="nama_foto">Thumbnail (Maksimal 2MB)</label>
|
||||
<div class="form-group">
|
||||
<img id="img_preview_add" style="max-width: 200px;"
|
||||
class="mt-2" />
|
||||
</div>
|
||||
<input type="file" accept="image/*" class="form-control mt-0"
|
||||
name="thumbnail" id="input_foto_add" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="teks">Teks (Foto Maksimal 2MB)</label>
|
||||
<textarea id="teks" placeholder="Masukkan Teks Layanan Mahasiswa"
|
||||
name="teks" class="ck_editor_txt" id="ck_editor_txt"></textarea>
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="release_date">Tanggal Rilis</label>
|
||||
<input type="date" class="form-control mt-0" name="release_date" required>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
|
||||
<div class="card-footer">
|
||||
<button id="submit" type="submit" class="btn btn-primary from-prevent-multiple-submits">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
//Define an adapter to upload the files
|
||||
class MyUploadAdapter {
|
||||
constructor(loader) {
|
||||
// The file loader instance to use during the upload. It sounds scary but do not
|
||||
// worry — the loader will be passed into the adapter later on in this guide.
|
||||
this.loader = loader;
|
||||
|
||||
// URL where to send files.
|
||||
this.url = '{{ route('ckeditor.upload') }}';
|
||||
|
||||
//
|
||||
}
|
||||
// Starts the upload process.
|
||||
upload() {
|
||||
return this.loader.file.then(
|
||||
(file) =>
|
||||
new Promise((resolve, reject) => {
|
||||
this._initRequest();
|
||||
this._initListeners(resolve, reject, file);
|
||||
this._sendRequest(file);
|
||||
})
|
||||
);
|
||||
}
|
||||
// Aborts the upload process.
|
||||
abort() {
|
||||
if (this.xhr) {
|
||||
this.xhr.abort();
|
||||
}
|
||||
}
|
||||
// Initializes the XMLHttpRequest object using the URL passed to the constructor.
|
||||
_initRequest() {
|
||||
const xhr = (this.xhr = new XMLHttpRequest());
|
||||
// Note that your request may look different. It is up to you and your editor
|
||||
// integration to choose the right communication channel. This example uses
|
||||
// a POST request with JSON as a data structure but your configuration
|
||||
// could be different.
|
||||
// xhr.open('POST', this.url, true);
|
||||
xhr.open("POST", this.url, true);
|
||||
xhr.setRequestHeader("x-csrf-token", "{{ csrf_token() }}");
|
||||
xhr.responseType = "json";
|
||||
}
|
||||
// Initializes XMLHttpRequest listeners.
|
||||
_initListeners(resolve, reject, file) {
|
||||
const xhr = this.xhr;
|
||||
const loader = this.loader;
|
||||
const genericErrorText = `Couldn't upload file: ${file.name}.`;
|
||||
xhr.addEventListener("error", () => reject(genericErrorText));
|
||||
xhr.addEventListener("abort", () => reject());
|
||||
xhr.addEventListener("load", () => {
|
||||
const response = xhr.response;
|
||||
// This example assumes the XHR server's "response" object will come with
|
||||
// an "error" which has its own "message" that can be passed to reject()
|
||||
// in the upload promise.
|
||||
//
|
||||
// Your integration may handle upload errors in a different way so make sure
|
||||
// it is done properly. The reject() function must be called when the upload fails.
|
||||
if (!response || response.error) {
|
||||
return reject(response && response.error ? response.error.message : genericErrorText);
|
||||
}
|
||||
// If the upload is successful, resolve the upload promise with an object containing
|
||||
// at least the "default" URL, pointing to the image on the server.
|
||||
// This URL will be used to display the image in the content. Learn more in the
|
||||
// UploadAdapter#upload documentation.
|
||||
resolve({
|
||||
default: response.url,
|
||||
});
|
||||
});
|
||||
// Upload progress when it is supported. The file loader has the #uploadTotal and #uploaded
|
||||
// properties which are used e.g. to display the upload progress bar in the editor
|
||||
// user interface.
|
||||
if (xhr.upload) {
|
||||
xhr.upload.addEventListener("progress", (evt) => {
|
||||
if (evt.lengthComputable) {
|
||||
loader.uploadTotal = evt.total;
|
||||
loader.uploaded = evt.loaded;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// Prepares the data and sends the request.
|
||||
_sendRequest(file) {
|
||||
// Prepare the form data.
|
||||
const data = new FormData();
|
||||
data.append("upload", file);
|
||||
// Important note: This is the right place to implement security mechanisms
|
||||
// like authentication and CSRF protection. For instance, you can use
|
||||
// XMLHttpRequest.setRequestHeader() to set the request headers containing
|
||||
// the CSRF token generated earlier by your application.
|
||||
// Send the request.
|
||||
this.xhr.send(data);
|
||||
}
|
||||
// ...
|
||||
}
|
||||
|
||||
function SimpleUploadAdapterPlugin(editor) {
|
||||
editor.plugins.get("FileRepository").createUploadAdapter = (loader) => {
|
||||
// Configure the URL to the upload script in your back-end here!
|
||||
return new MyUploadAdapter(loader);
|
||||
};
|
||||
}
|
||||
|
||||
var allEditors = document.querySelector('.ck_editor_txt');
|
||||
|
||||
//Initialize the ckeditor
|
||||
ClassicEditor.create(document.querySelector("#teks"), {
|
||||
extraPlugins: [SimpleUploadAdapterPlugin],
|
||||
}).catch((error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
$("#ckeditorForm").submit(function(e) {
|
||||
var content = $('.ck_editor_txt').val();
|
||||
html = $(content).text();
|
||||
if ($.trim(html) == '') {
|
||||
alert("Teks Tidak Boleh Kosong!");
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
//Form add image validation
|
||||
var uploadField = document.getElementById("input_foto_add");
|
||||
uploadField.onchange = function() {
|
||||
if (this.files[0].size > 2000000) {
|
||||
alert("Batas maksimum 2MB!");
|
||||
this.value = "";
|
||||
} else {
|
||||
//Ubah Img Preview
|
||||
var reader = new FileReader();
|
||||
reader.onload = function() {
|
||||
var output = document.getElementById('img_preview_add');
|
||||
output.src = reader.result;
|
||||
}
|
||||
reader.readAsDataURL(event.target.files[0]);
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function(){
|
||||
$('.from-prevent-multiple-submits').on('submit', function(){
|
||||
$('.from-prevent-multiple-submits').attr('disabled','true');
|
||||
})
|
||||
})();
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,227 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Layanan Mahasiswa')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Layanan Mahasiswa</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
<!-- /.content-header -->
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Edit Data Layanan Mahasiswa</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<!-- form start -->
|
||||
<form class="from-prevent-multiple-submits"
|
||||
action="{{ route('layanan_mahasiswa.update', $layananMahasiswa) }}"
|
||||
method="POST" enctype="multipart/form-data">
|
||||
@method('patch')
|
||||
@csrf
|
||||
<div class="card-body">
|
||||
<input type="hidden" value="{{ $layananMahasiswa->id }}" name="id">
|
||||
<div class="form-group">
|
||||
<label for="judul">Judul</label>
|
||||
<input type="text" class="form-control" id="judul" name="judul"
|
||||
maxlength="255" placeholder="Masukkan Judul"
|
||||
value="{{ $layananMahasiswa->judul }}" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="nama_foto">Thumbnail (Maksimal 2MB)</label>
|
||||
<div class="form-group">
|
||||
<img src="{{ url($layananMahasiswa->thumbnail) }}"
|
||||
alt="Image Missing" id="old_nama_foto" style="max-width: 200px;"
|
||||
class="mt-2" />
|
||||
</div>
|
||||
<input type="file" accept="image/*" class="form-control mt-0"
|
||||
name="thumbnail" id="input_foto_edit">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="teks">Teks (Foto Maksimal 2MB)</label>
|
||||
<textarea id="teks" placeholder="Masukkan Deskripsi"
|
||||
name="teks">{{ $layananMahasiswa->teks }}</textarea>
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="release_date">Tanggal Rilis</label>
|
||||
<input type="date" class="form-control mt-0" name="release_date"
|
||||
value="{{ $layananMahasiswa->release_date }}" required>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
|
||||
<div class="card-footer">
|
||||
<button id="submit" type="submit"
|
||||
class="btn btn-primary from-prevent-multiple-submits">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
//Define an adapter to upload the files
|
||||
class MyUploadAdapter {
|
||||
constructor(loader) {
|
||||
// The file loader instance to use during the upload. It sounds scary but do not
|
||||
// worry — the loader will be passed into the adapter later on in this guide.
|
||||
this.loader = loader;
|
||||
|
||||
// URL where to send files.
|
||||
this.url = '{{ route('ckeditor.upload') }}';
|
||||
|
||||
//
|
||||
}
|
||||
// Starts the upload process.
|
||||
upload() {
|
||||
return this.loader.file.then(
|
||||
(file) =>
|
||||
new Promise((resolve, reject) => {
|
||||
this._initRequest();
|
||||
this._initListeners(resolve, reject, file);
|
||||
this._sendRequest(file);
|
||||
})
|
||||
);
|
||||
}
|
||||
// Aborts the upload process.
|
||||
abort() {
|
||||
if (this.xhr) {
|
||||
this.xhr.abort();
|
||||
}
|
||||
}
|
||||
// Initializes the XMLHttpRequest object using the URL passed to the constructor.
|
||||
_initRequest() {
|
||||
const xhr = (this.xhr = new XMLHttpRequest());
|
||||
// Note that your request may look different. It is up to you and your editor
|
||||
// integration to choose the right communication channel. This example uses
|
||||
// a POST request with JSON as a data structure but your configuration
|
||||
// could be different.
|
||||
// xhr.open('POST', this.url, true);
|
||||
xhr.open("POST", this.url, true);
|
||||
xhr.setRequestHeader("x-csrf-token", "{{ csrf_token() }}");
|
||||
xhr.responseType = "json";
|
||||
}
|
||||
// Initializes XMLHttpRequest listeners.
|
||||
_initListeners(resolve, reject, file) {
|
||||
const xhr = this.xhr;
|
||||
const loader = this.loader;
|
||||
const genericErrorText = `Couldn't upload file: ${file.name}.`;
|
||||
xhr.addEventListener("error", () => reject(genericErrorText));
|
||||
xhr.addEventListener("abort", () => reject());
|
||||
xhr.addEventListener("load", () => {
|
||||
const response = xhr.response;
|
||||
// This example assumes the XHR server's "response" object will come with
|
||||
// an "error" which has its own "message" that can be passed to reject()
|
||||
// in the upload promise.
|
||||
//
|
||||
// Your integration may handle upload errors in a different way so make sure
|
||||
// it is done properly. The reject() function must be called when the upload fails.
|
||||
if (!response || response.error) {
|
||||
return reject(response && response.error ? response.error.message : genericErrorText);
|
||||
}
|
||||
// If the upload is successful, resolve the upload promise with an object containing
|
||||
// at least the "default" URL, pointing to the image on the server.
|
||||
// This URL will be used to display the image in the content. Learn more in the
|
||||
// UploadAdapter#upload documentation.
|
||||
resolve({
|
||||
default: response.url,
|
||||
});
|
||||
});
|
||||
// Upload progress when it is supported. The file loader has the #uploadTotal and #uploaded
|
||||
// properties which are used e.g. to display the upload progress bar in the editor
|
||||
// user interface.
|
||||
if (xhr.upload) {
|
||||
xhr.upload.addEventListener("progress", (evt) => {
|
||||
if (evt.lengthComputable) {
|
||||
loader.uploadTotal = evt.total;
|
||||
loader.uploaded = evt.loaded;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// Prepares the data and sends the request.
|
||||
_sendRequest(file) {
|
||||
// Prepare the form data.
|
||||
const data = new FormData();
|
||||
data.append("upload", file);
|
||||
// Important note: This is the right place to implement security mechanisms
|
||||
// like authentication and CSRF protection. For instance, you can use
|
||||
// XMLHttpRequest.setRequestHeader() to set the request headers containing
|
||||
// the CSRF token generated earlier by your application.
|
||||
// Send the request.
|
||||
this.xhr.send(data);
|
||||
}
|
||||
// ...
|
||||
}
|
||||
|
||||
function SimpleUploadAdapterPlugin(editor) {
|
||||
editor.plugins.get("FileRepository").createUploadAdapter = (loader) => {
|
||||
// Configure the URL to the upload script in your back-end here!
|
||||
return new MyUploadAdapter(loader);
|
||||
};
|
||||
}
|
||||
|
||||
//Initialize the ckeditor
|
||||
ClassicEditor.create(document.querySelector("#teks"), {
|
||||
extraPlugins: [SimpleUploadAdapterPlugin],
|
||||
}).catch((error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
$("#ckeditorForm").submit(function(e) {
|
||||
var content = $('.ck_editor_txt').val();
|
||||
html = $(content).text();
|
||||
if ($.trim(html) == '') {
|
||||
alert("Teks Tidak Boleh Kosong!");
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
//Form edit image validation
|
||||
var uploadField = document.getElementById("input_foto_edit");
|
||||
uploadField.onchange = function() {
|
||||
if (this.files[0].size > 2000000) {
|
||||
alert("Batas maksimum 2MB!");
|
||||
this.value = "";
|
||||
} else {
|
||||
//Ubah Img Preview
|
||||
var reader = new FileReader();
|
||||
reader.onload = function() {
|
||||
var output = document.getElementById('old_nama_foto');
|
||||
output.src = reader.result;
|
||||
}
|
||||
reader.readAsDataURL(event.target.files[0]);
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function() {
|
||||
$('.from-prevent-multiple-submits').on('submit', function() {
|
||||
$('.from-prevent-multiple-submits').attr('disabled', 'true');
|
||||
})
|
||||
})();
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,155 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Layanan Mahasiswa')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Layanan Mahasiswa</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
<!-- /.content-header -->
|
||||
|
||||
<!-- Alert Status -->
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('alert'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('alert') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Data Layanan Mahasiswa</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-12 text-left">
|
||||
<a href="{{ url('/admin/layanan_mahasiswa/create') }}" type="button"
|
||||
class="btn btn-success mb-3">
|
||||
<i class="fa fa-plus-circle mr-2"></i>Tambah Data
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table id="tabel_layanan_mahasiswa" class="table table-bordered table-striped mt-2">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>No</th>
|
||||
<th>Judul</th>
|
||||
<th>Thumbnail</th>
|
||||
<th>Teks</th>
|
||||
<th>Jadwal Rilis</th>
|
||||
<th>Status</th>
|
||||
<th>Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@foreach ($layananMahasiswas as $layananMahasiswa)
|
||||
<tr id="{{ $layananMahasiswa->id }}">
|
||||
<td>{{ $loop->iteration }}</td>
|
||||
<td>{{ $layananMahasiswa->judul }}</td>
|
||||
<td><img src="{{ url($layananMahasiswa->thumbnail) }}"
|
||||
style="width:100px">
|
||||
</td>
|
||||
<td>
|
||||
@if (strlen(strip_tags($layananMahasiswa->teks)) > 100)
|
||||
{{ str_replace(' ', '', substr(strip_tags($layananMahasiswa->teks), 0, 100) . '...') }}
|
||||
@else
|
||||
{{ str_replace(' ', '', substr(strip_tags($layananMahasiswa->teks), 0, 100)) }}
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ $layananMahasiswa->release_date }}</td>
|
||||
@if ($layananMahasiswa->deleted_at == '')
|
||||
@if ($layananMahasiswa->release_date <= date('Y-m-d'))
|
||||
<td>Rilis</td>
|
||||
@else
|
||||
<td>Belum Rilis</td>
|
||||
@endif
|
||||
@else
|
||||
($layananMahasiswa->deleted_at != "")
|
||||
<td>Terhapus</td>
|
||||
@endif
|
||||
@if ($layananMahasiswa->deleted_at == '')
|
||||
<td>
|
||||
<a href="{{ route('layanan_mahasiswa.edit', $layananMahasiswa) }}"
|
||||
class="btn btn-warning open-formModalEdit"><i
|
||||
class="fa fa-edit"></i> Edit</a>
|
||||
<form
|
||||
action="{{ route('layanan_mahasiswa.destroy', $layananMahasiswa) }}"
|
||||
method="post">
|
||||
@method('delete')
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-danger"
|
||||
onclick="return confirm('Apakah anda yakin ingin menghapus data?')"><i
|
||||
class="fa fa-trash"></i> Delete</button>
|
||||
</form>
|
||||
</td>
|
||||
@else
|
||||
<td>
|
||||
<form
|
||||
action="{{ url('/admin/layanan_mahasiswa/' . $layananMahasiswa->id . '/restore') }}"
|
||||
method="post">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-primary"
|
||||
onclick="return confirm('Apakah anda yakin ingin mengembalikan data?')"><i
|
||||
class="fas fa-trash-restore"></i> Restore
|
||||
</button>
|
||||
</form>
|
||||
<form
|
||||
action="{{ url('/admin/layanan_mahasiswa/' . $layananMahasiswa->id . '/delete') }}"
|
||||
method="post">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-danger"
|
||||
onclick="return confirm('Apakah anda yakin ingin menghapus permanen data?')"><i
|
||||
class="fa fa-trash"></i> Delete Permanent
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<!--Data Table -->
|
||||
<script>
|
||||
$(function() {
|
||||
$("#tabel_layanan_mahasiswa").DataTable({
|
||||
"paging": true,
|
||||
"lengthChange": false,
|
||||
"searching": true,
|
||||
"ordering": true,
|
||||
"info": true,
|
||||
"autoWidth": false,
|
||||
"responsive": false,
|
||||
"buttons": ["copy", "csv", "excel", "pdf", "print", "colvis"]
|
||||
}).buttons().container().appendTo('#tabel_layanan_mahasiswa_wrapper .col-md-6:eq(0)');
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,712 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<style>
|
||||
.space-maju {
|
||||
margin-left: 15px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>@yield('title')</title>
|
||||
<link rel="shortcut icon" href="{{ asset('/admin_template/dist/img/favicon.ico') }}">
|
||||
|
||||
<!-- Google Font: Source Sans Pro -->
|
||||
<link rel="stylesheet"
|
||||
href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700&display=fallback">
|
||||
<!-- Font Awesome -->
|
||||
<link rel="stylesheet" href="{{ url('/admin_template/plugins/fontawesome-free/css/all.min.css') }}">
|
||||
<!-- iCheck -->
|
||||
<link rel="stylesheet" href="{{ url('/admin_template/plugins/icheck-bootstrap/icheck-bootstrap.min.css') }}">
|
||||
<!-- JQVMap -->
|
||||
<link rel="stylesheet" href="{{ url('/admin_template/plugins/jqvmap/jqvmap.min.css') }}">
|
||||
<!-- Theme style -->
|
||||
<link rel="stylesheet" href="{{ url('/admin_template/dist/css/adminlte.min.css') }}">
|
||||
<!-- overlayScrollbars -->
|
||||
<link rel="stylesheet"
|
||||
href="{{ url('/admin_template/plugins/overlayScrollbars/css/OverlayScrollbars.min.css') }}">
|
||||
<!-- DataTables -->
|
||||
<link rel="stylesheet"
|
||||
href="{{ url('/admin_template/plugins/datatables-bs4/css/dataTables.bootstrap4.min.css') }}">
|
||||
<link rel="stylesheet"
|
||||
href="{{ url('/admin_template/plugins/datatables-responsive/css/responsive.bootstrap4.min.css') }}">
|
||||
<link rel="stylesheet"
|
||||
href="{{ url('/admin_template/plugins/datatables-buttons/css/buttons.bootstrap4.min.css') }}">
|
||||
<!-- Webicon -->
|
||||
<link href="{{ url('/images/logo.ico') }}" rel="shortcut icon" type="image/vnd.microsoft.icon" />
|
||||
|
||||
<link rel="stylesheet"
|
||||
href="{{ url('/admin_template/plugins/sweetalert2-theme-bootstrap-4/bootstrap-4.min.css') }}">
|
||||
|
||||
<!-- CK Editor -->
|
||||
<script src="{{ asset('admin_template/ck_editor/build/ckeditor.js') }}"></script>
|
||||
|
||||
<!-- jQuery -->
|
||||
<script src="{{ url('/admin_template/plugins/jquery/jquery.min.js') }}"></script>
|
||||
<!-- jQuery UI 1.11.4 -->
|
||||
<script src="{{ url('/admin_template/plugins/jquery-ui/jquery-ui.min.js') }}"></script>
|
||||
<!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
|
||||
<script>
|
||||
$.widget.bridge('uibutton', $.ui.button)
|
||||
</script>
|
||||
<!-- Bootstrap 4 -->
|
||||
<script src="{{ url('/admin_template/plugins/bootstrap/js/bootstrap.bundle.min.js') }}"></script>
|
||||
<!-- ChartJS -->
|
||||
<script src="{{ url('/admin_template/plugins/chart.js/Chart.min.js') }}"></script>
|
||||
<!-- Sparkline -->
|
||||
<script src="{{ url('/admin_template/plugins/sparklines/sparkline.js') }}"></script>
|
||||
<!-- JQVMap -->
|
||||
<script src="{{ url('/admin_template/plugins/jqvmap/jquery.vmap.min.js') }}"></script>
|
||||
<script src="{{ url('/admin_template/plugins/jqvmap/maps/jquery.vmap.usa.js') }}"></script>
|
||||
<!-- jQuery Knob Chart -->
|
||||
<script src="{{ url('/admin_template/plugins/jquery-knob/jquery.knob.min.js') }}"></script>
|
||||
<!-- overlayScrollbars -->
|
||||
<script src="{{ url('/admin_template/plugins/overlayScrollbars/js/jquery.overlayScrollbars.min.js') }}"></script>
|
||||
<!-- DataTables & Plugins -->
|
||||
<script src="{{ url('/admin_template/plugins/datatables/jquery.dataTables.min.js') }}"></script>
|
||||
<script src="{{ url('/admin_template/plugins/datatables-bs4/js/dataTables.bootstrap4.min.js') }}"></script>
|
||||
<script src="{{ url('/admin_template/plugins/datatables-responsive/js/dataTables.responsive.min.js') }}"></script>
|
||||
<script src="{{ url('/admin_template/plugins/datatables-responsive/js/responsive.bootstrap4.min.js') }}"></script>
|
||||
<script src="{{ url('/admin_template/plugins/datatables-buttons/js/dataTables.buttons.min.js') }}"></script>
|
||||
<script src="{{ url('/admin_template/plugins/datatables-buttons/js/buttons.bootstrap4.min.js') }}"></script>
|
||||
<script src="{{ url('/admin_template/plugins/jszip/jszip.min.js') }}"></script>
|
||||
<script src="{{ url('/admin_template/plugins/pdfmake/pdfmake.min.js') }}"></script>
|
||||
<script src="{{ url('/admin_template/plugins/pdfmake/vfs_fonts.js') }}"></script>
|
||||
<script src="{{ url('/admin_template/plugins/datatables-buttons/js/buttons.html5.min.js') }}"></script>
|
||||
<script src="{{ url('/admin_template/plugins/datatables-buttons/js/buttons.print.min.js') }}"></script>
|
||||
<script src="{{ url('/admin_template/plugins/datatables-buttons/js/buttons.colVis.min.js') }}"></script>
|
||||
<!-- AdminLTE for demo purposes -->
|
||||
<script src="{{ url('/admin_template/dist/js/demo.js') }}"></script>
|
||||
<!-- AdminLTE dashboard demo (This is only for demo purposes) -->
|
||||
<script src="{{ url('/admin_template/dist/js/pages/dashboard.js') }}"></script>
|
||||
<!-- AdminLTE App -->
|
||||
<script src="{{ url('/admin_template/dist/js/adminlte.min.js') }}"></script>
|
||||
|
||||
<script src="{{ url('/admin_template/plugins/sweetalert2/sweetalert2.min.js') }}"></script>
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body class="hold-transition sidebar-mini layout-fixed">
|
||||
<div class="wrapper">
|
||||
|
||||
<!-- Navbar -->
|
||||
<nav class="main-header navbar navbar-expand navbar-white navbar-light">
|
||||
<!-- Left navbar links -->
|
||||
<ul class="navbar-nav">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-widget="pushmenu" href="#" role="button"><i
|
||||
class="fas fa-bars"></i></a>
|
||||
</li>
|
||||
<li class="nav-item d-none d-sm-inline-block">
|
||||
<a href="{{ url('admin/dashboard') }}" class="nav-link">Dashboard</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<!-- Right navbar links -->
|
||||
<ul class="navbar-nav ml-auto">
|
||||
<!-- Navbar Search -->
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-widget="fullscreen" href="#" role="button">
|
||||
<i class="fas fa-expand-arrows-alt"></i>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link" data-toggle="dropdown" href="#">
|
||||
<i class="far fa-user"></i>
|
||||
</a>
|
||||
<div class="dropdown-menu dropdown-menu-md dropdown-menu-right">
|
||||
<span class="dropdown-item dropdown-header"><b>{{ $session_user->name }}</b></span>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a href="{{ url('admin/dashboard') }}" class="dropdown-item dropdown-footer">
|
||||
<i class="fas fa-tachometer-alt fa-sm fa-fw mr-2"></i>
|
||||
Dashboard</a>
|
||||
</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a href="{{ url('admin/logout') }}" class="dropdown-item text-danger dropdown-footer">
|
||||
<i class="fas fa-sign-out-alt fa-sm fa-fw mr-2"></i>
|
||||
Logout</a>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<!-- /.navbar -->
|
||||
|
||||
<!-- Main Sidebar Container -->
|
||||
<aside class="main-sidebar sidebar-dark-primary elevation-4">
|
||||
<!-- Brand Logo -->
|
||||
<div>
|
||||
<a href="{{ url('admin/dashboard') }}" class="brand-link">
|
||||
<img src="{{ url('/images/logo.png') }}" alt="Logo" class="brand-image img-circle elevation-3"
|
||||
style="opacity: .8">
|
||||
<span class="brand-text font-weight-light">Fakultas Teknik</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<!-- Sidebar -->
|
||||
<div class="sidebar">
|
||||
<!-- Sidebar user panel (optional) -->
|
||||
<div class="user-panel mt-3 pb-3 mb-3 d-flex">
|
||||
<div class="image">
|
||||
<img src="{{ url('/images/user.png') }}" class="img-circle elevation-2" alt="User Image">
|
||||
</div>
|
||||
<div class="info">
|
||||
<a href="#" class="d-block">{{ $session_user->name }}</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Sidebar Menu -->
|
||||
<nav class="mt-2 pb-2">
|
||||
<ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu"
|
||||
data-accordion="false">
|
||||
<!-- Add icons to the links using the .nav-icon class
|
||||
with font-awesome or any other icon font library -->
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="{{ url('admin/dashboard') }}"
|
||||
class="nav-link {{ set_active(['dashboard.index']) }}">
|
||||
<i class="nav-icon fas fa-tachometer-alt"></i>
|
||||
<p>
|
||||
Dashboard
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li
|
||||
class="nav-item {{ set_open(['banner.index','quote.index','profil_singkat.index','galeri.index','kemitraan.index','ucapan_selamat_datang.index']) }}">
|
||||
<a href="#"
|
||||
class="nav-link {{ set_active(['banner.index','quote.index','profil_singkat.index','galeri.index','kemitraan.index','ucapan_selamat_datang.index']) }}">
|
||||
<i class="nav-icon fas fa-home"></i>
|
||||
<p>
|
||||
Beranda
|
||||
<i class="right fas fa-angle-left"></i>
|
||||
</p>
|
||||
</a>
|
||||
<ul class="nav nav-treeview space-maju">
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="{{ url('admin/banner') }}"
|
||||
class="nav-link {{ set_active(['banner.index']) }}">
|
||||
<i class="far fa{{ set_dot(['banner.index']) }}-circle nav-icon"></i>
|
||||
<p>Banner</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="{{ url('admin/quote') }}"
|
||||
class="nav-link {{ set_active(['quote.index']) }}">
|
||||
<i class="far fa{{ set_dot(['quote.index']) }}-circle nav-icon"></i>
|
||||
<p>Quote</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="{{ url('admin/profil_singkat') }}"
|
||||
class="nav-link {{ set_active(['profil_singkat.index']) }}">
|
||||
<i class="far fa{{ set_dot(['profil_singkat.index']) }}-circle nav-icon"></i>
|
||||
<p>Profil Singkat</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="{{ url('admin/galeri') }}"
|
||||
class="nav-link {{ set_active(['galeri.index']) }}">
|
||||
<i class="far fa{{ set_dot(['galeri.index']) }}-circle nav-icon"></i>
|
||||
<p>Galeri</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="{{ url('admin/kemitraan') }}"
|
||||
class="nav-link {{ set_active(['kemitraan.index']) }}">
|
||||
<i class="far fa{{ set_dot(['kemitraan.index']) }}-circle nav-icon"></i>
|
||||
<p>Kemitraan</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="{{ url('admin/ucapan_selamat_datang') }}"
|
||||
class="nav-link {{ set_active(['ucapan_selamat_datang.index']) }}">
|
||||
<i
|
||||
class="far fa{{ set_dot(['ucapan_selamat_datang.index']) }}-circle nav-icon"></i>
|
||||
<p>Ucapan Selamat Datang</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li
|
||||
class="nav-item {{ set_open(['sejarah.index','video_profil.index','sambutan_pimpinan_instansi.index','visi_misi.index','struktur_instansi.index','akreditasi.index','kerjasama_mitra_kolaborasi.index','kerjasama_mitra_kolaborasi.create','kerjasama_mitra_kolaborasi.edit']) }}">
|
||||
<a href="#"
|
||||
class="nav-link {{ set_active(['sejarah.index','video_profil.index','sambutan_pimpinan_instansi.index','visi_misi.index','struktur_instansi.index','akreditasi.index','kerjasama_mitra_kolaborasi.index','kerjasama_mitra_kolaborasi.create','kerjasama_mitra_kolaborasi.edit']) }}">
|
||||
<i class="nav-icon fas fa-id-card"></i>
|
||||
<p>
|
||||
Profil
|
||||
<i class="right fas fa-angle-left"></i>
|
||||
</p>
|
||||
</a>
|
||||
<ul class="nav nav-treeview space-maju">
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="{{ url('admin/sejarah') }}"
|
||||
class="nav-link {{ set_active(['sejarah.index']) }}">
|
||||
<i class="far fa{{ set_dot(['sejarah.index']) }}-circle nav-icon"></i>
|
||||
<p>Sejarah</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="{{ url('admin/video_profil') }}"
|
||||
class="nav-link {{ set_active(['video_profil.index']) }}">
|
||||
<i class="far fa{{ set_dot(['video_profil.index']) }}-circle nav-icon"></i>
|
||||
<p>Video Profil</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="{{ url('admin/sambutan_pimpinan_instansi') }}"
|
||||
class="nav-link {{ set_active(['sambutan_pimpinan_instansi.index']) }}">
|
||||
<i
|
||||
class="far fa{{ set_dot(['sambutan_pimpinan_instansi.index']) }}-circle nav-icon"></i>
|
||||
<p>Sambutan Pimpinan Instansi</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="{{ url('admin/visi_misi') }}"
|
||||
class="nav-link {{ set_active(['visi_misi.index']) }}">
|
||||
<i class="far fa{{ set_dot(['visi_misi.index']) }}-circle nav-icon"></i>
|
||||
<p>Visi & Misi</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="{{ url('admin/struktur_instansi') }}"
|
||||
class="nav-link {{ set_active(['struktur_instansi.index']) }}">
|
||||
<i
|
||||
class="far fa{{ set_dot(['struktur_instansi.index']) }}-circle nav-icon"></i>
|
||||
<p>Struktur Instansi</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="{{ url('admin/akreditasi') }}"
|
||||
class="nav-link {{ set_active(['akreditasi.index']) }}">
|
||||
<i class="far fa{{ set_dot(['akreditasi.index']) }}-circle nav-icon"></i>
|
||||
<p>Akreditasi</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="{{ url('admin/kerjasama_mitra_kolaborasi') }}"
|
||||
class="nav-link {{ set_active(['kerjasama_mitra_kolaborasi.index','kerjasama_mitra_kolaborasi.create','kerjasama_mitra_kolaborasi.edit']) }}">
|
||||
<i
|
||||
class="far fa{{ set_dot(['kerjasama_mitra_kolaborasi.index','kerjasama_mitra_kolaborasi.create','kerjasama_mitra_kolaborasi.edit']) }}-circle nav-icon"></i>
|
||||
<p>Kerjasama & Mitra Kolaborasi</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
<li
|
||||
class="nav-item {{ set_open(['kurikulum.index','hasil_karya.index','hasil_karya.edit','hasil_karya.create','kalender_akademik.index','penelitian.index','penelitian.edit','penelitian.create','pengabdian_ke_masyarakat.index','pengabdian_ke_masyarakat.edit','pengabdian_ke_masyarakat.create','jurnal.index','link_prodi.index']) }}">
|
||||
<a href="#"
|
||||
class="nav-link {{ set_active(['kurikulum.index','hasil_karya.index','hasil_karya.edit','hasil_karya.create','kalender_akademik.index','penelitian.index','penelitian.edit','penelitian.create','pengabdian_ke_masyarakat.index','pengabdian_ke_masyarakat.edit','pengabdian_ke_masyarakat.create','jurnal.index','link_prodi.index']) }}">
|
||||
<i class="nav-icon fas fa-school"></i>
|
||||
<p>
|
||||
Akademik
|
||||
<i class="right fas fa-angle-left"></i>
|
||||
</p>
|
||||
</a>
|
||||
<ul class="nav nav-treeview space-maju">
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="{{ url('admin/kurikulum') }}"
|
||||
class="nav-link {{ set_active(['kurikulum.index']) }}">
|
||||
<i class="far fa{{ set_dot(['kurikulum.index']) }}-circle nav-icon"></i>
|
||||
<p>Kurikulum</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="{{ url('admin/hasil_karya') }}"
|
||||
class="nav-link {{ set_active(['hasil_karya.index', 'hasil_karya.edit', 'hasil_karya.create']) }}">
|
||||
<i
|
||||
class="far fa{{ set_dot(['hasil_karya.index', 'hasil_karya.edit', 'hasil_karya.create']) }}-circle nav-icon"></i>
|
||||
<p>Hasil Karya</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="{{ url('admin/kalender_akademik') }}"
|
||||
class="nav-link {{ set_active(['kalender_akademik.index']) }}">
|
||||
<i
|
||||
class="far fa{{ set_dot(['kalender_akademik.index']) }}-circle nav-icon"></i>
|
||||
<p>Kalender Akademik</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="{{ url('admin/penelitian') }}"
|
||||
class="nav-link {{ set_active(['penelitian.index', 'penelitian.edit', 'penelitian.create']) }}">
|
||||
<i
|
||||
class="far fa{{ set_dot(['penelitian.index', 'penelitian.edit', 'penelitian.create']) }}-circle nav-icon"></i>
|
||||
<p>Penelitian</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="{{ url('admin/pengabdian_ke_masyarakat') }}"
|
||||
class="nav-link {{ set_active(['pengabdian_ke_masyarakat.index','pengabdian_ke_masyarakat.edit','pengabdian_ke_masyarakat.create']) }}">
|
||||
<i
|
||||
class="far fa{{ set_dot(['pengabdian_ke_masyarakat.index','pengabdian_ke_masyarakat.edit','pengabdian_ke_masyarakat.create']) }}-circle nav-icon"></i>
|
||||
<p>Pengabdian Kepada Masyarakat</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="{{ url('admin/jurnal') }}"
|
||||
class="nav-link {{ set_active(['jurnal.index']) }}">
|
||||
<i class="far fa{{ set_dot(['jurnal.index']) }}-circle nav-icon"></i>
|
||||
<p>Jurnal</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="{{ url('admin/link_prodi') }}"
|
||||
class="nav-link {{ set_active(['link_prodi.index']) }}">
|
||||
<i class="far fa{{ set_dot(['link_prodi.index']) }}-circle nav-icon"></i>
|
||||
<p>Website Prodi</p>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li
|
||||
class="nav-item {{ set_open(['kegiatan_eksternal_kampus.index','kegiatan_eksternal_kampus.edit','kegiatan_eksternal_kampus.create','kegiatan_internal_kampus.index','kegiatan_internal_kampus.edit','kegiatan_internal_kampus.create','lomba_kompetisi.index','lomba_kompetisi.edit','lomba_kompetisi.create']) }}">
|
||||
<a href="#"
|
||||
class="nav-link {{ set_active(['kegiatan_eksternal_kampus.index','kegiatan_internal_kampus.index','lomba_kompetisi.index','lomba_kompetisi.edit','lomba_kompetisi.create']) }}">
|
||||
<i class="nav-icon fas fa-calendar"></i>
|
||||
<p>
|
||||
Agenda
|
||||
<i class="right fas fa-angle-left"></i>
|
||||
</p>
|
||||
</a>
|
||||
<ul class="nav nav-treeview space-maju">
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="{{ url('admin/kegiatan_eksternal_kampus') }}"
|
||||
class="nav-link {{ set_active(['kegiatan_eksternal_kampus.index','kegiatan_eksternal_kampus.edit','kegiatan_eksternal_kampus.create']) }}">
|
||||
<i
|
||||
class="far fa{{ set_dot(['kegiatan_eksternal_kampus.index','kegiatan_eksternal_kampus.edit','kegiatan_eksternal_kampus.create']) }}-circle nav-icon"></i>
|
||||
<p>Kegiatan Eksternal</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="{{ url('admin/kegiatan_internal_kampus') }}"
|
||||
class="nav-link {{ set_active(['kegiatan_internal_kampus.index','kegiatan_internal_kampus.edit','kegiatan_internal_kampus.create']) }}">
|
||||
<i
|
||||
class="far fa{{ set_dot(['kegiatan_internal_kampus.index','kegiatan_internal_kampus.edit','kegiatan_internal_kampus.create']) }}-circle nav-icon"></i>
|
||||
<p>Kegiatan Internal</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="{{ url('admin/lomba_kompetisi') }}"
|
||||
class="nav-link {{ set_active(['lomba_kompetisi.index', 'lomba_kompetisi.create', 'lomba_kompetisi.edit']) }}">
|
||||
<i
|
||||
class="far fa{{ set_dot(['lomba_kompetisi.index', 'lomba_kompetisi.edit', 'lomba_kompetisi.create']) }}-circle nav-icon"></i>
|
||||
<p>Lomba & Kompetisi</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li
|
||||
class="nav-item {{ set_open(['ukm_mahasiswa.index','ukm_mahasiswa.edit','ukm_mahasiswa.create','himpunan_mahasiswa.index','himpunan_mahasiswa.edit','himpunan_mahasiswa.create','prestasi_aktivitas_mahasiswa.index','prestasi_aktivitas_mahasiswa.edit','prestasi_aktivitas_mahasiswa.create','layanan_mahasiswa.index','layanan_mahasiswa.edit','layanan_mahasiswa.create','informasi_beasiswa.index','informasi_beasiswa.edit','informasi_beasiswa.create']) }}">
|
||||
<a href="#"
|
||||
class="nav-link {{ set_active(['ukm_mahasiswa.index','ukm_mahasiswa.edit','ukm_mahasiswa.create','himpunan_mahasiswa.index','himpunan_mahasiswa.edit','himpunan_mahasiswa.create','prestasi_aktivitas_mahasiswa.index','prestasi_aktivitas_mahasiswa.edit','prestasi_aktivitas_mahasiswa.create','layanan_mahasiswa.index','layanan_mahasiswa.edit','layanan_mahasiswa.create','informasi_beasiswa.index','informasi_beasiswa.edit','informasi_beasiswa.create']) }}">
|
||||
<i class="nav-icon fas fa-user-graduate"></i>
|
||||
<p>
|
||||
Mahasiswa & Alumni
|
||||
<i class="right fas fa-angle-left"></i>
|
||||
</p>
|
||||
</a>
|
||||
<ul class="nav nav-treeview space-maju">
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="{{ url('admin/ukm_mahasiswa') }}"
|
||||
class="nav-link {{ set_active(['ukm_mahasiswa.index', 'ukm_mahasiswa.edit', 'ukm_mahasiswa.create']) }}">
|
||||
<i
|
||||
class="far fa{{ set_dot(['ukm_mahasiswa.index', 'ukm_mahasiswa.edit', 'ukm_mahasiswa.create']) }}-circle nav-icon"></i>
|
||||
<p>UKM Mahasiswa</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="{{ url('admin/himpunan_mahasiswa') }}"
|
||||
class="nav-link {{ set_active(['himpunan_mahasiswa.index', 'himpunan_mahasiswa.edit', 'himpunan_mahasiswa.create']) }}">
|
||||
<i
|
||||
class="far fa{{ set_dot(['himpunan_mahasiswa.index', 'himpunan_mahasiswa.edit', 'himpunan_mahasiswa.create']) }}-circle nav-icon"></i>
|
||||
<p>Himpunan Mahasiswa</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="{{ url('admin/prestasi_aktivitas_mahasiswa') }}"
|
||||
class="nav-link {{ set_active(['prestasi_aktivitas_mahasiswa.index','prestasi_aktivitas_mahasiswa.edit','prestasi_aktivitas_mahasiswa.create']) }}">
|
||||
<i
|
||||
class="far fa{{ set_dot(['prestasi_aktivitas_mahasiswa.index','prestasi_aktivitas_mahasiswa.edit','prestasi_aktivitas_mahasiswa.create']) }}-circle nav-icon"></i>
|
||||
<p>Prestasi & Aktivitas Mahasiswa</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="{{ url('admin/layanan_mahasiswa') }}"
|
||||
class="nav-link {{ set_active(['layanan_mahasiswa.index', 'layanan_mahasiswa.edit', 'layanan_mahasiswa.create']) }}">
|
||||
<i
|
||||
class="far fa{{ set_dot(['layanan_mahasiswa.index', 'layanan_mahasiswa.edit', 'layanan_mahasiswa.create']) }}-circle nav-icon"></i>
|
||||
<p>Layanan Mahasiswa</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="{{ url('admin/informasi_beasiswa') }}"
|
||||
class="nav-link {{ set_active(['informasi_beasiswa.index', 'informasi_beasiswa.edit', 'informasi_beasiswa.create']) }}">
|
||||
<i
|
||||
class="far fa{{ set_dot(['informasi_beasiswa.index', 'informasi_beasiswa.edit', 'informasi_beasiswa.create']) }}-circle nav-icon"></i>
|
||||
<p>Informasi Beasiswa</p>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li
|
||||
class="nav-item {{ set_open(['ruang_perkuliahan.index','ruang_lab.index','ruang_pengelolaan_tata_usaha.index','perpustakaan.index']) }}">
|
||||
<a href="#"
|
||||
class="nav-link {{ set_active(['ruang_perkuliahan.index','ruang_lab.index','ruang_pengelolaan_tata_usaha.index','perpustakaan.index']) }}">
|
||||
<i class="nav-icon fas fa-building"></i>
|
||||
<p>
|
||||
Fasilitas
|
||||
<i class="right fas fa-angle-left"></i>
|
||||
</p>
|
||||
</a>
|
||||
<ul class="nav nav-treeview space-maju">
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="{{ url('admin/ruang_perkuliahan') }}"
|
||||
class="nav-link {{ set_active(['ruang_perkuliahan.index']) }}">
|
||||
<i
|
||||
class="far fa{{ set_dot(['ruang_perkuliahan.index']) }}-circle nav-icon"></i>
|
||||
<p>Ruang Perkuliahan</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="{{ url('admin/ruang_lab') }}"
|
||||
class="nav-link {{ set_active(['ruang_lab.index']) }}">
|
||||
<i class="far fa{{ set_dot(['ruang_lab.index']) }}-circle nav-icon"></i>
|
||||
<p>Ruang Lab</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="{{ url('admin/ruang_pengelolaan_tata_usaha') }}"
|
||||
class="nav-link {{ set_active(['ruang_pengelolaan_tata_usaha.index']) }}">
|
||||
<i
|
||||
class="far fa{{ set_dot(['ruang_pengelolaan_tata_usaha.index']) }}-circle nav-icon"></i>
|
||||
<p>Ruang Pengelolaan & Tata Usaha</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="{{ url('admin/perpustakaan') }}"
|
||||
class="nav-link {{ set_active(['perpustakaan.index']) }}">
|
||||
<i class="far fa{{ set_dot(['perpustakaan.index']) }}-circle nav-icon"></i>
|
||||
<p>Perpustakaan</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li
|
||||
class="nav-item {{ request()->is('admin/berita/' . $berita->id . '/edit') ? 'menu-open' : '' }}{{ set_open(['berita.index', 'berita.create', 'berita.edit', 'blog.index', 'blog.create', 'blog.edit']) }}">
|
||||
<a href="#"
|
||||
class="nav-link {{ request()->is('admin/berita/' . $berita->id . '/edit') ? 'active' : '' }}{{ set_active(['berita.index', 'berita.create', 'berita.edit', 'blog.index', 'blog.create', 'blog.edit']) }}">
|
||||
|
||||
<i class="nav-icon fas fa-newspaper"></i>
|
||||
<p>
|
||||
Berita & Blog
|
||||
<i class="right fas fa-angle-left"></i>
|
||||
</p>
|
||||
</a>
|
||||
<ul class="nav nav-treeview space-maju">
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="{{ url('admin/berita') }}"
|
||||
class="nav-link {{ request()->is('admin/berita/' . $berita->id . '/edit') ? 'active' : '' }} {{ set_active(['berita.index', 'berita.create', 'berita.edit']) }}">
|
||||
<i
|
||||
class="far fa{{ set_dot(['berita.index', 'berita.create', 'berita.edit']) }}{{ request()->is('admin/berita/' . $berita->id . '/edit') ? '-dot' : '' }}-circle nav-icon"></i>
|
||||
|
||||
<p>Berita</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="{{ url('admin/blog') }}"
|
||||
class="nav-link {{ set_active(['blog.index', 'blog.create', 'blog.edit']) }}">
|
||||
<i
|
||||
class="far fa{{ set_dot(['blog.index', 'blog.create', 'blog.edit']) }}-circle nav-icon"></i>
|
||||
|
||||
<p>Blog</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li class="nav-item {{ set_open(['kontak.index', 'staf.index', 'dosen.index']) }}">
|
||||
<a href="#"
|
||||
class="nav-link {{ set_active(['kontak.index', 'staf.index', 'dosen.index']) }}">
|
||||
<i class="nav-icon fas fa-users"></i>
|
||||
<p>
|
||||
Seputar Kampus
|
||||
<i class="right fas fa-angle-left"></i>
|
||||
</p>
|
||||
</a>
|
||||
<ul class="nav nav-treeview space-maju">
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="{{ url('admin/staf') }}"
|
||||
class="nav-link {{ set_active(['staf.index']) }}">
|
||||
<i class="far fa{{ set_dot(['staf.index']) }}-circle nav-icon"></i>
|
||||
<p>Staf</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="{{ url('admin/dosen') }}"
|
||||
class="nav-link {{ set_active(['dosen.index']) }}">
|
||||
<i class="far fa{{ set_dot(['dosen.index']) }}-circle nav-icon"></i>
|
||||
<p>Dosen</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="{{ url('admin/kontak') }}"
|
||||
class="nav-link {{ set_active(['kontak.index']) }}">
|
||||
<i class="far fa{{ set_dot(['kontak.index']) }}-circle nav-icon"></i>
|
||||
<p>
|
||||
Kontak
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="{{ url('admin/aplikasi_integrasi') }}"
|
||||
class="nav-link {{ set_active(['aplikasi_integrasi.index']) }}">
|
||||
<i class="nav-icon fas fa-tablet-alt"></i>
|
||||
<p>
|
||||
Aplikasi Terintegrasi
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
<li
|
||||
class="nav-item {{ set_open(['peraturan_perundang_undangan.index', 'dokumen_akademik.index']) }}">
|
||||
<a href="#"
|
||||
class="nav-link {{ set_active(['peraturan_perundang_undangan.index', 'dokumen_akademik.index']) }}">
|
||||
<i class="nav-icon fas fa-download"></i>
|
||||
<p>
|
||||
Unduhan
|
||||
<i class="right fas fa-angle-left"></i>
|
||||
</p>
|
||||
</a>
|
||||
<ul class="nav nav-treeview space-maju">
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="{{ url('admin/dokumen_akademik') }}"
|
||||
class="nav-link {{ set_active(['dokumen_akademik.index']) }}">
|
||||
<i
|
||||
class="far fa{{ set_dot(['dokumen_akademik.index']) }}-circle nav-icon"></i>
|
||||
<p>Dokumen Akademik</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="{{ url('admin/peraturan_perundang_undangan') }}"
|
||||
class="nav-link {{ set_active(['peraturan_perundang_undangan.index']) }}">
|
||||
<i
|
||||
class="far fa{{ set_dot(['peraturan_perundang_undangan.index']) }}-circle nav-icon"></i>
|
||||
<p>Peraturan & Perundang-undangan</p>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li
|
||||
class="nav-item {{ set_open(['faq.index','faq.edit','faq.create','pertanyaan.index','pertanyaan.edit','pertanyaan.create']) }}">
|
||||
<a href="#"
|
||||
class="nav-link {{ set_active(['faq.index', 'faq.edit', 'faq.create', 'pertanyaan.index']) }}">
|
||||
<i class="nav-icon fas fa-question"></i>
|
||||
<p>
|
||||
Interaksi
|
||||
<i class="right fas fa-angle-left"></i>
|
||||
</p>
|
||||
</a>
|
||||
<ul class="nav nav-treeview space-maju">
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="{{ url('admin/pertanyaan') }}"
|
||||
class="nav-link {{ set_active(['pertanyaan.index']) }}">
|
||||
<i class="far fa{{ set_dot(['pertanyaan.index']) }}-circle nav-icon"></i>
|
||||
<p>Pertanyaan</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="{{ url('admin/faq') }}"
|
||||
class="nav-link {{ set_active(['faq.index', 'faq.edit', 'faq.create']) }}">
|
||||
<i
|
||||
class="far fa{{ set_dot(['faq.index', 'faq.edit', 'faq.create']) }}-circle nav-icon"></i>
|
||||
<p>FAQ</p>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
<!-- /.sidebar-menu -->
|
||||
</div>
|
||||
<!-- /.sidebar -->
|
||||
</aside>
|
||||
|
||||
<!-- Content Wrapper. Contains page content -->
|
||||
@yield('container')
|
||||
<!-- /.content-wrapper -->
|
||||
<footer class="main-footer">
|
||||
|
||||
<div class="float-right d-none d-sm-inline-block">
|
||||
2022 © Jurusan Informatika, Universitas Tanjungpura.
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<!-- Control Sidebar -->
|
||||
<aside class="control-sidebar control-sidebar-dark">
|
||||
<!-- Control sidebar content goes here -->
|
||||
</aside>
|
||||
<!-- /.control-sidebar -->
|
||||
</div>
|
||||
<!-- ./wrapper -->
|
||||
</body>
|
||||
@yield('script')
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,253 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Link Prodi')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Link Prodi</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
|
||||
<!-- Alert Status -->
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('alert'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('alert') }}
|
||||
</div>
|
||||
@endif
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Data Link Prodi</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-12 text-left">
|
||||
<a type="button" href="#formModalAdd" data-toggle="modal"
|
||||
class="btn btn-success mb-3"><i class="fa fa-plus-circle"></i>
|
||||
Tambah Data Link Prodi
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table id="tabel_link_prodi" class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nomor</th>
|
||||
<th>Nama Prodi</th>
|
||||
<th>Link Web Prodi</th>
|
||||
<th>Jadwal Rilis</th>
|
||||
<th>Status</th>
|
||||
<th>Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($linkProdis as $linkProdi)
|
||||
<tr>
|
||||
<td>{{ $loop->iteration }}</td>
|
||||
<td>{{ $linkProdi->nama_prodi }}</td>
|
||||
<td><a href="{{ $linkProdi->url }}">{{ $linkProdi->url }}</a>
|
||||
</td>
|
||||
<td>{{ $linkProdi->release_date }}</td>
|
||||
<td>
|
||||
@if ($linkProdi->deleted_at != '')
|
||||
Terhapus
|
||||
@elseif ($linkProdi->release_date > date('Y-m-d'))
|
||||
Belum Rilis
|
||||
@else
|
||||
Rilis
|
||||
@endif
|
||||
</td>
|
||||
@if ($linkProdi->deleted_at == '')
|
||||
<td>
|
||||
<button href="#formModalEdit" role="button" data-toggle="modal"
|
||||
data-id="{{ $linkProdi->id }}"
|
||||
data-nama_prodi="{{ $linkProdi->nama_prodi }}"
|
||||
data-url="{{ $linkProdi->url }}"
|
||||
data-release_date="{{ $linkProdi->release_date }}"
|
||||
class="btn btn-warning open-formModalEdit"><i
|
||||
class="fa fa-edit"></i> Edit</button>
|
||||
<form action="{{ route('link_prodi.destroy', $linkProdi) }}"
|
||||
method="post">
|
||||
@method('delete')
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-danger"
|
||||
onclick="return confirm('Apakah anda yakin ingin menghapus data?')"><i
|
||||
class="fa fa-trash"></i> Delete</button>
|
||||
</form>
|
||||
</td>
|
||||
@else
|
||||
<td>
|
||||
<form
|
||||
action="{{ url('/admin/link_prodi/' . $linkProdi->id . '/restore') }}"
|
||||
method="post">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-primary"
|
||||
onclick="return confirm('Apakah anda yakin ingin mengembalikan data?')"><i
|
||||
class="fas fa-trash-restore"></i> Restore
|
||||
</button>
|
||||
</form>
|
||||
<form
|
||||
action="{{ url('/admin/link_prodi/' . $linkProdi->id . '/delete') }}"
|
||||
method="post">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-danger"
|
||||
onclick="return confirm('Apakah anda yakin ingin menghapus permanen data?')"><i
|
||||
class="fa fa-trash"></i> Delete Permanent
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<!-- Modal Add -->
|
||||
<div class="modal fade" id="formModalAdd" tabindex="-1" aria-labelledby="formModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="formModalLabel">Tambah Data Link Prodi</h5>
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal" aria-label="Close">X</button>
|
||||
</div>
|
||||
<form id="formAdd" action="{{ url('/admin/link_prodi') }}" method="post">
|
||||
@csrf
|
||||
<div class="modal-body">
|
||||
<div class="form-group mt-2">
|
||||
<label for="nama_prodi">Nama Prodi</label>
|
||||
<input type="text" class="form-control mt-0" name="nama_prodi" required maxlength="255"
|
||||
placeholder=". . .">
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="url">Link Web Prodi</label>
|
||||
<input type="text" class="form-control mt-0" name="url" required maxlength="255"
|
||||
placeholder=". . .">
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="release_date">Jadwal Rilis</label>
|
||||
<input type="date" class="form-control mt-0" name="release_date" required>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal"
|
||||
aria-label="Close">Batal</button>
|
||||
<button type="submit" class="btn btn-primary">Tambah Data</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@foreach ($linkProdis as $linkProdi)
|
||||
<!-- Modal Edit -->
|
||||
<div class="modal fade" id="formModalEdit" tabindex="-1" aria-labelledby="formModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="formModalLabel">Ubah Data Link Prodi</h5>
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal" aria-label="Close">X</button>
|
||||
</div>
|
||||
<form id="formEdit" action="{{ route('link_prodi.update', $linkProdi->id) }}" method="POST">
|
||||
@method('patch')
|
||||
@csrf
|
||||
<div class="modal-body">
|
||||
<input type="hidden" name="id" id="id">
|
||||
<div class="form-group mt-2">
|
||||
<label for="nama_prodi">Nama Prodi</label>
|
||||
<input type="text" class="form-control mt-0" name="nama_prodi" id="nama_prodi" required
|
||||
maxlength="255" placeholder=". . .">
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="url">Link Web Prodi</label>
|
||||
<input type="text" class="form-control mt-0" name="url" id="url" required maxlength="255"
|
||||
placeholder=". . .">
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="release_date">Jadwal Rilis</label>
|
||||
<input type="date" class="form-control mt-0" name="release_date" id="release_date" required>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal"
|
||||
aria-label="Close">Batal</button>
|
||||
<button type="submit" class="btn btn-primary">Ubah Data</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
|
||||
<script type="text/javascript">
|
||||
var $formAdd = $("#formAdd");
|
||||
$formAdd.submit(function() {
|
||||
$formAdd.submit(function() {
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var $formEdit = $("#formEdit");
|
||||
$formEdit.submit(function() {
|
||||
$formEdit.submit(function() {
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<!--Data Table -->
|
||||
<script>
|
||||
$(function() {
|
||||
$("#tabel_link_prodi").DataTable({
|
||||
"paging": true,
|
||||
"lengthChange": false,
|
||||
"searching": true,
|
||||
"ordering": true,
|
||||
"info": true,
|
||||
"autoWidth": false,
|
||||
"responsive": false,
|
||||
"buttons": ["copy", "csv", "excel", "pdf", "print", "colvis"]
|
||||
}).buttons().container().appendTo('#tabel_link_prodi_wrapper .col-md-6:eq(0)');
|
||||
});
|
||||
|
||||
$(document).on("click", ".open-formModalEdit", function() {
|
||||
var id = $(this).data('id');
|
||||
var nama_prodi = $(this).data('nama_prodi');
|
||||
var url = $(this).data('url');
|
||||
var release_date = $(this).data('release_date');
|
||||
|
||||
$(".modal-body #id").val(id);
|
||||
$(".modal-body #nama_prodi").val(nama_prodi);
|
||||
$(".modal-body #url").val(url);
|
||||
$(".modal-body #release_date").val(release_date);
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,80 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Login Admin Fakultas Teknik</title>
|
||||
|
||||
<!-- Google Font: Source Sans Pro -->
|
||||
<link rel="stylesheet"
|
||||
href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700&display=fallback">
|
||||
<!-- Font Awesome -->
|
||||
<link rel="stylesheet" href="{{url('/admin_template/plugins/fontawesome-free/css/all.min.css')}}">
|
||||
<!-- icheck bootstrap -->
|
||||
<link rel="stylesheet" href="{{url('/admin_template/plugins/icheck-bootstrap/icheck-bootstrap.min.css')}}">
|
||||
<!-- Theme style -->
|
||||
<link rel="stylesheet" href="{{url('/admin_template/dist/css/adminlte.min.css')}}">
|
||||
</head>
|
||||
|
||||
<body class="hold-transition login-page">
|
||||
<div class="login-box">
|
||||
<!-- /.login-logo -->
|
||||
<div class="card card-outline card-primary">
|
||||
<div class="card-header text-center">
|
||||
<img src="{{ url('/images/logo.png') }}" alt="Logo" class="brand-image"
|
||||
style="width :10rem;opacity: .8">
|
||||
<p class="h1"><b>Fakultas </b>Teknik</p>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p class="login-box-msg">Halaman Admin Web Fakultas Teknik</p>
|
||||
|
||||
@if (session('alert'))
|
||||
<div class="alert alert-danger">
|
||||
{{session('alert')}}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<form action="{{route('postlogin')}}" method="post">
|
||||
@csrf
|
||||
<div class="input-group mb-3">
|
||||
<input type="email" name="email" class="form-control" placeholder="Email">
|
||||
<div class="input-group-append">
|
||||
<div class="input-group-text">
|
||||
<span class="fas fa-envelope"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-group mb-3">
|
||||
<input type="password" name="password" class="form-control" placeholder="Password">
|
||||
<div class="input-group-append">
|
||||
<div class="input-group-text">
|
||||
<span class="fas fa-lock"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<!-- /.col -->
|
||||
<div class="col-4">
|
||||
<button type="submit" class="btn btn-primary btn-block">Login</button>
|
||||
</div>
|
||||
<!-- /.col -->
|
||||
</div>
|
||||
</form>
|
||||
<!-- /.social-auth-links -->
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
</div>
|
||||
<!-- /.card -->
|
||||
</div>
|
||||
<!-- /.login-box -->
|
||||
|
||||
<!-- jQuery -->
|
||||
<script src="{{url('/admin_template/plugins/jquery/jquery.min.js')}}"></script>
|
||||
<!-- Bootstrap 4 -->
|
||||
<script src="{{url('/admin_template/plugins/bootstrap/js/bootstrap.bundle.min.js')}}"></script>
|
||||
<!-- AdminLTE App -->
|
||||
<script src="{{url('/admin_template/dist/js/adminlte.min.js')}}"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,235 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Lomba & Kompetisi')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Lomba & Kompetisi</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
<!-- /.content-header -->
|
||||
|
||||
<!-- Alert Status -->
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('alert'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('alert') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Tambah Data Lomba & Kompetisi</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<!-- form start -->
|
||||
<form class="from-prevent-multiple-submits" action="{{ route('lomba_kompetisi.store') }}" method="POST" id="ckeditorForm"
|
||||
enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<label for="judul">Judul</label>
|
||||
<input type="text" class="form-control" id="judul" name="judul"
|
||||
placeholder="Masukkan Judul" value="" required maxlength="255">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="nama_foto">Thumbnail (Maksimal 2MB)</label>
|
||||
<div class="form-group">
|
||||
<img id="img_preview_add" style="max-width: 200px;"
|
||||
class="mt-2" />
|
||||
</div>
|
||||
<input type="file" accept="image/*" class="form-control mt-0"
|
||||
name="thumbnail" id="input_foto_add" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="teks">Teks (Foto Maksimal 2MB)</label>
|
||||
<textarea id="teks" placeholder="Masukkan Teks" name="teks"
|
||||
class="ck_editor_txt" id="ck_editor_txt"></textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="release_date">Tanggal Rilis</label>
|
||||
<input type="date" class="form-control" name="release_date" required>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
|
||||
<div class="card-footer">
|
||||
<button id="submit" type="submit" class="btn btn-primary from-prevent-multiple-submits">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
//Define an adapter to upload the files
|
||||
class MyUploadAdapter {
|
||||
constructor(loader) {
|
||||
// The file loader instance to use during the upload. It sounds scary but do not
|
||||
// worry — the loader will be passed into the adapter later on in this guide.
|
||||
this.loader = loader;
|
||||
|
||||
// URL where to send files.
|
||||
this.url = '{{ route('ckeditor.upload') }}';
|
||||
|
||||
//
|
||||
}
|
||||
// Starts the upload process.
|
||||
upload() {
|
||||
return this.loader.file.then(
|
||||
(file) =>
|
||||
new Promise((resolve, reject) => {
|
||||
this._initRequest();
|
||||
this._initListeners(resolve, reject, file);
|
||||
this._sendRequest(file);
|
||||
})
|
||||
);
|
||||
}
|
||||
// Aborts the upload process.
|
||||
abort() {
|
||||
if (this.xhr) {
|
||||
this.xhr.abort();
|
||||
}
|
||||
}
|
||||
// Initializes the XMLHttpRequest object using the URL passed to the constructor.
|
||||
_initRequest() {
|
||||
const xhr = (this.xhr = new XMLHttpRequest());
|
||||
// Note that your request may look different. It is up to you and your editor
|
||||
// integration to choose the right communication channel. This example uses
|
||||
// a POST request with JSON as a data structure but your configuration
|
||||
// could be different.
|
||||
// xhr.open('POST', this.url, true);
|
||||
xhr.open("POST", this.url, true);
|
||||
xhr.setRequestHeader("x-csrf-token", "{{ csrf_token() }}");
|
||||
xhr.responseType = "json";
|
||||
}
|
||||
// Initializes XMLHttpRequest listeners.
|
||||
_initListeners(resolve, reject, file) {
|
||||
const xhr = this.xhr;
|
||||
const loader = this.loader;
|
||||
const genericErrorText = `Couldn't upload file: ${file.name}.`;
|
||||
xhr.addEventListener("error", () => reject(genericErrorText));
|
||||
xhr.addEventListener("abort", () => reject());
|
||||
xhr.addEventListener("load", () => {
|
||||
const response = xhr.response;
|
||||
// This example assumes the XHR server's "response" object will come with
|
||||
// an "error" which has its own "message" that can be passed to reject()
|
||||
// in the upload promise.
|
||||
//
|
||||
// Your integration may handle upload errors in a different way so make sure
|
||||
// it is done properly. The reject() function must be called when the upload fails.
|
||||
if (!response || response.error) {
|
||||
return reject(response && response.error ? response.error.message : genericErrorText);
|
||||
}
|
||||
// If the upload is successful, resolve the upload promise with an object containing
|
||||
// at least the "default" URL, pointing to the image on the server.
|
||||
// This URL will be used to display the image in the content. Learn more in the
|
||||
// UploadAdapter#upload documentation.
|
||||
resolve({
|
||||
default: response.url,
|
||||
});
|
||||
});
|
||||
// Upload progress when it is supported. The file loader has the #uploadTotal and #uploaded
|
||||
// properties which are used e.g. to display the upload progress bar in the editor
|
||||
// user interface.
|
||||
if (xhr.upload) {
|
||||
xhr.upload.addEventListener("progress", (evt) => {
|
||||
if (evt.lengthComputable) {
|
||||
loader.uploadTotal = evt.total;
|
||||
loader.uploaded = evt.loaded;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// Prepares the data and sends the request.
|
||||
_sendRequest(file) {
|
||||
// Prepare the form data.
|
||||
const data = new FormData();
|
||||
data.append("upload", file);
|
||||
// Important note: This is the right place to implement security mechanisms
|
||||
// like authentication and CSRF protection. For instance, you can use
|
||||
// XMLHttpRequest.setRequestHeader() to set the request headers containing
|
||||
// the CSRF token generated earlier by your application.
|
||||
// Send the request.
|
||||
this.xhr.send(data);
|
||||
}
|
||||
// ...
|
||||
}
|
||||
|
||||
function SimpleUploadAdapterPlugin(editor) {
|
||||
editor.plugins.get("FileRepository").createUploadAdapter = (loader) => {
|
||||
// Configure the URL to the upload script in your back-end here!
|
||||
return new MyUploadAdapter(loader);
|
||||
};
|
||||
}
|
||||
|
||||
var allEditors = document.querySelector('.ck_editor_txt');
|
||||
|
||||
//Initialize the ckeditor
|
||||
ClassicEditor.create(document.querySelector("#teks"), {
|
||||
extraPlugins: [SimpleUploadAdapterPlugin],
|
||||
}).catch((error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
$("#ckeditorForm").submit(function(e) {
|
||||
var content = $('.ck_editor_txt').val();
|
||||
html = $(content).text();
|
||||
if ($.trim(html) == '') {
|
||||
alert("Teks Tidak Boleh Kosong!");
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
//Form add image validation
|
||||
var uploadField = document.getElementById("input_foto_add");
|
||||
uploadField.onchange = function() {
|
||||
if (this.files[0].size > 2000000) {
|
||||
alert("Batas maksimum 2MB!");
|
||||
this.value = "";
|
||||
} else {
|
||||
//Ubah Img Preview
|
||||
var reader = new FileReader();
|
||||
reader.onload = function() {
|
||||
var output = document.getElementById('img_preview_add');
|
||||
output.src = reader.result;
|
||||
}
|
||||
reader.readAsDataURL(event.target.files[0]);
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function(){
|
||||
$('.from-prevent-multiple-submits').on('submit', function(){
|
||||
$('.from-prevent-multiple-submits').attr('disabled','true');
|
||||
})
|
||||
})();
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,228 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Lomba & Kompetisi')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Lomba & Kompetisi</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
<!-- /.content-header -->
|
||||
|
||||
<!-- Alert Status -->
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('alert'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('alert') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Edit Data Lomba & Kompetisi</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<!-- form start -->
|
||||
<form class="from-prevent-multiple-submits" action="{{ route('lomba_kompetisi.update', $lombaKompetisi) }}" method="POST"
|
||||
enctype="multipart/form-data">
|
||||
@method('patch')
|
||||
@csrf
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<label for="judul">Judul</label>
|
||||
<input type="text" class="form-control" id="judul" name="judul"
|
||||
placeholder="Masukkan Judul" value="{{ $lombaKompetisi->judul }}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="nama_foto">Thumbnail (Maksimal 2MB)</label>
|
||||
<div class="form-group">
|
||||
<img src="{{ url($lombaKompetisi->thumbnail) }}" alt="Image Missing"
|
||||
id="old_nama_foto" style="max-width: 200px;"
|
||||
class="mt-2" />
|
||||
</div>
|
||||
<input type="file" accept="image/*" class="form-control mt-0"
|
||||
name="thumbnail" id="input_foto_edit">
|
||||
<input type="hidden" name="old_thumbnail"
|
||||
value="{{ $lombaKompetisi->thumbnail }}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="teks">Teks (Foto Maksimal 2MB)</label>
|
||||
<textarea id="teks" placeholder="Masukkan Deskripsi Video"
|
||||
name="teks">{{ $lombaKompetisi->teks }}</textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="release_date">Tanggal Rilis</label>
|
||||
<input type="date" class="form-control" name="release_date"
|
||||
value="{{ $lombaKompetisi->release_date }}" required>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
|
||||
<div class="card-footer">
|
||||
<button id="submit" type="submit" class="btn btn-primary from-prevent-multiple-submits">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
//Define an adapter to upload the files
|
||||
class MyUploadAdapter {
|
||||
constructor(loader) {
|
||||
// The file loader instance to use during the upload. It sounds scary but do not
|
||||
// worry — the loader will be passed into the adapter later on in this guide.
|
||||
this.loader = loader;
|
||||
|
||||
// URL where to send files.
|
||||
this.url = '{{ route('ckeditor.upload') }}';
|
||||
|
||||
//
|
||||
}
|
||||
// Starts the upload process.
|
||||
upload() {
|
||||
return this.loader.file.then(
|
||||
(file) =>
|
||||
new Promise((resolve, reject) => {
|
||||
this._initRequest();
|
||||
this._initListeners(resolve, reject, file);
|
||||
this._sendRequest(file);
|
||||
})
|
||||
);
|
||||
}
|
||||
// Aborts the upload process.
|
||||
abort() {
|
||||
if (this.xhr) {
|
||||
this.xhr.abort();
|
||||
}
|
||||
}
|
||||
// Initializes the XMLHttpRequest object using the URL passed to the constructor.
|
||||
_initRequest() {
|
||||
const xhr = (this.xhr = new XMLHttpRequest());
|
||||
// Note that your request may look different. It is up to you and your editor
|
||||
// integration to choose the right communication channel. This example uses
|
||||
// a POST request with JSON as a data structure but your configuration
|
||||
// could be different.
|
||||
// xhr.open('POST', this.url, true);
|
||||
xhr.open("POST", this.url, true);
|
||||
xhr.setRequestHeader("x-csrf-token", "{{ csrf_token() }}");
|
||||
xhr.responseType = "json";
|
||||
}
|
||||
// Initializes XMLHttpRequest listeners.
|
||||
_initListeners(resolve, reject, file) {
|
||||
const xhr = this.xhr;
|
||||
const loader = this.loader;
|
||||
const genericErrorText = `Couldn't upload file: ${file.name}.`;
|
||||
xhr.addEventListener("error", () => reject(genericErrorText));
|
||||
xhr.addEventListener("abort", () => reject());
|
||||
xhr.addEventListener("load", () => {
|
||||
const response = xhr.response;
|
||||
// This example assumes the XHR server's "response" object will come with
|
||||
// an "error" which has its own "message" that can be passed to reject()
|
||||
// in the upload promise.
|
||||
//
|
||||
// Your integration may handle upload errors in a different way so make sure
|
||||
// it is done properly. The reject() function must be called when the upload fails.
|
||||
if (!response || response.error) {
|
||||
return reject(response && response.error ? response.error.message : genericErrorText);
|
||||
}
|
||||
// If the upload is successful, resolve the upload promise with an object containing
|
||||
// at least the "default" URL, pointing to the image on the server.
|
||||
// This URL will be used to display the image in the content. Learn more in the
|
||||
// UploadAdapter#upload documentation.
|
||||
resolve({
|
||||
default: response.url,
|
||||
});
|
||||
});
|
||||
// Upload progress when it is supported. The file loader has the #uploadTotal and #uploaded
|
||||
// properties which are used e.g. to display the upload progress bar in the editor
|
||||
// user interface.
|
||||
if (xhr.upload) {
|
||||
xhr.upload.addEventListener("progress", (evt) => {
|
||||
if (evt.lengthComputable) {
|
||||
loader.uploadTotal = evt.total;
|
||||
loader.uploaded = evt.loaded;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// Prepares the data and sends the request.
|
||||
_sendRequest(file) {
|
||||
// Prepare the form data.
|
||||
const data = new FormData();
|
||||
data.append("upload", file);
|
||||
// Important note: This is the right place to implement security mechanisms
|
||||
// like authentication and CSRF protection. For instance, you can use
|
||||
// XMLHttpRequest.setRequestHeader() to set the request headers containing
|
||||
// the CSRF token generated earlier by your application.
|
||||
// Send the request.
|
||||
this.xhr.send(data);
|
||||
}
|
||||
// ...
|
||||
}
|
||||
|
||||
function SimpleUploadAdapterPlugin(editor) {
|
||||
editor.plugins.get("FileRepository").createUploadAdapter = (loader) => {
|
||||
// Configure the URL to the upload script in your back-end here!
|
||||
return new MyUploadAdapter(loader);
|
||||
};
|
||||
}
|
||||
|
||||
//Initialize the ckeditor
|
||||
ClassicEditor.create(document.querySelector("#teks"), {
|
||||
extraPlugins: [SimpleUploadAdapterPlugin],
|
||||
}).catch((error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
//Form edit image validation
|
||||
var uploadField = document.getElementById("input_foto_edit");
|
||||
uploadField.onchange = function() {
|
||||
if (this.files[0].size > 2000000) {
|
||||
alert("Batas maksimum 2MB!");
|
||||
this.value = "";
|
||||
} else {
|
||||
//Ubah Img Preview
|
||||
var reader = new FileReader();
|
||||
reader.onload = function() {
|
||||
var output = document.getElementById('old_nama_foto');
|
||||
output.src = reader.result;
|
||||
}
|
||||
reader.readAsDataURL(event.target.files[0]);
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function(){
|
||||
$('.from-prevent-multiple-submits').on('submit', function(){
|
||||
$('.from-prevent-multiple-submits').attr('disabled','true');
|
||||
})
|
||||
})();
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,158 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Lomba & Kompetisi')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Lomba & Kompetisi</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
<!-- /.content-header -->
|
||||
|
||||
<!-- Alert Status -->
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('alert'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('alert') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Data Lomba & Kompetisi</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-12 text-left">
|
||||
<a type="button" href="{{ url('/admin/lomba_kompetisi/create') }}"
|
||||
class="btn btn-success mb-3"><i class="fa fa-plus-circle"></i>
|
||||
Tambah Data Lomba & Kompetisi
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table id="tabel_lomba_kompetisi" class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nomor</th>
|
||||
<th>Judul</th>
|
||||
<th>Thumbnail</th>
|
||||
<th>Teks</th>
|
||||
<th>Jadwal Rilis</th>
|
||||
<th>Status</th>
|
||||
<th>Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($lombaKompetisis as $lombaKompetisi)
|
||||
<tr>
|
||||
<td>{{ $loop->iteration }}</td>
|
||||
<td>{{ $lombaKompetisi->judul }}</td>
|
||||
<td>
|
||||
<img src="{{ url($lombaKompetisi->thumbnail) }}"
|
||||
alt="Image Missing" style="width: 100px;">
|
||||
</td>
|
||||
<td>
|
||||
@if (strlen(strip_tags($lombaKompetisi->teks)) > 100)
|
||||
{{ str_replace(' ', '', substr(strip_tags($lombaKompetisi->teks), 0, 100) . '...') }}
|
||||
@else
|
||||
{{ str_replace(' ', '', substr(strip_tags($lombaKompetisi->teks), 0, 100)) }}
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ $lombaKompetisi->release_date }}</td>
|
||||
<td>
|
||||
@if ($lombaKompetisi->deleted_at != '')
|
||||
Terhapus
|
||||
@elseif ($lombaKompetisi->release_date > date('Y-m-d'))
|
||||
Belum Rilis
|
||||
@else
|
||||
Rilis
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if ($lombaKompetisi->deleted_at != '')
|
||||
<form
|
||||
action="{{ url('/admin/lomba_kompetisi/' . $lombaKompetisi->id . '/restore') }}"
|
||||
method="post">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-primary"
|
||||
onclick="return confirm('Apakah anda yakin ingin mengembalikan data?')"><i
|
||||
class="fas fa-trash-restore"></i> Restore
|
||||
</button>
|
||||
</form>
|
||||
<form
|
||||
action="{{ url('/admin/lomba_kompetisi/' . $lombaKompetisi->id . '/delete_permanen') }}"
|
||||
method="post">
|
||||
@csrf
|
||||
<input type="hidden" name="thumbnail"
|
||||
value="{{ $lombaKompetisi->thumbnail }}">
|
||||
<button type="submit" class="btn btn-danger"
|
||||
onclick="return confirm('Apakah anda yakin ingin menghapus permanen data?')"><i
|
||||
class="fa fa-trash"></i> Delete Permanent
|
||||
</button>
|
||||
</form>
|
||||
@else
|
||||
<a href="{{ route('lomba_kompetisi.edit', $lombaKompetisi) }}"
|
||||
class="btn btn-warning open-formModalEdit">
|
||||
<i class="fa fa-edit"></i> Edit
|
||||
</a>
|
||||
<form
|
||||
action="{{ route('lomba_kompetisi.destroy', $lombaKompetisi) }}"
|
||||
method="post">
|
||||
@method('delete')
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-danger"
|
||||
onclick="return confirm('Apakah anda yakin ingin menghapus data?')"><i
|
||||
class="fa fa-trash"></i> Delete
|
||||
</button>
|
||||
</form>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<!--Data Table -->
|
||||
<script>
|
||||
$(function() {
|
||||
$("#tabel_lomba_kompetisi").DataTable({
|
||||
"paging": true,
|
||||
"lengthChange": false,
|
||||
"searching": true,
|
||||
"ordering": true,
|
||||
"info": true,
|
||||
"autoWidth": false,
|
||||
"responsive": false,
|
||||
"buttons": ["copy", "csv", "excel", "pdf", "print", "colvis"]
|
||||
}).buttons().container().appendTo('#tabel_lomba_kompetisi_wrapper .col-md-6:eq(0)');
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,220 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Penelitian')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Penelitian</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Tambah Data Penelitian</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<!-- form start -->
|
||||
<form class="from-prevent-multiple-submits" action="{{ route('penelitian.store') }}" method="POST" id="ckeditorForm"
|
||||
enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<label for="judul">Judul</label>
|
||||
<input type="text" class="form-control" id="judul" name="judul"
|
||||
placeholder="Masukkan Judul" value="" required maxlength="255">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="nama_foto">Thumbnail (Maksimal 2MB)</label>
|
||||
<div class="form-group">
|
||||
<img id="img_preview_add" style="max-width: 200px;"
|
||||
class="mt-2" />
|
||||
</div>
|
||||
<input type="file" accept="image/*" class="form-control mt-0"
|
||||
name="thumbnail" id="input_foto_add" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="teks">Teks (Foto Maksimal 2MB)</label>
|
||||
<textarea id="teks" placeholder="Masukkan Teks Penelitian" name="teks"
|
||||
class="ck_editor_txt" id="ck_editor_txt"></textarea>
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="release_date">Tanggal Rilis</label>
|
||||
<input type="date" class="form-control mt-0" name="release_date" required>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
|
||||
<div class="card-footer">
|
||||
<button id="submit" type="submit" class="btn btn-primary from-prevent-multiple-submits">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
//Define an adapter to upload the files
|
||||
class MyUploadAdapter {
|
||||
constructor(loader) {
|
||||
// The file loader instance to use during the upload. It sounds scary but do not
|
||||
// worry — the loader will be passed into the adapter later on in this guide.
|
||||
this.loader = loader;
|
||||
|
||||
// URL where to send files.
|
||||
this.url = '{{ route('ckeditor.upload') }}';
|
||||
|
||||
//
|
||||
}
|
||||
// Starts the upload process.
|
||||
upload() {
|
||||
return this.loader.file.then(
|
||||
(file) =>
|
||||
new Promise((resolve, reject) => {
|
||||
this._initRequest();
|
||||
this._initListeners(resolve, reject, file);
|
||||
this._sendRequest(file);
|
||||
})
|
||||
);
|
||||
}
|
||||
// Aborts the upload process.
|
||||
abort() {
|
||||
if (this.xhr) {
|
||||
this.xhr.abort();
|
||||
}
|
||||
}
|
||||
// Initializes the XMLHttpRequest object using the URL passed to the constructor.
|
||||
_initRequest() {
|
||||
const xhr = (this.xhr = new XMLHttpRequest());
|
||||
// Note that your request may look different. It is up to you and your editor
|
||||
// integration to choose the right communication channel. This example uses
|
||||
// a POST request with JSON as a data structure but your configuration
|
||||
// could be different.
|
||||
// xhr.open('POST', this.url, true);
|
||||
xhr.open("POST", this.url, true);
|
||||
xhr.setRequestHeader("x-csrf-token", "{{ csrf_token() }}");
|
||||
xhr.responseType = "json";
|
||||
}
|
||||
// Initializes XMLHttpRequest listeners.
|
||||
_initListeners(resolve, reject, file) {
|
||||
const xhr = this.xhr;
|
||||
const loader = this.loader;
|
||||
const genericErrorText = `Couldn't upload file: ${file.name}.`;
|
||||
xhr.addEventListener("error", () => reject(genericErrorText));
|
||||
xhr.addEventListener("abort", () => reject());
|
||||
xhr.addEventListener("load", () => {
|
||||
const response = xhr.response;
|
||||
// This example assumes the XHR server's "response" object will come with
|
||||
// an "error" which has its own "message" that can be passed to reject()
|
||||
// in the upload promise.
|
||||
//
|
||||
// Your integration may handle upload errors in a different way so make sure
|
||||
// it is done properly. The reject() function must be called when the upload fails.
|
||||
if (!response || response.error) {
|
||||
return reject(response && response.error ? response.error.message : genericErrorText);
|
||||
}
|
||||
// If the upload is successful, resolve the upload promise with an object containing
|
||||
// at least the "default" URL, pointing to the image on the server.
|
||||
// This URL will be used to display the image in the content. Learn more in the
|
||||
// UploadAdapter#upload documentation.
|
||||
resolve({
|
||||
default: response.url,
|
||||
});
|
||||
});
|
||||
// Upload progress when it is supported. The file loader has the #uploadTotal and #uploaded
|
||||
// properties which are used e.g. to display the upload progress bar in the editor
|
||||
// user interface.
|
||||
if (xhr.upload) {
|
||||
xhr.upload.addEventListener("progress", (evt) => {
|
||||
if (evt.lengthComputable) {
|
||||
loader.uploadTotal = evt.total;
|
||||
loader.uploaded = evt.loaded;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// Prepares the data and sends the request.
|
||||
_sendRequest(file) {
|
||||
// Prepare the form data.
|
||||
const data = new FormData();
|
||||
data.append("upload", file);
|
||||
// Important note: This is the right place to implement security mechanisms
|
||||
// like authentication and CSRF protection. For instance, you can use
|
||||
// XMLHttpRequest.setRequestHeader() to set the request headers containing
|
||||
// the CSRF token generated earlier by your application.
|
||||
// Send the request.
|
||||
this.xhr.send(data);
|
||||
}
|
||||
// ...
|
||||
}
|
||||
|
||||
function SimpleUploadAdapterPlugin(editor) {
|
||||
editor.plugins.get("FileRepository").createUploadAdapter = (loader) => {
|
||||
// Configure the URL to the upload script in your back-end here!
|
||||
return new MyUploadAdapter(loader);
|
||||
};
|
||||
}
|
||||
|
||||
var allEditors = document.querySelector('.ck_editor_txt');
|
||||
|
||||
//Initialize the ckeditor
|
||||
ClassicEditor.create(document.querySelector("#teks"), {
|
||||
extraPlugins: [SimpleUploadAdapterPlugin],
|
||||
}).catch((error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
$("#ckeditorForm").submit(function(e) {
|
||||
var content = $('.ck_editor_txt').val();
|
||||
html = $(content).text();
|
||||
if ($.trim(html) == '') {
|
||||
alert("Teks Tidak Boleh Kosong!");
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
//Form add image validation
|
||||
var uploadField = document.getElementById("input_foto_add");
|
||||
uploadField.onchange = function() {
|
||||
if (this.files[0].size > 2000000) {
|
||||
alert("Batas maksimum 2MB!");
|
||||
this.value = "";
|
||||
} else {
|
||||
//Ubah Img Preview
|
||||
var reader = new FileReader();
|
||||
reader.onload = function() {
|
||||
var output = document.getElementById('img_preview_add');
|
||||
output.src = reader.result;
|
||||
}
|
||||
reader.readAsDataURL(event.target.files[0]);
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function(){
|
||||
$('.from-prevent-multiple-submits').on('submit', function(){
|
||||
$('.from-prevent-multiple-submits').attr('disabled','true');
|
||||
})
|
||||
})();
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,226 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Penelitian')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Penelitian</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
<!-- /.content-header -->
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Edit Data Penelitian</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<!-- form start -->
|
||||
<form class="from-prevent-multiple-submits"
|
||||
action="{{ route('penelitian.update', $penelitian) }}" method="POST"
|
||||
enctype="multipart/form-data">
|
||||
@method('patch')
|
||||
@csrf
|
||||
<div class="card-body">
|
||||
<input type="hidden" value="{{ $penelitian->id }}" name="id">
|
||||
<div class="form-group">
|
||||
<label for="judul">Judul</label>
|
||||
<input type="text" class="form-control" id="judul" name="judul"
|
||||
maxlength="255" placeholder="Masukkan Judul"
|
||||
value="{{ $penelitian->judul }}" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="nama_foto">Thumbnail (Maksimal 2MB)</label>
|
||||
<div class="form-group">
|
||||
<img src="{{ url($penelitian->thumbnail) }}" alt="Image Missing"
|
||||
id="old_nama_foto" style="max-width: 200px;"
|
||||
class="mt-2" />
|
||||
</div>
|
||||
<input type="file" accept="image/*" class="form-control mt-0"
|
||||
name="thumbnail" id="input_foto_edit">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="teks">Teks (Foto Maksimal 2MB)</label>
|
||||
<textarea id="teks" placeholder="Masukkan Deskripsi Video"
|
||||
name="teks">{{ $penelitian->teks }}</textarea>
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="release_date">Tanggal Rilis</label>
|
||||
<input type="date" class="form-control mt-0" name="release_date"
|
||||
value="{{ $penelitian->release_date }}" required>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
|
||||
<div class="card-footer">
|
||||
<button id="submit" type="submit"
|
||||
class="btn btn-primary from-prevent-multiple-submits">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
//Define an adapter to upload the files
|
||||
class MyUploadAdapter {
|
||||
constructor(loader) {
|
||||
// The file loader instance to use during the upload. It sounds scary but do not
|
||||
// worry — the loader will be passed into the adapter later on in this guide.
|
||||
this.loader = loader;
|
||||
|
||||
// URL where to send files.
|
||||
this.url = '{{ route('ckeditor.upload') }}';
|
||||
|
||||
//
|
||||
}
|
||||
// Starts the upload process.
|
||||
upload() {
|
||||
return this.loader.file.then(
|
||||
(file) =>
|
||||
new Promise((resolve, reject) => {
|
||||
this._initRequest();
|
||||
this._initListeners(resolve, reject, file);
|
||||
this._sendRequest(file);
|
||||
})
|
||||
);
|
||||
}
|
||||
// Aborts the upload process.
|
||||
abort() {
|
||||
if (this.xhr) {
|
||||
this.xhr.abort();
|
||||
}
|
||||
}
|
||||
// Initializes the XMLHttpRequest object using the URL passed to the constructor.
|
||||
_initRequest() {
|
||||
const xhr = (this.xhr = new XMLHttpRequest());
|
||||
// Note that your request may look different. It is up to you and your editor
|
||||
// integration to choose the right communication channel. This example uses
|
||||
// a POST request with JSON as a data structure but your configuration
|
||||
// could be different.
|
||||
// xhr.open('POST', this.url, true);
|
||||
xhr.open("POST", this.url, true);
|
||||
xhr.setRequestHeader("x-csrf-token", "{{ csrf_token() }}");
|
||||
xhr.responseType = "json";
|
||||
}
|
||||
// Initializes XMLHttpRequest listeners.
|
||||
_initListeners(resolve, reject, file) {
|
||||
const xhr = this.xhr;
|
||||
const loader = this.loader;
|
||||
const genericErrorText = `Couldn't upload file: ${file.name}.`;
|
||||
xhr.addEventListener("error", () => reject(genericErrorText));
|
||||
xhr.addEventListener("abort", () => reject());
|
||||
xhr.addEventListener("load", () => {
|
||||
const response = xhr.response;
|
||||
// This example assumes the XHR server's "response" object will come with
|
||||
// an "error" which has its own "message" that can be passed to reject()
|
||||
// in the upload promise.
|
||||
//
|
||||
// Your integration may handle upload errors in a different way so make sure
|
||||
// it is done properly. The reject() function must be called when the upload fails.
|
||||
if (!response || response.error) {
|
||||
return reject(response && response.error ? response.error.message : genericErrorText);
|
||||
}
|
||||
// If the upload is successful, resolve the upload promise with an object containing
|
||||
// at least the "default" URL, pointing to the image on the server.
|
||||
// This URL will be used to display the image in the content. Learn more in the
|
||||
// UploadAdapter#upload documentation.
|
||||
resolve({
|
||||
default: response.url,
|
||||
});
|
||||
});
|
||||
// Upload progress when it is supported. The file loader has the #uploadTotal and #uploaded
|
||||
// properties which are used e.g. to display the upload progress bar in the editor
|
||||
// user interface.
|
||||
if (xhr.upload) {
|
||||
xhr.upload.addEventListener("progress", (evt) => {
|
||||
if (evt.lengthComputable) {
|
||||
loader.uploadTotal = evt.total;
|
||||
loader.uploaded = evt.loaded;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// Prepares the data and sends the request.
|
||||
_sendRequest(file) {
|
||||
// Prepare the form data.
|
||||
const data = new FormData();
|
||||
data.append("upload", file);
|
||||
// Important note: This is the right place to implement security mechanisms
|
||||
// like authentication and CSRF protection. For instance, you can use
|
||||
// XMLHttpRequest.setRequestHeader() to set the request headers containing
|
||||
// the CSRF token generated earlier by your application.
|
||||
// Send the request.
|
||||
this.xhr.send(data);
|
||||
}
|
||||
// ...
|
||||
}
|
||||
|
||||
function SimpleUploadAdapterPlugin(editor) {
|
||||
editor.plugins.get("FileRepository").createUploadAdapter = (loader) => {
|
||||
// Configure the URL to the upload script in your back-end here!
|
||||
return new MyUploadAdapter(loader);
|
||||
};
|
||||
}
|
||||
|
||||
//Initialize the ckeditor
|
||||
ClassicEditor.create(document.querySelector("#teks"), {
|
||||
extraPlugins: [SimpleUploadAdapterPlugin],
|
||||
}).catch((error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
$("#ckeditorForm").submit(function(e) {
|
||||
var content = $('.ck_editor_txt').val();
|
||||
html = $(content).text();
|
||||
if ($.trim(html) == '') {
|
||||
alert("Teks Tidak Boleh Kosong!");
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
//Form edit image validation
|
||||
var uploadField = document.getElementById("input_foto_edit");
|
||||
uploadField.onchange = function() {
|
||||
if (this.files[0].size > 2000000) {
|
||||
alert("Batas maksimum 2MB!");
|
||||
this.value = "";
|
||||
} else {
|
||||
//Ubah Img Preview
|
||||
var reader = new FileReader();
|
||||
reader.onload = function() {
|
||||
var output = document.getElementById('old_nama_foto');
|
||||
output.src = reader.result;
|
||||
}
|
||||
reader.readAsDataURL(event.target.files[0]);
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function() {
|
||||
$('.from-prevent-multiple-submits').on('submit', function() {
|
||||
$('.from-prevent-multiple-submits').attr('disabled', 'true');
|
||||
})
|
||||
})();
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,152 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Penelitian')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Penelitian</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
<!-- /.content-header -->
|
||||
|
||||
<!-- Alert Status -->
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('alert'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('alert') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Data Penelitian</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-12 text-left">
|
||||
<a href="{{ url('/admin/penelitian/create') }}" type="button"
|
||||
class="btn btn-success mb-3">
|
||||
<i class="fa fa-plus-circle mr-2"></i>Tambah Data
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table id="tabel_penelitian" class="table table-bordered table-striped mt-2">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>No</th>
|
||||
<th>Judul</th>
|
||||
<th>Thumbnail</th>
|
||||
<th>Teks</th>
|
||||
<th>Jadwal Rilis</th>
|
||||
<th>Status</th>
|
||||
<th>Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@foreach ($penelitians as $penelitian)
|
||||
<tr id="{{ $penelitian->id }}">
|
||||
<td>{{ $loop->iteration }}</td>
|
||||
<td>{{ $penelitian->judul }}</td>
|
||||
<td><img src="{{ url($penelitian->thumbnail) }}" style="width:100px"></td>
|
||||
<td>
|
||||
@if (strlen(strip_tags($penelitian->teks)) > 100)
|
||||
{{ str_replace(' ', '', substr(strip_tags($penelitian->teks), 0, 100) . '...') }}
|
||||
@else
|
||||
{{ str_replace(' ', '', substr(strip_tags($penelitian->teks), 0, 100)) }}
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ $penelitian->release_date }}</td>
|
||||
@if ($penelitian->deleted_at == '')
|
||||
@if ($penelitian->release_date <= date('Y-m-d'))
|
||||
<td>Rilis</td>
|
||||
@else
|
||||
<td>Belum Rilis</td>
|
||||
@endif
|
||||
@else
|
||||
($penelitian->deleted_at != "")
|
||||
<td>Terhapus</td>
|
||||
@endif
|
||||
@if ($penelitian->deleted_at == '')
|
||||
<td>
|
||||
<a href="{{ route('penelitian.edit', $penelitian) }}"
|
||||
class="btn btn-warning open-formModalEdit"><i
|
||||
class="fa fa-edit"></i> Edit</a>
|
||||
<form action="{{ route('penelitian.destroy', $penelitian) }}"
|
||||
method="post">
|
||||
@method('delete')
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-danger"
|
||||
onclick="return confirm('Apakah anda yakin ingin menghapus data?')"><i
|
||||
class="fa fa-trash"></i> Delete</button>
|
||||
</form>
|
||||
</td>
|
||||
@else
|
||||
<td>
|
||||
<form
|
||||
action="{{ url('/admin/penelitian/' . $penelitian->id . '/restore') }}"
|
||||
method="post">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-primary"
|
||||
onclick="return confirm('Apakah anda yakin ingin mengembalikan data?')"><i
|
||||
class="fas fa-trash-restore"></i> Restore
|
||||
</button>
|
||||
</form>
|
||||
<form
|
||||
action="{{ url('/admin/penelitian/' . $penelitian->id . '/delete') }}"
|
||||
method="post">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-danger"
|
||||
onclick="return confirm('Apakah anda yakin ingin menghapus permanen data?')"><i
|
||||
class="fa fa-trash"></i> Delete Permanent
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<!--Data Table -->
|
||||
<script>
|
||||
$(function() {
|
||||
$("#tabel_penelitian").DataTable({
|
||||
"paging": true,
|
||||
"lengthChange": false,
|
||||
"searching": true,
|
||||
"ordering": true,
|
||||
"info": true,
|
||||
"autoWidth": false,
|
||||
"responsive": false,
|
||||
"buttons": ["copy", "csv", "excel", "pdf", "print", "colvis"]
|
||||
}).buttons().container().appendTo('#tabel_penelitian_wrapper .col-md-6:eq(0)');
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,220 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Pengabdian Kepada Masyarakat')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Pengabdian Kepada Masyarakat</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Tambah Data Pengabdian Kepada Masyarakat</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<!-- form start -->
|
||||
<form class="from-prevent-multiple-submits" action="{{ route('pengabdian_ke_masyarakat.store') }}" method="POST"
|
||||
id="ckeditorForm" enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<label for="judul">Judul</label>
|
||||
<input type="text" class="form-control" id="judul" name="judul"
|
||||
placeholder="Masukkan Judul" value="" required maxlength="255">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="nama_foto">Thumbnail (Maksimal 2MB)</label>
|
||||
<div class="form-group">
|
||||
<img id="img_preview_add" style="max-width: 200px;"
|
||||
class="mt-2" />
|
||||
</div>
|
||||
<input type="file" accept="image/*" class="form-control mt-0"
|
||||
name="thumbnail" id="input_foto_add" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="teks">Teks (Foto Maksimal 2MB)</label>
|
||||
<textarea id="teks" placeholder="Masukkan Teks Pengabdian Kepada Masyarakat"
|
||||
name="teks" class="ck_editor_txt" id="ck_editor_txt"></textarea>
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="release_date">Tanggal Rilis</label>
|
||||
<input type="date" class="form-control mt-0" name="release_date" required>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
|
||||
<div class="card-footer">
|
||||
<button id="submit" type="submit" class="btn btn-primary from-prevent-multiple-submits">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
//Define an adapter to upload the files
|
||||
class MyUploadAdapter {
|
||||
constructor(loader) {
|
||||
// The file loader instance to use during the upload. It sounds scary but do not
|
||||
// worry — the loader will be passed into the adapter later on in this guide.
|
||||
this.loader = loader;
|
||||
|
||||
// URL where to send files.
|
||||
this.url = '{{ route('ckeditor.upload') }}';
|
||||
|
||||
//
|
||||
}
|
||||
// Starts the upload process.
|
||||
upload() {
|
||||
return this.loader.file.then(
|
||||
(file) =>
|
||||
new Promise((resolve, reject) => {
|
||||
this._initRequest();
|
||||
this._initListeners(resolve, reject, file);
|
||||
this._sendRequest(file);
|
||||
})
|
||||
);
|
||||
}
|
||||
// Aborts the upload process.
|
||||
abort() {
|
||||
if (this.xhr) {
|
||||
this.xhr.abort();
|
||||
}
|
||||
}
|
||||
// Initializes the XMLHttpRequest object using the URL passed to the constructor.
|
||||
_initRequest() {
|
||||
const xhr = (this.xhr = new XMLHttpRequest());
|
||||
// Note that your request may look different. It is up to you and your editor
|
||||
// integration to choose the right communication channel. This example uses
|
||||
// a POST request with JSON as a data structure but your configuration
|
||||
// could be different.
|
||||
// xhr.open('POST', this.url, true);
|
||||
xhr.open("POST", this.url, true);
|
||||
xhr.setRequestHeader("x-csrf-token", "{{ csrf_token() }}");
|
||||
xhr.responseType = "json";
|
||||
}
|
||||
// Initializes XMLHttpRequest listeners.
|
||||
_initListeners(resolve, reject, file) {
|
||||
const xhr = this.xhr;
|
||||
const loader = this.loader;
|
||||
const genericErrorText = `Couldn't upload file: ${file.name}.`;
|
||||
xhr.addEventListener("error", () => reject(genericErrorText));
|
||||
xhr.addEventListener("abort", () => reject());
|
||||
xhr.addEventListener("load", () => {
|
||||
const response = xhr.response;
|
||||
// This example assumes the XHR server's "response" object will come with
|
||||
// an "error" which has its own "message" that can be passed to reject()
|
||||
// in the upload promise.
|
||||
//
|
||||
// Your integration may handle upload errors in a different way so make sure
|
||||
// it is done properly. The reject() function must be called when the upload fails.
|
||||
if (!response || response.error) {
|
||||
return reject(response && response.error ? response.error.message : genericErrorText);
|
||||
}
|
||||
// If the upload is successful, resolve the upload promise with an object containing
|
||||
// at least the "default" URL, pointing to the image on the server.
|
||||
// This URL will be used to display the image in the content. Learn more in the
|
||||
// UploadAdapter#upload documentation.
|
||||
resolve({
|
||||
default: response.url,
|
||||
});
|
||||
});
|
||||
// Upload progress when it is supported. The file loader has the #uploadTotal and #uploaded
|
||||
// properties which are used e.g. to display the upload progress bar in the editor
|
||||
// user interface.
|
||||
if (xhr.upload) {
|
||||
xhr.upload.addEventListener("progress", (evt) => {
|
||||
if (evt.lengthComputable) {
|
||||
loader.uploadTotal = evt.total;
|
||||
loader.uploaded = evt.loaded;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// Prepares the data and sends the request.
|
||||
_sendRequest(file) {
|
||||
// Prepare the form data.
|
||||
const data = new FormData();
|
||||
data.append("upload", file);
|
||||
// Important note: This is the right place to implement security mechanisms
|
||||
// like authentication and CSRF protection. For instance, you can use
|
||||
// XMLHttpRequest.setRequestHeader() to set the request headers containing
|
||||
// the CSRF token generated earlier by your application.
|
||||
// Send the request.
|
||||
this.xhr.send(data);
|
||||
}
|
||||
// ...
|
||||
}
|
||||
|
||||
function SimpleUploadAdapterPlugin(editor) {
|
||||
editor.plugins.get("FileRepository").createUploadAdapter = (loader) => {
|
||||
// Configure the URL to the upload script in your back-end here!
|
||||
return new MyUploadAdapter(loader);
|
||||
};
|
||||
}
|
||||
|
||||
var allEditors = document.querySelector('.ck_editor_txt');
|
||||
|
||||
//Initialize the ckeditor
|
||||
ClassicEditor.create(document.querySelector("#teks"), {
|
||||
extraPlugins: [SimpleUploadAdapterPlugin],
|
||||
}).catch((error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
$("#ckeditorForm").submit(function(e) {
|
||||
var content = $('.ck_editor_txt').val();
|
||||
html = $(content).text();
|
||||
if ($.trim(html) == '') {
|
||||
alert("Teks Tidak Boleh Kosong!");
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
//Form add image validation
|
||||
var uploadField = document.getElementById("input_foto_add");
|
||||
uploadField.onchange = function() {
|
||||
if (this.files[0].size > 2000000) {
|
||||
alert("Batas maksimum 2MB!");
|
||||
this.value = "";
|
||||
} else {
|
||||
//Ubah Img Preview
|
||||
var reader = new FileReader();
|
||||
reader.onload = function() {
|
||||
var output = document.getElementById('img_preview_add');
|
||||
output.src = reader.result;
|
||||
}
|
||||
reader.readAsDataURL(event.target.files[0]);
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function(){
|
||||
$('.from-prevent-multiple-submits').on('submit', function(){
|
||||
$('.from-prevent-multiple-submits').attr('disabled','true');
|
||||
})
|
||||
})();
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,226 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Pengabdian Kepada Masyarakat')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Pengabdian Kepada Masyarakat</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
<!-- /.content-header -->
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Edit Data Pengabdian Kepada Masyarakat</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<!-- form start -->
|
||||
<form class="from-prevent-multiple-submits"
|
||||
action="{{ route('pengabdian_ke_masyarakat.update', $pengabdianKeMasyarakat) }}"
|
||||
method="POST" enctype="multipart/form-data">
|
||||
@method('patch')
|
||||
@csrf
|
||||
<div class="card-body">
|
||||
<input type="hidden" value="{{ $pengabdianKeMasyarakat->id }}" name="id">
|
||||
<div class="form-group">
|
||||
<label for="judul">Judul</label>
|
||||
<input type="text" class="form-control" id="judul" name="judul"
|
||||
placeholder="Masukkan Judul" maxlength="255"
|
||||
value="{{ $pengabdianKeMasyarakat->judul }}" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="nama_foto">Thumbnail (Maksimal 2MB)</label>
|
||||
<div class="form-group">
|
||||
<img src="{{ url($pengabdianKeMasyarakat->thumbnail) }}"
|
||||
alt="Image Missing" id="old_nama_foto" style="max-width: 200px;"
|
||||
class="mt-2" />
|
||||
</div>
|
||||
<input type="file" accept="image/*" class="form-control mt-0"
|
||||
name="thumbnail" id="input_foto_edit">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="teks">Teks (Foto Maksimal 2MB)</label>
|
||||
<textarea id="teks" placeholder="Masukkan Deskripsi Video"
|
||||
name="teks">{{ $pengabdianKeMasyarakat->teks }}</textarea>
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="release_date">Tanggal Rilis</label>
|
||||
<input type="date" class="form-control mt-0" name="release_date"
|
||||
value="{{ $pengabdianKeMasyarakat->release_date }}" required>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
|
||||
<div class="card-footer">
|
||||
<button id="submit" type="submit"
|
||||
class="btn btn-primary from-prevent-multiple-submits">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
//Define an adapter to upload the files
|
||||
class MyUploadAdapter {
|
||||
constructor(loader) {
|
||||
// The file loader instance to use during the upload. It sounds scary but do not
|
||||
// worry — the loader will be passed into the adapter later on in this guide.
|
||||
this.loader = loader;
|
||||
|
||||
// URL where to send files.
|
||||
this.url = '{{ route('ckeditor.upload') }}';
|
||||
|
||||
//
|
||||
}
|
||||
// Starts the upload process.
|
||||
upload() {
|
||||
return this.loader.file.then(
|
||||
(file) =>
|
||||
new Promise((resolve, reject) => {
|
||||
this._initRequest();
|
||||
this._initListeners(resolve, reject, file);
|
||||
this._sendRequest(file);
|
||||
})
|
||||
);
|
||||
}
|
||||
// Aborts the upload process.
|
||||
abort() {
|
||||
if (this.xhr) {
|
||||
this.xhr.abort();
|
||||
}
|
||||
}
|
||||
// Initializes the XMLHttpRequest object using the URL passed to the constructor.
|
||||
_initRequest() {
|
||||
const xhr = (this.xhr = new XMLHttpRequest());
|
||||
// Note that your request may look different. It is up to you and your editor
|
||||
// integration to choose the right communication channel. This example uses
|
||||
// a POST request with JSON as a data structure but your configuration
|
||||
// could be different.
|
||||
// xhr.open('POST', this.url, true);
|
||||
xhr.open("POST", this.url, true);
|
||||
xhr.setRequestHeader("x-csrf-token", "{{ csrf_token() }}");
|
||||
xhr.responseType = "json";
|
||||
}
|
||||
// Initializes XMLHttpRequest listeners.
|
||||
_initListeners(resolve, reject, file) {
|
||||
const xhr = this.xhr;
|
||||
const loader = this.loader;
|
||||
const genericErrorText = `Couldn't upload file: ${file.name}.`;
|
||||
xhr.addEventListener("error", () => reject(genericErrorText));
|
||||
xhr.addEventListener("abort", () => reject());
|
||||
xhr.addEventListener("load", () => {
|
||||
const response = xhr.response;
|
||||
// This example assumes the XHR server's "response" object will come with
|
||||
// an "error" which has its own "message" that can be passed to reject()
|
||||
// in the upload promise.
|
||||
//
|
||||
// Your integration may handle upload errors in a different way so make sure
|
||||
// it is done properly. The reject() function must be called when the upload fails.
|
||||
if (!response || response.error) {
|
||||
return reject(response && response.error ? response.error.message : genericErrorText);
|
||||
}
|
||||
// If the upload is successful, resolve the upload promise with an object containing
|
||||
// at least the "default" URL, pointing to the image on the server.
|
||||
// This URL will be used to display the image in the content. Learn more in the
|
||||
// UploadAdapter#upload documentation.
|
||||
resolve({
|
||||
default: response.url,
|
||||
});
|
||||
});
|
||||
// Upload progress when it is supported. The file loader has the #uploadTotal and #uploaded
|
||||
// properties which are used e.g. to display the upload progress bar in the editor
|
||||
// user interface.
|
||||
if (xhr.upload) {
|
||||
xhr.upload.addEventListener("progress", (evt) => {
|
||||
if (evt.lengthComputable) {
|
||||
loader.uploadTotal = evt.total;
|
||||
loader.uploaded = evt.loaded;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// Prepares the data and sends the request.
|
||||
_sendRequest(file) {
|
||||
// Prepare the form data.
|
||||
const data = new FormData();
|
||||
data.append("upload", file);
|
||||
// Important note: This is the right place to implement security mechanisms
|
||||
// like authentication and CSRF protection. For instance, you can use
|
||||
// XMLHttpRequest.setRequestHeader() to set the request headers containing
|
||||
// the CSRF token generated earlier by your application.
|
||||
// Send the request.
|
||||
this.xhr.send(data);
|
||||
}
|
||||
// ...
|
||||
}
|
||||
|
||||
function SimpleUploadAdapterPlugin(editor) {
|
||||
editor.plugins.get("FileRepository").createUploadAdapter = (loader) => {
|
||||
// Configure the URL to the upload script in your back-end here!
|
||||
return new MyUploadAdapter(loader);
|
||||
};
|
||||
}
|
||||
|
||||
//Initialize the ckeditor
|
||||
ClassicEditor.create(document.querySelector("#teks"), {
|
||||
extraPlugins: [SimpleUploadAdapterPlugin],
|
||||
}).catch((error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
$("#ckeditorForm").submit(function(e) {
|
||||
var content = $('.ck_editor_txt').val();
|
||||
html = $(content).text();
|
||||
if ($.trim(html) == '') {
|
||||
alert("Teks Tidak Boleh Kosong!");
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
//Form edit image validation
|
||||
var uploadField = document.getElementById("input_foto_edit");
|
||||
uploadField.onchange = function() {
|
||||
if (this.files[0].size > 2000000) {
|
||||
alert("Batas maksimum 2MB!");
|
||||
this.value = "";
|
||||
} else {
|
||||
//Ubah Img Preview
|
||||
var reader = new FileReader();
|
||||
reader.onload = function() {
|
||||
var output = document.getElementById('old_nama_foto');
|
||||
output.src = reader.result;
|
||||
}
|
||||
reader.readAsDataURL(event.target.files[0]);
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function() {
|
||||
$('.from-prevent-multiple-submits').on('submit', function() {
|
||||
$('.from-prevent-multiple-submits').attr('disabled', 'true');
|
||||
})
|
||||
})();
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,156 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Pengabdian Kepada Masyarakat')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Pengabdian Kepada Masyarakat</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
<!-- /.content-header -->
|
||||
|
||||
<!-- Alert Status -->
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('alert'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('alert') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Data Pengabdian Kepada Masyarakat</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-12 text-left">
|
||||
<a href="{{ url('/admin/pengabdian_ke_masyarakat/create') }}" type="button"
|
||||
class="btn btn-success mb-3">
|
||||
<i class="fa fa-plus-circle mr-2"></i>Tambah Data
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table id="tabel_pengabdian_ke_masyarakat" class="table table-bordered table-striped mt-2">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>No</th>
|
||||
<th>Judul</th>
|
||||
<th>Thumbnail</th>
|
||||
<th>Teks</th>
|
||||
<th>Jadwal Rilis</th>
|
||||
<th>Status</th>
|
||||
<th>Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@foreach ($pengabdianKeMasyarakats as $pengabdianKeMasyarakat)
|
||||
<tr id="{{ $pengabdianKeMasyarakat->id }}">
|
||||
<td>{{ $loop->iteration }}</td>
|
||||
<td>{{ $pengabdianKeMasyarakat->judul }}</td>
|
||||
<td>
|
||||
<img src="{{ url($pengabdianKeMasyarakat->thumbnail) }}"
|
||||
style="width:100px">
|
||||
</td>
|
||||
<td>
|
||||
@if (strlen(strip_tags($pengabdianKeMasyarakat->teks)) > 100)
|
||||
{{ str_replace(' ', '', substr(strip_tags($pengabdianKeMasyarakat->teks), 0, 100) . '...') }}
|
||||
@else
|
||||
{{ str_replace(' ', '', substr(strip_tags($pengabdianKeMasyarakat->teks), 0, 100)) }}
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ $pengabdianKeMasyarakat->release_date }}</td>
|
||||
@if ($pengabdianKeMasyarakat->deleted_at == '')
|
||||
@if ($pengabdianKeMasyarakat->release_date <= date('Y-m-d'))
|
||||
<td>Rilis</td>
|
||||
@else
|
||||
<td>Belum Rilis</td>
|
||||
@endif
|
||||
@else
|
||||
($pengabdianKeMasyarakat->deleted_at != "")
|
||||
<td>Terhapus</td>
|
||||
@endif
|
||||
@if ($pengabdianKeMasyarakat->deleted_at == '')
|
||||
<td>
|
||||
<a href="{{ route('pengabdian_ke_masyarakat.edit', $pengabdianKeMasyarakat) }}"
|
||||
class="btn btn-warning open-formModalEdit"><i
|
||||
class="fa fa-edit"></i> Edit</a>
|
||||
<form
|
||||
action="{{ route('pengabdian_ke_masyarakat.destroy', $pengabdianKeMasyarakat) }}"
|
||||
method="post">
|
||||
@method('delete')
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-danger"
|
||||
onclick="return confirm('Apakah anda yakin ingin menghapus data?')"><i
|
||||
class="fa fa-trash"></i> Delete</button>
|
||||
</form>
|
||||
</td>
|
||||
@else
|
||||
<td>
|
||||
<form
|
||||
action="{{ url('/admin/pengabdian_ke_masyarakat/' . $pengabdianKeMasyarakat->id . '/restore') }}"
|
||||
method="post">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-primary"
|
||||
onclick="return confirm('Apakah anda yakin ingin mengembalikan data?')"><i
|
||||
class="fas fa-trash-restore"></i> Restore
|
||||
</button>
|
||||
</form>
|
||||
<form
|
||||
action="{{ url('/admin/pengabdian_ke_masyarakat/' . $pengabdianKeMasyarakat->id . '/delete') }}"
|
||||
method="post">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-danger"
|
||||
onclick="return confirm('Apakah anda yakin ingin menghapus permanen data?')"><i
|
||||
class="fa fa-trash"></i> Delete Permanent
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<!--Data Table -->
|
||||
<script>
|
||||
$(function() {
|
||||
$("#tabel_pengabdian_ke_masyarakat").DataTable({
|
||||
"paging": true,
|
||||
"lengthChange": false,
|
||||
"searching": true,
|
||||
"ordering": true,
|
||||
"info": true,
|
||||
"autoWidth": false,
|
||||
"responsive": false,
|
||||
"buttons": ["copy", "csv", "excel", "pdf", "print", "colvis"]
|
||||
}).buttons().container().appendTo('#tabel_pengabdian_ke_masyarakat_wrapper .col-md-6:eq(0)');
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,280 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Peraturan & Perundang Undangan')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Peraturan & Perundang Undangan</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
|
||||
<!-- Alert Status -->
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('alert'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('alert') }}
|
||||
</div>
|
||||
@endif
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Data Peraturan & Perundang Undangan</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-12 text-left">
|
||||
<a type="button" href="#formModalAdd" data-toggle="modal"
|
||||
class="btn btn-success mb-3"><i class="fa fa-plus-circle"></i>
|
||||
Tambah Data Peraturan & Perundang Undangan
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table id="tabel_peraturan_perundang_undangan"
|
||||
class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nomor</th>
|
||||
<th>Judul</th>
|
||||
<th>File</th>
|
||||
<th>Jadwal Rilis</th>
|
||||
<th>Status</th>
|
||||
<th>Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($peraturanPerundangUndangans as $peraturanPerundangUndangan)
|
||||
<tr>
|
||||
<td>{{ $loop->iteration }}</td>
|
||||
<td>{{ $peraturanPerundangUndangan->judul }}</td>
|
||||
<td><a href="{{ url($peraturanPerundangUndangan->nama_file) }}"
|
||||
download
|
||||
target="_blank">{{ $peraturanPerundangUndangan->nama_file }}</a>
|
||||
</td>
|
||||
<td>{{ $peraturanPerundangUndangan->release_date }}</td>
|
||||
@if ($peraturanPerundangUndangan->deleted_at == '')
|
||||
@if ($peraturanPerundangUndangan->release_date <= date('Y-m-d'))
|
||||
<td>Rilis</td>
|
||||
@else
|
||||
<td>Belum Rilis</td>
|
||||
@endif
|
||||
@else ($peraturanPerundangUndangan->deleted_at != "")
|
||||
<td>Terhapus</td>
|
||||
@endif
|
||||
@if ($peraturanPerundangUndangan->deleted_at == '')
|
||||
<td>
|
||||
<button href="#formModalEdit" role="button" data-toggle="modal"
|
||||
data-id="{{ $peraturanPerundangUndangan->id }}"
|
||||
data-judul="{{ $peraturanPerundangUndangan->judul }}"
|
||||
data-nama_file="{{ $peraturanPerundangUndangan->nama_file }}"
|
||||
data-release_date="{{ $peraturanPerundangUndangan->release_date }}"
|
||||
class="btn btn-warning open-formModalEdit"><i
|
||||
class="fa fa-edit"></i> Edit</button>
|
||||
<form
|
||||
action="{{ route('peraturan_perundang_undangan.destroy', $peraturanPerundangUndangan) }}"
|
||||
method="post">
|
||||
@method('delete')
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-danger"
|
||||
onclick="return confirm('Apakah anda yakin ingin menghapus data?')"><i
|
||||
class="fa fa-trash"></i> Delete</button>
|
||||
</form>
|
||||
</td>
|
||||
@else
|
||||
<td>
|
||||
<form
|
||||
action="{{ url('/admin/peraturan_perundang_undangan/' . $peraturanPerundangUndangan->id . '/restore') }}"
|
||||
method="post">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-primary"
|
||||
onclick="return confirm('Apakah anda yakin ingin mengembalikan data?')"><i
|
||||
class="fas fa-trash-restore"></i> Restore
|
||||
</button>
|
||||
</form>
|
||||
<form
|
||||
action="{{ url('/admin/peraturan_perundang_undangan/' . $peraturanPerundangUndangan->id . '/delete') }}"
|
||||
method="post">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-danger"
|
||||
onclick="return confirm('Apakah anda yakin ingin menghapus permanen data?')"><i
|
||||
class="fa fa-trash"></i> Delete Permanent
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<!-- Modal Add -->
|
||||
<div class="modal fade" id="formModalAdd" tabindex="-1" aria-labelledby="formModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="formModalLabel">Tambah Data Peraturan & Perundang Undangan</h5>
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal" aria-label="Close">X</button>
|
||||
</div>
|
||||
<form id="formAdd" action="{{ url('/admin/peraturan_perundang_undangan') }}" method="post"
|
||||
enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="modal-body">
|
||||
<div class="form-group mt-2">
|
||||
<label for="judul">Judul</label>
|
||||
<input type="text" class="form-control mt-0" name="judul" id="judul" required maxlength="255"
|
||||
placeholder=". . .">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="nama_file">File Peraturan & Perundang Undangan</label>
|
||||
<input type="file" id="input_file_add" class="form-control mt-0" name="nama_file"
|
||||
required onchange="Filevalidation()" accept="application/pdf">
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="release_date">Jadwal Rilis</label>
|
||||
<input type="date" class="form-control mt-0" name="release_date" required>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal"
|
||||
aria-label="Close">Batal</button>
|
||||
<button type="submit" class="btn btn-primary">Tambah Data</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@foreach ($peraturanPerundangUndangans as $peraturanPerundangUndangan)
|
||||
<!-- Modal Edit -->
|
||||
<div class="modal fade" id="formModalEdit" tabindex="-1" aria-labelledby="formModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="formModalLabel">Ubah Data Peraturan & Perundang Undangan</h5>
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal" aria-label="Close">X</button>
|
||||
</div>
|
||||
<form id="formEdit" action="{{ route('peraturan_perundang_undangan.update', $peraturanPerundangUndangan->id) }}"
|
||||
method="POST" enctype="multipart/form-data">
|
||||
@method('patch')
|
||||
@csrf
|
||||
<div class="modal-body">
|
||||
<input type="hidden" name="id" id="id">
|
||||
<div class="form-group mt-2">
|
||||
<label for="judul">Nama</label>
|
||||
<input type="text" class="form-control mt-0" name="judul" id="judul" required
|
||||
maxlength="255" placeholder=". . .">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="nama_file">File Peraturan & Perundang Undangan</label>
|
||||
<input type="file" id="input_file_edit" class="form-control mt-0" name="nama_file"
|
||||
id="nama_file" accept="application/pdf">
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="release_date">Jadwal Rilis</label>
|
||||
<input type="date" class="form-control mt-0" name="release_date" id="release_date" required>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal"
|
||||
aria-label="Close">Batal</button>
|
||||
<button type="submit" class="btn btn-primary">Ubah Data</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
|
||||
<script type="text/javascript">
|
||||
var $formAdd = $("#formAdd");
|
||||
$formAdd.submit(function(){
|
||||
$formAdd.submit(function(){
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var $formEdit = $("#formEdit");
|
||||
$formEdit.submit(function(){
|
||||
$formEdit.submit(function(){
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<!--Data Table -->
|
||||
<script>
|
||||
$(function() {
|
||||
$("#tabel_peraturan_perundang_undangan").DataTable({
|
||||
"paging": true,
|
||||
"lengthChange": false,
|
||||
"searching": true,
|
||||
"ordering": true,
|
||||
"info": true,
|
||||
"autoWidth": false,
|
||||
"responsive": false,
|
||||
"buttons": ["copy", "csv", "excel", "pdf", "print", "colvis"]
|
||||
}).buttons().container().appendTo('#tabel_peraturan_perundang_undangan_wrapper .col-md-6:eq(0)');
|
||||
});
|
||||
|
||||
$(document).on("click", ".open-formModalEdit", function() {
|
||||
var id = $(this).data('id');
|
||||
var judul = $(this).data('judul');
|
||||
var nama_file = $(this).data('nama_file');
|
||||
var release_date = $(this).data('release_date');
|
||||
|
||||
$(".modal-body #id").val(id);
|
||||
$(".modal-body #judul").val(judul);
|
||||
$(".modal-body #release_date").val(release_date);
|
||||
$(".modal-body #nama_file").val(nama_file);
|
||||
$(".modal-body #input_file_edit").val("");
|
||||
});
|
||||
|
||||
//Form add image validation
|
||||
var uploadField = document.getElementById("input_file_add");
|
||||
uploadField.onchange = function() {
|
||||
if (this.files[0].size > 2000000) {
|
||||
alert("Batas maksimum 2MB!");
|
||||
this.value = "";
|
||||
};
|
||||
};
|
||||
|
||||
//Form edit image validation
|
||||
var uploadField = document.getElementById("input_file_edit");
|
||||
uploadField.onchange = function() {
|
||||
if (this.files[0].size > 2000000) {
|
||||
alert("Batas maksimum 2MB!");
|
||||
this.value = "";
|
||||
};
|
||||
};
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,182 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Perpustakaan')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Perpustakaan</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
<!-- /.content-header -->
|
||||
|
||||
<!-- Alert Status -->
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('alert'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('alert') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Edit Menu Perpustakaan</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<form class="from-prevent-multiple-submits" action="{{ route('perpustakaan.update', $perpustakaan->id) }}" method="POST">
|
||||
@method('patch')
|
||||
@csrf
|
||||
<textarea id="teks" placeholder="Enter the Description"
|
||||
name="teks">{{ $perpustakaan->teks }}</textarea>
|
||||
<br>
|
||||
<button id="submit" type="submit" class="btn btn-primary from-prevent-multiple-submits">Save</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
@section('script')
|
||||
<script>
|
||||
//Define an adapter to upload the files
|
||||
class MyUploadAdapter {
|
||||
constructor(loader) {
|
||||
// The file loader instance to use during the upload. It sounds scary but do not
|
||||
// worry — the loader will be passed into the adapter later on in this guide.
|
||||
this.loader = loader;
|
||||
|
||||
// URL where to send files.
|
||||
this.url = '{{ route('ckeditor.upload') }}';
|
||||
|
||||
//
|
||||
}
|
||||
// Starts the upload process.
|
||||
upload() {
|
||||
return this.loader.file.then(
|
||||
(file) =>
|
||||
new Promise((resolve, reject) => {
|
||||
this._initRequest();
|
||||
this._initListeners(resolve, reject, file);
|
||||
this._sendRequest(file);
|
||||
})
|
||||
);
|
||||
}
|
||||
// Aborts the upload process.
|
||||
abort() {
|
||||
if (this.xhr) {
|
||||
this.xhr.abort();
|
||||
}
|
||||
}
|
||||
// Initializes the XMLHttpRequest object using the URL passed to the constructor.
|
||||
_initRequest() {
|
||||
const xhr = (this.xhr = new XMLHttpRequest());
|
||||
// Note that your request may look different. It is up to you and your editor
|
||||
// integration to choose the right communication channel. This example uses
|
||||
// a POST request with JSON as a data structure but your configuration
|
||||
// could be different.
|
||||
// xhr.open('POST', this.url, true);
|
||||
xhr.open("POST", this.url, true);
|
||||
xhr.setRequestHeader("x-csrf-token", "{{ csrf_token() }}");
|
||||
xhr.responseType = "json";
|
||||
}
|
||||
// Initializes XMLHttpRequest listeners.
|
||||
_initListeners(resolve, reject, file) {
|
||||
const xhr = this.xhr;
|
||||
const loader = this.loader;
|
||||
const genericErrorText = `Couldn't upload file: ${file.name}.`;
|
||||
xhr.addEventListener("error", () => reject(genericErrorText));
|
||||
xhr.addEventListener("abort", () => reject());
|
||||
xhr.addEventListener("load", () => {
|
||||
const response = xhr.response;
|
||||
// This example assumes the XHR server's "response" object will come with
|
||||
// an "error" which has its own "message" that can be passed to reject()
|
||||
// in the upload promise.
|
||||
//
|
||||
// Your integration may handle upload errors in a different way so make sure
|
||||
// it is done properly. The reject() function must be called when the upload fails.
|
||||
if (!response || response.error) {
|
||||
return reject(response && response.error ? response.error.message : genericErrorText);
|
||||
}
|
||||
// If the upload is successful, resolve the upload promise with an object containing
|
||||
// at least the "default" URL, pointing to the image on the server.
|
||||
// This URL will be used to display the image in the content. Learn more in the
|
||||
// UploadAdapter#upload documentation.
|
||||
resolve({
|
||||
default: response.url,
|
||||
});
|
||||
});
|
||||
// Upload progress when it is supported. The file loader has the #uploadTotal and #uploaded
|
||||
// properties which are used e.g. to display the upload progress bar in the editor
|
||||
// user interface.
|
||||
if (xhr.upload) {
|
||||
xhr.upload.addEventListener("progress", (evt) => {
|
||||
if (evt.lengthComputable) {
|
||||
loader.uploadTotal = evt.total;
|
||||
loader.uploaded = evt.loaded;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// Prepares the data and sends the request.
|
||||
_sendRequest(file) {
|
||||
// Prepare the form data.
|
||||
const data = new FormData();
|
||||
data.append("upload", file);
|
||||
// Important note: This is the right place to implement security mechanisms
|
||||
// like authentication and CSRF protection. For instance, you can use
|
||||
// XMLHttpRequest.setRequestHeader() to set the request headers containing
|
||||
// the CSRF token generated earlier by your application.
|
||||
// Send the request.
|
||||
this.xhr.send(data);
|
||||
}
|
||||
// ...
|
||||
}
|
||||
|
||||
function SimpleUploadAdapterPlugin(editor) {
|
||||
editor.plugins.get("FileRepository").createUploadAdapter = (loader) => {
|
||||
// Configure the URL to the upload script in your back-end here!
|
||||
return new MyUploadAdapter(loader);
|
||||
};
|
||||
}
|
||||
|
||||
//Initialize the ckeditor
|
||||
ClassicEditor.create(document.querySelector("#teks"), {
|
||||
extraPlugins: [SimpleUploadAdapterPlugin],
|
||||
}).catch((error) => {
|
||||
console.error(error);
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function(){
|
||||
$('.from-prevent-multiple-submits').on('submit', function(){
|
||||
$('.from-prevent-multiple-submits').attr('disabled','true');
|
||||
})
|
||||
})();
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,140 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Pertanyaan')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Pertanyaan</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
|
||||
<!-- Alert Status -->
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('alert'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('alert') }}
|
||||
</div>
|
||||
@endif
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Data Pertanyaan</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="table-responsive">
|
||||
<table id="tabel_pertanyaan" class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nomor</th>
|
||||
<th>Nama</th>
|
||||
<th>Email</th>
|
||||
<th>Pertanyaan</th>
|
||||
<th>Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($pertanyaans as $pertanyaan)
|
||||
<tr>
|
||||
<td>{{ $loop->iteration }}</td>
|
||||
<td>{{ $pertanyaan->nama }}</td>
|
||||
<td>{{ $pertanyaan->email }}</td>
|
||||
<td>{{ $pertanyaan->pertanyaan }}</td>
|
||||
@if ($pertanyaan->deleted_at == '')
|
||||
<td>
|
||||
<form
|
||||
action="{{ route('pertanyaan.destroy', $pertanyaan) }}"
|
||||
method="post">
|
||||
@method('delete')
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-danger"
|
||||
onclick="return confirm('Apakah anda yakin ingin menghapus data?')"><i
|
||||
class="fa fa-trash"></i> Delete</button>
|
||||
</form>
|
||||
</td>
|
||||
@else
|
||||
<td>
|
||||
<form
|
||||
action="{{ url('/admin/pertanyaan/' . $pertanyaan->id . '/restore') }}"
|
||||
method="post">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-primary"
|
||||
onclick="return confirm('Apakah anda yakin ingin mengembalikan data?')"><i
|
||||
class="fas fa-trash-restore"></i> Restore
|
||||
</button>
|
||||
</form>
|
||||
<form
|
||||
action="{{ url('/admin/pertanyaan/' . $pertanyaan->id . '/delete') }}"
|
||||
method="post">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-danger"
|
||||
onclick="return confirm('Apakah anda yakin ingin menghapus permanen data?')"><i
|
||||
class="fa fa-trash"></i> Delete Permanent
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('script')
|
||||
<!--Data Table -->
|
||||
<script>
|
||||
$(function () {
|
||||
$("#tabel_pertanyaan").DataTable({
|
||||
"paging": true,
|
||||
"lengthChange": false,
|
||||
"searching": true,
|
||||
"ordering": true,
|
||||
"info": true,
|
||||
"autoWidth": false,
|
||||
"responsive": false,
|
||||
"buttons": ["copy", "csv", "excel", "pdf", "print", "colvis"]
|
||||
}).buttons().container().appendTo('#tabel_pertanyaan_wrapper .col-md-6:eq(0)');
|
||||
});
|
||||
|
||||
$(document).on("click", ".open-formModalEdit", function () {
|
||||
var id = $(this).data('id');
|
||||
var nama = $(this).data('nama');
|
||||
var email = $(this).data('email');
|
||||
var pertanyaan = $(this).data('pertanyaan');
|
||||
var answer = $(this).data('answer');
|
||||
var status = $(this).data('status');
|
||||
|
||||
$(".modal-body #id").val(id);
|
||||
$(".modal-body #nama").val(nama);
|
||||
$(".modal-body #email").val(email);
|
||||
$(".modal-body #pertanyaan").val(pertanyaan);
|
||||
$(".modal-body #answer").val(answer);
|
||||
$(".modal-body #status").val(status);
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,235 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Prestasi & Aktivitas Mahasiswa')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Prestasi & Aktivitas Mahasiswa</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
<!-- /.content-header -->
|
||||
|
||||
<!-- Alert Status -->
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('alert'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('alert') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Tambah Data Prestasi & Aktivitas Mahasiswa</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<!-- form start -->
|
||||
<form class="from-prevent-multiple-submits" action="{{ route('prestasi_aktivitas_mahasiswa.store') }}" method="POST"
|
||||
id="ckeditorForm" enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<label for="judul">Judul</label>
|
||||
<input type="text" class="form-control" id="judul" name="judul"
|
||||
placeholder="Masukkan Judul" value="" required maxlength="255">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="nama_foto">Thumbnail (Maksimal 2MB)</label>
|
||||
<div class="form-group">
|
||||
<img id="img_preview_add" style="max-width: 200px;"
|
||||
class="mt-2" />
|
||||
</div>
|
||||
<input type="file" accept="image/*" class="form-control mt-0"
|
||||
name="thumbnail" id="input_foto_add" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="teks">Teks (Foto Maksimal 2MB)</label>
|
||||
<textarea id="teks" placeholder="Masukkan Teks" name="teks"
|
||||
class="ck_editor_txt" id="ck_editor_txt"></textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="release_date">Tanggal Rilis</label>
|
||||
<input type="date" class="form-control" name="release_date" required>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
|
||||
<div class="card-footer">
|
||||
<button id="submit" type="submit" class="btn btn-primary from-prevent-multiple-submits">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
//Define an adapter to upload the files
|
||||
class MyUploadAdapter {
|
||||
constructor(loader) {
|
||||
// The file loader instance to use during the upload. It sounds scary but do not
|
||||
// worry — the loader will be passed into the adapter later on in this guide.
|
||||
this.loader = loader;
|
||||
|
||||
// URL where to send files.
|
||||
this.url = '{{ route('ckeditor.upload') }}';
|
||||
|
||||
//
|
||||
}
|
||||
// Starts the upload process.
|
||||
upload() {
|
||||
return this.loader.file.then(
|
||||
(file) =>
|
||||
new Promise((resolve, reject) => {
|
||||
this._initRequest();
|
||||
this._initListeners(resolve, reject, file);
|
||||
this._sendRequest(file);
|
||||
})
|
||||
);
|
||||
}
|
||||
// Aborts the upload process.
|
||||
abort() {
|
||||
if (this.xhr) {
|
||||
this.xhr.abort();
|
||||
}
|
||||
}
|
||||
// Initializes the XMLHttpRequest object using the URL passed to the constructor.
|
||||
_initRequest() {
|
||||
const xhr = (this.xhr = new XMLHttpRequest());
|
||||
// Note that your request may look different. It is up to you and your editor
|
||||
// integration to choose the right communication channel. This example uses
|
||||
// a POST request with JSON as a data structure but your configuration
|
||||
// could be different.
|
||||
// xhr.open('POST', this.url, true);
|
||||
xhr.open("POST", this.url, true);
|
||||
xhr.setRequestHeader("x-csrf-token", "{{ csrf_token() }}");
|
||||
xhr.responseType = "json";
|
||||
}
|
||||
// Initializes XMLHttpRequest listeners.
|
||||
_initListeners(resolve, reject, file) {
|
||||
const xhr = this.xhr;
|
||||
const loader = this.loader;
|
||||
const genericErrorText = `Couldn't upload file: ${file.name}.`;
|
||||
xhr.addEventListener("error", () => reject(genericErrorText));
|
||||
xhr.addEventListener("abort", () => reject());
|
||||
xhr.addEventListener("load", () => {
|
||||
const response = xhr.response;
|
||||
// This example assumes the XHR server's "response" object will come with
|
||||
// an "error" which has its own "message" that can be passed to reject()
|
||||
// in the upload promise.
|
||||
//
|
||||
// Your integration may handle upload errors in a different way so make sure
|
||||
// it is done properly. The reject() function must be called when the upload fails.
|
||||
if (!response || response.error) {
|
||||
return reject(response && response.error ? response.error.message : genericErrorText);
|
||||
}
|
||||
// If the upload is successful, resolve the upload promise with an object containing
|
||||
// at least the "default" URL, pointing to the image on the server.
|
||||
// This URL will be used to display the image in the content. Learn more in the
|
||||
// UploadAdapter#upload documentation.
|
||||
resolve({
|
||||
default: response.url,
|
||||
});
|
||||
});
|
||||
// Upload progress when it is supported. The file loader has the #uploadTotal and #uploaded
|
||||
// properties which are used e.g. to display the upload progress bar in the editor
|
||||
// user interface.
|
||||
if (xhr.upload) {
|
||||
xhr.upload.addEventListener("progress", (evt) => {
|
||||
if (evt.lengthComputable) {
|
||||
loader.uploadTotal = evt.total;
|
||||
loader.uploaded = evt.loaded;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// Prepares the data and sends the request.
|
||||
_sendRequest(file) {
|
||||
// Prepare the form data.
|
||||
const data = new FormData();
|
||||
data.append("upload", file);
|
||||
// Important note: This is the right place to implement security mechanisms
|
||||
// like authentication and CSRF protection. For instance, you can use
|
||||
// XMLHttpRequest.setRequestHeader() to set the request headers containing
|
||||
// the CSRF token generated earlier by your application.
|
||||
// Send the request.
|
||||
this.xhr.send(data);
|
||||
}
|
||||
// ...
|
||||
}
|
||||
|
||||
function SimpleUploadAdapterPlugin(editor) {
|
||||
editor.plugins.get("FileRepository").createUploadAdapter = (loader) => {
|
||||
// Configure the URL to the upload script in your back-end here!
|
||||
return new MyUploadAdapter(loader);
|
||||
};
|
||||
}
|
||||
|
||||
var allEditors = document.querySelector('.ck_editor_txt');
|
||||
|
||||
//Initialize the ckeditor
|
||||
ClassicEditor.create(document.querySelector("#teks"), {
|
||||
extraPlugins: [SimpleUploadAdapterPlugin],
|
||||
}).catch((error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
$("#ckeditorForm").submit(function(e) {
|
||||
var content = $('.ck_editor_txt').val();
|
||||
html = $(content).text();
|
||||
if ($.trim(html) == '') {
|
||||
alert("Teks Tidak Boleh Kosong!");
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
//Form add image validation
|
||||
var uploadField = document.getElementById("input_foto_add");
|
||||
uploadField.onchange = function() {
|
||||
if (this.files[0].size > 2000000) {
|
||||
alert("Batas maksimum 2MB!");
|
||||
this.value = "";
|
||||
} else {
|
||||
//Ubah Img Preview
|
||||
var reader = new FileReader();
|
||||
reader.onload = function() {
|
||||
var output = document.getElementById('img_preview_add');
|
||||
output.src = reader.result;
|
||||
}
|
||||
reader.readAsDataURL(event.target.files[0]);
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function(){
|
||||
$('.from-prevent-multiple-submits').on('submit', function(){
|
||||
$('.from-prevent-multiple-submits').attr('disabled','true');
|
||||
})
|
||||
})();
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,231 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Prestasi Aktivitas Mahasiswa')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Prestasi Aktivitas Mahasiswa</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
<!-- /.content-header -->
|
||||
|
||||
<!-- Alert Status -->
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('alert'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('alert') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Edit Data Prestasi Aktivitas Mahasiswa</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<!-- form start -->
|
||||
<form
|
||||
action="{{ route('prestasi_aktivitas_mahasiswa.update', $prestasiAktivitasMahasiswa) }}"
|
||||
method="POST" enctype="multipart/form-data">
|
||||
@method('patch')
|
||||
@csrf
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<label for="judul">Judul</label>
|
||||
<input type="text" class="form-control" id="judul" name="judul"
|
||||
placeholder="Masukkan Judul" maxlength="255"
|
||||
value="{{ $prestasiAktivitasMahasiswa->judul }}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="nama_foto">Foto (Maksimal 2MB)</label>
|
||||
<div class="form-group">
|
||||
<img src="{{ url($prestasiAktivitasMahasiswa->thumbnail) }}"
|
||||
alt="Image Missing" id="old_nama_foto" style="max-width: 200px;"
|
||||
class="mt-2" />
|
||||
</div>
|
||||
<input type="file" accept="image/*" class="form-control mt-0"
|
||||
name="thumbnail" id="input_foto_edit">
|
||||
<input type="hidden" name="old_thumbnail"
|
||||
value="{{ $prestasiAktivitasMahasiswa->thumbnail }}">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="teks">Teks (Foto Maksimal 2MB)</label>
|
||||
<textarea id="teks" placeholder="Masukkan Deskripsi Video"
|
||||
name="teks">{{ $prestasiAktivitasMahasiswa->teks }}</textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="release_date">Tanggal Rilis</label>
|
||||
<input type="date" class="form-control" name="release_date"
|
||||
value="{{ $prestasiAktivitasMahasiswa->release_date }}" required>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
|
||||
<div class="card-footer">
|
||||
<button id="submit" type="submit"
|
||||
class="btn btn-primary from-prevent-multiple-submits">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
//Define an adapter to upload the files
|
||||
class MyUploadAdapter {
|
||||
constructor(loader) {
|
||||
// The file loader instance to use during the upload. It sounds scary but do not
|
||||
// worry — the loader will be passed into the adapter later on in this guide.
|
||||
this.loader = loader;
|
||||
|
||||
// URL where to send files.
|
||||
this.url = '{{ route('ckeditor.upload') }}';
|
||||
|
||||
//
|
||||
}
|
||||
// Starts the upload process.
|
||||
upload() {
|
||||
return this.loader.file.then(
|
||||
(file) =>
|
||||
new Promise((resolve, reject) => {
|
||||
this._initRequest();
|
||||
this._initListeners(resolve, reject, file);
|
||||
this._sendRequest(file);
|
||||
})
|
||||
);
|
||||
}
|
||||
// Aborts the upload process.
|
||||
abort() {
|
||||
if (this.xhr) {
|
||||
this.xhr.abort();
|
||||
}
|
||||
}
|
||||
// Initializes the XMLHttpRequest object using the URL passed to the constructor.
|
||||
_initRequest() {
|
||||
const xhr = (this.xhr = new XMLHttpRequest());
|
||||
// Note that your request may look different. It is up to you and your editor
|
||||
// integration to choose the right communication channel. This example uses
|
||||
// a POST request with JSON as a data structure but your configuration
|
||||
// could be different.
|
||||
// xhr.open('POST', this.url, true);
|
||||
xhr.open("POST", this.url, true);
|
||||
xhr.setRequestHeader("x-csrf-token", "{{ csrf_token() }}");
|
||||
xhr.responseType = "json";
|
||||
}
|
||||
// Initializes XMLHttpRequest listeners.
|
||||
_initListeners(resolve, reject, file) {
|
||||
const xhr = this.xhr;
|
||||
const loader = this.loader;
|
||||
const genericErrorText = `Couldn't upload file: ${file.name}.`;
|
||||
xhr.addEventListener("error", () => reject(genericErrorText));
|
||||
xhr.addEventListener("abort", () => reject());
|
||||
xhr.addEventListener("load", () => {
|
||||
const response = xhr.response;
|
||||
// This example assumes the XHR server's "response" object will come with
|
||||
// an "error" which has its own "message" that can be passed to reject()
|
||||
// in the upload promise.
|
||||
//
|
||||
// Your integration may handle upload errors in a different way so make sure
|
||||
// it is done properly. The reject() function must be called when the upload fails.
|
||||
if (!response || response.error) {
|
||||
return reject(response && response.error ? response.error.message : genericErrorText);
|
||||
}
|
||||
// If the upload is successful, resolve the upload promise with an object containing
|
||||
// at least the "default" URL, pointing to the image on the server.
|
||||
// This URL will be used to display the image in the content. Learn more in the
|
||||
// UploadAdapter#upload documentation.
|
||||
resolve({
|
||||
default: response.url,
|
||||
});
|
||||
});
|
||||
// Upload progress when it is supported. The file loader has the #uploadTotal and #uploaded
|
||||
// properties which are used e.g. to display the upload progress bar in the editor
|
||||
// user interface.
|
||||
if (xhr.upload) {
|
||||
xhr.upload.addEventListener("progress", (evt) => {
|
||||
if (evt.lengthComputable) {
|
||||
loader.uploadTotal = evt.total;
|
||||
loader.uploaded = evt.loaded;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// Prepares the data and sends the request.
|
||||
_sendRequest(file) {
|
||||
// Prepare the form data.
|
||||
const data = new FormData();
|
||||
data.append("upload", file);
|
||||
// Important note: This is the right place to implement security mechanisms
|
||||
// like authentication and CSRF protection. For instance, you can use
|
||||
// XMLHttpRequest.setRequestHeader() to set the request headers containing
|
||||
// the CSRF token generated earlier by your application.
|
||||
// Send the request.
|
||||
this.xhr.send(data);
|
||||
}
|
||||
// ...
|
||||
}
|
||||
|
||||
function SimpleUploadAdapterPlugin(editor) {
|
||||
editor.plugins.get("FileRepository").createUploadAdapter = (loader) => {
|
||||
// Configure the URL to the upload script in your back-end here!
|
||||
return new MyUploadAdapter(loader);
|
||||
};
|
||||
}
|
||||
|
||||
//Initialize the ckeditor
|
||||
ClassicEditor.create(document.querySelector("#teks"), {
|
||||
extraPlugins: [SimpleUploadAdapterPlugin],
|
||||
}).catch((error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
//Form edit image validation
|
||||
var uploadField = document.getElementById("input_foto_edit");
|
||||
uploadField.onchange = function() {
|
||||
if (this.files[0].size > 2000000) {
|
||||
alert("Batas maksimum 2MB!");
|
||||
this.value = "";
|
||||
} else {
|
||||
//Ubah Img Preview
|
||||
var reader = new FileReader();
|
||||
reader.onload = function() {
|
||||
var output = document.getElementById('old_nama_foto');
|
||||
output.src = reader.result;
|
||||
}
|
||||
reader.readAsDataURL(event.target.files[0]);
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function() {
|
||||
$('.from-prevent-multiple-submits').on('submit', function() {
|
||||
$('.from-prevent-multiple-submits').attr('disabled', 'true');
|
||||
})
|
||||
})();
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,159 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Prestasi & Aktivitas Mahasiswa')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Prestasi & Aktivitas Mahasiswa</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
<!-- /.content-header -->
|
||||
|
||||
<!-- Alert Status -->
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('alert'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('alert') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Data Prestasi & Aktivitas Mahasiswa</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-12 text-left">
|
||||
<a type="button" href="{{ url('/admin/prestasi_aktivitas_mahasiswa/create') }}"
|
||||
class="btn btn-success mb-3"><i class="fa fa-plus-circle"></i>
|
||||
Tambah Data Prestasi & Aktivitas Mahasiswa
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table id="tabel_prestasi_aktivitas_mahasiswa"
|
||||
class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nomor</th>
|
||||
<th>Judul</th>
|
||||
<th>Thumbnail</th>
|
||||
<th>Teks</th>
|
||||
<th>Jadwal Rilis</th>
|
||||
<th>Status</th>
|
||||
<th>Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($prestasiAktivitasMahasiswas as $prestasiAktivitasMahasiswa)
|
||||
<tr>
|
||||
<td>{{ $loop->iteration }}</td>
|
||||
<td>{{ $prestasiAktivitasMahasiswa->judul }}</td>
|
||||
<td>
|
||||
<img src="{{ url($prestasiAktivitasMahasiswa->thumbnail) }}"
|
||||
alt="Image Missing" style="width: 100px;">
|
||||
</td>
|
||||
<td>
|
||||
@if (strlen(strip_tags($prestasiAktivitasMahasiswa->teks)) > 100)
|
||||
{{ str_replace(' ', '', substr(strip_tags($prestasiAktivitasMahasiswa->teks), 0, 100) . '...') }}
|
||||
@else
|
||||
{{ str_replace(' ', '', substr(strip_tags($prestasiAktivitasMahasiswa->teks), 0, 100)) }}
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ $prestasiAktivitasMahasiswa->release_date }}</td>
|
||||
<td>
|
||||
@if ($prestasiAktivitasMahasiswa->deleted_at != '')
|
||||
Terhapus
|
||||
@elseif ($prestasiAktivitasMahasiswa->release_date > date('Y-m-d'))
|
||||
Belum Rilis
|
||||
@else
|
||||
Rilis
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if ($prestasiAktivitasMahasiswa->deleted_at != '')
|
||||
<form
|
||||
action="{{ url('/admin/prestasi_aktivitas_mahasiswa/' . $prestasiAktivitasMahasiswa->id . '/restore') }}"
|
||||
method="post">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-primary"
|
||||
onclick="return confirm('Apakah anda yakin ingin mengembalikan data?')"><i
|
||||
class="fas fa-trash-restore"></i> Restore
|
||||
</button>
|
||||
</form>
|
||||
<form
|
||||
action="{{ url('/admin/prestasi_aktivitas_mahasiswa/' . $prestasiAktivitasMahasiswa->id . '/delete_permanen') }}"
|
||||
method="post">
|
||||
@csrf
|
||||
<input type="hidden" name="thumbnail"
|
||||
value="{{ $prestasiAktivitasMahasiswa->thumbnail }}">
|
||||
<button type="submit" class="btn btn-danger"
|
||||
onclick="return confirm('Apakah anda yakin ingin menghapus permanen data?')"><i
|
||||
class="fa fa-trash"></i> Delete Permanent
|
||||
</button>
|
||||
</form>
|
||||
@else
|
||||
<a href="{{ route('prestasi_aktivitas_mahasiswa.edit', $prestasiAktivitasMahasiswa) }}"
|
||||
class="btn btn-warning open-formModalEdit">
|
||||
<i class="fa fa-edit"></i> Edit
|
||||
</a>
|
||||
<form
|
||||
action="{{ route('prestasi_aktivitas_mahasiswa.destroy', $prestasiAktivitasMahasiswa) }}"
|
||||
method="post">
|
||||
@method('delete')
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-danger"
|
||||
onclick="return confirm('Apakah anda yakin ingin menghapus data?')"><i
|
||||
class="fa fa-trash"></i> Delete
|
||||
</button>
|
||||
</form>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<!--Data Table -->
|
||||
<script>
|
||||
$(function() {
|
||||
$("#tabel_prestasi_aktivitas_mahasiswa").DataTable({
|
||||
"paging": true,
|
||||
"lengthChange": false,
|
||||
"searching": true,
|
||||
"ordering": true,
|
||||
"info": true,
|
||||
"autoWidth": false,
|
||||
"responsive": false,
|
||||
"buttons": ["copy", "csv", "excel", "pdf", "print", "colvis"]
|
||||
}).buttons().container().appendTo('#tabel_prestasi_aktivitas_mahasiswa_wrapper .col-md-6:eq(0)');
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,104 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Profil Singkat')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Profil Singkat</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
<!-- /.content-header -->
|
||||
|
||||
<!-- Alert Status -->
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('alert'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('alert') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Edit Menu Profil Singkat</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<form class="from-prevent-multiple-submits"
|
||||
action="{{ route('profil_singkat.update', $profilSingkat->id) }}" method="POST"
|
||||
enctype="multipart/form-data">
|
||||
@method('patch')
|
||||
@csrf
|
||||
<input type="hidden" name="id" value="{{ $profilSingkat->id }}">
|
||||
<div class="form-group">
|
||||
<label for="nama_foto">Foto (Maksimal 2MB)</label>
|
||||
<div class="form-group">
|
||||
<img id="img_preview_add" src="{{ url($profilSingkat->nama_foto) }}"
|
||||
style="width:300px;">
|
||||
</div>
|
||||
<input type="file" accept="image/*" class="form-control mt-0" name="nama_foto"
|
||||
id="input_foto_add">
|
||||
</div>
|
||||
<div class=" form-group">
|
||||
<textarea class="form-control" style="width : 40rem;height:20rem" type="text"
|
||||
id="teks" name="teks"
|
||||
maxlength="255">{{ $profilSingkat->teks }}</textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-success"> Save </button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
//Form add image validation
|
||||
var uploadField = document.getElementById("input_foto_add");
|
||||
uploadField.onchange = function() {
|
||||
if (this.files[0].size > 2000000) {
|
||||
alert("Batas maksimum 2MB!");
|
||||
this.value = "";
|
||||
} else {
|
||||
//Ubah Img Preview
|
||||
var reader = new FileReader();
|
||||
reader.onload = function() {
|
||||
var output = document.getElementById('img_preview_add');
|
||||
output.src = reader.result;
|
||||
}
|
||||
reader.readAsDataURL(event.target.files[0]);
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function() {
|
||||
$('.from-prevent-multiple-submits').on('submit', function() {
|
||||
$('.from-prevent-multiple-submits').attr('disabled', 'true');
|
||||
})
|
||||
})();
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,317 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Quote')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Quote</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
|
||||
<!-- Alert Status -->
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('alert'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('alert') }}
|
||||
</div>
|
||||
@endif
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Data Quote</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-12 text-left">
|
||||
<a type="button" href="#formModalAdd" data-toggle="modal"
|
||||
class="btn btn-success mb-3"><i class="fa fa-plus-circle"></i>
|
||||
Tambah Data Quote
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table id="tabel_quote" class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nomor</th>
|
||||
<th>Teks</th>
|
||||
<th>Foto</th>
|
||||
<th>Sumber</th>
|
||||
<th>Jadwal Rilis</th>
|
||||
<th>Status</th>
|
||||
<th>Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($quotes as $quote)
|
||||
<tr>
|
||||
<td>{{ $loop->iteration }}</td>
|
||||
<td>{{ $quote->teks }}</td>
|
||||
<td><img src="{{ url($quote->nama_foto) }}"
|
||||
style="width:100px;height:auto;object-fit:cover"></td>
|
||||
<td>{{ $quote->sumber }}</td>
|
||||
<td>{{ $quote->release_date }}</td>
|
||||
@if ($quote->deleted_at == '')
|
||||
@if ($quote->release_date <= date('Y-m-d'))
|
||||
<td>Rilis</td>
|
||||
@else
|
||||
<td>Belum Rilis</td>
|
||||
@endif
|
||||
@else ($quote->deleted_at != "")
|
||||
<td>Terhapus</td>
|
||||
@endif
|
||||
@if ($quote->deleted_at == '')
|
||||
<td>
|
||||
<button href="#formModalEdit" role="button" data-toggle="modal"
|
||||
data-id="{{ $quote->id }}"
|
||||
data-teks="{{ $quote->teks }}"
|
||||
data-nama_foto="{{ url($quote->nama_foto) }}"
|
||||
data-sumber="{{ $quote->sumber }}"
|
||||
data-release_date="{{ $quote->release_date }}"
|
||||
class="btn btn-warning open-formModalEdit"><i
|
||||
class="fa fa-edit"></i> Edit</button>
|
||||
<form action="{{ route('quote.destroy', $quote) }}"
|
||||
method="post">
|
||||
@method('delete')
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-danger"
|
||||
onclick="return confirm('Apakah anda yakin ingin menghapus data?')"><i
|
||||
class="fa fa-trash"></i> Delete</button>
|
||||
</form>
|
||||
</td>
|
||||
@else
|
||||
<td>
|
||||
<form
|
||||
action="{{ url('/admin/quote/' . $quote->id . '/restore') }}"
|
||||
method="post">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-primary"
|
||||
onclick="return confirm('Apakah anda yakin ingin mengembalikan data?')"><i
|
||||
class="fas fa-trash-restore"></i> Restore
|
||||
</button>
|
||||
</form>
|
||||
<form
|
||||
action="{{ url('/admin/quote/' . $quote->id . '/delete') }}"
|
||||
method="post">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-danger"
|
||||
onclick="return confirm('Apakah anda yakin ingin menghapus permanen data?')"><i
|
||||
class="fa fa-trash"></i> Delete Permanent
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<!-- Modal Add -->
|
||||
<div class="modal fade" id="formModalAdd" tabindex="-1" aria-labelledby="formModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="formModalLabel">Tambah Data Quote</h5>
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal" aria-label="Close">X</button>
|
||||
</div>
|
||||
<form id="formAdd" action="{{ url('/admin/quote') }}" method="post" enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="modal-body">
|
||||
<div class="form-group mt-2">
|
||||
<label for="teks">Teks Quotes</label>
|
||||
<input type="text" class="form-control mt-0" name="teks" required maxlength="255"
|
||||
placeholder=". . .">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="nama_foto">Foto (Maksimal 2MB)</label>
|
||||
<div class="form-group">
|
||||
<img id="img_preview_add" style="max-width: 200px;" class="mt-2" />
|
||||
</div>
|
||||
<input type="file" accept="image/*" class="form-control mt-0" name="nama_foto"
|
||||
id="input_foto_add" required>
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="sumber">Sumber</label>
|
||||
<input type="text" class="form-control mt-0" name="sumber" required maxlength="255"
|
||||
placeholder=". . .">
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="release_date">Jadwal Rilis</label>
|
||||
<input type="date" class="form-control mt-0" name="release_date" required>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal"
|
||||
aria-label="Close">Batal</button>
|
||||
<button type="submit" class="btn btn-primary">Tambah Data</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@foreach ($quotes as $quote)
|
||||
<!-- Modal Edit -->
|
||||
<div class="modal fade" id="formModalEdit" tabindex="-1" aria-labelledby="formModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="formModalLabel">Ubah Data Quote</h5>
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal" aria-label="Close">X</button>
|
||||
</div>
|
||||
<form id="formEdit" action="{{ route('quote.update', $quote->id) }}" method="POST" enctype="multipart/form-data">
|
||||
@method('patch')
|
||||
@csrf
|
||||
<div class="modal-body">
|
||||
<input type="hidden" name="id" id="id">
|
||||
<div class="form-group mt-2">
|
||||
<label for="teks">Teks (Foto Maksimal 2MB)</label>
|
||||
<input type="text" class="form-control mt-0" name="teks" id="teks" required maxlength="255"
|
||||
placeholder=". . .">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="nama_foto">Foto (Maksimal 2MB)</label>
|
||||
<div class="form-group">
|
||||
<img src="" alt="Image Missing" id="old_nama_foto" style="max-width: 200px;"
|
||||
class="mt-2" />
|
||||
</div>
|
||||
<input type="file" accept="image/*" class="form-control mt-0" name="nama_foto"
|
||||
id="input_foto_edit">
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="sumber">Sumber</label>
|
||||
<input type="text" class="form-control mt-0" name="sumber" id="sumber" required
|
||||
maxlength="255" placeholder=". . .">
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="release_date">Jadwal Rilis</label>
|
||||
<input type="date" class="form-control mt-0" name="release_date" id="release_date" required>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal"
|
||||
aria-label="Close">Batal</button>
|
||||
<button type="submit" class="btn btn-primary">Ubah Data</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
|
||||
<script type="text/javascript">
|
||||
var $formAdd = $("#formAdd");
|
||||
$formAdd.submit(function(){
|
||||
$formAdd.submit(function(){
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var $formEdit = $("#formEdit");
|
||||
$formEdit.submit(function(){
|
||||
$formEdit.submit(function(){
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<!--Data Table -->
|
||||
<script>
|
||||
$(function() {
|
||||
$("#tabel_quote").DataTable({
|
||||
"paging": true,
|
||||
"lengthChange": false,
|
||||
"searching": true,
|
||||
"ordering": true,
|
||||
"info": true,
|
||||
"autoWidth": false,
|
||||
"responsive": false,
|
||||
"buttons": ["copy", "csv", "excel", "pdf", "print", "colvis"]
|
||||
}).buttons().container().appendTo('#tabel_quote_wrapper .col-md-6:eq(0)');
|
||||
});
|
||||
|
||||
$(document).on("click", ".open-formModalEdit", function() {
|
||||
var id = $(this).data('id');
|
||||
var teks = $(this).data('teks');
|
||||
var sumber = $(this).data('sumber');
|
||||
var nama_foto = $(this).data('nama_foto');
|
||||
var release_date = $(this).data('release_date');
|
||||
|
||||
$(".modal-body #id").val(id);
|
||||
$(".modal-body #teks").val(teks);
|
||||
$(".modal-body #sumber").val(sumber);
|
||||
$(".modal-body #release_date").val(release_date);
|
||||
$(".modal-body #old_nama_foto").attr('src', nama_foto);
|
||||
});
|
||||
|
||||
var uploadField = document.getElementById("input_foto_add");
|
||||
uploadField.onchange = function() {
|
||||
if (this.files[0].size > 2000000) {
|
||||
alert("Batas maksimum 2MB!");
|
||||
this.value = "";
|
||||
} else {
|
||||
//Ubah Img Preview
|
||||
var reader = new FileReader();
|
||||
reader.onload = function() {
|
||||
var output = document.getElementById('img_preview_add');
|
||||
output.src = reader.result;
|
||||
}
|
||||
reader.readAsDataURL(event.target.files[0]);
|
||||
};
|
||||
};
|
||||
//Form edit image validation
|
||||
var uploadField = document.getElementById("input_foto_edit");
|
||||
uploadField.onchange = function() {
|
||||
if (this.files[0].size > 2000000) {
|
||||
alert("Batas maksimum 2MB!");
|
||||
this.value = "";
|
||||
} else {
|
||||
//Ubah Img Preview
|
||||
var reader = new FileReader();
|
||||
reader.onload = function() {
|
||||
var output = document.getElementById('old_nama_foto');
|
||||
output.src = reader.result;
|
||||
}
|
||||
reader.readAsDataURL(event.target.files[0]);
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function(){
|
||||
$('.from-prevent-multiple-submits').on('submit', function(){
|
||||
$('.from-prevent-multiple-submits').attr('disabled','true');
|
||||
})
|
||||
})();
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,182 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Ruang Lab')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Ruang Lab</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
<!-- /.content-header -->
|
||||
|
||||
<!-- Alert Status -->
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('alert'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('alert') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Edit Menu Ruang Lab</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<form class="from-prevent-multiple-submits" action="{{ route('ruang_lab.update', $ruangLab->id) }}" method="POST">
|
||||
@method('patch')
|
||||
@csrf
|
||||
<textarea id="teks" placeholder="Enter the Description"
|
||||
name="teks">{{ $ruangLab->teks }}</textarea>
|
||||
<br>
|
||||
<button id="submit" type="submit" class="btn btn-primary from-prevent-multiple-submits">Save</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
@section('script')
|
||||
<script>
|
||||
//Define an adapter to upload the files
|
||||
class MyUploadAdapter {
|
||||
constructor(loader) {
|
||||
// The file loader instance to use during the upload. It sounds scary but do not
|
||||
// worry — the loader will be passed into the adapter later on in this guide.
|
||||
this.loader = loader;
|
||||
|
||||
// URL where to send files.
|
||||
this.url = '{{ route('ckeditor.upload') }}';
|
||||
|
||||
//
|
||||
}
|
||||
// Starts the upload process.
|
||||
upload() {
|
||||
return this.loader.file.then(
|
||||
(file) =>
|
||||
new Promise((resolve, reject) => {
|
||||
this._initRequest();
|
||||
this._initListeners(resolve, reject, file);
|
||||
this._sendRequest(file);
|
||||
})
|
||||
);
|
||||
}
|
||||
// Aborts the upload process.
|
||||
abort() {
|
||||
if (this.xhr) {
|
||||
this.xhr.abort();
|
||||
}
|
||||
}
|
||||
// Initializes the XMLHttpRequest object using the URL passed to the constructor.
|
||||
_initRequest() {
|
||||
const xhr = (this.xhr = new XMLHttpRequest());
|
||||
// Note that your request may look different. It is up to you and your editor
|
||||
// integration to choose the right communication channel. This example uses
|
||||
// a POST request with JSON as a data structure but your configuration
|
||||
// could be different.
|
||||
// xhr.open('POST', this.url, true);
|
||||
xhr.open("POST", this.url, true);
|
||||
xhr.setRequestHeader("x-csrf-token", "{{ csrf_token() }}");
|
||||
xhr.responseType = "json";
|
||||
}
|
||||
// Initializes XMLHttpRequest listeners.
|
||||
_initListeners(resolve, reject, file) {
|
||||
const xhr = this.xhr;
|
||||
const loader = this.loader;
|
||||
const genericErrorText = `Couldn't upload file: ${file.name}.`;
|
||||
xhr.addEventListener("error", () => reject(genericErrorText));
|
||||
xhr.addEventListener("abort", () => reject());
|
||||
xhr.addEventListener("load", () => {
|
||||
const response = xhr.response;
|
||||
// This example assumes the XHR server's "response" object will come with
|
||||
// an "error" which has its own "message" that can be passed to reject()
|
||||
// in the upload promise.
|
||||
//
|
||||
// Your integration may handle upload errors in a different way so make sure
|
||||
// it is done properly. The reject() function must be called when the upload fails.
|
||||
if (!response || response.error) {
|
||||
return reject(response && response.error ? response.error.message : genericErrorText);
|
||||
}
|
||||
// If the upload is successful, resolve the upload promise with an object containing
|
||||
// at least the "default" URL, pointing to the image on the server.
|
||||
// This URL will be used to display the image in the content. Learn more in the
|
||||
// UploadAdapter#upload documentation.
|
||||
resolve({
|
||||
default: response.url,
|
||||
});
|
||||
});
|
||||
// Upload progress when it is supported. The file loader has the #uploadTotal and #uploaded
|
||||
// properties which are used e.g. to display the upload progress bar in the editor
|
||||
// user interface.
|
||||
if (xhr.upload) {
|
||||
xhr.upload.addEventListener("progress", (evt) => {
|
||||
if (evt.lengthComputable) {
|
||||
loader.uploadTotal = evt.total;
|
||||
loader.uploaded = evt.loaded;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// Prepares the data and sends the request.
|
||||
_sendRequest(file) {
|
||||
// Prepare the form data.
|
||||
const data = new FormData();
|
||||
data.append("upload", file);
|
||||
// Important note: This is the right place to implement security mechanisms
|
||||
// like authentication and CSRF protection. For instance, you can use
|
||||
// XMLHttpRequest.setRequestHeader() to set the request headers containing
|
||||
// the CSRF token generated earlier by your application.
|
||||
// Send the request.
|
||||
this.xhr.send(data);
|
||||
}
|
||||
// ...
|
||||
}
|
||||
|
||||
function SimpleUploadAdapterPlugin(editor) {
|
||||
editor.plugins.get("FileRepository").createUploadAdapter = (loader) => {
|
||||
// Configure the URL to the upload script in your back-end here!
|
||||
return new MyUploadAdapter(loader);
|
||||
};
|
||||
}
|
||||
|
||||
//Initialize the ckeditor
|
||||
ClassicEditor.create(document.querySelector("#teks"), {
|
||||
extraPlugins: [SimpleUploadAdapterPlugin],
|
||||
}).catch((error) => {
|
||||
console.error(error);
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function(){
|
||||
$('.from-prevent-multiple-submits').on('submit', function(){
|
||||
$('.from-prevent-multiple-submits').attr('disabled','true');
|
||||
})
|
||||
})();
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,185 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Ruang Pengelolaan dan Tata Usaha')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Ruang Pengelolaan dan Tata Usaha</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
<!-- /.content-header -->
|
||||
|
||||
<!-- Alert Status -->
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('alert'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('alert') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Edit Menu Ruang Pengelolaan dan Tata Usaha</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<form class="from-prevent-multiple-submits"
|
||||
action="{{ route('ruang_pengelolaan_tata_usaha.update', $ruangPengelolaanTataUsaha->id) }}"
|
||||
method="POST">
|
||||
@method('patch')
|
||||
@csrf
|
||||
<textarea id="teks" placeholder="Enter the Description"
|
||||
name="teks">{{ $ruangPengelolaanTataUsaha->teks }}</textarea>
|
||||
<br>
|
||||
<button id="submit" type="submit"
|
||||
class="btn btn-primary from-prevent-multiple-submits">Save</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
@section('script')
|
||||
<script>
|
||||
//Define an adapter to upload the files
|
||||
class MyUploadAdapter {
|
||||
constructor(loader) {
|
||||
// The file loader instance to use during the upload. It sounds scary but do not
|
||||
// worry — the loader will be passed into the adapter later on in this guide.
|
||||
this.loader = loader;
|
||||
|
||||
// URL where to send files.
|
||||
this.url = '{{ route('ckeditor.upload') }}';
|
||||
|
||||
//
|
||||
}
|
||||
// Starts the upload process.
|
||||
upload() {
|
||||
return this.loader.file.then(
|
||||
(file) =>
|
||||
new Promise((resolve, reject) => {
|
||||
this._initRequest();
|
||||
this._initListeners(resolve, reject, file);
|
||||
this._sendRequest(file);
|
||||
})
|
||||
);
|
||||
}
|
||||
// Aborts the upload process.
|
||||
abort() {
|
||||
if (this.xhr) {
|
||||
this.xhr.abort();
|
||||
}
|
||||
}
|
||||
// Initializes the XMLHttpRequest object using the URL passed to the constructor.
|
||||
_initRequest() {
|
||||
const xhr = (this.xhr = new XMLHttpRequest());
|
||||
// Note that your request may look different. It is up to you and your editor
|
||||
// integration to choose the right communication channel. This example uses
|
||||
// a POST request with JSON as a data structure but your configuration
|
||||
// could be different.
|
||||
// xhr.open('POST', this.url, true);
|
||||
xhr.open("POST", this.url, true);
|
||||
xhr.setRequestHeader("x-csrf-token", "{{ csrf_token() }}");
|
||||
xhr.responseType = "json";
|
||||
}
|
||||
// Initializes XMLHttpRequest listeners.
|
||||
_initListeners(resolve, reject, file) {
|
||||
const xhr = this.xhr;
|
||||
const loader = this.loader;
|
||||
const genericErrorText = `Couldn't upload file: ${file.name}.`;
|
||||
xhr.addEventListener("error", () => reject(genericErrorText));
|
||||
xhr.addEventListener("abort", () => reject());
|
||||
xhr.addEventListener("load", () => {
|
||||
const response = xhr.response;
|
||||
// This example assumes the XHR server's "response" object will come with
|
||||
// an "error" which has its own "message" that can be passed to reject()
|
||||
// in the upload promise.
|
||||
//
|
||||
// Your integration may handle upload errors in a different way so make sure
|
||||
// it is done properly. The reject() function must be called when the upload fails.
|
||||
if (!response || response.error) {
|
||||
return reject(response && response.error ? response.error.message : genericErrorText);
|
||||
}
|
||||
// If the upload is successful, resolve the upload promise with an object containing
|
||||
// at least the "default" URL, pointing to the image on the server.
|
||||
// This URL will be used to display the image in the content. Learn more in the
|
||||
// UploadAdapter#upload documentation.
|
||||
resolve({
|
||||
default: response.url,
|
||||
});
|
||||
});
|
||||
// Upload progress when it is supported. The file loader has the #uploadTotal and #uploaded
|
||||
// properties which are used e.g. to display the upload progress bar in the editor
|
||||
// user interface.
|
||||
if (xhr.upload) {
|
||||
xhr.upload.addEventListener("progress", (evt) => {
|
||||
if (evt.lengthComputable) {
|
||||
loader.uploadTotal = evt.total;
|
||||
loader.uploaded = evt.loaded;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// Prepares the data and sends the request.
|
||||
_sendRequest(file) {
|
||||
// Prepare the form data.
|
||||
const data = new FormData();
|
||||
data.append("upload", file);
|
||||
// Important note: This is the right place to implement security mechanisms
|
||||
// like authentication and CSRF protection. For instance, you can use
|
||||
// XMLHttpRequest.setRequestHeader() to set the request headers containing
|
||||
// the CSRF token generated earlier by your application.
|
||||
// Send the request.
|
||||
this.xhr.send(data);
|
||||
}
|
||||
// ...
|
||||
}
|
||||
|
||||
function SimpleUploadAdapterPlugin(editor) {
|
||||
editor.plugins.get("FileRepository").createUploadAdapter = (loader) => {
|
||||
// Configure the URL to the upload script in your back-end here!
|
||||
return new MyUploadAdapter(loader);
|
||||
};
|
||||
}
|
||||
|
||||
//Initialize the ckeditor
|
||||
ClassicEditor.create(document.querySelector("#teks"), {
|
||||
extraPlugins: [SimpleUploadAdapterPlugin],
|
||||
}).catch((error) => {
|
||||
console.error(error);
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function() {
|
||||
$('.from-prevent-multiple-submits').on('submit', function() {
|
||||
$('.from-prevent-multiple-submits').attr('disabled', 'true');
|
||||
})
|
||||
})();
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,183 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Ruang Perkuliahan')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Ruang Perkuliahan</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
<!-- /.content-header -->
|
||||
|
||||
<!-- Alert Status -->
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('alert'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('alert') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Edit Menu Ruang Perkuliahan</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<form class="from-prevent-multiple-submits" action="{{ route('ruang_perkuliahan.update', $ruangPerkuliahan->id) }}"
|
||||
method="POST">
|
||||
@method('patch')
|
||||
@csrf
|
||||
<textarea id="teks" placeholder="Enter the Description"
|
||||
name="teks">{{ $ruangPerkuliahan->teks }}</textarea>
|
||||
<br>
|
||||
<button id="submit" type="submit" class="btn btn-primary from-prevent-multiple-submits">Save</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
@section('script')
|
||||
<script>
|
||||
//Define an adapter to upload the files
|
||||
class MyUploadAdapter {
|
||||
constructor(loader) {
|
||||
// The file loader instance to use during the upload. It sounds scary but do not
|
||||
// worry — the loader will be passed into the adapter later on in this guide.
|
||||
this.loader = loader;
|
||||
|
||||
// URL where to send files.
|
||||
this.url = '{{ route('ckeditor.upload') }}';
|
||||
|
||||
//
|
||||
}
|
||||
// Starts the upload process.
|
||||
upload() {
|
||||
return this.loader.file.then(
|
||||
(file) =>
|
||||
new Promise((resolve, reject) => {
|
||||
this._initRequest();
|
||||
this._initListeners(resolve, reject, file);
|
||||
this._sendRequest(file);
|
||||
})
|
||||
);
|
||||
}
|
||||
// Aborts the upload process.
|
||||
abort() {
|
||||
if (this.xhr) {
|
||||
this.xhr.abort();
|
||||
}
|
||||
}
|
||||
// Initializes the XMLHttpRequest object using the URL passed to the constructor.
|
||||
_initRequest() {
|
||||
const xhr = (this.xhr = new XMLHttpRequest());
|
||||
// Note that your request may look different. It is up to you and your editor
|
||||
// integration to choose the right communication channel. This example uses
|
||||
// a POST request with JSON as a data structure but your configuration
|
||||
// could be different.
|
||||
// xhr.open('POST', this.url, true);
|
||||
xhr.open("POST", this.url, true);
|
||||
xhr.setRequestHeader("x-csrf-token", "{{ csrf_token() }}");
|
||||
xhr.responseType = "json";
|
||||
}
|
||||
// Initializes XMLHttpRequest listeners.
|
||||
_initListeners(resolve, reject, file) {
|
||||
const xhr = this.xhr;
|
||||
const loader = this.loader;
|
||||
const genericErrorText = `Couldn't upload file: ${file.name}.`;
|
||||
xhr.addEventListener("error", () => reject(genericErrorText));
|
||||
xhr.addEventListener("abort", () => reject());
|
||||
xhr.addEventListener("load", () => {
|
||||
const response = xhr.response;
|
||||
// This example assumes the XHR server's "response" object will come with
|
||||
// an "error" which has its own "message" that can be passed to reject()
|
||||
// in the upload promise.
|
||||
//
|
||||
// Your integration may handle upload errors in a different way so make sure
|
||||
// it is done properly. The reject() function must be called when the upload fails.
|
||||
if (!response || response.error) {
|
||||
return reject(response && response.error ? response.error.message : genericErrorText);
|
||||
}
|
||||
// If the upload is successful, resolve the upload promise with an object containing
|
||||
// at least the "default" URL, pointing to the image on the server.
|
||||
// This URL will be used to display the image in the content. Learn more in the
|
||||
// UploadAdapter#upload documentation.
|
||||
resolve({
|
||||
default: response.url,
|
||||
});
|
||||
});
|
||||
// Upload progress when it is supported. The file loader has the #uploadTotal and #uploaded
|
||||
// properties which are used e.g. to display the upload progress bar in the editor
|
||||
// user interface.
|
||||
if (xhr.upload) {
|
||||
xhr.upload.addEventListener("progress", (evt) => {
|
||||
if (evt.lengthComputable) {
|
||||
loader.uploadTotal = evt.total;
|
||||
loader.uploaded = evt.loaded;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// Prepares the data and sends the request.
|
||||
_sendRequest(file) {
|
||||
// Prepare the form data.
|
||||
const data = new FormData();
|
||||
data.append("upload", file);
|
||||
// Important note: This is the right place to implement security mechanisms
|
||||
// like authentication and CSRF protection. For instance, you can use
|
||||
// XMLHttpRequest.setRequestHeader() to set the request headers containing
|
||||
// the CSRF token generated earlier by your application.
|
||||
// Send the request.
|
||||
this.xhr.send(data);
|
||||
}
|
||||
// ...
|
||||
}
|
||||
|
||||
function SimpleUploadAdapterPlugin(editor) {
|
||||
editor.plugins.get("FileRepository").createUploadAdapter = (loader) => {
|
||||
// Configure the URL to the upload script in your back-end here!
|
||||
return new MyUploadAdapter(loader);
|
||||
};
|
||||
}
|
||||
|
||||
//Initialize the ckeditor
|
||||
ClassicEditor.create(document.querySelector("#teks"), {
|
||||
extraPlugins: [SimpleUploadAdapterPlugin],
|
||||
}).catch((error) => {
|
||||
console.error(error);
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function(){
|
||||
$('.from-prevent-multiple-submits').on('submit', function(){
|
||||
$('.from-prevent-multiple-submits').attr('disabled','true');
|
||||
})
|
||||
})();
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,181 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Sambutan Pimpinan Instansi')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Sambutan Pimpinan Instansi</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
<!-- /.content-header -->
|
||||
|
||||
<!-- Alert Status -->
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('alert'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('alert') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Edit Menu Sambutan Pimpinan Instansi</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<form
|
||||
action="{{ route('sambutan_pimpinan_instansi.update', $sambutanPimpinanInstansi->id) }}"
|
||||
method="POST">
|
||||
@method('patch')
|
||||
@csrf
|
||||
<textarea id="teks" placeholder="Enter the Description"
|
||||
name="teks">{{ $sambutanPimpinanInstansi->teks }}</textarea>
|
||||
<br>
|
||||
<button id="submit" type="submit" class="btn btn-primary from-prevent-multiple-submits">Save</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
//Define an adapter to upload the files
|
||||
class MyUploadAdapter {
|
||||
constructor(loader) {
|
||||
// The file loader instance to use during the upload. It sounds scary but do not
|
||||
// worry — the loader will be passed into the adapter later on in this guide.
|
||||
this.loader = loader;
|
||||
|
||||
// URL where to send files.
|
||||
this.url = '{{ route('ckeditor.upload') }}';
|
||||
|
||||
//
|
||||
}
|
||||
// Starts the upload process.
|
||||
upload() {
|
||||
return this.loader.file.then(
|
||||
(file) =>
|
||||
new Promise((resolve, reject) => {
|
||||
this._initRequest();
|
||||
this._initListeners(resolve, reject, file);
|
||||
this._sendRequest(file);
|
||||
})
|
||||
);
|
||||
}
|
||||
// Aborts the upload process.
|
||||
abort() {
|
||||
if (this.xhr) {
|
||||
this.xhr.abort();
|
||||
}
|
||||
}
|
||||
// Initializes the XMLHttpRequest object using the URL passed to the constructor.
|
||||
_initRequest() {
|
||||
const xhr = (this.xhr = new XMLHttpRequest());
|
||||
// Note that your request may look different. It is up to you and your editor
|
||||
// integration to choose the right communication channel. This example uses
|
||||
// a POST request with JSON as a data structure but your configuration
|
||||
// could be different.
|
||||
// xhr.open('POST', this.url, true);
|
||||
xhr.open("POST", this.url, true);
|
||||
xhr.setRequestHeader("x-csrf-token", "{{ csrf_token() }}");
|
||||
xhr.responseType = "json";
|
||||
}
|
||||
// Initializes XMLHttpRequest listeners.
|
||||
_initListeners(resolve, reject, file) {
|
||||
const xhr = this.xhr;
|
||||
const loader = this.loader;
|
||||
const genericErrorText = `Couldn't upload file: ${file.name}.`;
|
||||
xhr.addEventListener("error", () => reject(genericErrorText));
|
||||
xhr.addEventListener("abort", () => reject());
|
||||
xhr.addEventListener("load", () => {
|
||||
const response = xhr.response;
|
||||
// This example assumes the XHR server's "response" object will come with
|
||||
// an "error" which has its own "message" that can be passed to reject()
|
||||
// in the upload promise.
|
||||
//
|
||||
// Your integration may handle upload errors in a different way so make sure
|
||||
// it is done properly. The reject() function must be called when the upload fails.
|
||||
if (!response || response.error) {
|
||||
return reject(response && response.error ? response.error.message : genericErrorText);
|
||||
}
|
||||
// If the upload is successful, resolve the upload promise with an object containing
|
||||
// at least the "default" URL, pointing to the image on the server.
|
||||
// This URL will be used to display the image in the content. Learn more in the
|
||||
// UploadAdapter#upload documentation.
|
||||
resolve({
|
||||
default: response.url,
|
||||
});
|
||||
});
|
||||
// Upload progress when it is supported. The file loader has the #uploadTotal and #uploaded
|
||||
// properties which are used e.g. to display the upload progress bar in the editor
|
||||
// user interface.
|
||||
if (xhr.upload) {
|
||||
xhr.upload.addEventListener("progress", (evt) => {
|
||||
if (evt.lengthComputable) {
|
||||
loader.uploadTotal = evt.total;
|
||||
loader.uploaded = evt.loaded;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// Prepares the data and sends the request.
|
||||
_sendRequest(file) {
|
||||
// Prepare the form data.
|
||||
const data = new FormData();
|
||||
data.append("upload", file);
|
||||
// Important note: This is the right place to implement security mechanisms
|
||||
// like authentication and CSRF protection. For instance, you can use
|
||||
// XMLHttpRequest.setRequestHeader() to set the request headers containing
|
||||
// the CSRF token generated earlier by your application.
|
||||
// Send the request.
|
||||
this.xhr.send(data);
|
||||
}
|
||||
// ...
|
||||
}
|
||||
|
||||
function SimpleUploadAdapterPlugin(editor) {
|
||||
editor.plugins.get("FileRepository").createUploadAdapter = (loader) => {
|
||||
// Configure the URL to the upload script in your back-end here!
|
||||
return new MyUploadAdapter(loader);
|
||||
};
|
||||
}
|
||||
|
||||
//Initialize the ckeditor
|
||||
ClassicEditor.create(document.querySelector("#teks"), {
|
||||
extraPlugins: [SimpleUploadAdapterPlugin],
|
||||
}).catch((error) => {
|
||||
console.error(error);
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function(){
|
||||
$('.from-prevent-multiple-submits').on('submit', function(){
|
||||
$('.from-prevent-multiple-submits').attr('disabled','true');
|
||||
})
|
||||
})();
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,178 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Sejarah')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Sejarah</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
<!-- /.content-header -->
|
||||
|
||||
<!-- Alert Status -->
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('alert'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('alert') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Edit Menu Sejarah</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<form class="from-prevent-multiple-submits" action="{{ route('sejarah.update', $sejarah->id) }}" method="POST">
|
||||
@method('patch')
|
||||
@csrf
|
||||
<textarea id="teks" placeholder="Enter the Description"
|
||||
name="teks">{{ $sejarah->teks }}</textarea>
|
||||
<br>
|
||||
<button id="submit" type="submit" class="btn btn-primary from-prevent-multiple-submits">Save</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
//Define an adapter to upload the files
|
||||
class MyUploadAdapter {
|
||||
constructor(loader) {
|
||||
// The file loader instance to use during the upload. It sounds scary but do not
|
||||
// worry — the loader will be passed into the adapter later on in this guide.
|
||||
this.loader = loader;
|
||||
|
||||
// URL where to send files.
|
||||
this.url = '{{ route('ckeditor.upload') }}';
|
||||
|
||||
//
|
||||
}
|
||||
// Starts the upload process.
|
||||
upload() {
|
||||
return this.loader.file.then(
|
||||
(file) =>
|
||||
new Promise((resolve, reject) => {
|
||||
this._initRequest();
|
||||
this._initListeners(resolve, reject, file);
|
||||
this._sendRequest(file);
|
||||
})
|
||||
);
|
||||
}
|
||||
// Aborts the upload process.
|
||||
abort() {
|
||||
if (this.xhr) {
|
||||
this.xhr.abort();
|
||||
}
|
||||
}
|
||||
// Initializes the XMLHttpRequest object using the URL passed to the constructor.
|
||||
_initRequest() {
|
||||
const xhr = (this.xhr = new XMLHttpRequest());
|
||||
// Note that your request may look different. It is up to you and your editor
|
||||
// integration to choose the right communication channel. This example uses
|
||||
// a POST request with JSON as a data structure but your configuration
|
||||
// could be different.
|
||||
// xhr.open('POST', this.url, true);
|
||||
xhr.open("POST", this.url, true);
|
||||
xhr.setRequestHeader("x-csrf-token", "{{ csrf_token() }}");
|
||||
xhr.responseType = "json";
|
||||
}
|
||||
// Initializes XMLHttpRequest listeners.
|
||||
_initListeners(resolve, reject, file) {
|
||||
const xhr = this.xhr;
|
||||
const loader = this.loader;
|
||||
const genericErrorText = `Couldn't upload file: ${file.name}.`;
|
||||
xhr.addEventListener("error", () => reject(genericErrorText));
|
||||
xhr.addEventListener("abort", () => reject());
|
||||
xhr.addEventListener("load", () => {
|
||||
const response = xhr.response;
|
||||
// This example assumes the XHR server's "response" object will come with
|
||||
// an "error" which has its own "message" that can be passed to reject()
|
||||
// in the upload promise.
|
||||
//
|
||||
// Your integration may handle upload errors in a different way so make sure
|
||||
// it is done properly. The reject() function must be called when the upload fails.
|
||||
if (!response || response.error) {
|
||||
return reject(response && response.error ? response.error.message : genericErrorText);
|
||||
}
|
||||
// If the upload is successful, resolve the upload promise with an object containing
|
||||
// at least the "default" URL, pointing to the image on the server.
|
||||
// This URL will be used to display the image in the content. Learn more in the
|
||||
// UploadAdapter#upload documentation.
|
||||
resolve({
|
||||
default: response.url,
|
||||
});
|
||||
});
|
||||
// Upload progress when it is supported. The file loader has the #uploadTotal and #uploaded
|
||||
// properties which are used e.g. to display the upload progress bar in the editor
|
||||
// user interface.
|
||||
if (xhr.upload) {
|
||||
xhr.upload.addEventListener("progress", (evt) => {
|
||||
if (evt.lengthComputable) {
|
||||
loader.uploadTotal = evt.total;
|
||||
loader.uploaded = evt.loaded;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// Prepares the data and sends the request.
|
||||
_sendRequest(file) {
|
||||
// Prepare the form data.
|
||||
const data = new FormData();
|
||||
data.append("upload", file);
|
||||
// Important note: This is the right place to implement security mechanisms
|
||||
// like authentication and CSRF protection. For instance, you can use
|
||||
// XMLHttpRequest.setRequestHeader() to set the request headers containing
|
||||
// the CSRF token generated earlier by your application.
|
||||
// Send the request.
|
||||
this.xhr.send(data);
|
||||
}
|
||||
// ...
|
||||
}
|
||||
|
||||
function SimpleUploadAdapterPlugin(editor) {
|
||||
editor.plugins.get("FileRepository").createUploadAdapter = (loader) => {
|
||||
// Configure the URL to the upload script in your back-end here!
|
||||
return new MyUploadAdapter(loader);
|
||||
};
|
||||
}
|
||||
|
||||
//Initialize the ckeditor
|
||||
ClassicEditor.create(document.querySelector("#teks"), {
|
||||
extraPlugins: [SimpleUploadAdapterPlugin],
|
||||
}).catch((error) => {
|
||||
console.error(error);
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function(){
|
||||
$('.from-prevent-multiple-submits').on('submit', function(){
|
||||
$('.from-prevent-multiple-submits').attr('disabled','true');
|
||||
})
|
||||
})();
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,224 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Staf')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Staf</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
<!-- /.content-header -->
|
||||
|
||||
<!-- Alert Status -->
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('alert'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('alert') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Data Staf</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-12 text-left">
|
||||
<a type="button" href="#formModalAdd" data-toggle="modal"
|
||||
class="btn btn-success mb-3"><i class="fa fa-plus-circle"></i>
|
||||
Tambah Data Staf
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table id="tabel_staf" class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nomor</th>
|
||||
<th>Nama</th>
|
||||
<th>NIP</th>
|
||||
<th>Pangkat/Golongan</th>
|
||||
<th>Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($stafs as $staf)
|
||||
<tr>
|
||||
<td>{{ $loop->iteration }}</td>
|
||||
<td>{{ $staf->nama }}</td>
|
||||
<td>{{ $staf->nip }}</td>
|
||||
<td>{{ $staf->pangkat_golongan }}</td>
|
||||
<td>
|
||||
<button href="#formModalEdit" role="button" data-toggle="modal"
|
||||
data-id="{{ $staf->id }}" data-nama="{{ $staf->nama }}"
|
||||
data-nip="{{ $staf->nip }}"
|
||||
data-pangkat_golongan="{{ $staf->pangkat_golongan }}"
|
||||
class="btn btn-warning open-formModalEdit"><i
|
||||
class="fa fa-edit"></i> Edit</button>
|
||||
<form action="{{ route('staf.destroy', $staf) }}" method="post">
|
||||
@method('delete')
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-danger"
|
||||
onclick="return confirm('Apakah anda yakin ingin menghapus data?')"><i
|
||||
class="fa fa-trash"></i> Delete</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<!-- Modal Add -->
|
||||
<div class="modal fade" id="formModalAdd" tabindex="-1" aria-labelledby="formModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="formModalLabel">Tambah Data Staf</h5>
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal" aria-label="Close">X</button>
|
||||
</div>
|
||||
<form id="formAdd" action="{{ url('/admin/staf') }}" method="post">
|
||||
@csrf
|
||||
<div class="modal-body">
|
||||
<div class="form-group mt-2">
|
||||
<label for="nama">Nama</label>
|
||||
<input type="text" class="form-control mt-0" name="nama" required maxlength="255"
|
||||
placeholder=". . .">
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="nip">NIP</label>
|
||||
<input type="text" class="form-control mt-0" name="nip" required maxlength="25"
|
||||
placeholder=". . .">
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="pangkat_golongan">Pangkat/Golongan</label>
|
||||
<input type="text" class="form-control mt-0" name="pangkat_golongan"
|
||||
required maxlength="100" placeholder=". . .">
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal"
|
||||
aria-label="Close">Batal</button>
|
||||
<button type="submit" class="btn btn-primary">Tambah Data</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@foreach ($stafs as $staf)
|
||||
<!-- Modal Edit -->
|
||||
<div class="modal fade" id="formModalEdit" tabindex="-1" aria-labelledby="formModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="formModalLabel">Ubah Data Staf</h5>
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal" aria-label="Close">X</button>
|
||||
</div>
|
||||
<form id="formEdit" action="{{ route('staf.update', $staf->id) }}" method="POST">
|
||||
@method('patch')
|
||||
@csrf
|
||||
<div class="modal-body">
|
||||
<input type="hidden" name="id" id="id">
|
||||
<div class="form-group mt-2">
|
||||
<label for="nama">Nama</label>
|
||||
<input type="text" class="form-control mt-0" name="nama" id="nama" required maxlength="255"
|
||||
placeholder=". . .">
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="nip">NIP</label>
|
||||
<input type="text" class="form-control mt-0" name="nip" id="nip" required maxlength="25"
|
||||
placeholder=". . .">
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label for="pangkat_golongan">Pangkat Golongan</label>
|
||||
<input type="text" class="form-control mt-0" name="pangkat_golongan" id="pangkat_golongan"
|
||||
required maxlength="100" placeholder=". . .">
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal"
|
||||
aria-label="Close">Batal</button>
|
||||
<button type="submit" class="btn btn-primary">Ubah Data</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
|
||||
<script type="text/javascript">
|
||||
var $formAdd = $("#formAdd");
|
||||
$formAdd.submit(function(){
|
||||
$formAdd.submit(function(){
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var $formEdit = $("#formEdit");
|
||||
$formEdit.submit(function(){
|
||||
$formEdit.submit(function(){
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<!--Data Table -->
|
||||
<script>
|
||||
$(function() {
|
||||
$("#tabel_staf").DataTable({
|
||||
"paging": true,
|
||||
"lengthChange": false,
|
||||
"searching": true,
|
||||
"ordering": true,
|
||||
"info": true,
|
||||
"autoWidth": false,
|
||||
"responsive": false,
|
||||
"buttons": ["copy", "csv", "excel", "pdf", "print", "colvis"]
|
||||
}).buttons().container().appendTo('#tabel_staf_wrapper .col-md-6:eq(0)');
|
||||
});
|
||||
</script>
|
||||
|
||||
<!--Modal Edit -->
|
||||
<script type="text/javascript">
|
||||
$(document).on("click", ".open-formModalEdit", function() {
|
||||
var id = $(this).data('id');
|
||||
var nama = $(this).data('nama');
|
||||
var nip = $(this).data('nip');
|
||||
var pangkat_golongan = $(this).data('pangkat_golongan');
|
||||
|
||||
$(".modal-body #id").val(id);
|
||||
$(".modal-body #nama").val(nama);
|
||||
$(".modal-body #nip").val(nip);
|
||||
$(".modal-body #pangkat_golongan").val(pangkat_golongan);
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,179 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Struktur Instansi')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Struktur Instansi</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
<!-- /.content-header -->
|
||||
|
||||
<!-- Alert Status -->
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('alert'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('alert') }}
|
||||
</div>
|
||||
@endif
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Edit Menu Struktur Instansi</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<form class="from-prevent-multiple-submits" action="{{ route('struktur_instansi.update', $strukturInstansi->id) }}"
|
||||
method="POST">
|
||||
@method('patch')
|
||||
@csrf
|
||||
<textarea id="teks" placeholder="Enter the Description"
|
||||
name="teks">{{ $strukturInstansi->teks }}</textarea>
|
||||
<br>
|
||||
<button id="submit" type="submit" class="btn btn-primary from-prevent-multiple-submits">Save</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
//Define an adapter to upload the files
|
||||
class MyUploadAdapter {
|
||||
constructor(loader) {
|
||||
// The file loader instance to use during the upload. It sounds scary but do not
|
||||
// worry — the loader will be passed into the adapter later on in this guide.
|
||||
this.loader = loader;
|
||||
|
||||
// URL where to send files.
|
||||
this.url = '{{ route('ckeditor.upload') }}';
|
||||
|
||||
//
|
||||
}
|
||||
// Starts the upload process.
|
||||
upload() {
|
||||
return this.loader.file.then(
|
||||
(file) =>
|
||||
new Promise((resolve, reject) => {
|
||||
this._initRequest();
|
||||
this._initListeners(resolve, reject, file);
|
||||
this._sendRequest(file);
|
||||
})
|
||||
);
|
||||
}
|
||||
// Aborts the upload process.
|
||||
abort() {
|
||||
if (this.xhr) {
|
||||
this.xhr.abort();
|
||||
}
|
||||
}
|
||||
// Initializes the XMLHttpRequest object using the URL passed to the constructor.
|
||||
_initRequest() {
|
||||
const xhr = (this.xhr = new XMLHttpRequest());
|
||||
// Note that your request may look different. It is up to you and your editor
|
||||
// integration to choose the right communication channel. This example uses
|
||||
// a POST request with JSON as a data structure but your configuration
|
||||
// could be different.
|
||||
// xhr.open('POST', this.url, true);
|
||||
xhr.open("POST", this.url, true);
|
||||
xhr.setRequestHeader("x-csrf-token", "{{ csrf_token() }}");
|
||||
xhr.responseType = "json";
|
||||
}
|
||||
// Initializes XMLHttpRequest listeners.
|
||||
_initListeners(resolve, reject, file) {
|
||||
const xhr = this.xhr;
|
||||
const loader = this.loader;
|
||||
const genericErrorText = `Couldn't upload file: ${file.name}.`;
|
||||
xhr.addEventListener("error", () => reject(genericErrorText));
|
||||
xhr.addEventListener("abort", () => reject());
|
||||
xhr.addEventListener("load", () => {
|
||||
const response = xhr.response;
|
||||
// This example assumes the XHR server's "response" object will come with
|
||||
// an "error" which has its own "message" that can be passed to reject()
|
||||
// in the upload promise.
|
||||
//
|
||||
// Your integration may handle upload errors in a different way so make sure
|
||||
// it is done properly. The reject() function must be called when the upload fails.
|
||||
if (!response || response.error) {
|
||||
return reject(response && response.error ? response.error.message : genericErrorText);
|
||||
}
|
||||
// If the upload is successful, resolve the upload promise with an object containing
|
||||
// at least the "default" URL, pointing to the image on the server.
|
||||
// This URL will be used to display the image in the content. Learn more in the
|
||||
// UploadAdapter#upload documentation.
|
||||
resolve({
|
||||
default: response.url,
|
||||
});
|
||||
});
|
||||
// Upload progress when it is supported. The file loader has the #uploadTotal and #uploaded
|
||||
// properties which are used e.g. to display the upload progress bar in the editor
|
||||
// user interface.
|
||||
if (xhr.upload) {
|
||||
xhr.upload.addEventListener("progress", (evt) => {
|
||||
if (evt.lengthComputable) {
|
||||
loader.uploadTotal = evt.total;
|
||||
loader.uploaded = evt.loaded;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// Prepares the data and sends the request.
|
||||
_sendRequest(file) {
|
||||
// Prepare the form data.
|
||||
const data = new FormData();
|
||||
data.append("upload", file);
|
||||
// Important note: This is the right place to implement security mechanisms
|
||||
// like authentication and CSRF protection. For instance, you can use
|
||||
// XMLHttpRequest.setRequestHeader() to set the request headers containing
|
||||
// the CSRF token generated earlier by your application.
|
||||
// Send the request.
|
||||
this.xhr.send(data);
|
||||
}
|
||||
// ...
|
||||
}
|
||||
|
||||
function SimpleUploadAdapterPlugin(editor) {
|
||||
editor.plugins.get("FileRepository").createUploadAdapter = (loader) => {
|
||||
// Configure the URL to the upload script in your back-end here!
|
||||
return new MyUploadAdapter(loader);
|
||||
};
|
||||
}
|
||||
|
||||
//Initialize the ckeditor
|
||||
ClassicEditor.create(document.querySelector("#teks"), {
|
||||
extraPlugins: [SimpleUploadAdapterPlugin],
|
||||
}).catch((error) => {
|
||||
console.error(error);
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function(){
|
||||
$('.from-prevent-multiple-submits').on('submit', function(){
|
||||
$('.from-prevent-multiple-submits').attr('disabled','true');
|
||||
})
|
||||
})();
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,68 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Ucapan Selamat Datang')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Ucapan Selamat Datang</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
<!-- /.content-header -->
|
||||
|
||||
<!-- Alert Status -->
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('alert'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('alert') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Edit Menu Ucapan Selamat Datang</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<form action="{{ route('ucapan_selamat_datang.update', $ucapanSelamatDatang->id) }}"
|
||||
method="POST" enctype="multipart/form-data">
|
||||
@method('patch')
|
||||
@csrf
|
||||
<input type="hidden" name="id" value="{{ $ucapanSelamatDatang->id }}">
|
||||
|
||||
<div class="form-group">
|
||||
<textarea class="form-control" style="width : 40rem" rows="5" type="text"
|
||||
id="teks" name="teks"
|
||||
maxlength="255">{{ $ucapanSelamatDatang->teks }}</textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-success"> Save </button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,234 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'UKM Mahasiswa')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">UKM Mahasiswa</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
<!-- /.content-header -->
|
||||
|
||||
<!-- Alert Status -->
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('alert'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('alert') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Tambah Data UKM Mahasiswa</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<!-- form start -->
|
||||
<form class="from-prevent-multiple-submits" action="{{ route('ukm_mahasiswa.store') }}" method="POST" id="ckeditorForm"
|
||||
enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<label for="judul">Judul</label>
|
||||
<input type="text" class="form-control" id="judul" name="judul"
|
||||
placeholder="Masukkan Judul" value="" required maxlength="255">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="nama_foto">Thumbnail (Maksimal 2MB)</label>
|
||||
<div class="form-group">
|
||||
<img id="img_preview_add" style="max-width: 200px;"
|
||||
class="mt-2" />
|
||||
</div>
|
||||
<input type="file" accept="image/*" class="form-control mt-0"
|
||||
name="thumbnail" id="input_foto_add" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="teks">Teks (Foto Maksimal 2MB)</label>
|
||||
<textarea id="teks" placeholder="Masukkan Teks" name="teks"
|
||||
class="ck_editor_txt" id="ck_editor_txt"></textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="release_date">Tanggal Rilis</label>
|
||||
<input type="date" class="form-control" name="release_date" required>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
|
||||
<div class="card-footer">
|
||||
<button id="submit" type="submit" class="btn btn-primary from-prevent-multiple-submits">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
//Define an adapter to upload the files
|
||||
class MyUploadAdapter {
|
||||
constructor(loader) {
|
||||
// The file loader instance to use during the upload. It sounds scary but do not
|
||||
// worry — the loader will be passed into the adapter later on in this guide.
|
||||
this.loader = loader;
|
||||
|
||||
// URL where to send files.
|
||||
this.url = '{{ route('ckeditor.upload') }}';
|
||||
|
||||
//
|
||||
}
|
||||
// Starts the upload process.
|
||||
upload() {
|
||||
return this.loader.file.then(
|
||||
(file) =>
|
||||
new Promise((resolve, reject) => {
|
||||
this._initRequest();
|
||||
this._initListeners(resolve, reject, file);
|
||||
this._sendRequest(file);
|
||||
})
|
||||
);
|
||||
}
|
||||
// Aborts the upload process.
|
||||
abort() {
|
||||
if (this.xhr) {
|
||||
this.xhr.abort();
|
||||
}
|
||||
}
|
||||
// Initializes the XMLHttpRequest object using the URL passed to the constructor.
|
||||
_initRequest() {
|
||||
const xhr = (this.xhr = new XMLHttpRequest());
|
||||
// Note that your request may look different. It is up to you and your editor
|
||||
// integration to choose the right communication channel. This example uses
|
||||
// a POST request with JSON as a data structure but your configuration
|
||||
// could be different.
|
||||
// xhr.open('POST', this.url, true);
|
||||
xhr.open("POST", this.url, true);
|
||||
xhr.setRequestHeader("x-csrf-token", "{{ csrf_token() }}");
|
||||
xhr.responseType = "json";
|
||||
}
|
||||
// Initializes XMLHttpRequest listeners.
|
||||
_initListeners(resolve, reject, file) {
|
||||
const xhr = this.xhr;
|
||||
const loader = this.loader;
|
||||
const genericErrorText = `Couldn't upload file: ${file.name}.`;
|
||||
xhr.addEventListener("error", () => reject(genericErrorText));
|
||||
xhr.addEventListener("abort", () => reject());
|
||||
xhr.addEventListener("load", () => {
|
||||
const response = xhr.response;
|
||||
// This example assumes the XHR server's "response" object will come with
|
||||
// an "error" which has its own "message" that can be passed to reject()
|
||||
// in the upload promise.
|
||||
//
|
||||
// Your integration may handle upload errors in a different way so make sure
|
||||
// it is done properly. The reject() function must be called when the upload fails.
|
||||
if (!response || response.error) {
|
||||
return reject(response && response.error ? response.error.message : genericErrorText);
|
||||
}
|
||||
// If the upload is successful, resolve the upload promise with an object containing
|
||||
// at least the "default" URL, pointing to the image on the server.
|
||||
// This URL will be used to display the image in the content. Learn more in the
|
||||
// UploadAdapter#upload documentation.
|
||||
resolve({
|
||||
default: response.url,
|
||||
});
|
||||
});
|
||||
// Upload progress when it is supported. The file loader has the #uploadTotal and #uploaded
|
||||
// properties which are used e.g. to display the upload progress bar in the editor
|
||||
// user interface.
|
||||
if (xhr.upload) {
|
||||
xhr.upload.addEventListener("progress", (evt) => {
|
||||
if (evt.lengthComputable) {
|
||||
loader.uploadTotal = evt.total;
|
||||
loader.uploaded = evt.loaded;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// Prepares the data and sends the request.
|
||||
_sendRequest(file) {
|
||||
// Prepare the form data.
|
||||
const data = new FormData();
|
||||
data.append("upload", file);
|
||||
// Important note: This is the right place to implement security mechanisms
|
||||
// like authentication and CSRF protection. For instance, you can use
|
||||
// XMLHttpRequest.setRequestHeader() to set the request headers containing
|
||||
// the CSRF token generated earlier by your application.
|
||||
// Send the request.
|
||||
this.xhr.send(data);
|
||||
}
|
||||
// ...
|
||||
}
|
||||
|
||||
function SimpleUploadAdapterPlugin(editor) {
|
||||
editor.plugins.get("FileRepository").createUploadAdapter = (loader) => {
|
||||
// Configure the URL to the upload script in your back-end here!
|
||||
return new MyUploadAdapter(loader);
|
||||
};
|
||||
}
|
||||
|
||||
var allEditors = document.querySelector('.ck_editor_txt');
|
||||
|
||||
//Initialize the ckeditor
|
||||
ClassicEditor.create(document.querySelector("#teks"), {
|
||||
extraPlugins: [SimpleUploadAdapterPlugin],
|
||||
}).catch((error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
$("#ckeditorForm").submit(function(e) {
|
||||
var content = $('.ck_editor_txt').val();
|
||||
html = $(content).text();
|
||||
if ($.trim(html) == '') {
|
||||
alert("Teks Tidak Boleh Kosong!");
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
//Form add image validation
|
||||
var uploadField = document.getElementById("input_foto_add");
|
||||
uploadField.onchange = function() {
|
||||
if (this.files[0].size > 2000000) {
|
||||
alert("Batas maksimum 2MB!");
|
||||
this.value = "";
|
||||
} else {
|
||||
//Ubah Img Preview
|
||||
var reader = new FileReader();
|
||||
reader.onload = function() {
|
||||
var output = document.getElementById('img_preview_add');
|
||||
output.src = reader.result;
|
||||
}
|
||||
reader.readAsDataURL(event.target.files[0]);
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function(){
|
||||
$('.from-prevent-multiple-submits').on('submit', function(){
|
||||
$('.from-prevent-multiple-submits').attr('disabled','true');
|
||||
})
|
||||
})();
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,232 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'UKM Mahasiswa')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">UKM Mahasiswa</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
<!-- /.content-header -->
|
||||
|
||||
<!-- Alert Status -->
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('alert'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('alert') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Edit Data UKM Mahasiswa</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<!-- form start -->
|
||||
<form class="from-prevent-multiple-submits"
|
||||
action="{{ route('ukm_mahasiswa.update', $ukmMahasiswa) }}" method="POST"
|
||||
enctype="multipart/form-data">
|
||||
@method('patch')
|
||||
@csrf
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<label for="judul">Judul</label>
|
||||
<input type="text" class="form-control" id="judul" name="judul"
|
||||
maxlength="255" placeholder="Masukkan Judul"
|
||||
value="{{ $ukmMahasiswa->judul }}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="nama_foto">Thumbnail (Maksimal 2MB)</label>
|
||||
<div class="form-group">
|
||||
<img src="{{ url($ukmMahasiswa->thumbnail) }}" alt="Image Missing"
|
||||
id="old_nama_foto" style="max-width: 200px;"
|
||||
class="mt-2" />
|
||||
</div>
|
||||
<input type="file" accept="image/*" class="form-control mt-0"
|
||||
name="thumbnail" id="input_foto_edit">
|
||||
<input type="hidden" name="old_thumbnail"
|
||||
value="{{ $ukmMahasiswa->thumbnail }}">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="teks">Teks (Foto Maksimal 2MB)</label>
|
||||
<textarea id="teks" placeholder="Masukkan Deskripsi Video"
|
||||
name="teks">{{ $ukmMahasiswa->teks }}</textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="release_date">Tanggal Rilis</label>
|
||||
<input type="date" class="form-control" name="release_date"
|
||||
value="{{ $ukmMahasiswa->release_date }}" required>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
|
||||
<div class="card-footer">
|
||||
<button id="submit" type="submit"
|
||||
class="btn btn-primary from-prevent-multiple-submits">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
//Define an adapter to upload the files
|
||||
class MyUploadAdapter {
|
||||
constructor(loader) {
|
||||
// The file loader instance to use during the upload. It sounds scary but do not
|
||||
// worry — the loader will be passed into the adapter later on in this guide.
|
||||
this.loader = loader;
|
||||
|
||||
// URL where to send files.
|
||||
this.url = '{{ route('ckeditor.upload') }}';
|
||||
|
||||
//
|
||||
}
|
||||
// Starts the upload process.
|
||||
upload() {
|
||||
return this.loader.file.then(
|
||||
(file) =>
|
||||
new Promise((resolve, reject) => {
|
||||
this._initRequest();
|
||||
this._initListeners(resolve, reject, file);
|
||||
this._sendRequest(file);
|
||||
})
|
||||
);
|
||||
}
|
||||
// Aborts the upload process.
|
||||
abort() {
|
||||
if (this.xhr) {
|
||||
this.xhr.abort();
|
||||
}
|
||||
}
|
||||
// Initializes the XMLHttpRequest object using the URL passed to the constructor.
|
||||
_initRequest() {
|
||||
const xhr = (this.xhr = new XMLHttpRequest());
|
||||
// Note that your request may look different. It is up to you and your editor
|
||||
// integration to choose the right communication channel. This example uses
|
||||
// a POST request with JSON as a data structure but your configuration
|
||||
// could be different.
|
||||
// xhr.open('POST', this.url, true);
|
||||
xhr.open("POST", this.url, true);
|
||||
xhr.setRequestHeader("x-csrf-token", "{{ csrf_token() }}");
|
||||
xhr.responseType = "json";
|
||||
}
|
||||
// Initializes XMLHttpRequest listeners.
|
||||
_initListeners(resolve, reject, file) {
|
||||
const xhr = this.xhr;
|
||||
const loader = this.loader;
|
||||
const genericErrorText = `Couldn't upload file: ${file.name}.`;
|
||||
xhr.addEventListener("error", () => reject(genericErrorText));
|
||||
xhr.addEventListener("abort", () => reject());
|
||||
xhr.addEventListener("load", () => {
|
||||
const response = xhr.response;
|
||||
// This example assumes the XHR server's "response" object will come with
|
||||
// an "error" which has its own "message" that can be passed to reject()
|
||||
// in the upload promise.
|
||||
//
|
||||
// Your integration may handle upload errors in a different way so make sure
|
||||
// it is done properly. The reject() function must be called when the upload fails.
|
||||
if (!response || response.error) {
|
||||
return reject(response && response.error ? response.error.message : genericErrorText);
|
||||
}
|
||||
// If the upload is successful, resolve the upload promise with an object containing
|
||||
// at least the "default" URL, pointing to the image on the server.
|
||||
// This URL will be used to display the image in the content. Learn more in the
|
||||
// UploadAdapter#upload documentation.
|
||||
resolve({
|
||||
default: response.url,
|
||||
});
|
||||
});
|
||||
// Upload progress when it is supported. The file loader has the #uploadTotal and #uploaded
|
||||
// properties which are used e.g. to display the upload progress bar in the editor
|
||||
// user interface.
|
||||
if (xhr.upload) {
|
||||
xhr.upload.addEventListener("progress", (evt) => {
|
||||
if (evt.lengthComputable) {
|
||||
loader.uploadTotal = evt.total;
|
||||
loader.uploaded = evt.loaded;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// Prepares the data and sends the request.
|
||||
_sendRequest(file) {
|
||||
// Prepare the form data.
|
||||
const data = new FormData();
|
||||
data.append("upload", file);
|
||||
// Important note: This is the right place to implement security mechanisms
|
||||
// like authentication and CSRF protection. For instance, you can use
|
||||
// XMLHttpRequest.setRequestHeader() to set the request headers containing
|
||||
// the CSRF token generated earlier by your application.
|
||||
// Send the request.
|
||||
this.xhr.send(data);
|
||||
}
|
||||
// ...
|
||||
}
|
||||
|
||||
function SimpleUploadAdapterPlugin(editor) {
|
||||
editor.plugins.get("FileRepository").createUploadAdapter = (loader) => {
|
||||
// Configure the URL to the upload script in your back-end here!
|
||||
return new MyUploadAdapter(loader);
|
||||
};
|
||||
}
|
||||
|
||||
//Initialize the ckeditor
|
||||
ClassicEditor.create(document.querySelector("#teks"), {
|
||||
extraPlugins: [SimpleUploadAdapterPlugin],
|
||||
}).catch((error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
//Form edit image validation
|
||||
var uploadField = document.getElementById("input_foto_edit");
|
||||
uploadField.onchange = function() {
|
||||
if (this.files[0].size > 2000000) {
|
||||
alert("Batas maksimum 2MB!");
|
||||
this.value = "";
|
||||
} else {
|
||||
//Ubah Img Preview
|
||||
var reader = new FileReader();
|
||||
reader.onload = function() {
|
||||
var output = document.getElementById('old_nama_foto');
|
||||
output.src = reader.result;
|
||||
}
|
||||
reader.readAsDataURL(event.target.files[0]);
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function() {
|
||||
$('.from-prevent-multiple-submits').on('submit', function() {
|
||||
$('.from-prevent-multiple-submits').attr('disabled', 'true');
|
||||
})
|
||||
})();
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,158 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'UKM Mahasiswa')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">UKM Mahasiswa</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
<!-- /.content-header -->
|
||||
|
||||
<!-- Alert Status -->
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('alert'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('alert') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Data UKM Mahasiswa</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-12 text-left">
|
||||
<a type="button" href="{{ url('/admin/ukm_mahasiswa/create') }}"
|
||||
class="btn btn-success mb-3"><i class="fa fa-plus-circle"></i>
|
||||
Tambah Data UKM Mahasiswa
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table id="tabel_ukm_mahasiswa" class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nomor</th>
|
||||
<th>Judul</th>
|
||||
<th>Thumbnail</th>
|
||||
<th>Teks</th>
|
||||
<th>Jadwal Rilis</th>
|
||||
<th>Status</th>
|
||||
<th>Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($ukmMahasiswas as $ukmMahasiswa)
|
||||
<tr>
|
||||
<td>{{ $loop->iteration }}</td>
|
||||
<td>{{ $ukmMahasiswa->judul }}</td>
|
||||
<td>
|
||||
<img src="{{ url($ukmMahasiswa->thumbnail) }}" alt="Image Missing"
|
||||
style="width: 100px;">
|
||||
</td>
|
||||
<td>
|
||||
@if (strlen(strip_tags($ukmMahasiswa->teks)) > 100)
|
||||
{{ str_replace(' ', '', substr(strip_tags($ukmMahasiswa->teks), 0, 100) . '...') }}
|
||||
@else
|
||||
{{ str_replace(' ', '', substr(strip_tags($ukmMahasiswa->teks), 0, 100)) }}
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ $ukmMahasiswa->release_date }}</td>
|
||||
<td>
|
||||
@if ($ukmMahasiswa->deleted_at != '')
|
||||
Terhapus
|
||||
@elseif ($ukmMahasiswa->release_date > date('Y-m-d'))
|
||||
Belum Rilis
|
||||
@else
|
||||
Rilis
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if ($ukmMahasiswa->deleted_at != '')
|
||||
<form
|
||||
action="{{ url('/admin/ukm_mahasiswa/' . $ukmMahasiswa->id . '/restore') }}"
|
||||
method="post">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-primary"
|
||||
onclick="return confirm('Apakah anda yakin ingin mengembalikan data?')"><i
|
||||
class="fas fa-trash-restore"></i> Restore
|
||||
</button>
|
||||
</form>
|
||||
<form
|
||||
action="{{ url('/admin/ukm_mahasiswa/' . $ukmMahasiswa->id . '/delete_permanen') }}"
|
||||
method="post">
|
||||
@csrf
|
||||
<input type="hidden" name="thumbnail"
|
||||
value="{{ $ukmMahasiswa->thumbnail }}">
|
||||
<button type="submit" class="btn btn-danger"
|
||||
onclick="return confirm('Apakah anda yakin ingin menghapus permanen data?')"><i
|
||||
class="fa fa-trash"></i> Delete Permanent
|
||||
</button>
|
||||
</form>
|
||||
@else
|
||||
<a href="{{ route('ukm_mahasiswa.edit', $ukmMahasiswa) }}"
|
||||
class="btn btn-warning open-formModalEdit">
|
||||
<i class="fa fa-edit"></i> Edit
|
||||
</a>
|
||||
<form
|
||||
action="{{ route('ukm_mahasiswa.destroy', $ukmMahasiswa) }}"
|
||||
method="post">
|
||||
@method('delete')
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-danger"
|
||||
onclick="return confirm('Apakah anda yakin ingin menghapus data?')"><i
|
||||
class="fa fa-trash"></i> Delete
|
||||
</button>
|
||||
</form>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<!--Data Table -->
|
||||
<script>
|
||||
$(function() {
|
||||
$("#tabel_ukm_mahasiswa").DataTable({
|
||||
"paging": true,
|
||||
"lengthChange": false,
|
||||
"searching": true,
|
||||
"ordering": true,
|
||||
"info": true,
|
||||
"autoWidth": false,
|
||||
"responsive": false,
|
||||
"buttons": ["copy", "csv", "excel", "pdf", "print", "colvis"]
|
||||
}).buttons().container().appendTo('#tabel_ukm_mahasiswa_wrapper .col-md-6:eq(0)');
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,203 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Video Profil')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Video Profil</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
<!-- /.content-header -->
|
||||
|
||||
<!-- Alert Status -->
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('alert'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('alert') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Edit Menu Video Profil</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<!-- form start -->
|
||||
<form class="from-prevent-multiple-submits"
|
||||
action="{{ route('video_profil.update', $videoProfil->id) }}" method="POST">
|
||||
@method('patch')
|
||||
@csrf
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<label for="judul">Judul</label>
|
||||
<input type="text" class="form-control" id="judul" name="judul"
|
||||
maxlength="255" placeholder="Masukkan Judul Video"
|
||||
value="{{ $videoProfil->judul }}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="url">ID Youtube</label>
|
||||
<input type="text" class="form-control" id="url" name="url"
|
||||
maxlength="255" placeholder="Masukkan Url Video"
|
||||
value="{{ $videoProfil->url }}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="teks">Deskripsi Video</label>
|
||||
<textarea id="teks" placeholder="Masukkan Deskripsi Video" name="teks">
|
||||
{{ $videoProfil->teks }}
|
||||
</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
|
||||
<div class="card-footer">
|
||||
<button id="submit" type="submit"
|
||||
class="btn btn-primary from-prevent-multiple-submits">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
//Define an adapter to upload the files
|
||||
class MyUploadAdapter {
|
||||
constructor(loader) {
|
||||
// The file loader instance to use during the upload. It sounds scary but do not
|
||||
// worry — the loader will be passed into the adapter later on in this guide.
|
||||
this.loader = loader;
|
||||
|
||||
// URL where to send files.
|
||||
this.url = '{{ route('ckeditor.upload') }}';
|
||||
|
||||
//
|
||||
}
|
||||
// Starts the upload process.
|
||||
upload() {
|
||||
return this.loader.file.then(
|
||||
(file) =>
|
||||
new Promise((resolve, reject) => {
|
||||
this._initRequest();
|
||||
this._initListeners(resolve, reject, file);
|
||||
this._sendRequest(file);
|
||||
})
|
||||
);
|
||||
}
|
||||
// Aborts the upload process.
|
||||
abort() {
|
||||
if (this.xhr) {
|
||||
this.xhr.abort();
|
||||
}
|
||||
}
|
||||
// Initializes the XMLHttpRequest object using the URL passed to the constructor.
|
||||
_initRequest() {
|
||||
const xhr = (this.xhr = new XMLHttpRequest());
|
||||
// Note that your request may look different. It is up to you and your editor
|
||||
// integration to choose the right communication channel. This example uses
|
||||
// a POST request with JSON as a data structure but your configuration
|
||||
// could be different.
|
||||
// xhr.open('POST', this.url, true);
|
||||
xhr.open("POST", this.url, true);
|
||||
xhr.setRequestHeader("x-csrf-token", "{{ csrf_token() }}");
|
||||
xhr.responseType = "json";
|
||||
}
|
||||
// Initializes XMLHttpRequest listeners.
|
||||
_initListeners(resolve, reject, file) {
|
||||
const xhr = this.xhr;
|
||||
const loader = this.loader;
|
||||
const genericErrorText = `Couldn't upload file: ${file.name}.`;
|
||||
xhr.addEventListener("error", () => reject(genericErrorText));
|
||||
xhr.addEventListener("abort", () => reject());
|
||||
xhr.addEventListener("load", () => {
|
||||
const response = xhr.response;
|
||||
// This example assumes the XHR server's "response" object will come with
|
||||
// an "error" which has its own "message" that can be passed to reject()
|
||||
// in the upload promise.
|
||||
//
|
||||
// Your integration may handle upload errors in a different way so make sure
|
||||
// it is done properly. The reject() function must be called when the upload fails.
|
||||
if (!response || response.error) {
|
||||
return reject(response && response.error ? response.error.message : genericErrorText);
|
||||
}
|
||||
// If the upload is successful, resolve the upload promise with an object containing
|
||||
// at least the "default" URL, pointing to the image on the server.
|
||||
// This URL will be used to display the image in the content. Learn more in the
|
||||
// UploadAdapter#upload documentation.
|
||||
resolve({
|
||||
default: response.url,
|
||||
});
|
||||
});
|
||||
// Upload progress when it is supported. The file loader has the #uploadTotal and #uploaded
|
||||
// properties which are used e.g. to display the upload progress bar in the editor
|
||||
// user interface.
|
||||
if (xhr.upload) {
|
||||
xhr.upload.addEventListener("progress", (evt) => {
|
||||
if (evt.lengthComputable) {
|
||||
loader.uploadTotal = evt.total;
|
||||
loader.uploaded = evt.loaded;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// Prepares the data and sends the request.
|
||||
_sendRequest(file) {
|
||||
// Prepare the form data.
|
||||
const data = new FormData();
|
||||
data.append("upload", file);
|
||||
// Important note: This is the right place to implement security mechanisms
|
||||
// like authentication and CSRF protection. For instance, you can use
|
||||
// XMLHttpRequest.setRequestHeader() to set the request headers containing
|
||||
// the CSRF token generated earlier by your application.
|
||||
// Send the request.
|
||||
this.xhr.send(data);
|
||||
}
|
||||
// ...
|
||||
}
|
||||
|
||||
function SimpleUploadAdapterPlugin(editor) {
|
||||
editor.plugins.get("FileRepository").createUploadAdapter = (loader) => {
|
||||
// Configure the URL to the upload script in your back-end here!
|
||||
return new MyUploadAdapter(loader);
|
||||
};
|
||||
}
|
||||
|
||||
//Initialize the ckeditor
|
||||
ClassicEditor.create(document.querySelector("#teks"), {
|
||||
extraPlugins: [SimpleUploadAdapterPlugin],
|
||||
}).catch((error) => {
|
||||
console.error(error);
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function() {
|
||||
$('.from-prevent-multiple-submits').on('submit', function() {
|
||||
$('.from-prevent-multiple-submits').attr('disabled', 'true');
|
||||
})
|
||||
})();
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,178 @@
|
||||
@extends('admin/layout/main')
|
||||
|
||||
@section('title', 'Visi & Misi')
|
||||
|
||||
@section('container')
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0">Visi & Misi</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
<!-- /.content-header -->
|
||||
|
||||
<!-- Alert Status -->
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('alert'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('alert') }}
|
||||
</div>
|
||||
@endif
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Edit Menu Visi & Misi</h3>
|
||||
</div>
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<form class="from-prevent-multiple-submits" action="{{ route('visi_misi.update', $visiMisi->id) }}" method="POST">
|
||||
@method('patch')
|
||||
@csrf
|
||||
<textarea id="teks" placeholder="Enter the Description"
|
||||
name="teks">{{ $visiMisi->teks }}</textarea>
|
||||
<br>
|
||||
<button id="submit" type="submit" class="btn btn-primary from-prevent-multiple-submits">Save</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
//Define an adapter to upload the files
|
||||
class MyUploadAdapter {
|
||||
constructor(loader) {
|
||||
// The file loader instance to use during the upload. It sounds scary but do not
|
||||
// worry — the loader will be passed into the adapter later on in this guide.
|
||||
this.loader = loader;
|
||||
|
||||
// URL where to send files.
|
||||
this.url = '{{ route('ckeditor.upload') }}';
|
||||
|
||||
//
|
||||
}
|
||||
// Starts the upload process.
|
||||
upload() {
|
||||
return this.loader.file.then(
|
||||
(file) =>
|
||||
new Promise((resolve, reject) => {
|
||||
this._initRequest();
|
||||
this._initListeners(resolve, reject, file);
|
||||
this._sendRequest(file);
|
||||
})
|
||||
);
|
||||
}
|
||||
// Aborts the upload process.
|
||||
abort() {
|
||||
if (this.xhr) {
|
||||
this.xhr.abort();
|
||||
}
|
||||
}
|
||||
// Initializes the XMLHttpRequest object using the URL passed to the constructor.
|
||||
_initRequest() {
|
||||
const xhr = (this.xhr = new XMLHttpRequest());
|
||||
// Note that your request may look different. It is up to you and your editor
|
||||
// integration to choose the right communication channel. This example uses
|
||||
// a POST request with JSON as a data structure but your configuration
|
||||
// could be different.
|
||||
// xhr.open('POST', this.url, true);
|
||||
xhr.open("POST", this.url, true);
|
||||
xhr.setRequestHeader("x-csrf-token", "{{ csrf_token() }}");
|
||||
xhr.responseType = "json";
|
||||
}
|
||||
// Initializes XMLHttpRequest listeners.
|
||||
_initListeners(resolve, reject, file) {
|
||||
const xhr = this.xhr;
|
||||
const loader = this.loader;
|
||||
const genericErrorText = `Couldn't upload file: ${file.name}.`;
|
||||
xhr.addEventListener("error", () => reject(genericErrorText));
|
||||
xhr.addEventListener("abort", () => reject());
|
||||
xhr.addEventListener("load", () => {
|
||||
const response = xhr.response;
|
||||
// This example assumes the XHR server's "response" object will come with
|
||||
// an "error" which has its own "message" that can be passed to reject()
|
||||
// in the upload promise.
|
||||
//
|
||||
// Your integration may handle upload errors in a different way so make sure
|
||||
// it is done properly. The reject() function must be called when the upload fails.
|
||||
if (!response || response.error) {
|
||||
return reject(response && response.error ? response.error.message : genericErrorText);
|
||||
}
|
||||
// If the upload is successful, resolve the upload promise with an object containing
|
||||
// at least the "default" URL, pointing to the image on the server.
|
||||
// This URL will be used to display the image in the content. Learn more in the
|
||||
// UploadAdapter#upload documentation.
|
||||
resolve({
|
||||
default: response.url,
|
||||
});
|
||||
});
|
||||
// Upload progress when it is supported. The file loader has the #uploadTotal and #uploaded
|
||||
// properties which are used e.g. to display the upload progress bar in the editor
|
||||
// user interface.
|
||||
if (xhr.upload) {
|
||||
xhr.upload.addEventListener("progress", (evt) => {
|
||||
if (evt.lengthComputable) {
|
||||
loader.uploadTotal = evt.total;
|
||||
loader.uploaded = evt.loaded;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// Prepares the data and sends the request.
|
||||
_sendRequest(file) {
|
||||
// Prepare the form data.
|
||||
const data = new FormData();
|
||||
data.append("upload", file);
|
||||
// Important note: This is the right place to implement security mechanisms
|
||||
// like authentication and CSRF protection. For instance, you can use
|
||||
// XMLHttpRequest.setRequestHeader() to set the request headers containing
|
||||
// the CSRF token generated earlier by your application.
|
||||
// Send the request.
|
||||
this.xhr.send(data);
|
||||
}
|
||||
// ...
|
||||
}
|
||||
|
||||
function SimpleUploadAdapterPlugin(editor) {
|
||||
editor.plugins.get("FileRepository").createUploadAdapter = (loader) => {
|
||||
// Configure the URL to the upload script in your back-end here!
|
||||
return new MyUploadAdapter(loader);
|
||||
};
|
||||
}
|
||||
|
||||
//Initialize the ckeditor
|
||||
ClassicEditor.create(document.querySelector("#teks"), {
|
||||
extraPlugins: [SimpleUploadAdapterPlugin],
|
||||
}).catch((error) => {
|
||||
console.error(error);
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function(){
|
||||
$('.from-prevent-multiple-submits').on('submit', function(){
|
||||
$('.from-prevent-multiple-submits').attr('disabled','true');
|
||||
})
|
||||
})();
|
||||
</script>
|
||||
@endsection
|
||||
Reference in New Issue
Block a user