89 lines
2.0 KiB
PHP
89 lines
2.0 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use App\Models\BookingModel;
|
|
use Illuminate\Http\Request;
|
|
|
|
class CekStatusController extends Controller
|
|
{
|
|
/**
|
|
* Display a listing of the resource.
|
|
*/
|
|
public function index()
|
|
{
|
|
return view('user.pages.cek_status.index');
|
|
}
|
|
|
|
/**
|
|
* Show the form for creating a new resource.
|
|
*/
|
|
public function create()
|
|
{
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Store a newly created resource in storage.
|
|
*/
|
|
public function store(Request $request)
|
|
{
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Display the specified resource.
|
|
*/
|
|
public function show(string $id)
|
|
{
|
|
$data = BookingModel::where('kode_unik', $id)->first();
|
|
if($data != null) {
|
|
if($data->status_tes == '1' && $data->unix_expired_time < time()) {
|
|
$data->update([
|
|
'status_tes' => '0'
|
|
]);
|
|
}
|
|
return response()->json([
|
|
'status' => true,
|
|
'msg' => 'Data ditemukan (' . $id . ')',
|
|
'id_booking' => $data->id_booking,
|
|
'status_data' => $data->status_tes,
|
|
'nama_lengkap' => $data->nama_lengkap,
|
|
'kode_unik' => $data->kode_unik,
|
|
'tgl_booking' => $data->tgl_booking,
|
|
'jam_booking' => date('H:i:s', strtotime($data->created_at)),
|
|
'deskripsi_tambahan' => $data->deskripsi_tambahan,
|
|
]);
|
|
} else {
|
|
return response()->json([
|
|
'status' => false,
|
|
'msg' => 'Data tidak ditemukan (' . $id . ')'
|
|
]);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Show the form for editing the specified resource.
|
|
*/
|
|
public function edit(string $id)
|
|
{
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Update the specified resource in storage.
|
|
*/
|
|
public function update(Request $request, string $id)
|
|
{
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Remove the specified resource from storage.
|
|
*/
|
|
public function destroy(string $id)
|
|
{
|
|
//
|
|
}
|
|
}
|