Penambahan Menu FrontOffice
This commit is contained in:
163
app/Http/Controllers/FrontOffice/FrontOfficeController.php
Normal file
163
app/Http/Controllers/FrontOffice/FrontOfficeController.php
Normal file
@@ -0,0 +1,163 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\FrontOffice;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\TransaksiParkir;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class FrontOfficeController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
return view ('frontoffice.index');
|
||||
}
|
||||
|
||||
public function search(Request $request)
|
||||
{
|
||||
// Log::info($request->all());
|
||||
$keyword = $request->q;
|
||||
Log::info($keyword);
|
||||
|
||||
if (!$keyword) {
|
||||
return response()->json([
|
||||
'status' => false,
|
||||
'message' => 'Input kosong'
|
||||
]);
|
||||
}
|
||||
|
||||
// $data = TransaksiParkir::where('no_pol', $keyword)
|
||||
$data = DB::table('transaksi_parkir')->where('no_pol', $keyword)
|
||||
->select(DB::raw(
|
||||
'CAST(id AS TEXT) as id, no_pol, waktu_masuk, id_kendaraan, pic_body_masuk'
|
||||
))
|
||||
// ->where('status', 1)
|
||||
// ->orWhere('no_pol', $keyword)
|
||||
->orderByDesc('waktu_masuk')
|
||||
->first();
|
||||
|
||||
if (!empty($data->pic_body_masuk) && is_resource($data->pic_body_masuk)) {
|
||||
$data->pic_body_masuk = base64_encode(stream_get_contents($data->pic_body_masuk)) ?? 'Not Image';
|
||||
} else {
|
||||
$data->pic_body_masuk = 'No Image';
|
||||
}
|
||||
// $pic_body_masuk = (string) $data->pic_body_masuk;
|
||||
|
||||
// $data->pic_body_masuk_base64 = $data->pic_body_masuk
|
||||
// ? 'data:image/jpeg;base64,' . base64_encode($pic_body_masuk )
|
||||
// : null;
|
||||
|
||||
// Log::info($data);
|
||||
|
||||
if (!$data) {
|
||||
return response()->json([
|
||||
'status' => false,
|
||||
'message' => 'Data tidak ditemukan'
|
||||
]);
|
||||
}
|
||||
|
||||
return response()->json([
|
||||
'status' => true,
|
||||
// 'data' => $data
|
||||
'data' => [
|
||||
'id' => (string) $data->id,
|
||||
'no_pol' => $data->no_pol,
|
||||
'waktu_masuk' => $data->waktu_masuk,
|
||||
'vehicle_capt' => $data->pic_body_masuk
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
||||
public function image($id)
|
||||
{
|
||||
$picture = TransaksiParkir::select('pic_body_masuk')->where('no_pol', $id)
|
||||
->where('status', 1)
|
||||
->orderByDesc('waktu_masuk')
|
||||
->first();
|
||||
|
||||
// return response($picture->pic_body_masuk)
|
||||
// ->header('Content-Type', 'image/jpeg');
|
||||
|
||||
// ❌ kalau tidak ada data
|
||||
if (!$picture || !$picture->pic_body_masuk) {
|
||||
return response()->file(public_path('images/no-image.jpg'));
|
||||
}
|
||||
|
||||
return response($picture->pic_body_masuk)
|
||||
->header('Content-Type', 'image/jpeg')
|
||||
->header('Cache-Control', 'public, max-age=86400'); // cache 1 hari
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
Log::info('Method Store : ' . json_encode($request->all()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
Log::info($request->all());
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -1,114 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\FrontOffice;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\TransaksiParkir;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class FrontOfficeControllerController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
return view ('tools.additional');
|
||||
}
|
||||
|
||||
public function search(Request $request)
|
||||
{
|
||||
$keyword = $request->q;
|
||||
|
||||
if (!$keyword) {
|
||||
return response()->json([
|
||||
'status' => false,
|
||||
'message' => 'Input kosong'
|
||||
]);
|
||||
}
|
||||
|
||||
$data = TransaksiParkir::where('no_pol', $keyword)
|
||||
->orWhere('no_pol', $keyword)
|
||||
->first();
|
||||
|
||||
if (!$data) {
|
||||
return response()->json([
|
||||
'status' => false,
|
||||
'message' => 'Data tidak ditemukan'
|
||||
]);
|
||||
}
|
||||
|
||||
return response()->json([
|
||||
'status' => true,
|
||||
'data' => $data
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
BIN
public/images/no-image.jpg
Normal file
BIN
public/images/no-image.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.8 KiB |
BIN
resources/views/.DS_Store
vendored
BIN
resources/views/.DS_Store
vendored
Binary file not shown.
@@ -53,7 +53,7 @@ class="img-fluid logo-img"> --}}
|
||||
Member masih aktif
|
||||
</div>
|
||||
|
||||
<p class="text-info">silahkan pilih produk di bawah ini :</p>
|
||||
<p class="text-warning">silahkan pilih produk di bawah ini :</p>
|
||||
<div class="select-input">
|
||||
<select id="produkSelect" class="form-control form-select">
|
||||
|
||||
|
||||
@@ -3,38 +3,23 @@
|
||||
@section('styles')
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.8/css/jquery.dataTables.min.css">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
||||
<link href="https://cdn.jsdelivr.net/npm/select2-bootstrap-5-theme@1.3.0/dist/select2-bootstrap-5-theme.min.css" rel="stylesheet" />
|
||||
<link href="https://cdn.jsdelivr.net/npm/select2-bootstrap-5-theme@1.3.0/dist/select2-bootstrap-5-theme.min.css"
|
||||
rel="stylesheet" />
|
||||
<link rel="stylesheet" href="{{ asset('vendors/select2/select2.min.css') }}">
|
||||
<style>
|
||||
.dashboard-row {
|
||||
background: #f8fafc;
|
||||
transition: all 0.2s ease;
|
||||
.detail-label {
|
||||
font-size: 14px;
|
||||
color: #6c757d;
|
||||
}
|
||||
|
||||
.dashboard-row:hover {
|
||||
background: #e2e8f0;
|
||||
transform: translateY(-2px);
|
||||
.detail-value {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #212529;
|
||||
}
|
||||
|
||||
.card {
|
||||
border-radius: 12px;
|
||||
}
|
||||
|
||||
.card-header {
|
||||
border-radius: 12px 12px 0 0;
|
||||
}
|
||||
|
||||
.select2-container .select2-selection--single {
|
||||
height: 38px !important;
|
||||
padding: 5px 10px;
|
||||
}
|
||||
|
||||
.select2-selection__rendered {
|
||||
line-height: 28px !important;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
height: 38px !important;
|
||||
.detail-row {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
</style>
|
||||
@endsection
|
||||
@@ -60,10 +45,9 @@
|
||||
<div class="card-body">
|
||||
<ul class="nav nav-pills mb-3" id="pills-tab" role="tablist">
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link active" id="pills-home-tab"
|
||||
data-bs-toggle="pill" data-bs-target="#pills-home" type="button"
|
||||
role="tab" aria-controls="pills-home"
|
||||
aria-selected="true">Check IN</button>
|
||||
<button class="nav-link active" id="pills-home-tab" data-bs-toggle="pill"
|
||||
data-bs-target="#pills-home" type="button" role="tab"
|
||||
aria-controls="pills-home" aria-selected="true">Check IN</button>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link" id="pills-profile-tab" data-bs-toggle="pill"
|
||||
@@ -78,54 +62,159 @@
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link" id="pills-disabled-tab" data-bs-toggle="pill"
|
||||
data-bs-target="#pills-disabled" type="button" role="tab"
|
||||
aria-controls="pills-disabled" aria-selected="false"
|
||||
disabled>Disabled</button>
|
||||
aria-controls="pills-disabled" aria-selected="false" disabled>Disabled</button>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content" id="pills-tabContent">
|
||||
<div class="tab-pane fade show active" id="pills-home" role="tabpanel"
|
||||
aria-labelledby="pills-home-tab" tabindex="0">
|
||||
<div class="row">
|
||||
<div class="col-md-3 grid-margin stretch-card">
|
||||
<div class="row g-3">
|
||||
|
||||
<!-- LEFT PANEL (SCAN / INPUT) -->
|
||||
<div class="col-md-2">
|
||||
<div class="card shadow-sm h-100">
|
||||
<div class="card-body">
|
||||
<div class="mb-3">
|
||||
<label class="form-label fw-semibold">Input atau Scan Tiket/Kartu Akses</h5></label>
|
||||
<input type="text" class="form-control" id="search-value" placeholder="Scan / input tiket..." autofocus>
|
||||
<small id="search-status" class="text-muted"></small>
|
||||
<div class="mt-2">
|
||||
<button class="btn btn-primary btn-sm add-button" data-bs-toggle="modal" data-bs-target=".bd-example-modal-lg">Tambah</button>
|
||||
</div>
|
||||
|
||||
<label class="form-label fw-semibold">
|
||||
Input / Scan Tiket / Kartu Akses
|
||||
</label>
|
||||
|
||||
<input type="text" class="form-control mb-2" id="search-value"
|
||||
placeholder="Scan / input tiket..." autofocus>
|
||||
|
||||
<small id="search-status" class="text-muted d-block mb-3"></small>
|
||||
|
||||
<div class="d-grid">
|
||||
<button class="btn btn-primary btn-sm" data-bs-toggle="modal"
|
||||
data-bs-target=".bd-example-modal-lg">
|
||||
<i class="fa fa-plus me-1"></i> Tambah
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-9 grid-margin stretch-card">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="card-title">Detail Transaksi</h4>
|
||||
<div class="d-flex justify-content-between align-items-center mb-2">
|
||||
|
||||
<div id="rowActions" class="d-none">
|
||||
<button class="btn btn-warning btn-sm edit-button" id="btnEdit" data-bs-toggle="modal" data-bs-target=".bd-ubah-modal-lg">Edit</button>
|
||||
<button class="btn btn-danger btn-sm" id="btnDelete">Hapus</button>
|
||||
<button class="btn btn-info btn-sm" id="btnDetail">Detail</button>
|
||||
|
||||
<!-- RIGHT PANEL -->
|
||||
<div class="col-md-10">
|
||||
<div class="row g-3">
|
||||
<!-- DETAIL TRANSAKSI -->
|
||||
<div class="col-md-5">
|
||||
<div class="card h-100">
|
||||
<div class="card-body">
|
||||
|
||||
<h5 class="card-title mb-3">Detail Transaksi</h5>
|
||||
|
||||
<form id="formTransaksi" method="POST">
|
||||
@csrf
|
||||
{{-- @method('PUT') --}}
|
||||
|
||||
<!-- ACTION BUTTON -->
|
||||
<div id="rowActions" class="d-none mb-3"></div>
|
||||
|
||||
<hr>
|
||||
|
||||
<!-- FORM INPUT -->
|
||||
<div class="d-none mt-3" id="formEdit">
|
||||
|
||||
<!-- Nama / Kamar -->
|
||||
<div class="row align-items-center mb-2">
|
||||
<div class="col-4">
|
||||
<label class="form-label detail-label mb-0">
|
||||
Nama / No. Kamar
|
||||
</label>
|
||||
</div>
|
||||
<div class="col-8">
|
||||
<input type="text"
|
||||
name="nama"
|
||||
class="form-control"
|
||||
placeholder="Nama / K501">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- No Polisi -->
|
||||
<div class="row align-items-center mb-2">
|
||||
<div class="col-4">
|
||||
<label class="form-label detail-label mb-0">
|
||||
No. Polisi
|
||||
</label>
|
||||
</div>
|
||||
<div class="col-8">
|
||||
<input type="text"
|
||||
name="no_pol"
|
||||
class="form-control"
|
||||
placeholder="B123TES">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Lama Parkir -->
|
||||
<div class="row align-items-center mb-3">
|
||||
<div class="col-4">
|
||||
<label class="form-label detail-label mb-0">
|
||||
Lama Parkir
|
||||
</label>
|
||||
</div>
|
||||
<div class="col-8">
|
||||
<select name="durasi" class="form-select">
|
||||
<option value="1">1 Malam</option>
|
||||
<option value="2">2 Malam</option>
|
||||
<option value="3">3 Malam</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- SUBMIT BUTTON -->
|
||||
<div class="d-flex justify-content-end">
|
||||
<button type="submit" class="btn btn-success">
|
||||
<i class="fa fa-save me-1"></i> Simpan
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<!-- DETAIL DISPLAY -->
|
||||
<div id="detail-content" class="text-muted mt-3">
|
||||
Pilih transaksi untuk melihat detail
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- IMAGE PREVIEW -->
|
||||
<div class="col-md-7">
|
||||
<div class="card h-100">
|
||||
<div
|
||||
class="card-body d-flex justify-content-center align-items-center">
|
||||
|
||||
<img id="pic_body_masuk" src=""
|
||||
alt="Preview Kendaraan"
|
||||
class="w-100 h-100 rounded d-none"
|
||||
style="max-height: 880px; object-fit: cover;">
|
||||
|
||||
<span id="no-image" class="text-muted">
|
||||
Tidak ada gambar
|
||||
</span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="pills-profile" role="tabpanel"
|
||||
aria-labelledby="pills-profile-tab" tabindex="0">
|
||||
<ul class="list-group">
|
||||
<li
|
||||
class="list-group-item d-flex justify-content-between align-items-start">
|
||||
<li class="list-group-item d-flex justify-content-between align-items-start">
|
||||
<div class="me-auto d-flex align-items-center">
|
||||
<div>
|
||||
<input class="form-check-input me-2 mt-0"
|
||||
name="checkbox1" type="checkbox" value="" checked="">
|
||||
<input class="form-check-input me-2 mt-0" name="checkbox1"
|
||||
type="checkbox" value="" checked="">
|
||||
<label class="form-check-label" for="checkbox1"></label>
|
||||
</div>
|
||||
<div>
|
||||
@@ -137,12 +226,11 @@ class="list-group-item d-flex justify-content-between align-items-start">
|
||||
</div>
|
||||
<span class="badge bg-info rounded-pill">14</span>
|
||||
</li>
|
||||
<li
|
||||
class="list-group-item d-flex justify-content-between align-items-start">
|
||||
<li class="list-group-item d-flex justify-content-between align-items-start">
|
||||
<div class="me-auto d-flex align-items-center">
|
||||
<div>
|
||||
<input class="form-check-input me-2 mt-0"
|
||||
name="checkbox1" type="checkbox" value="">
|
||||
<input class="form-check-input me-2 mt-0" name="checkbox1"
|
||||
type="checkbox" value="">
|
||||
<label class="form-check-label" for="checkbox1"></label>
|
||||
</div>
|
||||
<div>
|
||||
@@ -154,13 +242,11 @@ class="list-group-item d-flex justify-content-between align-items-start">
|
||||
</div>
|
||||
<span class="badge bg-danger rounded-pill">14</span>
|
||||
</li>
|
||||
<li
|
||||
class="list-group-item d-flex justify-content-between align-items-start">
|
||||
<li class="list-group-item d-flex justify-content-between align-items-start">
|
||||
<div class="me-auto d-flex align-items-center">
|
||||
<div>
|
||||
<input class="form-check-input me-2 mt-0"
|
||||
name="checkbox1" type="checkbox" value=""
|
||||
>
|
||||
<input class="form-check-input me-2 mt-0" name="checkbox1"
|
||||
type="checkbox" value="">
|
||||
<label class="form-check-label" for="checkbox1"></label>
|
||||
</div>
|
||||
<div>
|
||||
@@ -177,12 +263,11 @@ class="list-group-item d-flex justify-content-between align-items-start">
|
||||
<div class="tab-pane fade" id="pills-contact" role="tabpanel"
|
||||
aria-labelledby="pills-contact-tab" tabindex="0">
|
||||
<ul class="list-group">
|
||||
<li
|
||||
class="list-group-item d-flex justify-content-between align-items-start">
|
||||
<li class="list-group-item d-flex justify-content-between align-items-start">
|
||||
<div class="me-auto d-flex align-items-center">
|
||||
<div>
|
||||
<input class="form-check-input me-2 mt-0"
|
||||
name="checkbox1" type="checkbox" value="">
|
||||
<input class="form-check-input me-2 mt-0" name="checkbox1"
|
||||
type="checkbox" value="">
|
||||
<label class="form-check-label" for="checkbox1"></label>
|
||||
</div>
|
||||
<div>
|
||||
@@ -194,12 +279,11 @@ class="list-group-item d-flex justify-content-between align-items-start">
|
||||
</div>
|
||||
<span class="badge bg-info rounded-pill">14</span>
|
||||
</li>
|
||||
<li
|
||||
class="list-group-item d-flex justify-content-between align-items-start">
|
||||
<li class="list-group-item d-flex justify-content-between align-items-start">
|
||||
<div class="me-auto d-flex align-items-center">
|
||||
<div>
|
||||
<input class="form-check-input me-2 mt-0"
|
||||
name="checkbox1" type="checkbox" value="">
|
||||
<input class="form-check-input me-2 mt-0" name="checkbox1"
|
||||
type="checkbox" value="">
|
||||
<label class="form-check-label" for="checkbox1"></label>
|
||||
</div>
|
||||
<div>
|
||||
@@ -211,13 +295,11 @@ class="list-group-item d-flex justify-content-between align-items-start">
|
||||
</div>
|
||||
<span class="badge bg-danger rounded-pill">14</span>
|
||||
</li>
|
||||
<li
|
||||
class="list-group-item d-flex justify-content-between align-items-start">
|
||||
<li class="list-group-item d-flex justify-content-between align-items-start">
|
||||
<div class="me-auto d-flex align-items-center">
|
||||
<div>
|
||||
<input class="form-check-input me-2 mt-0"
|
||||
name="checkbox1" type="checkbox" value=""
|
||||
checked="">
|
||||
<input class="form-check-input me-2 mt-0" name="checkbox1"
|
||||
type="checkbox" value="" checked="">
|
||||
<label class="form-check-label" for="checkbox1"></label>
|
||||
</div>
|
||||
<div>
|
||||
@@ -234,13 +316,11 @@ class="list-group-item d-flex justify-content-between align-items-start">
|
||||
<div class="tab-pane fade" id="pills-disabled" role="tabpanel"
|
||||
aria-labelledby="pills-disabled-tab" tabindex="0">
|
||||
<ul class="list-group">
|
||||
<li
|
||||
class="list-group-item d-flex justify-content-between align-items-start">
|
||||
<li class="list-group-item d-flex justify-content-between align-items-start">
|
||||
<div class="me-auto d-flex align-items-center">
|
||||
<div>
|
||||
<input class="form-check-input me-2 mt-0"
|
||||
name="checkbox1" type="checkbox" value=""
|
||||
id="checkbox1">
|
||||
<input class="form-check-input me-2 mt-0" name="checkbox1"
|
||||
type="checkbox" value="" id="checkbox1">
|
||||
<label class="form-check-label" for="checkbox1"></label>
|
||||
</div>
|
||||
<div>
|
||||
@@ -252,13 +332,11 @@ class="list-group-item d-flex justify-content-between align-items-start">
|
||||
</div>
|
||||
<span class="badge bg-info rounded-pill">14</span>
|
||||
</li>
|
||||
<li
|
||||
class="list-group-item d-flex justify-content-between align-items-start">
|
||||
<li class="list-group-item d-flex justify-content-between align-items-start">
|
||||
<div class="me-auto d-flex align-items-center">
|
||||
<div>
|
||||
<input class="form-check-input me-2 mt-0"
|
||||
name="checkbox1" type="checkbox" value=""
|
||||
checked="">
|
||||
<input class="form-check-input me-2 mt-0" name="checkbox1"
|
||||
type="checkbox" value="" checked="">
|
||||
<label class="form-check-label" for="checkbox1"></label>
|
||||
</div>
|
||||
<div>
|
||||
@@ -270,13 +348,11 @@ class="list-group-item d-flex justify-content-between align-items-start">
|
||||
</div>
|
||||
<span class="badge bg-danger rounded-pill">14</span>
|
||||
</li>
|
||||
<li
|
||||
class="list-group-item d-flex justify-content-between align-items-start">
|
||||
<li class="list-group-item d-flex justify-content-between align-items-start">
|
||||
<div class="me-auto d-flex align-items-center">
|
||||
<div>
|
||||
<input class="form-check-input me-2 mt-0"
|
||||
name="checkbox1" type="checkbox" value=""
|
||||
>
|
||||
<input class="form-check-input me-2 mt-0" name="checkbox1"
|
||||
type="checkbox" value="">
|
||||
<label class="form-check-label" for="checkbox1"></label>
|
||||
</div>
|
||||
<div>
|
||||
@@ -309,31 +385,119 @@ class="list-group-item d-flex justify-content-between align-items-start">
|
||||
<script src="{{ asset('js/select2.js') }}"></script>
|
||||
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
function searchData (value) {
|
||||
$(document).ready(function() {
|
||||
$('#no-image').addClass('d-none');
|
||||
|
||||
function searchData(value) {
|
||||
if (!value) return;
|
||||
|
||||
$('#search-status').text('Mencari...');
|
||||
console.log(value);
|
||||
|
||||
$.ajax({
|
||||
url: "{{ route('check-in-out.search') }}",
|
||||
type: "GET",
|
||||
data: { q: value },
|
||||
success: function (res) {
|
||||
data: {
|
||||
q: value
|
||||
},
|
||||
success: function(res) {
|
||||
if (res.status) {
|
||||
$('#search-status').html('<span class="text-success">Ditemukan</span>');
|
||||
window.location.href = "/check-in-out" + res.data.id;
|
||||
let data = res.data;
|
||||
$('#rowActions').html(`
|
||||
<div>
|
||||
<div class="detail-row">
|
||||
<span class="detail-label">No. :</span>
|
||||
<span class="detail-value">${data.id}</span>
|
||||
<input type="hidden" name="id" value="${data.id}">
|
||||
</div>
|
||||
<div class="detail-row">
|
||||
<span class="detail-label">No. Transaksi :</span>
|
||||
<span class="detail-value">${data.no_pol}</span>
|
||||
<input type="hidden" name="notrans" value="${data.no_pol}">
|
||||
</div>
|
||||
<div class="detail-row">
|
||||
<span class="detail-label">Jam Masuk : </span>
|
||||
<span class="detail-value" name="indate">${data.waktu_masuk}</span>
|
||||
<input type="hidden" name="waktu_masuk" value="${data.waktu_masuk}">
|
||||
</div>
|
||||
</div>
|
||||
`).removeClass('d-none');
|
||||
$('#formEdit').removeClass('d-none');
|
||||
if (data.vehicle_capt) {
|
||||
$('#pic_body_masuk').attr('src', `data:image/jpeg;base64,${data.vehicle_capt}`).removeClass('d-none');
|
||||
// $('#pic_body_masuk').html(`
|
||||
// <img src="data:image/jpeg;base64,${data.vehicle_capt}" alt="Pic Body Masuk" style="max-width: 700px; max-height: 300px;">
|
||||
// `);
|
||||
$('#no-image').addClass('d-none');
|
||||
} else {
|
||||
$('#pic_body_masuk').addClass('d-none');
|
||||
$('#no-image').removeClass('d-none');
|
||||
}
|
||||
|
||||
console.log(res);
|
||||
// window.location.href = "/check-in-out" + res.data.id;
|
||||
} else {
|
||||
$('#search-status').html('<span class="text-danger">'+ res.message + '</span>');
|
||||
$('#search-status').html('<span class="text-danger">' + res.message +
|
||||
'</span>');
|
||||
}
|
||||
|
||||
$('#search-value').val('').focus();
|
||||
},
|
||||
error: function () {
|
||||
error: function() {
|
||||
$('#search-status').html('<span class="text-danger">Error server</span>');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$('#search-value').on('keypress', function(e) {
|
||||
if (e.which == 13) {
|
||||
e.preventDefault();
|
||||
searchData($(this).val());
|
||||
}
|
||||
});
|
||||
|
||||
let timer;
|
||||
$('#search-value').on('input', function() {
|
||||
clearTimeout(timer);
|
||||
let val = $(this).val();
|
||||
|
||||
timer = setTimeout(() => {
|
||||
if (val.length >= 5) {
|
||||
searchData(val);
|
||||
}
|
||||
|
||||
}, 300);
|
||||
});
|
||||
|
||||
$('#search-value').on('paste', function(e) {
|
||||
let input = $(this);
|
||||
|
||||
setTimeout(() => {
|
||||
let val = input.val();
|
||||
|
||||
console.log('PASTE VALUE:', val); // debug
|
||||
|
||||
searchData(val);
|
||||
}, 100); // tunggu value masuk dulu
|
||||
});
|
||||
|
||||
$('#formTransaksi').on('submit', function(e){
|
||||
e.preventDefault();
|
||||
|
||||
let formData = $(this).serialize();
|
||||
|
||||
$.ajax({
|
||||
url: $(this).attr('action'),
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
success: function(res){
|
||||
alert('Berhasil disimpan');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
@endsection
|
||||
@@ -17,7 +17,7 @@
|
||||
use App\Http\Controllers\SetupController;
|
||||
use App\Http\Controllers\StikerController;
|
||||
use App\Http\Controllers\StreamerController;
|
||||
use App\Http\Controllers\FrontOffice\FrontOfficeControllerController;
|
||||
use App\Http\Controllers\FrontOffice\FrontOfficeController;
|
||||
use App\Http\Controllers\Tools\StikerExtendedController;
|
||||
use App\Http\Controllers\Tools\TransactionChangeController;
|
||||
use App\Http\Controllers\VerifyTransController;
|
||||
@@ -84,8 +84,9 @@
|
||||
});
|
||||
|
||||
Route::prefix('/front-office')->group(function () {
|
||||
Route::resource('check-in-out', FrontOfficeControllerController::class);
|
||||
Route::get('/check-in-out/search', [FrontOfficeControllerController::class, 'search'])->name('check-in-out.search');
|
||||
Route::get('/check-in-out/search', [FrontOfficeController::class, 'search'])->name('check-in-out.search');
|
||||
Route::get('/check-in-out/image/{id}', [FrontOfficeController::class, 'image']);
|
||||
Route::resource('check-in-out', FrontOfficeController::class);
|
||||
});
|
||||
|
||||
// Route::get('/home', [App\Http\Controllers\HomeController::class, 'index'])->name('home');
|
||||
|
||||
Reference in New Issue
Block a user