Commit a43286f7 by Juliper

no message

parent 07340e30
......@@ -70,6 +70,8 @@ class LoginController extends Controller
->withErrors($validator)
->withInput();
}
}else{
return redirect('login')->with('message','Password atau Username Salah');
}
}
}
......
......@@ -78,6 +78,12 @@ class CustomerController extends Controller
->where('homestay.id','=',$dataTransaksi[0]->id_homestay)
->get();
$dataPemilik = DB::table('homestay')
->join('pemilikhomestay','homestay.id_pemilik','pemilikhomestay.id')
->select('pemilikhomestay.no_telepon')
->where('homestay.id','=',$dataTransaksi[0]->id_homestay)
->get();
$homestayJumlahKamar = DB::table('homestay')
->select('homestay.jumlah_kamar')
->where('homestay.id','=',$dataTransaksi[0]->id_homestay)
......@@ -88,11 +94,17 @@ class CustomerController extends Controller
->where('daftar_book.tanggal_mulai','=',$request['tanggal'])
->get();
//dd($dataBookingMulai,$request['tanggal']);
$tanggal_baru = explode('-', $request['tanggal']);
//$tanggal_baru = explode('-',request(['tanggal']));
$tanggal_baru[2] +=$request['lama_menginap'];
$tanggal = join('-',$tanggal_baru);
//dd($tanggal);
$dataBookingBerakhir = DB::table('daftar_book')
->select('daftar_book.*')
->where('daftar_book.tanggal_berakhir','=',$tanggal)
......@@ -162,28 +174,24 @@ class CustomerController extends Controller
$transaksi->tanggal_mulai = $request['tanggal'];
$transaksi->tanggal_berakhir = $baru;
$transaksi->jumlah_kamar = $request['jumlah_kamar'];
$transaksi->total_pembayaran = $request['jumlah_kamar'] * $dataHomestay[0]->harga ;
//dd($transaksi->total_pembayaran,$dataHomestay[0]->harga);
$dafBook = ListBook::where('id_transaksi',$id)->get();
/*DB::table('daftar_book')
$df = DB::table('daftar_book')
->where('daftar_book.id_transaksi','=',$id)
->get();*/
$lb = ListBook::find($dafBook[0]->id);
//dd($lb);
->get();
$dafBook = ListBook::find($df[0]->id);
$lb->jumlah_kamar = $request['jumlah_kamar'];
$lb->tanggal_mulai = $request['tanggal'];
$lb->tanggal_berakhir = $baru;
$dafBook->jumlah_kamar = $request['jumlah_kamar'];
$dafBook->tanggal_mulai = $request['tanggal'];
$dafBook->tanggal_berakhir = $baru;
//dd($dafBook[0]);
$transaksi->update();
$lb->update();
$dafBook->update();
return redirect('customerHistory');
}
......@@ -369,16 +377,16 @@ class CustomerController extends Controller
->where('daftar_book.tanggal_berakhir','=',$request['tanggal'])
->get();
//dd($dataHomestay[0]->jumlah_kamar,$request['jumlah_kamar']);
if($dataHomestay[0]->jumlah_kamar < $request['jumlah_kamar']){
return redirect('detailhomestay/',$dataHomestay[0]->id)->with('message','Maaf Jumalh kamar tidak sesuai');
}else{
if($dataBookingMulai->count() > 0){
$currentJumlahKamar = $homestayJumlahKamar[0]->jumlah_kamar - $dataBookingMulai[0]->jumlah_kamar;
if($currentJumlahKamar < $request['jumlah_kamar']){
return redirect()->action('GuestController@detailhomestay',['id'=>$request['id']])->with('message', 'Maaf Anda Tidak Bisa Melakukan Pembookingan di karenakan kamar yang tersisa tidak sesuai dengan permintaan anda!');
}
}else{
if($dataBookingBerakhir->count() > 0){
$currentJumlahKamar2 = $homestayJumlahKamar[0]->jumlah_kamar - $dataBookingBerakhir[0]->jumlah_kamar;
......@@ -455,16 +463,15 @@ class CustomerController extends Controller
//Save
$lb->save();
$text = "Ada Pesanan Kamari dari Sdr/i : ";
$text = "Ada Pesanan Kamar dari Sdr/i : ";
$pesan = $text . ' ' .$dataPelanggan[0]->nama;
//$pesan = $text + $dataPelanggan[0]->nama;
//$pesan +=" dengan jumlah kamar"+ ;
$newPesan = $pesan . ' '. "Silahkan Cek Sistem Informasi";
Nexmo::message()->send([
/*Nexmo::message()->send([
'to' => $dataPemilik[0]->no_telepon,
'from' => 'ASDASD',
'text' => $pesan
]);
'text' => $newPesan
]);*/
return redirect('customerHistory');
}
......
......@@ -145,8 +145,10 @@ class OwnerController extends Controller
$updateHomestay->alamat = $request['alamatUpdate'];
$updateHomestay->harga = $request['hargaUpdate'];
if ($updateHomestay->fasilitas == null){
$updateHomestay->fasilitas = $updateHomestay->fasilitas;
$updateHomestay->fasilitas = $request['fasilitasUpdate'];
}else{
$updateHomestay->fasilitas = $request['fasilitasUpdate'];
}
......
......@@ -18,7 +18,6 @@ class Customer
{
if(Auth::check()){
if(Auth::user()->role !='Customer'){
dd('masuk');
if(Auth::user()->role == 'Owner'){
return redirect('owner');
}elseif(Auth::user()->role=='DinasPariwisata'){
......
This diff is collapsed. Click to expand it.
img/e3.JPG

17.9 KB

img/gallery-1.jpg

37.7 KB | W: | H:

img/gallery-1.jpg

169 KB | W: | H:

img/gallery-1.jpg
img/gallery-1.jpg
img/gallery-1.jpg
img/gallery-1.jpg
  • 2-up
  • Swipe
  • Onion skin
......@@ -14904,6 +14904,7 @@ $.widget( "ui.tooltip", {
if ( element.data( "ui-tooltip-title" ) ) {
element.attr( "title", element.data( "ui-tooltip-title" ) );
element.removeData( "ui-tooltip-title" );
element.removeData( "ui-tooltip-title" );
}
});
}
......
......@@ -27,6 +27,11 @@
</div>
@endif
@if(session()->has('message'))
<div class="alert alert-info">
{{session()->get('message')}}
</div>
@endif
<div class="login-box-body" >
<!-- <p class="login-box-msg"> {{ trans('adminlte_lang::message.siginsession') }} </p> -->
......
......@@ -7,7 +7,7 @@
@section('main-content')
<div class="box box-warning">
<div class="box-header with-border">
<h3 class="box-title"> LIST PEMILIK HOMESTAY </h3>
<h3 class="box-title"> DAFTAR PEMILIK HOMESTAY </h3>
@if (count($errors) > 0)
<div class="alert alert-danger">
<strong>Whoops!</strong> {{ trans('adminlte_lang::message.someproblems') }}<br><br>
......
......@@ -49,9 +49,9 @@
</form>
</td>
@elseif($a->status==1)
<td colspan="3"><h4>Di Terima</h4></td>
<td colspan="3"><h4>Diterima</h4></td>
@elseif($a->status==2)
<td colspan="3"><h4>Di Tolak</h4></td>
<td colspan="3"><h4>Ditolak</h4></td>
@elseif($a->status=3)
<td colspan="3"><h4>Telah Dibatalkan</h4></td>
@endif
......
......@@ -34,7 +34,7 @@
<tr>
<th>Nama Pelanggan</th>
<th>Nomor Telepon</th>
<th>Pekerjaan</th>
<th>Alamat</th>
<th>Tanggal Mulai</th>
<th>Tanggal Berakhir</th>
<th>Lama Menginap</th>
......@@ -45,8 +45,8 @@
@foreach($data as $a)
<tr>
<td>{{$a->nama}}</td>
<td>{{$a->alamat}}</td>
<td>{{$a->no_telepon}}</td>
<td>{{$a->alamat}}</td>
<td>{{$a->tanggal_mulai}}</td>
<td>{{$a->tanggal_berakhir}}</td>
<td>{{$a->lama_menginap}} Hari</td>
......
......@@ -42,10 +42,13 @@
<input class="date agileits w3layouts" id="datepicker1" name="tanggal" type="text" value=" Tanggal Check in" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = '';}">
</div>
<div class="col-md-2 col-sm-2 agileits w3layouts contact-grid contact-grid-2 ">
<input type="text" class="text wow agileits w3layouts " name="jumlah_hari" placeholder="Lama Menginap" style="background-color: white; color: black">
<input type="number" min="1" class="text wow agileits w3layouts " name="jumlah_hari" placeholder="Lama Menginap" onchange="updateDate(this)" style="background-color: white; color: black">
</div>
<div class="col-md-2 col-sm-2 agileits w3layouts contact-grid contact-grid-2 ">
<input type="number" min="0" class="text wow agileits w3layouts " name="jumlah_kamar" placeholder="Jumlah Kamar" style="background-color: white; color: black">
<input type="number" min="1" class="text wow agileits w3layouts " name="jumlah_kamar" placeholder="Jumlah Kamar" style="background-color: white; color: black">
</div>
<div class="col-md-2 col-sm-2 agileits w3layouts contact-grid contact-grid-2 ">
<input type="text" id="datepicker2" class="text wow agileits w3layouts " name="tanggal_selesai" readonly placeholder="Tanggal Berakhir" style="background-color: white; color: black">
</div>
<div class="book">
<input type="submit" class="more_btn wow agileits w3layouts " value="Book Now">
......@@ -170,6 +173,27 @@
</div>
</div>
<script>
function updateDate(object) {
//$('#tanggal_selesai').datepicker({
// dateFormat: "yy-mm-dd",
//});
alert(object.value);
//var tanggal_mulai = $('#datepicker1').datepicker('getDate');
//tanggal_mulai.setDate(tanggal_mulai.getDate()+parseInt(object.value));
//$('#tanggal_selesai').datepicker('setDate',tanggal_mulai);
//alert(tanggal_mulai);
var date1 = $('#datepicker1').datepicker('getDate');
var date = new Date( Date.parse( date1 ) );
date.setDate( date.getDate() + parseInt(object.value) );
var newDate = date.toDateString();
newDate = new Date( Date.parse( newDate ) );
$('#datepicker2').datepicker("setDate",newDate);
}
</script>
<!-- //Kritik & Saran -->
<!-- Scripts -->
......
......@@ -88,9 +88,11 @@
<!-- Menu Footer-->
<li class="user-footer">
@if(Auth::user()->role != "DinasPariwisata")
<div class="pull-left">
<a href="{{ url('profile') }}" class="btn btn-default btn-flat">{{ trans('adminlte_lang::message.profile') }}</a>
</div>
@endif
<div class="pull-right">
<a href="{{ url('/logout') }}" class="btn btn-default btn-flat"
onclick="event.preventDefault();
......
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