322 lines
12 KiB
HTML
322 lines
12 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
|
|
<meta name="description" content="">
|
|
<meta name="author" content="">
|
|
|
|
<title>Shenior Kurir | List User</title>
|
|
|
|
<!-- Main Styles -->
|
|
<link rel="stylesheet" href="/styles/style.min.css">
|
|
|
|
<!-- mCustomScrollbar -->
|
|
<link rel="stylesheet" href="/plugin/mCustomScrollbar/jquery.mCustomScrollbar.min.css">
|
|
|
|
<!-- Waves Effect -->
|
|
<link rel="stylesheet" href="/plugin/waves/waves.min.css">
|
|
|
|
<!-- Sweet Alert -->
|
|
<link rel="stylesheet" href="/plugin/sweet-alert/sweetalert.css">
|
|
|
|
<link rel="stylesheet" href="/fonts/fontello/fontello.css">
|
|
|
|
<link rel="stylesheet" href="/fonts/material-design-iconic-font/css/material-design-iconic-font.min.css">
|
|
<link rel="stylesheet" href="/fonts/material-design/css/materialdesignicons.css">
|
|
|
|
<link rel="stylesheet" href="/plugin/datatables/media/css/dataTables.bootstrap.min.css">
|
|
|
|
<!-- Toastr -->
|
|
<link rel="stylesheet" href="/plugin/toastr/toastr.css">
|
|
</head>
|
|
|
|
<body>
|
|
<div class="main-menu">
|
|
<header class="header">
|
|
<a href="/admin" class="logo">Shenior Kurir</a>
|
|
<button type="button" class="button-close fa fa-times js__menu_close"></button>
|
|
<div class="user">
|
|
<a href="#" class="avatar"><img src="/images/admin.png" alt=""><span class="status online"></span></a>
|
|
<h5 class="name"><a href="#">Admin</a></h5>
|
|
<h5 class="position">Admin</h5>
|
|
|
|
</div>
|
|
<!-- /.user -->
|
|
</header>
|
|
<!-- /.header -->
|
|
<div class="content">
|
|
|
|
<div class="navigation">
|
|
<h5 class="title">Navigasi</h5>
|
|
<!-- /.title -->
|
|
<ul class="menu js__accordion">
|
|
<li>
|
|
<a class="waves-effect" href="/admin"><i class="menu-icon fa fa-home"></i><span>Halaman
|
|
Utama</span></a>
|
|
</li>
|
|
|
|
<li>
|
|
<a class="waves-effect" href="/admin/kurir"><i
|
|
class="menu-icon ico mdi mdi-motorbike"></i><span>List Kurir</span></a>
|
|
</li>
|
|
|
|
<li class="current active">
|
|
<a class="waves-effect" href="/admin/user"><i class="menu-icon fa fa-users"></i><span>List
|
|
User</span></a>
|
|
</li>
|
|
|
|
<li>
|
|
<a class="waves-effect" href="/admin/list" ><i
|
|
class="menu-icon ico icon-table"></i><span>List Penghantaran</span></a>
|
|
</li>
|
|
|
|
|
|
<li>
|
|
<a class="waves-effect" href="#" onclick="logout()"><i
|
|
class="menu-icon ico icon-logout"></i><span>Logout</span></a>
|
|
</li>
|
|
</ul>
|
|
|
|
</div>
|
|
<!-- /.navigation -->
|
|
</div>
|
|
<!-- /.content -->
|
|
</div>
|
|
<!-- /.main-menu -->
|
|
|
|
<div class="fixed-navbar">
|
|
<div class="pull-left">
|
|
<button type="button"
|
|
class="menu-mobile-button glyphicon glyphicon-menu-hamburger js__menu_mobile"></button>
|
|
<h1 class="page-title">List User</h1>
|
|
<!-- /.page-title -->
|
|
</div>
|
|
<!-- /.pull-left -->
|
|
<div class="pull-right">
|
|
|
|
|
|
<a href="#" class="ico-item ico icon-logout" onclick="logout()"></a>
|
|
</div>
|
|
<!-- /.pull-right -->
|
|
</div>
|
|
<!-- /.fixed-navbar -->
|
|
|
|
<div id="wrapper">
|
|
<div class="main-content">
|
|
<div class="row small-spacing">
|
|
<div class="col-xs-12">
|
|
<div class="box-content card">
|
|
<h4 class="box-title">Form User</h4>
|
|
<!-- /.box-title -->
|
|
<div class="card-content">
|
|
|
|
<div class="form-group" style="overflow-x: auto;">
|
|
<table id="tb-user" class="table table-striped table-bordered display"
|
|
style="width:100%">
|
|
|
|
</table>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<!-- /.box-content -->
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
<footer class="footer">
|
|
<ul class="list-inline">
|
|
<li>Arifuddin Naawi Amanah © 2025.</li>
|
|
<!-- <li><a href="#">Privacy</a></li>
|
|
<li><a href="#">Terms</a></li>
|
|
<li><a href="#">Help</a></li> -->
|
|
</ul>
|
|
</footer>
|
|
</div>
|
|
<!-- /.main-content -->
|
|
</div><!--/#wrapper -->
|
|
|
|
<div class="modal fade" id="modal-kurir" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
|
|
<div class="modal-dialog" role="document">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
|
|
aria-hidden="true">×</span></button>
|
|
<h4 class="modal-title" id="modal-user-title">Modal title</h4>
|
|
</div>
|
|
<form class="modal-body" id="form-modal">
|
|
<div class="form-group">
|
|
<!-- show the upload -->
|
|
<div id="show-upload-gambar-user" style="display: none">
|
|
<center>
|
|
<div id="preview-gambar-user" style="height: 200px; width: 150px"></div>
|
|
</center>
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="modal-user-nama">Nama</label>
|
|
<input type="text" class="form-control" id="nama" placeholder="Masukkan Nama">
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="modal-user-nama">No Telpon/HP</label>
|
|
<input type="text" class="form-control" id="no_telpon" oninput="numberOnly(this)" maxlength="13"
|
|
placeholder="Masukkan No Telpon/HP">
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="alamat">Alamat </label>
|
|
<textarea name="alamat" class="form-control" id="alamat" placeholder="Masukkan Alamat"
|
|
style="resize: none"></textarea>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</form>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-default btn-sm waves-effect waves-light"
|
|
data-dismiss="modal">Close</button>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
|
|
<!--[if lt IE 9]>
|
|
<script src="/script/html5shiv.min.js"></script>
|
|
<script src="/script/respond.min.js"></script>
|
|
<![endif]-->
|
|
<!--
|
|
================================================== -->
|
|
<!-- Placed at the end of the document so the pages load faster -->
|
|
<script src="/scripts/jquery.min.js"></script>
|
|
<script src="/scripts/modernizr.min.js"></script>
|
|
<script src="/plugin/bootstrap/js/bootstrap.min.js"></script>
|
|
<script src="/plugin/mCustomScrollbar/jquery.mCustomScrollbar.concat.min.js"></script>
|
|
<script src="/plugin/nprogress/nprogress.js"></script>
|
|
<script src="/plugin/sweet-alert/sweetalert.min.js"></script>
|
|
<script src="/plugin/waves/waves.min.js"></script>
|
|
<!-- Full Screen Plugin -->
|
|
<script src="/plugin/fullscreen/jquery.fullscreen-min.js"></script>
|
|
|
|
<script src="/plugin/datatables/media/js/jquery.dataTables.min.js"></script>
|
|
<script src="/plugin/datatables/media/js/dataTables.bootstrap.min.js"></script>
|
|
<script src="/plugin/datatables/extensions/Responsive/js/dataTables.responsive.min.js"></script>
|
|
|
|
<!-- Toastr -->
|
|
<script src="/plugin/toastr/toastr.min.js"></script>
|
|
|
|
<script src="/block/jquery.blockUI.js"></script>
|
|
|
|
<script src="/scripts/main.min.js"></script>
|
|
<script src="/my-js.js"></script>
|
|
<script>
|
|
function reloadTable() {
|
|
// destroy table
|
|
// $('#tb-kurir').DataTable().destroy();
|
|
$('#tb-user').DataTable({
|
|
// responsive: true,
|
|
scrollX: true,
|
|
// order: [
|
|
// [0, 'asc']
|
|
// ],
|
|
ajax: {
|
|
url: '/admin/user/data',
|
|
type: 'GET',
|
|
timeout: 120000,
|
|
dataSrc: function (data) {
|
|
console.log(data)
|
|
return data
|
|
}
|
|
},
|
|
"sAjaxDataProp": "",
|
|
"aoColumns": [
|
|
{
|
|
"mData": "no_telpon",
|
|
"title": "No Telpon",
|
|
"render": function (data, type, row) {
|
|
return data
|
|
}
|
|
},
|
|
{
|
|
"mData": "nama",
|
|
"title": "Nama",
|
|
"render": function (data, type, row) {
|
|
return data
|
|
}
|
|
},
|
|
{
|
|
"mData": null,
|
|
"title": "Aksi",
|
|
"render": function (data, type, row) {
|
|
return `<button type='button' onclick='open_modal_edit("${data._id}")' title='Detail Kurir' class='btn btn-info btn-circle btn-sm waves-effect waves-light'><i class='ico zmdi zmdi-info'></i></button>`
|
|
}
|
|
}
|
|
]
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
reloadTable()
|
|
|
|
|
|
function open_modal_edit(id) {
|
|
// console.log(id)
|
|
selectClicked = false
|
|
$.ajax({
|
|
type: 'GET',
|
|
url: '/admin/user/data/' + id,
|
|
dataType: 'json',
|
|
beforeSend: function () {
|
|
blockUI('Loading')
|
|
},
|
|
success: function (data) {
|
|
console.log(data)
|
|
$('#modal-user-title').html('Detail Kurir')
|
|
|
|
$("#no_telpon").val(data.no_telpon)
|
|
$("#nama").val(data.nama)
|
|
$("#alamat").val(data.alamat)
|
|
// disable all input in #form-modal
|
|
|
|
enableInput(true)
|
|
|
|
$('#modal-kurir').modal('show')
|
|
var img = document.createElement('img');
|
|
img.src = 'kurir/gambar/' + data.no_telpon + '/' + data.gambar_kurir;
|
|
img.style.maxWidth = '100%'; // Make the image fit the width of the div
|
|
img.style.maxHeight = '100%'; // Make the image fit the height of the div
|
|
|
|
// Get the preview div
|
|
var previewDiv = document.getElementById('preview-gambar-user');
|
|
$('#show-upload-gambar-user').show();
|
|
// Clear any existing content in the preview div
|
|
previewDiv.innerHTML = '';
|
|
|
|
// Append the image to the preview div
|
|
previewDiv.appendChild(img);
|
|
|
|
|
|
|
|
|
|
$.unblockUI();
|
|
},
|
|
error: function (jqXHR, textStatus, errorThrown) {
|
|
$.unblockUI();
|
|
swal("Ups!", jqXHR.responseJSON.message ?? 'Something went wrong', "error");
|
|
}
|
|
})
|
|
}
|
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html> |