Commit 70875f94 by Juliper

list book op

parent 1256fecf
......@@ -3,6 +3,7 @@
namespace App\Http\Controllers;
use App\Homestay;
use App\ListBook;
use App\Room;
use App\Transaksi;
use Illuminate\Http\Request;
......@@ -113,8 +114,8 @@ class CustomerController extends Controller
}
public function booking(Request $request){
$lb = new ListBook();
//dd($data,$room);
$data = DB::table('homestay')
->join('kamar','homestay.id','=','kamar.idHomestay')
->select('kamar.*','homestay.harga')
......@@ -123,12 +124,12 @@ class CustomerController extends Controller
$data2 = DB::table('users')
->join('pelanggan','users.id','=','pelanggan.id_Akun')
->select('pelanggan.id')
->select('pelanggan.id','pelanggan.nama')
->where('users.id','=',Auth::user()->id)
->get();
$time = explode('-', $request['tanggal']);
$time[1] +=$request['jumlah_hari'];
$time[2] +=$request['jumlah_hari'];
$baru = join('-',$time);
......@@ -142,21 +143,23 @@ class CustomerController extends Controller
$trans->save();
$dataTrans = DB::table('transaksi')
->select('transaksi.*')
->where('transaksi.id_pelanggan','=',$data2[0]->id)
->get();
$room = Room::all()->where('idHomestay',$data[0]->idHomestay);
for ($i=0;$i<=$request['jumlah_kamar'];$i++){
if($room[$i]->id_transaksi==null){
$upRoom = Room::find($room[$i]->id);
$upRoom->id_transaksi = $dataTrans[0]->id;
$upRoom->update();
}
}
// $dataTrans = DB::table('transaksi')
// ->select('transaksi.*')
// ->where('transaksi.id_pelanggan','=',$data2[0]->id)
// ->get();
//
// $room = Room::all()->where('idHomestay',$data[0]->idHomestay);
//
// for ($i=0;$i<=$request['jumlah_kamar'];$i++){
// if($room[$i]->id_transaksi==null){
// $upRoom = Room::find($room[$i]->id);
// $upRoom->id_transaksi = $dataTrans[0]->id;
// $upRoom->update();
// }
// }
dd("masuk gan",$request['tanggal'],$time,$baru,$request['id'],$data2,$data);
}
......
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class ListBook extends Model
{
protected $table = "daftar_book";
protected $fillable = [
'nama_pemesan','tanggal_mulai','tanggal_berakhir'
];
public $timestamps = false;
}
......@@ -13,48 +13,60 @@
<br><br>
<div class="col-md-12 col-sm-12 agileits w3layouts contact-grid contact-grid-2 wow slideInLeft">
<form action="{{url('book')}}" method="post">
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<input type="hidden" name="id" value="{{$data->id}}">
<div class="col-md-3 col-sm-3 agileits w3layouts contact-grid contact-grid-2 wow slideInLeft">
<input class="date agileits w3layouts" id="datepicker1" name="tanggal" type="text" value=" Tanggal Check in" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = '';}" required="">
</div>
<div class="col-md-3 col-sm-3 agileits w3layouts contact-grid contact-grid-2 wow slideInLeft">
<input type="text" class="text wow agileits w3layouts slideInLeft" name="jumlah_hari" placeholder="Lama Menginap" required="" style="background-color: white; color: black">
</div>
<div class="col-md-3 col-sm-3 agileits w3layouts contact-grid contact-grid-2 wow slideInLeft">
<input type="text" class="text wow agileits w3layouts slideInLeft" name="jumlah_kamar" placeholder="Jumlah Kamar" required="" style="background-color: white; color: black">
</div>
<<<<<<< HEAD
<div class="col-md-3 col-sm-3 agileits w3layouts contact-grid contact-grid-2 wow slideInLeft" style="margin-top: 10px;">
<button class="btn btn-success " >BOOK NOW</button>
=======
>>>>>>> 1b1aa66ed77eecba26c79b08a445f59576a1ca97
<div class="col-md-3 col-sm-3 agileits w3layouts contact-grid contact-grid-2 wow slideInLeft">
<a href="{{url('history')}}" id="book" >
<input type="button" class="more_btn wow agileits w3layouts slideInLeft" value="Book Now">
</a>
<input type="submit" class="more_btn wow agileits w3layouts slideInLeft" value="Book Now">
<<<<<<< HEAD
=======
<<<<<<< HEAD
=======
>>>>>>> f3f2287d7c86a7c8efc0162c242d120bfcaf820a
>>>>>>> 36fc9a9037d0772bcfa4c52323fe8a6c39550bd5
>>>>>>> 0f3eed02f22695fdd7fc61c41b915d902aeca1fc
>>>>>>> 1b1aa66ed77eecba26c79b08a445f59576a1ca97
</div>
</form>
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<input type="hidden" name="id" value="{{$data->id}}">
<div class="col-md-3 col-sm-3 agileits w3layouts contact-grid contact-grid-2 wow slideInLeft">
<input class="date agileits w3layouts" id="datepicker1" name="tanggal" type="text" value=" Tanggal Check in" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = '';}" required="">
</div>
<div class="col-md-3 col-sm-3 agileits w3layouts contact-grid contact-grid-2 wow slideInLeft">
<input type="text" class="text wow agileits w3layouts slideInLeft" name="jumlah_hari" placeholder="Lama Menginap" required="" style="background-color: white; color: black">
</div>
<div class="col-md-3 col-sm-3 agileits w3layouts contact-grid contact-grid-2 wow slideInLeft">
<input type="text" class="text wow agileits w3layouts slideInLeft" name="jumlah_kamar" placeholder="Jumlah Kamar" required="" style="background-color: white; color: black">
</div>
<div class="col-md-3 col-sm-3 agileits w3layouts contact-grid contact-grid-2 wow slideInLeft">
<input type="submit" class="more_btn wow agileits w3layouts slideInLeft" value="Book Now">
</div>
</form>
</div>
</div>
</div>
<!-- Booking -->
<div class="details agilets w3layouts" >
<div class="container">
<div class="cuisines agileits w3layouts">
<div class="container">
<table class="table table-striped">
<thead>
<tr>
<th> No. </th>
<th> No. Rekening </th>
<th> Atas Nama </th>
<th> Total Pembayaran </th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>456141923</td>
<td>Palti Sinaga</td>
<td>2.400.000</td>
</tr>
<tr class="success">
<td>2</td>
<td>09179287213</td>
<td>Lestari Siregar</td>
<td>2.123.091</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<!-- Informations -->
<div class="cuisines agileits w3layouts">
<div class="container">
......@@ -88,10 +100,6 @@
<div class="details-grid-image agileits w3layouts">
<img src="{{asset('img/project-1.jpg')}}" alt="Agileits W3layouts" data-toggle="modal" data-target="#myModal" style="cursor: pointer;">
</div>
<!-- <div class="details-grid-info agileits w3layouts">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua ut enim ad minim veniam.</p>
</div> -->
<!-- <button class="btn btn-primary wow agileits w3layouts fadeInLeft" data-toggle="modal" data-target="#myModal">EXPLORE<span class="glyphicon agileits w3layouts glyphicon-arrow-right" aria-hidden="true"></span></button> -->
<div class="clearfix"></div>
</div>
</div>
......@@ -123,28 +131,28 @@
<div class="details agileits w3layouts">
<div class="container">
<div class="col-md-6 col-sm-6 agileits w3layouts contact-grid contact-grid-2 wow slideInLeft">
<<<<<<< HEAD
<h2 style="margin-bottom: 10px;"> Kritik dan Saran</h2>
<form action="#" method="post" style="margin-bottom: 25px;">
<form action="#" method="post" style="margin-bottom: 25px;"></form>
<h2 style="margin-bottom: 10px;"> Kritik dan Saran </h2>
<form action ="#" method="post" style="margin-bottom: 25px;">
<form action ="#" method="post" style="margin-bottom: 25px;"></form>
=======
<h2 style="margin-bottom: 10px;"> Kritik dan Saran</h2>
<form action="#" method="post" style="margin-bottom: 25px;">
<h2 style="margin-bottom: 10px;"> Kritik dan Saran </h2>
<form action ="#" method="post" style="margin-bottom: 25px;">
>>>>>>> 1b1aa66ed77eecba26c79b08a445f59576a1ca97
<input type="text" class="text wow agileits w3layouts slideInLeft" name="Name" placeholder="Name" required="">
<input type="text" class="text wow agileits w3layouts slideInLeft" name="Email" placeholder="Email" required="">
<textarea name="Message" class="wow agileits w3layouts slideInLeft" placeholder="Message" required=""></textarea>
<input type="submit" class="more_btn wow agileits w3layouts slideInLeft" value="Send Message">
</button>
</form>
</div>
</div>
</form>
<form action ="#" method="post" style="margin-bottom: 25px;">
<input type="text" class="text wow agileits w3layouts slideInLeft" name="Name" placeholder="Name" required="">
<input type="text" class="text wow agileits w3layouts slideInLeft" name="Email" placeholder="Email" required="">
<textarea name="Message" class="wow agileits w3layouts slideInLeft" placeholder="Message" required=""></textarea>
<input type="submit" class="more_btn wow agileits w3layouts slideInLeft" value="Send Message">
</button>
</form>
<div>
</div>
</div>
......@@ -157,14 +165,11 @@
document.getElementById('book').onclick = function(){
swal("Good job!", "You clicked the button!", "success");};
</script>
<<<<<<< HEAD
@endsection
</div>
=======
</div>
>>>>>>> 1b1aa66ed77eecba26c79b08a445f59576a1ca97
<script>
......@@ -196,17 +201,11 @@
});
};
<<<<<<< HEAD
</script>
=======
</script>
<<<<<<< HEAD
=======
<<<<<<< HEAD
</div>
</div>
@endsection
=======
>>>>>>> f3f2287d7c86a7c8efc0162c242d120bfcaf820a
>>>>>>> 36fc9a9037d0772bcfa4c52323fe8a6c39550bd5
>>>>>>> 0f3eed02f22695fdd7fc61c41b915d902aeca1fc
>>>>>>> 1b1aa66ed77eecba26c79b08a445f59576a1ca97
......@@ -35,7 +35,6 @@
<li><a href="{{url('home')}}">{{Auth::user()->name}}</a></li>
@endif
</a>
<<<<<<< HEAD
<ul class="dropdown-menu">
<!-- The user image in the menu -->
<li class="user-header">
......@@ -46,8 +45,6 @@
<!-- <small>{{ trans('adminlte_lang::message.login') }} </small> -->
</p>
</li>
<!-- Menu Body -->
=======
@if(Auth::user()->role=="Customer")
<ul class="dropdown-menu">
<!-- The user image in the menu -->
......@@ -60,7 +57,6 @@
</p>
</li>
<!-- Menu Body -->
>>>>>>> 36fc9a9037d0772bcfa4c52323fe8a6c39550bd5
<!-- Menu Footer-->
<li class="user-footer">
......@@ -89,6 +85,7 @@
<!-- <li><a href="codes.html">CODES</a></li> -->
<!-- <li><a href="booking.html">BOOKING</a></li> -->
</ul>
</ul>
</div>
</div>
</nav>
......
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