Skip to content

Commit

Permalink
Add datatable server side, update certificate
Browse files Browse the repository at this point in the history
  • Loading branch information
ajifatur committed Jun 14, 2021
1 parent 3638afa commit d72922f
Show file tree
Hide file tree
Showing 19 changed files with 436 additions and 255 deletions.
95 changes: 31 additions & 64 deletions resources/views/admin/email/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,50 +52,6 @@
<th width="80">Opsi</th>
</tr>
</thead>
<tbody>
@foreach($email as $data)
<tr>
<td><input type="checkbox"></td>
<td>
<a href="{{ route('admin.email.detail', ['id' => $data->id_email]) }}">{{ $data->subject }}</a>
<br>
@if(count_penerima_email($data->receiver_id)>0)
<small class="text-muted"><i class="fa fa-check-circle mr-1"></i>Sudah dikirim kepada {{ number_format(count_penerima_email($data->receiver_id),0,'.','.') }} dari total {{ number_format(count_member_aktif(),0,'.','.') }} member.</small>
@endif
</td>
<td>
<a href="{{ route('admin.user.detail', ['id' => $data->id_user]) }}">{{ $data->nama_user }}</a>
<br>
<small><i class="fa fa-envelope mr-1"></i>{{ $data->email }}</small>
<br>
<small><i class="fa fa-phone mr-1"></i>{{ $data->nomor_hp }}</small>
</td>
<td>
@if($data->scheduled != null)
<span>Harian</span>
<br>
<small><i class="fa fa-clock-o mr-1"></i>{{ $data->scheduled }} WIB</small>
@else
<span class="badge badge-danger">Tidak</span>
@endif
</td>
<td>
<span class="d-none">{{ $data->sent_at }}</span>
{{ date('d/m/Y', strtotime($data->sent_at)) }}
<br>
<small><i class="fa fa-clock-o mr-1"></i>{{ date('H:i', strtotime($data->sent_at)) }} WIB</small>
</td>
<td>
<div class="btn-group">
<a href="{{ route('admin.email.detail', ['id' => $data->id_email]) }}" class="btn btn-info btn-sm" data-toggle="tooltip" title="Detail"><i class="fa fa-eye"></i></a>
<a href="#" class="btn btn-warning btn-sm btn-schedule" data-id="{{ $data->id_email }}" data-schedule="{{ $data->scheduled }}" data-toggle="tooltip" title="Atur Jadwal"><i class="fa fa-clock-o"></i></a>
<a href="#" class="btn btn-success btn-sm btn-forward" data-id="{{ $data->id_email }}" data-r="{{ $data->receiver_id }}" data-toggle="tooltip" title="Teruskan"><i class="fa fa-share"></i></a>
<a href="#" class="btn btn-danger btn-sm btn-delete" data-id="{{ $data->id_email }}" data-toggle="tooltip" title="Hapus"><i class="fa fa-trash"></i></a>
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
<form id="form-delete" class="d-none" method="post" action="{{ route('admin.email.delete') }}">
{{ csrf_field() }}
Expand Down Expand Up @@ -210,7 +166,18 @@
<script type="text/javascript" src="{{ asset('assets/plugins/clockpicker/bootstrap-clockpicker.min.js') }}"></script>
<script type="text/javascript">
// DataTable
generate_datatable("#dataTable");
generate_datatable("#dataTable", {
"url": "{{ route('admin.email.data') }}",
"columns": [
{data: 'checkbox', name: 'checkbox'},
{data: 'email', name: 'email'},
{data: 'sender', name: 'sender'},
{data: 'scheduled', name: 'scheduled'},
{data: 'sent_at', name: 'sent_at'},
{data: 'options', name: 'options'},
],
"order": [3, 'desc']
});
// Button Forward
$(document).on("click", ".btn-forward", function(e){
Expand Down Expand Up @@ -277,28 +244,28 @@
e.preventDefault();
var id = $(this).data("id");
var schedule = $(this).data("schedule");
// Add values
// Add values
$("#modal-schedule input[name=id]").val(id);
if(schedule != ''){
$("#modal-schedule #terjadwal-1").prop("checked", true);
$("#modal-schedule .form-jadwal").removeClass("d-none");
$("#modal-schedule input[name=scheduled]").val(schedule);
}
else{
$("#modal-schedule #terjadwal-0").prop("checked", true);
$("#modal-schedule .form-jadwal").addClass("d-none");
$("#modal-schedule input[name=scheduled]").val(schedule);
}
if(schedule != ''){
$("#modal-schedule #terjadwal-1").prop("checked", true);
$("#modal-schedule .form-jadwal").removeClass("d-none");
$("#modal-schedule input[name=scheduled]").val(schedule);
}
else{
$("#modal-schedule #terjadwal-0").prop("checked", true);
$("#modal-schedule .form-jadwal").addClass("d-none");
$("#modal-schedule input[name=scheduled]").val(schedule);
}
// Show modal
$("#modal-schedule").modal("show");
});
// Clockpicker
$(".clockpicker").clockpicker({
autoclose: true
});
// Clockpicker
$(".clockpicker").clockpicker({
autoclose: true
});
// Change Terjadwal
$(document).on("change", "input[name=terjadwal]", function(){
Expand All @@ -309,7 +276,7 @@
// Hide Modal Schedule
$('#modal-schedule').on('hidden.bs.modal', function(){
$("#modal-schedule input[name=id]").val(null);
$("#modal-schedule input[name=scheduled]").val(null);
$("#modal-schedule input[name=scheduled]").val(null);
});
// Checkbox Batch
Expand Down Expand Up @@ -382,7 +349,7 @@ function countChecked(array){
</script>
@if(count($errors)>0)
<script type="text/javascript">
$("#modal-schedule").modal("show");
$("#modal-schedule").modal("show");
</script>
@endif

Expand Down
79 changes: 15 additions & 64 deletions resources/views/admin/komisi/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,68 +44,6 @@
<th width="40">Opsi</th>
</tr>
</thead>
<tbody>
@foreach($komisi as $data)
<tr>
<td><input type="checkbox"></td>
<td>{{ $data->inv_komisi }}</td>
<td>
@if($data->komisi_at != null)
<span class="d-none">{{ $data->komisi_at }}</span>
{{ date('d/m/Y', strtotime($data->komisi_at)) }}
<br>
<small><i class="fa fa-clock-o mr-1"></i>{{ date('H:i', strtotime($data->komisi_at)) }} WIB</small>
@else
-
@endif
</td>
<td>
<a href="{{ route('admin.user.detail', ['id' => $data->id_user ]) }}">{{ $data->nama_user }}</a>
<br>
<small><i class="fa fa-envelope mr-1"></i>{{ $data->email }}</small>
<br>
<small><i class="fa fa-phone mr-1"></i>{{ $data->nomor_hp }}</small>
</td>
<td>
<a href="{{ route('admin.user.detail', ['id' => $data->id_sponsor->id_user ]) }}">{{ $data->id_sponsor->nama_user }}</a>
<br>
<small><i class="fa fa-envelope mr-1"></i>{{ $data->id_sponsor->email }}</small>
<br>
<small><i class="fa fa-phone mr-1"></i>{{ $data->id_sponsor->nomor_hp }}</small>
</td>
<td>
<strong>Aktivasi Komisi:</strong><br>
Rp. {{ number_format($data->komisi_aktivasi,0,',',',') }}<br><br>
<strong>Hasil Komisi:</strong><br>
Rp. {{ number_format($data->komisi_hasil,0,',',',') }}
</td>
<td>
@if($data->komisi_status == 1)
<strong class="text-success">Diterima</strong>
@else
@if($data->komisi_proof != '')
<strong class="text-danger">Pembayaran Belum Diverifikasi</strong>
@else
<strong class="text-danger">User Belum Membayar</strong>
@endif
@endif
</td>
<td align="center">
<div class="btn-group">
@if($data->komisi_status == 1)
<a href="{{ asset('assets/images/komisi/'.$data->komisi_proof) }}" class="btn btn-sm btn-info btn-magnify-popup" data-toggle="tooltip" title="Bukti Transfer"><i class="fa fa-image"></i></a>
@else
@if($data->komisi_proof != '')
<a href="#" class="btn btn-sm btn-success btn-verify" data-id="{{ $data->id_komisi }}" data-proof="{{ asset('assets/images/komisi/'.$data->komisi_proof) }}" data-toggle="tooltip" title="Verifikasi Pembayaran"><i class="fa fa-check"></i></a>
@else
<a href="#" class="btn btn-sm btn-success btn-confirm" data-id="{{ $data->id_komisi }}" data-toggle="tooltip" title="Konfirmasi Pembayaran"><i class="fa fa-check"></i></a>
@endif
@endif
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
Expand Down Expand Up @@ -194,15 +132,28 @@

<script type="text/javascript">
// DataTable
generate_datatable("#dataTable");
generate_datatable("#dataTable", {
"url": "{{ route('admin.komisi.data') }}",
"columns": [
{data: 'checkbox', name: 'checkbox'},
{data: 'inv_komisi', name: 'inv_komisi'},
{data: 'komisi_at', name: 'komisi_at'},
{data: 'user_identity', name: 'user_identity'},
{data: 'sponsor', name: 'sponsor'},
{data: 'komisi', name: 'komisi'},
{data: 'komisi_status', name: 'komisi_status'},
{data: 'options', name: 'options'},
],
"order": [6, 'asc']
});
// Button Verify
$(document).on("click", ".btn-verify", function(e){
e.preventDefault();
var id = $(this).data("id");
var proof = $(this).data("proof");
$("#form-verify input[name=id_komisi]").val(id);
$("#form-verify img").attr("src", proof);
$("#form-verify img").attr("src", proof).removeClass("d-none");
$("#modal-verify").modal("show");
});
Expand Down
11 changes: 1 addition & 10 deletions resources/views/admin/pelatihan/create.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
</div>
</div>
<div class="form-group row">
<label class="col-md-2 col-form-label">Materi <span class="text-danger">*</span></label>
<label class="col-md-2 col-form-label">Materi</label>
<div class="col-md-10">
<a class="btn btn-sm btn-secondary btn-add-materi" href="#"><i class="fa fa-plus mr-2"></i>Tambah Materi</a>
<div class="table-responsive-sm konten-materi mt-3 mb-3 mb-md-0">
Expand Down Expand Up @@ -250,15 +250,6 @@
$(document).on("click", "button[type=submit]", function(e){
e.preventDefault();
// Cek Materi
var rows = $(".konten-materi .form-row");
if(rows.length == 1){
if($(rows).find(".kode-unit").val() == '' || $(rows).find(".judul-unit").val() == '' || $(rows).find(".durasi").val() == '' ){
alert("Materi harus diisi minimal 1 (satu) !");
return;
}
}
// Get Konten di Quill Editor
var myEditor = document.querySelector('#editor');
var html = myEditor.children[0].innerHTML;
Expand Down
2 changes: 2 additions & 0 deletions resources/views/admin/pelatihan/detail.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
<strong>Deskripsi:</strong>
<div class="ql-snow"><div class="ql-editor p-0">{!! html_entity_decode($pelatihan->deskripsi_pelatihan) !!}</div></div>
</div>
@if(count($pelatihan->materi_pelatihan)>0)
<div class="mt-3">
<strong>Materi:</strong>
<div class="list-group list-group-flush">
Expand All @@ -90,6 +91,7 @@
@endforeach
</div>
</div>
@endif
</div>
<!-- /Tile Body -->
</div>
Expand Down
Loading

0 comments on commit d72922f

Please sign in to comment.