added pengguna,kurir page, with socket.io,need to switch this to node.js first
This commit is contained in:
306
routes/kurir_ui/index.html
Normal file
306
routes/kurir_ui/index.html
Normal file
@ -0,0 +1,306 @@
|
||||
<!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 | Halaman Utama</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">
|
||||
<script src="/auth.js"></script>
|
||||
</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" id="img-avatar" alt=""><span
|
||||
class="status online"></span></a>
|
||||
<h5 class="name"><a href="#" id="h5-title">...</a></h5>
|
||||
<h5 class="position">Kurir</h5>
|
||||
|
||||
</div>
|
||||
<!-- /.user -->
|
||||
</header>
|
||||
<!-- /.header -->
|
||||
<div class="content">
|
||||
|
||||
<div class="navigation">
|
||||
<h5 class="title">Navigasi</h5>
|
||||
<!-- /.title -->
|
||||
<ul class="menu js__accordion">
|
||||
<li class="current active">
|
||||
<a class="waves-effect" href="/kurir"><i class="menu-icon fa fa-home"></i><span>Halaman
|
||||
Utama</span></a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a class="waves-effect" href="/kurir/penghantaran"><i
|
||||
class="menu-icon ico mdi mdi-motorbike"></i><span>Pengiriman Paket</span></a>
|
||||
</li>
|
||||
|
||||
<!-- <li>
|
||||
<a class="waves-effect" href="#" onclick="notAvailable()"><i
|
||||
class="menu-icon fa fa-users"></i><span>List User</span></a>
|
||||
</li> -->
|
||||
|
||||
<li>
|
||||
<a class="waves-effect" href="#" onclick="notAvailable()"><i
|
||||
class="menu-icon ico icon-table"></i><span>Log Penghantaran</span></a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a class="waves-effect" href="/kurir/profil"><i
|
||||
class="menu-icon fa fa-unlock-alt"></i><span>Ganti Password</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">Halaman Utama</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">
|
||||
|
||||
<div class="col-lg-6 col-md-6 col-xs-6">
|
||||
<div class="box-content">
|
||||
<h4 class="box-title">Jumlah Pengguna</h4>
|
||||
<!-- /.box-title -->
|
||||
|
||||
<!-- /.dropdown js__dropdown -->
|
||||
<div class="content">
|
||||
<div class="row small-spacing">
|
||||
<div class="col-xs-6">
|
||||
<img src="/images/kiriman.png" alt="" style="width: 100%;">
|
||||
</div>
|
||||
<!-- show this icon ico icon-users-1 -->
|
||||
|
||||
<div class="col-xs-6">
|
||||
<div class="right-content">
|
||||
<h2 class="murid-counter"></h2>
|
||||
<!-- /.counter -->
|
||||
<p class="text">Orang</p>
|
||||
<!-- /.text -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.right-content -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<!-- /.box-content -->
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-6 col-xs-6">
|
||||
<div class="box-content">
|
||||
<h4 class="box-title">Jumlah Kiriman Dilakukan</h4>
|
||||
<!-- /.box-title -->
|
||||
|
||||
<!-- /.dropdown js__dropdown -->
|
||||
<div class="content">
|
||||
<div class="row small-spacing">
|
||||
<div class="col-xs-6">
|
||||
<img src="/images/kiriman2.png" alt="" style="width: 100%;">
|
||||
</div>
|
||||
<!-- show this icon ico icon-users-1 -->
|
||||
|
||||
<div class="col-xs-6">
|
||||
<div class="right-content">
|
||||
<h2 class="staf-counter"></h2>
|
||||
<!-- /.counter -->
|
||||
<p class="text">Orang</p>
|
||||
<!-- /.text -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.right-content -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<!-- /.box-content -->
|
||||
</div>
|
||||
<!-- <div class="col-xs-12">
|
||||
<div class="box-content card">
|
||||
<img src="/images/habibie.jpg" alt="" style="width: 100%; border-radius: 30px;">
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
<div class="row small-spacing">
|
||||
<div class="col-lg-2 col-md-2 col-xs-12"></div>
|
||||
<div class="col-lg-8 col-md-8 col-xs-12">
|
||||
<div class="box-content card white">
|
||||
<h4 class="box-title">Profil Kurir</h4>
|
||||
<form class="card-content" id="form-kurir">
|
||||
<div class="form-group">
|
||||
<!-- show the upload -->
|
||||
<div id="show-upload-gambar-kurir">
|
||||
<center>
|
||||
<div id="preview-gambar-kurir" style="height: 200px; width: 150px"></div>
|
||||
</center>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="form-group" id="form-gambar-kurir">
|
||||
<label for="modal-kurir-nama">Photo Kurir</label>
|
||||
<input type="file" class="form-control" id="gambar-kurir" accept="image/*"
|
||||
onchange="showUpload(this, 'gambar-kurir')">
|
||||
</div> -->
|
||||
|
||||
<div class="form-group">
|
||||
<label for="modal-kurir-nama">Nama</label>
|
||||
<input type="text" class="form-control" id="nama" placeholder="Masukkan Nama">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="modal-kurir-nama">Status</label>
|
||||
<input type="text" class="form-control" id="status" placeholder="Masukkan Status">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="modal-kurir-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="modal-kurir-nama">Jenis Kelamin</label>
|
||||
<select class="form-control" id="jenis-kelamin">
|
||||
<option value="" disabled selected>-Pilih Jenis Kelamin</option>
|
||||
<option value="Laki-laki">Laki-laki</option>
|
||||
<option value="Perempuan">Perempuan</option>
|
||||
</select>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="form-group">
|
||||
<div id="show-upload-gambar-motor">
|
||||
<center>
|
||||
<div id="preview-gambar-motor" style="height: 200px; width: 150px"></div>
|
||||
</center>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div class="form-group" id="form-gambar-motor">
|
||||
<label for="modal-kurir-nama">Photo Motor</label>
|
||||
<input type="file" class="form-control" id="gambar-motor" accept="image/*"
|
||||
onchange="showUpload(this, 'gambar-motor')">
|
||||
</div> -->
|
||||
<div class="form-group">
|
||||
<label for="modal-kurir-dd-motor">DD Motor</label>
|
||||
<input type="text" class="form-control" id="dd-motor" placeholder="Masukkan DD Motor">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-xs-12"></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 -->
|
||||
<!-- 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="/scripts/main.min.js"></script>
|
||||
<script src="/my-js.js"></script>
|
||||
<script src="/socketnya/client-dist/socket.io.js"></script>
|
||||
<script>
|
||||
const global_data = JSON.parse(localStorage.getItem('user'));
|
||||
console.log(global_data);
|
||||
|
||||
const form = document.querySelector('#form-kurir');
|
||||
form.querySelectorAll('input, select, textarea, button').forEach(el => {
|
||||
el.disabled = true;
|
||||
});
|
||||
|
||||
let img = document.createElement('img');
|
||||
img.src = 'kurir/motor/' + global_data.gambar_motor;
|
||||
img.width = 200;
|
||||
img.height = 200;
|
||||
document.getElementById('preview-gambar-motor').appendChild(img);
|
||||
let img2 = document.createElement('img');
|
||||
img2.src = 'kurir/kurir/' + global_data.gambar_kurir;
|
||||
img2.width = 200;
|
||||
img2.height = 200;
|
||||
document.getElementById('preview-gambar-kurir').appendChild(img2);
|
||||
|
||||
document.getElementById('h5-title').innerHTML = global_data.nama;
|
||||
|
||||
$("#nama").val(global_data.nama);
|
||||
$("#no_telpon").val(global_data.no_telpon);
|
||||
$("#status").val(global_data.status == null ? "Tersedia" : global_data.status);
|
||||
$("#jenis-kelamin").val(global_data.jenis_kelamin);
|
||||
$("#dd-motor").val(global_data.dd_motor);
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
104
routes/kurir_ui/login.html
Normal file
104
routes/kurir_ui/login.html
Normal file
@ -0,0 +1,104 @@
|
||||
<!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>Halaman Login Kurir</title>
|
||||
<link rel="stylesheet" href="/styles/style.min.css">
|
||||
|
||||
<!-- Waves Effect -->
|
||||
<link rel="stylesheet" href="/plugin/waves/waves.min.css">
|
||||
|
||||
<!-- Toastr -->
|
||||
<link rel="stylesheet" href="/plugin/toastr/toastr.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div id="single-wrapper">
|
||||
<form action="#" class="frm-single">
|
||||
<div class="inside">
|
||||
<div class="title"><strong>Shenior</strong> Kurir</div>
|
||||
<!-- /.title -->
|
||||
<div class="frm-title">Login Kurir</div>
|
||||
<!-- /.frm-title -->
|
||||
<div class="frm-input"><input type="text" id="username" placeholder="No Telpon" class="frm-inp"><i class="fa fa-user frm-ico"></i></div>
|
||||
<!-- /.frm-input -->
|
||||
<div class="frm-input"><input type="password" id="password" placeholder="Password" class="frm-inp"><i class="fa fa-lock frm-ico"></i></div>
|
||||
<!-- /.frm-input -->
|
||||
|
||||
<button type="button" class="frm-submit" onclick="login()">Login<i class="fa fa-arrow-circle-right"></i></button>
|
||||
|
||||
|
||||
<a href="/" class="a-link"><i class="fa fa-home"></i>Kembali Ke Halaman Utama.</a>
|
||||
|
||||
<div class="frm-footer">Arifuddin Naawi Amanah © 2025.</div>
|
||||
<!-- /.footer -->
|
||||
</div>
|
||||
<!-- .inside -->
|
||||
</form>
|
||||
<!-- /.frm-single -->
|
||||
</div><!--/#single-wrapper -->
|
||||
|
||||
<!-- 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/nprogress/nprogress.js"></script>
|
||||
<script src="/plugin/waves/waves.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 login() {
|
||||
var username = $("#username").val();
|
||||
var password = $("#password").val();
|
||||
|
||||
$.ajax({
|
||||
url: "/kurir/login",
|
||||
type: "POST",
|
||||
data: {
|
||||
no_telpon: username,
|
||||
password: password
|
||||
},
|
||||
beforeSend: function () {
|
||||
blockUI('Login Sedang Diproses...');
|
||||
|
||||
},
|
||||
success: function (data) {
|
||||
console.log(data);
|
||||
$.unblockUI();
|
||||
toastr.success("Login Berhasil");
|
||||
// create local storage
|
||||
localStorage.setItem('user', JSON.stringify(data));
|
||||
localStorage.setItem('role', 'kurir');
|
||||
// 2 sec the to halaman login
|
||||
setTimeout(() => {
|
||||
window.location.href = "/kurir";
|
||||
}, 2500);
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
$.unblockUI();
|
||||
toastr.error(xhr.responseJSON !== undefined ? xhr.responseJSON : "Terjadi Kesalahan Server");
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user