Commit ee014bec by Juliper

transaction will done in time

parent fe9c68c1
...@@ -18,6 +18,12 @@ use Psy\Command\ListCommand\ConstantEnumerator; ...@@ -18,6 +18,12 @@ use Psy\Command\ListCommand\ConstantEnumerator;
class CustomerController extends Controller class CustomerController extends Controller
{ {
public function hitory($id){
return view('adminlte::layouts.customers.History');
}
public function profile(){ public function profile(){
//dd("masuk agan"); //dd("masuk agan");
//dd(Auth::user()->id); //dd(Auth::user()->id);
...@@ -148,14 +154,17 @@ class CustomerController extends Controller ...@@ -148,14 +154,17 @@ class CustomerController extends Controller
$lb->homestay = $request['id']; $lb->homestay = $request['id'];
$lb->nama_pemesan = $data2[0]->nama; $lb->nama_pemesan = $data2[0]->nama;
$lb->tanggal_mulai =$request['tanggal'] ; $lb->tanggal_mulai = $request['tanggal'] ;
$lb->tanggal_berakhir = $baru; $lb->tanggal_berakhir = $baru;
$trans->save(); $trans->save();
$lb->save(); $lb->save();
return redirect('detailhomestay/',$request['id']); return redirect()->action(
'CustomerController@detailhomestay', ['id' => $request['id']]
);
} }
} }
...@@ -9,7 +9,7 @@ class ListBook extends Model ...@@ -9,7 +9,7 @@ class ListBook extends Model
protected $table = "daftar_book"; protected $table = "daftar_book";
protected $fillable = [ protected $fillable = [
'nama_pemesan','tanggal_mulai','tanggal_berakhir' 'nama_pemesan','tanggal_mulai','tanggal_berakhir','homestay'
]; ];
public $timestamps = false; public $timestamps = false;
......
...@@ -40,32 +40,32 @@ ...@@ -40,32 +40,32 @@
<br><br> <br><br>
<div class="details agilets w3layouts"> <div class="details agilets w3layouts">
<h2 style="margin-bottom: 10px;"> Daftar Booking </h2> <h2 style="margin-bottom: 10px;"> Daftar Booking </h2>
<div class="container"> <div class="container">
<div class="cuisines agileits w3layouts"> <div class="cuisines agileits w3layouts">
<div class="container"> <div class="container">
<table class="table table-striped"> <table class="table table-striped">
<thead> <thead>
<tr> <tr>
<th> Nama Pemesan </th> <th> Nama Pemesan </th>
<th> Tanggal Mulai </th> <th> Tanggal Mulai </th>
<th> Tanggal Berakhir </th> <th> Tanggal Berakhir </th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@foreach($daftarBook as $a) @foreach($daftarBook as $a)
<tr> <tr>
<td>{{$a->nama_pemesan}}</td> <td>{{$a->nama_pemesan}}</td>
<td>{{$a->tanggal_mulai}}</td> <td>{{$a->tanggal_mulai}}</td>
<td>{{$a->tanggal_berakhir}}</td> <td>{{$a->tanggal_berakhir}}</td>
</tr> </tr>
@endforeach @endforeach
</tbody> </tbody>
</table> </table>
</div>
</div> </div>
</div> </div>
</div> </div>
</div>
<!-- Informations --> <!-- Informations -->
......
...@@ -81,11 +81,11 @@ ...@@ -81,11 +81,11 @@
<script src="{{asset('js/jquery-ui.js')}}"></script> <script src="{{asset('js/jquery-ui.js')}}"></script>
<script> <script>
$('#datepicker2').datepicker({ $('#datepicker2').datepicker({
dateFormat: "dd-M-yy" dateFormat: "yy-mm-dd"
}); });
$("#datepicker1").datepicker({ $("#datepicker1").datepicker({
dateFormat: "dd-M-yy", dateFormat: "yy-mm-dd",
minDate: 0, minDate: 0,
onSelect: function(date){ onSelect: function(date){
var date1 = $('#datepicker1').datepicker('getDate'); var date1 = $('#datepicker1').datepicker('getDate');
......
...@@ -46,6 +46,7 @@ Route::group(['middleware' => 'auth'], function () { ...@@ -46,6 +46,7 @@ Route::group(['middleware' => 'auth'], function () {
#adminlte_routes #adminlte_routes
}); });
Route::get('detailhomestay/{id}','CustomerController@detailhomestay'); Route::get('detailhomestay/{id}','CustomerController@detailhomestay');
Route::get('history/{id}','CustomerController@hitory');
Route::get('daftar','CustomerController@register'); Route::get('daftar','CustomerController@register');
Route::post('daftar','CustomerController@registerStore'); Route::post('daftar','CustomerController@registerStore');
Route::post('book','CustomerController@booking'); Route::post('book','CustomerController@booking');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment