Commit 58e98932 by Juliper

no message

parent 68ed2296
...@@ -262,23 +262,26 @@ class OwnerController extends Controller ...@@ -262,23 +262,26 @@ class OwnerController extends Controller
$dataHomestay = DB::table('homestay') $dataHomestay = DB::table('homestay')
->join('pemilikhomestay','homestay.id_pemilik','pemilikhomestay.id') ->join('pemilikhomestay','homestay.id_pemilik','pemilikhomestay.id')
->select('homestay.id') ->select('homestay.id','homestay.jumlah_kamar')
->where('homestay.id_pemilik','=',$dataPemilik[0]->id) ->where('homestay.id_pemilik','=',$dataPemilik[0]->id)
->get(); ->get();
$lb->homestay = $dataHomestay[0]->id; if($dataHomestay[0]->jumlah_kamar < $request['jumlah_kamar']){
$lb->nama_pemesan = $request['nama']; return redirect('AddBook')->with('message','Maaf jumlah kamar tidak mencukupi');
$lb->jumlah_kamar = $request['jumlah_kamar']; }else{
$lb->tanggal_mulai = $request['tanggal_mulai']; $lb->homestay = $dataHomestay[0]->id;
$time = explode('-', $request['tanggal_mulai']); $lb->nama_pemesan = $request['nama'];
$time[2] +=$request['jumlah_hari']; $lb->jumlah_kamar = $request['jumlah_kamar'];
$baru = join('-',$time); $lb->tanggal_mulai = $request['tanggal_mulai'];
$lb->tanggal_berakhir = $baru; $time = explode('-', $request['tanggal_mulai']);
$time[2] +=$request['jumlah_hari'];
$lb->save(); $baru = join('-',$time);
$lb->tanggal_berakhir = $baru;
return redirect('daftarBooking');
$lb->save();
return redirect('daftarBooking');
}
} }
//Melakukan Update Kamar //Melakukan Update Kamar
......
...@@ -11,8 +11,9 @@ ...@@ -11,8 +11,9 @@
<th> Total Pembayaran </th> <th> Total Pembayaran </th>
<th> Bukti Pembayaran </th> <th> Bukti Pembayaran </th>
<th> Status Pemesanan</th> <th> Status Pemesanan</th>
<th> Unggah Pembayaran </th> <th></th>
<th> Bataklan Pesanan </th> <th></th>
<th></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
...@@ -41,15 +42,21 @@ ...@@ -41,15 +42,21 @@
{{csrf_field()}} {{csrf_field()}}
</form> </form>
</td> </td>
<td>
<form action="" method="post">
<input type="hidden" name="_method" value="PUT">
{{csrf_field()}}
<input type="submit" value="Perbaharui">
</form>
</td>
@elseif($a->status==1) @elseif($a->status==1)
<td colspan="3"><h3>Di Terima</h3></td> <td colspan="3"><h4>Di Terima</h4></td>
@elseif($a->status==2) @elseif($a->status==2)
<td colspan="3"><h3>Di Tolak</h3></td> <td colspan="3"><h4>Di Tolak</h4></td>
@elseif($a->status=3) @elseif($a->status=3)
<td colspan="3"><h3>Telah Dibatalkan</h3></td> <td colspan="3"><h4>Telah Dibatalkan</h4></td>
@endif @endif
</td> </td>
</tr> </tr>
@endforeach @endforeach
</tbody> </tbody>
......
...@@ -18,6 +18,11 @@ ...@@ -18,6 +18,11 @@
</ul> </ul>
</div> </div>
@endif @endif
@if(session()->has('message'))
<div class="alert alert-info">
{{session()->get('message')}}
</div>
@endif
</div> </div>
<div class="box-body"> <div class="box-body">
<form action="{{url('addManual')}}" method="post"> <form action="{{url('addManual')}}" method="post">
......
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