Commit de32596c by Palti Sinaga

asdasd

parents 75fac108 ffc0f29f
......@@ -73,21 +73,25 @@ class AdminController extends Controller
$dataHomestay = Homestay::where('nama_homestay',$request['nama_homestay'])->get();
//dd($dataHomestay[0]->id);
//$dataBok = DB::table('daftar_book')
// ->where('da');
$asd = Transaksi::all()->where('status',1);
// $asd = Transaksi::all()->where('status',1);
//dd($asd);
//dd($request['bulan']);
if($request['bulang']== null){
$dataHos = DB::table('daftar_book')
->join('transaksi','daftar_book.id_transaksi','=','transaksi.id')
->join('homestay','daftar_book.homestay','=','homestay.id')
->where('daftar_book.homestay','=',$dataHomestay[0]->id)
->select('homestay.nama_homestay','homestay.owner','transaksi.total_pembayaran','transaksi.jumlah_kamar','daftar_book.*')
->get();
return view('adminlte::layouts.admin.resultlistpesanan')->with('data',$dataHos);
}else{
$data = DB::table('daftar_book')
->join('transaksi','daftar_book.id_transaksi','=','transaksi.id')
->join('homestay','daftar_book.homestay','=','homestay.id')
//->join('pelanggan','transaksi.id_pelanggan','=','pelanggan.id')
->where('daftar_book.homestay','=',$dataHomestay[0]->id)
->whereMonth('daftar_book.tanggal_mulai','=',$request['bulan'])
//->where('transaksi.status','=',1)
->select('homestay.nama_homestay','homestay.owner','transaksi.total_pembayaran','transaksi.jumlah_kamar','daftar_book.*')
->get();
......@@ -115,6 +119,8 @@ class AdminController extends Controller
return view('adminlte::layouts.admin.resultlistpesanan')->with('data',$data);
}
}
public function Allfeedback(){
......
......@@ -53,8 +53,13 @@ class GuestController extends Controller
$trans->jumlah_kamar = $request['jumlah_kamar'];
$trans->jumlah_tamu = $request['jumlah_tamu'];
$trans->lama_menginap = $request['lama_menginap'];
if ($request['extrabed']==null){
$trans->extrabed = 0;
}else{
$trans->extrabed = $request['extrabed'];
}
$trans->permintaan_khusus = $request['permintaan_khusus'];
$trans->total_pembayaran = $request['total_harga'];
$trans->total_pembayaran = $request['total_harga'] + ($request['extrabed'] * 30000);
$trans->status = 0;
$trans->save();
......@@ -63,7 +68,10 @@ class GuestController extends Controller
->select('transaksi.id')
->where('transaksi.tanggal_mulai','=',$request['tanggal_mulai'])
->where('transaksi.tanggal_berakhir','=',$request['tanggal_selesai'])
->where('transaksi.total_pembayaran','=',$request['total_harga'])
->where('transaksi.total_pembayaran','=',$request['total_harga'] + + ($request['extrabed'] * 30000))
->where('transaksi.jumlah_kamar','=',$request['jumlah_kamar'])
->where('transaksi.jumlah_tamu','=', $request['jumlah_tamu'])
->where('transaksi.lama_menginap','=', $request['lama_menginap'])
->get();
//dd($dataTrans);
......@@ -73,7 +81,12 @@ class GuestController extends Controller
$lb->homestay = $request['id_homestay'];
$lb->id_transaksi = $dataTrans[0]->id;
$lb->nama_pemesan = $request['nama'];
$lb->total_harga = $request['total_harga'];
if($request['extrabed'] == null){
$lb->extrabed = 0;
}else{
$lb->extrabed = $request['extrabed'];
}
$lb->total_harga = $request['total_harga']+ ($request['extrabed'] * 30000);
$lb->permintaan_khusus = $request['permintaan_khusus'];
$lb->jumlah_kamar = $request['jumlah_kamar'];
$lb->jumlah_tamu = $request['jumlah_tamu'];
......
......@@ -9,7 +9,7 @@ class ListBook extends Model
protected $table = "daftar_book";
protected $fillable = [
'jumlah_tamu','total_harga','permintaan_khusus','nama_pemesan','tanggal_mulai','tanggal_berakhir','homestay','jumlah_kamar'
'extrabed','jumlah_tamu','total_harga','permintaan_khusus','nama_pemesan','tanggal_mulai','tanggal_berakhir','homestay','jumlah_kamar'
];
public $timestamps = false;
......
......@@ -9,7 +9,7 @@ class Transaksi extends Model
protected $table = "transaksi";
protected $fillable = [
'tanggal_konfirmasi','jumlah_tamu','permintaan_khusus','id_pelanggan', 'tanggal_mulai', 'tanggal_berakhir','lama_menginap','total_pembayaran','tanggal_konfirmasi','status',
'extrabed','tanggal_konfirmasi','jumlah_tamu','permintaan_khusus','id_pelanggan', 'tanggal_mulai', 'tanggal_berakhir','lama_menginap','total_pembayaran','tanggal_konfirmasi','status',
];
public $timestamps = false;
......
......@@ -95,8 +95,8 @@
<button type="submit" class="btn btn-info"><i class="fa fa-check"> Terima</i></button>
</form>
<!-- {{url('requestFasilitass/'.$data->id)}} -->
<form action="" method="post" style="display:inline">
<!-- -->
<form action="{{url('requestFasilitass/'.$data->id)}}" method="post" style="display:inline">
{{csrf_field()}}
<input type="hidden" name="_method" value="PUT">
<button type="submit" class="btn btn-danger" data-toggle="modal" data-target="#confirmDelete"
......
......@@ -28,12 +28,22 @@
</div>
</div>
<div class="form-group">
<div class="col-sm-10">
<label>Permintaan Khusus</label>
<textarea name="permintaan_khusus" style="border: #cccccc 1px solid;border-radius: 5px; min-height:150px;"></textarea>
</div>
</div>
<div class="form-group">
<div class="col-sm-10">
<label>ExtraBed</label>
<input type="number" min="0" name="extrabed" class="form-control" id="inputEmail3" >
</div>
</div>
<input type="hidden" value="{{$dataUser->no_telepon}}" name="id_user">
<input type="hidden" value="{{$request->lama_menginap}}" name="lama_menginap">
<input type="hidden" value="{{$request->tanggal_mulai}}" name="tanggal_mulai">
......@@ -106,7 +116,7 @@
<tr>
<td> Total Bayar</td>
<td>:</td>
<td>{{$totalHarga}}</td>
<td><input type="text" name="total_harga" value="{{$totalHarga}}" disabled></td>
</tr>
</table>
<br>
......
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