Commit 56651a82 by Juliper

final

parent e7605eba
...@@ -64,13 +64,9 @@ class AdminController extends Controller ...@@ -64,13 +64,9 @@ class AdminController extends Controller
} }
public function cariPesanan(Request $request){ public function cariPesanan(Request $request){
$dataHomestay = Homestay::where('nama_homestay',$request['nama_homestay'])->get(); $dataHomestay = Homestay::where('nama_homestay',$request['nama_homestay'])->get();
$homestay = DB::table('homestay')->get();
// $asd = Transaksi::all()->where('status',1); //dd($homestay);
//dd($asd);
//dd($request['bulan']);
if($request['bulan']== null){ if($request['bulan']== null){
$dataHos = DB::table('daftar_book') $dataHos = DB::table('daftar_book')
->join('transaksi','daftar_book.id_transaksi','=','transaksi.id') ->join('transaksi','daftar_book.id_transaksi','=','transaksi.id')
...@@ -85,7 +81,7 @@ class AdminController extends Controller ...@@ -85,7 +81,7 @@ class AdminController extends Controller
->where('daftar_book.id_transaksi','=',null) ->where('daftar_book.id_transaksi','=',null)
->select('homestay.nama_homestay','homestay.owner','daftar_book.*') ->select('homestay.nama_homestay','homestay.owner','daftar_book.*')
->get(); ->get();
//dd('masuk');
$penghasilan = 0; $penghasilan = 0;
foreach ($dataHos as $a){ foreach ($dataHos as $a){
$penghasilan += $a->total_pembayaran; $penghasilan += $a->total_pembayaran;
...@@ -99,7 +95,7 @@ class AdminController extends Controller ...@@ -99,7 +95,7 @@ class AdminController extends Controller
return view('adminlte::layouts.admin.resultlistpesanan')->with('data',$dataHos)->with('data2',$dataHos2 ) return view('adminlte::layouts.admin.resultlistpesanan')->with('data',$dataHos)->with('data2',$dataHos2 )
->with('penghasilan',$penghasilan); ->with('penghasilan',$penghasilan)->with('homestay',$homestay);
}else{ }else{
$data = DB::table('daftar_book') $data = DB::table('daftar_book')
...@@ -131,10 +127,10 @@ class AdminController extends Controller ...@@ -131,10 +127,10 @@ class AdminController extends Controller
} }
//dd($data,$data2,$penghasilan); //dd($data,$data2,$penghasilan);
//dd($homestay);
//dd($data2); //dd($data2);
return view('adminlte::layouts.admin.resultlistpesanan')->with('data',$data)->with('data2',$data2) return view('adminlte::layouts.admin.resultlistpesanan')->with('data',$data)->with('data2',$data2)
->with('penghasilan',$penghasilan); ->with('penghasilan',$penghasilan)->with('homestay',$homestay);
} }
} }
......
...@@ -122,7 +122,7 @@ class GuestController extends Controller ...@@ -122,7 +122,7 @@ class GuestController extends Controller
public function rincianpemesanan(Request $request, $id){ public function rincianpemesanan(Request $request, $id){
if(Auth::guest()){ if(Auth::guest()){
return redirect('login')->with('message','Anda Harus Login dulu !!'); return redirect('login')->with('message','Anda Harus Login dulu');
}else{ }else{
$dataUser = DB::table('pelanggan') $dataUser = DB::table('pelanggan')
->where('pelanggan.id_Akun','=',Auth::user()->id) ->where('pelanggan.id_Akun','=',Auth::user()->id)
...@@ -140,7 +140,7 @@ class GuestController extends Controller ...@@ -140,7 +140,7 @@ class GuestController extends Controller
public function sendFeedback(Request $request, $id){ public function sendFeedback(Request $request, $id){
if(Auth::guest()){ if(Auth::guest()){
return redirect()->action('GuestController@detailhomestay', ['id' => $id])->with('message','Anda Harus Login Dulu !!'); return redirect()->action('GuestController@detailhomestay', ['id' => $id])->with('message','Anda Harus Login Dulu');
//dd("maaf nggak bisa bang"); //dd("maaf nggak bisa bang");
} }
......
...@@ -19,25 +19,73 @@ use PDF; ...@@ -19,25 +19,73 @@ use PDF;
class OwnerController extends Controller class OwnerController extends Controller
{ {
public function __construct(){ public function __construct(){
$this->middleware('auth'); $this->middleware('auth');
$this->middleware('owner'); $this->middleware('owner');
} }
public function batalkan(Request $request){
//dd('masuk');
$data = Transaksi::find($request['requestID']);
DB::table('daftar_book')->where('tanggal_mulai', '=', $data->tanggal_mulai)->delete();
$data->pesan = $request['pesan'];
$data->status = 2;
$data->update();
}
public function Report(Request $request){ public function Report(Request $request){
//dd('masuk'); //dd('masuk',$request['tahun']);
return redirect()->action('OwnerController@findReport', ['id' => $request['bulan']]);
if($request['tahun']==null){
return redirect()->action('OwnerController@dfindReport', ['id' => $request['bulan']]);
}else{
return redirect()->action('OwnerController@findReport',['id' => $request['bulan'] , 'tahun' => $request['tahun']]);
}
//return redirect()->action('OwnerController@findReport', ['id' => $request['bulan']]);
//return redirect('report/{id}',$request['bulan']); //return redirect('report/{id}',$request['bulan']);
//dd($dataHomestay,$request['bulan'],$dataPesanan,$penghasilan); //dd($dataHomestay,$request['bulan'],$dataPesanan,$penghasilan);
} }
public function findReport($id,$tahun){
//dd('masuk');
$dataHomestay = DB::table('homestay')
->join('pemilikhomestay','homestay.id_pemilik','=','pemilikhomestay.id')
->where('pemilikhomestay.id_akun','=',Auth::user()->id)
->select('homestay.id')
->get();
$dataPesanan = DB::table('daftar_book')
->where('daftar_book.homestay','=',$dataHomestay[0]->id)
->whereMonth('daftar_book.tanggal_mulai','=',$id)
->whereYear('daftar_book.tanggal_mulai', $tahun)
->get();
$penghasilan = 0;
$jumlah_tamu = 0;
foreach ($dataPesanan as $a){
$penghasilan += $a->total_harga;
$jumlah_tamu += $a->jumlah_tamu;
}
return view('adminlte::layouts.owner.Report')->with('data',$dataPesanan)->with('penghasilan',$penghasilan)->with('jumlahTamu',$jumlah_tamu);
}
public function printReport(Request $request){ public function printReport(Request $request){
//dd('masuk',$request['bulan']); dd('masuk',$request['bulan']);
$dataHomestay = DB::table('homestay') $dataHomestay = DB::table('homestay')
->join('pemilikhomestay','homestay.id_pemilik','=','pemilikhomestay.id') ->join('pemilikhomestay','homestay.id_pemilik','=','pemilikhomestay.id')
...@@ -62,7 +110,8 @@ class OwnerController extends Controller ...@@ -62,7 +110,8 @@ class OwnerController extends Controller
$pdf->stream('reportOwner.pdf'); $pdf->stream('reportOwner.pdf');
} }
public function findReport($id){ public function dfindReport($id){
//dd('disini aja');
$dataHomestay = DB::table('homestay') $dataHomestay = DB::table('homestay')
->join('pemilikhomestay','homestay.id_pemilik','=','pemilikhomestay.id') ->join('pemilikhomestay','homestay.id_pemilik','=','pemilikhomestay.id')
->where('pemilikhomestay.id_akun','=',Auth::user()->id) ->where('pemilikhomestay.id_akun','=',Auth::user()->id)
...@@ -89,7 +138,7 @@ class OwnerController extends Controller ...@@ -89,7 +138,7 @@ class OwnerController extends Controller
//$//path = window.location.pathname; //$//path = window.location.pathname;
//dd($request['bulan']); //dd($request['bulan'],$request['tahun']);
$dataHomestay = DB::table('homestay') $dataHomestay = DB::table('homestay')
->join('pemilikhomestay','homestay.id_pemilik','=','pemilikhomestay.id') ->join('pemilikhomestay','homestay.id_pemilik','=','pemilikhomestay.id')
...@@ -97,10 +146,20 @@ class OwnerController extends Controller ...@@ -97,10 +146,20 @@ class OwnerController extends Controller
->select('homestay.id','homestay.nama_homestay') ->select('homestay.id','homestay.nama_homestay')
->get(); ->get();
//dd($dataHomestay[0]->nama_homestay); //dd($dataHomestay[0]->nama_homestay);
$dataPesanan = DB::table('daftar_book')
->where('daftar_book.homestay','=',$dataHomestay[0]->id) if($request['tahun'==null]){
->whereMonth('daftar_book.tanggal_mulai','=',$request['bulan']) $dataPesanan = DB::table('daftar_book')
->get(); ->where('daftar_book.homestay','=',$dataHomestay[0]->id)
->whereMonth('daftar_book.tanggal_mulai','=',$request['bulan'])
->get();
}else{
$dataPesanan = DB::table('daftar_book')
->where('daftar_book.homestay','=',$dataHomestay[0]->id)
->whereMonth('daftar_book.tanggal_mulai','=',$request['bulan'])
->whereYear('daftar_book.tanggal_mulai','=',$request['bulan'])
->get();
}
$penghasilan = 0; $penghasilan = 0;
$jumlah_tamu = 0; $jumlah_tamu = 0;
...@@ -154,7 +213,7 @@ class OwnerController extends Controller ...@@ -154,7 +213,7 @@ class OwnerController extends Controller
$dataTrans = DB::table('transaksi') $dataTrans = DB::table('transaksi')
->join('pelanggan','transaksi.id_pelanggan','=','pelanggan.id') ->join('pelanggan','transaksi.id_pelanggan','=','pelanggan.id')
->select('transaksi.total_pembayaran','transaksi.bukti_pembayaran','transaksi.tanggal_mulai','transaksi.id','transaksi.tanggal_berakhir','transaksi.jumlah_kamar','transaksi.lama_menginap','pelanggan.nama','pelanggan.no_telepon') ->select('transaksi.status','transaksi.total_pembayaran','transaksi.bukti_pembayaran','transaksi.tanggal_mulai','transaksi.id','transaksi.tanggal_berakhir','transaksi.jumlah_kamar','transaksi.lama_menginap','pelanggan.nama','pelanggan.no_telepon')
->where('transaksi.id','=',$id) ->where('transaksi.id','=',$id)
->get(); ->get();
...@@ -363,6 +422,7 @@ class OwnerController extends Controller ...@@ -363,6 +422,7 @@ class OwnerController extends Controller
DB::table('daftar_book')->where('tanggal_mulai', '=', $data->tanggal_mulai)->delete(); DB::table('daftar_book')->where('tanggal_mulai', '=', $data->tanggal_mulai)->delete();
$data->status=$request['konfirmasi']; $data->status=$request['konfirmasi'];
$data->pesan = $request['pesan'];
} }
$data->update(); $data->update();
......
...@@ -9,7 +9,7 @@ class Transaksi extends Model ...@@ -9,7 +9,7 @@ class Transaksi extends Model
protected $table = "transaksi"; protected $table = "transaksi";
protected $fillable = [ protected $fillable = [
'extrabed','tanggal_konfirmasi','jumlah_tamu','permintaan_khusus','id_pelanggan', 'tanggal_mulai', 'tanggal_berakhir','lama_menginap','total_pembayaran','tanggal_konfirmasi','status', 'pesan','extrabed','tanggal_konfirmasi','jumlah_tamu','permintaan_khusus','id_pelanggan', 'tanggal_mulai', 'tanggal_berakhir','lama_menginap','total_pembayaran','tanggal_konfirmasi','status',
]; ];
public $timestamps = false; public $timestamps = false;
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
<tr> <tr>
<th>Total Pembayaran</th> <th>Total Pembayaran</th>
<td>:</td> <td>:</td>
<td>{{$data->total_pembayaran}}</td> <td>Rp {{number_format($data->total_pembayaran)}}</td>
</tr> </tr>
<tr> <tr>
<th>Bukti pembayaran</th> <th>Bukti pembayaran</th>
......
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
<div class="form-group" align="left"> <div class="form-group" align="left">
<label>Bulan</label> <label>Bulan</label>
<input type="number" min="1" max="12" name="bulan"> <input type="number" min="1" max="12" name="bulan">
<label>Tahun</label>
<input type="number" min="1" max="12" name="bulan">
<label>Nama Homestay</label> <label>Nama Homestay</label>
<!-- <input type="text" name="nama_homestay"> --> <!-- <input type="text" name="nama_homestay"> -->
<select class="" name="nama_homestay"> <select class="" name="nama_homestay">
......
...@@ -21,7 +21,8 @@ ...@@ -21,7 +21,8 @@
</div> </div>
<div class="box-body"> <div class="box-body">
<table class="table table-striped"> <table id="example2" class="table table-bordered table-hover">
<thead>
<tr> <tr>
<th>Pengaju</th> <th>Pengaju</th>
<th>Nama Request Fasilitas</th> <th>Nama Request Fasilitas</th>
...@@ -29,6 +30,8 @@ ...@@ -29,6 +30,8 @@
<th>Status</th> <th>Status</th>
<th>Lihat</th> <th>Lihat</th>
</tr> </tr>
</thead>
<tbody>
@foreach($data as $a) @foreach($data as $a)
<tr> <tr>
<td>{{$a->nama}}</td> <td>{{$a->nama}}</td>
...@@ -50,13 +53,26 @@ ...@@ -50,13 +53,26 @@
</td> </td>
</tr> </tr>
@endforeach @endforeach
</tbody>
</table> </table>
{!! $data->render() !!} {!! $data->render() !!}
</div> </div>
</div> </div>
<script>
$(function () {
$("#example1").DataTable();
$('#example2').DataTable({
"paging": true,
"lengthChange": false,
"searching": false,
"ordering": true,
"info": true,
"autoWidth": false
});
});
</script>
@endsection @endsection
...@@ -7,7 +7,26 @@ ...@@ -7,7 +7,26 @@
@section('main-content') @section('main-content')
<div class="box box-warning"> <div class="box box-warning">
<div class="box-header with-border"> <div class="box-header with-border">
<h3 class="box-title"> DATA PEMESANAN </h3> <h3 class="box-title"> DATA PEMESANAN </h3>
<form action="{{url('caripesanan')}}">
<div class="form-group" align="left">
<label>Bulan</label>
<input type="number" min="1" max="12" name="bulan">
<label>Tahun</label>
<input type="number" min="1" max="12" name="bulan">
<label>Nama Homestay</label>
<!-- <input type="text" name="nama_homestay"> -->
<select class="" name="nama_homestay">
@foreach($homestay as $h)
<option value="{{$h->nama_homestay}}">{{$h->nama_homestay}}</option>
@endforeach
</select>
<input type="submit" class="btn btn-warning" value="Cari" >
</div>
</form>
@if (count($errors) > 0) @if (count($errors) > 0)
<div class="alert alert-danger"> <div class="alert alert-danger">
<strong>Whoops!</strong> {{ trans('adminlte_lang::message.someproblems') }}<br><br> <strong>Whoops!</strong> {{ trans('adminlte_lang::message.someproblems') }}<br><br>
...@@ -26,8 +45,9 @@ ...@@ -26,8 +45,9 @@
</div> </div>
</form> --> </form> -->
<table class="table table-striped"> <table id="example2" class="table table-bordered table-hover">
<tr> <thead>
<tr>
<th>Nama Homestay</th> <th>Nama Homestay</th>
<th>Nama Pemilik Homestay</th> <th>Nama Pemilik Homestay</th>
<th>Nama Pemesan</th> <th>Nama Pemesan</th>
...@@ -35,8 +55,10 @@ ...@@ -35,8 +55,10 @@
<th>Tanggal Berakhir</th> <th>Tanggal Berakhir</th>
<th>Jumlah Kamar yang dipesan</th> <th>Jumlah Kamar yang dipesan</th>
<th>Total Harga</th> <th>Total Harga</th>
</tr> </tr>
@foreach($data as $a) </thead>
<tbody>
@foreach($data as $a)
<tr> <tr>
<td>{{$a->nama_homestay}}</td> <td>{{$a->nama_homestay}}</td>
<td>{{$a->owner}}</td> <td>{{$a->owner}}</td>
...@@ -47,6 +69,8 @@ ...@@ -47,6 +69,8 @@
<td>{{$a->total_harga}}</td> <td>{{$a->total_harga}}</td>
</tr> </tr>
@endforeach @endforeach
</tbody>
<tbody>
@foreach($data2 as $c) @foreach($data2 as $c)
<tr> <tr>
<td>{{$c->nama_homestay}}</td> <td>{{$c->nama_homestay}}</td>
...@@ -58,7 +82,7 @@ ...@@ -58,7 +82,7 @@
<td>{{$c->total_harga}}</td> <td>{{$c->total_harga}}</td>
</tr> </tr>
@endforeach @endforeach
</tbody>
<tr> <tr>
<td>Total</td> <td>Total</td>
<td></td> <td></td>
...@@ -75,5 +99,17 @@ ...@@ -75,5 +99,17 @@
</div> </div>
</div> </div>
<script>
$(function () {
$("#example1").DataTable();
$('#example2').DataTable({
"paging": true,
"lengthChange": false,
"searching": false,
"ordering": true,
"info": true,
"autoWidth": false
});
});
</script>
@endsection @endsection
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<tr> <tr>
<td>{{$a->no_rekening}}</td> <td>{{$a->no_rekening}}</td>
<td>{{$a->nama}}</td> <td>{{$a->nama}}</td>
<td>{{$a->total_pembayaran}}</td> <td>Rp {{number_format($a->total_pembayaran)}}</td>
<td>{{$a->tanggal_mulai}}</td> <td>{{$a->tanggal_mulai}}</td>
<td>{{$a->tanggal_berakhir}}</td> <td>{{$a->tanggal_berakhir}}</td>
<td> <td>
......
...@@ -110,12 +110,17 @@ ...@@ -110,12 +110,17 @@
<tr> <tr>
<td>Harga Kamar</td> <td>Harga Kamar</td>
<td>:</td> <td>:</td>
<td>{{$data->harga}}</td> <td>Rp {{number_format($data->harga)}}</td>
</tr> </tr>
<tr> <tr>
<td>Harga extra bed</td>
<td>:</td>
<td>Rp {{number_format(30000)}}</td>
</tr>
<tr>
<td> Total Bayar</td> <td> Total Bayar</td>
<td>:</td> <td>:</td>
<td><input type="text" id="tot_har" name="total_harga" value="{{$totalHarga}}" disabled></td> <td><input type="text" id="tot_har" name="total_harga" value="Rp {{number_format($totalHarga)}}" disabled></td>
</tr> </tr>
</table> </table>
<br> <br>
......
...@@ -23,7 +23,8 @@ ...@@ -23,7 +23,8 @@
<!-- <div class="col-md-4 col-sm-6 col-xs-12"> <!-- <div class="col-md-4 col-sm-6 col-xs-12">
</div> --> </div> -->
<table class="table table-striped"> <table id="example2" class="table table-bordered table-hover">
<thead>
<tr> <tr>
<th>Judul</th> <th>Judul</th>
<th >Keterangan</th> <th >Keterangan</th>
...@@ -32,6 +33,8 @@ ...@@ -32,6 +33,8 @@
<th>Alasan</th> <th>Alasan</th>
<th></th> <th></th>
</tr> </tr>
</thead>
<tbody>
@foreach($data as $a) @foreach($data as $a)
<tr> <tr>
<td>{{$a->nama_request_fasilitas}}</td> <td>{{$a->nama_request_fasilitas}}</td>
...@@ -65,8 +68,23 @@ ...@@ -65,8 +68,23 @@
</td> </td>
</tr> </tr>
@endforeach @endforeach
</tbody>
</table> </table>
{!! $data->render() !!} {!! $data->render() !!}
</div> </div>
</div> </div>
<script>
$(function () {
$("#example1").DataTable();
$('#example2').DataTable({
"paging": true,
"lengthChange": false,
"searching": false,
"ordering": true,
"info": true,
"autoWidth": false
});
});
</script>
@endsection @endsection
...@@ -13,7 +13,9 @@ ...@@ -13,7 +13,9 @@
<div class="box-body"> <div class="box-body">
<form action="{{url('report')}}"> <form action="{{url('report')}}">
<label>Bulan</label> <label>Bulan</label>
<input type="number" min="1" onchange="updateVal(this)" max="12" name="bulan" required > <input type="number" min="1" onchange="updateVal(this)" max="12" name="bulan" required>
<label>Tahun</label>
<input type="number" min="2010" onchange="updateVal(this)" name="tahun" required>
<input type="submit" value="Cari" class="btn-btn info"> <input type="submit" value="Cari" class="btn-btn info">
</form> </form>
...@@ -22,6 +24,7 @@ ...@@ -22,6 +24,7 @@
<form action="{{url('printReportOwner')}}" enctype="multipart/form-data" style="float:right;"> <form action="{{url('printReportOwner')}}" enctype="multipart/form-data" style="float:right;">
<div class="form-group" align="right"> <div class="form-group" align="right">
<input type="number" hidden value="{{Request::segment(2)}}" min="1" max="12" name="bulan" display="none" required > <input type="number" hidden value="{{Request::segment(2)}}" min="1" max="12" name="bulan" display="none" required >
<input type="number" hidden value="{{Request::segment(3)}}" min="2010" name="tahun" display="none" required >
<input type="submit" class="btn btn-warning" value="Print"> <input type="submit" class="btn btn-warning" value="Print">
</div> </div>
</form> </form>
...@@ -32,9 +35,10 @@ ...@@ -32,9 +35,10 @@
<H2>Data Tidak Ada</H2> <H2>Data Tidak Ada</H2>
@else @else
<table class="table"> <table id="example2" class="table table-bordered table-hover">
<thead>
<tr> <tr>
<td></td> <th></th>
<th>Nama Pemesan</th> <th>Nama Pemesan</th>
<th>Jumlah Kamar</th> <th>Jumlah Kamar</th>
<th>Jumlah Tamu</th> <th>Jumlah Tamu</th>
...@@ -44,6 +48,8 @@ ...@@ -44,6 +48,8 @@
<th>Tanggal Berakhir</th> <th>Tanggal Berakhir</th>
<th>Total Harga</th> <th>Total Harga</th>
</tr> </tr>
</thead>
<tbody>
@foreach($data as $a) @foreach($data as $a)
<tr> <tr>
<td></td> <td></td>
...@@ -57,6 +63,7 @@ ...@@ -57,6 +63,7 @@
<td><Rp></Rp> {{number_format($a->total_harga,0)}}</td> <td><Rp></Rp> {{number_format($a->total_harga,0)}}</td>
</tr> </tr>
@endforeach @endforeach
</tbody>
<tr> <tr>
<td>Total</td> <td>Total</td>
<td></td> <td></td>
...@@ -83,6 +90,20 @@ ...@@ -83,6 +90,20 @@
{{--</script>--}} {{--</script>--}}
<script> <script>
$(function () {
$("#example1").DataTable();
$('#example2').DataTable({
"paging": true,
"lengthChange": false,
"searching": false,
"ordering": true,
"info": true,
"autoWidth": false
});
});
</script>
<script>
function cancelRequest() { function cancelRequest() {
$.ajax({ $.ajax({
data: { data: {
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
</div> </div>
@endif @endif
</div> </div>
<div class="col-md-10 box-body"> <div class="col-md-11 box-body">
<table class="table table-user-information "> <table class="table table-user-information ">
<tr> <tr>
<th>Nama Pemesan</th> <th>Nama Pemesan</th>
...@@ -59,7 +59,44 @@ ...@@ -59,7 +59,44 @@
<tr> <tr>
<th>Bukti Pembayaran</th> <th>Bukti Pembayaran</th>
<td>: </td> <td>: </td>
<td><a href="/img/{{ $data->bukti_pembayaran }}" alt="Bukti Pembayaran" data-lightbox="roadtrip"><img src="/img/{{ $data->bukti_pembayaran }}" style="max-width:200px;" ></a></td> <td>
@if($data->bukti_pembayaran==null)
Bukti pembayaran tidak ada
@else
<a href="/img/{{ $data->bukti_pembayaran }}" alt="Bukti Pembayaran" data-lightbox="roadtrip"><img src="/img/{{ $data->bukti_pembayaran }}" style="max-height: 150px; width:200px;"></a>
@endif
</td>
</tr>
<tr>
<th>Pesan</th>
<td>:</td>
<td><textarea class="form-control" placeholder="Pesan harap diisi" id="pesan" style="height:200px;" name="deskripsi"> </textarea></td>
</tr>
<tr>
<th>Status</th>
<td> : </td>
<td> @if($data->status==0)
<td>
<form action="{{url('konfirmasiPemesanan/'.$data->id)}}" method="post">
{{csrf_field()}}
<input type="hidden" name="_method" value="PUT">
<input type="hidden" name="konfirmasi" value="1">
<button type="submit" class="btn btn-info"><i class="fa fa-check"> Terima</i></button>
</form>
</td>
<td>
{{--<form action="{{url('konfirmasiPemesanan/'.$data->id)}}" method="post">--}}
{{--{{csrf_field()}}--}}
{{--<input type="hidden" name="_method" value="PUT">--}}
{{--<input type="hidden" name="konfirmasi" value="2">--}}
{{--<button type="submit" class="btn btn-danger"><i class="glyphicon glyphicon-trash"> Tolak</i></button>--}}
{{--</form>--}}
<a class="btn btn-danger" onclick="cancelRequest()"> <i class="fa fa-close"></i>Tolak </a>
</td>
@elseif($data->status==1) Diterima
@elseif($data->status==2) Ditolak
@endif
</td>
</tr> </tr>
</table> </table>
...@@ -74,4 +111,32 @@ ...@@ -74,4 +111,32 @@
</div> </div>
<script>
function cancelRequest() {
var check = confirm("Apakah anda yakin untuk menolak nya??");
var fiedl = document.getElementById('pesan');
if(fiedl.value == ' ' || fiedl.value == null || fiedl.value == ' '){
alert('Pesan Harus di isi');
}else {
if(check) {
$.ajax({
data: {
pesan : fiedl.value,
requestID: '{{$data->id}}',
_token: '{{ csrf_token() }}',
},
url: '{{ url('batalkan') }}',
type: 'POST',
success: function (data) {
window.location.reload(true);
}
});
}
}
}
</script>
@endsection @endsection
...@@ -32,17 +32,19 @@ ...@@ -32,17 +32,19 @@
<!-- /.info-box --> <!-- /.info-box -->
</div> </div>
<table class="table table-striped"> <table id="example2" class="table table-bordered table-hover">
<thead>
<tr> <tr>
<th>Nama Pelanggan</th> <th>Nama Pelanggan</th>
<th>Tanggal Check-in</th> <th>Tanggal Check-in</th>
<th>Tanggal Check-out</th> <th>Tanggal Check-out</th>
<th>Bukti Pembayaran</th> <th>Bukti Pembayaran</th>
<th>Lihat Detail</th>
<th>Download Bukti Pembayaran</th> <th>Download Bukti Pembayaran</th>
<th style="position: center;">Status</th> <th style="position: center;">Status</th>
<th colspan="2"></th> <th>Lihat Detail</th>
</tr> </tr>
</thead>
<tbody>
@foreach($data as $a) @foreach($data as $a)
<tr> <tr>
<td>{{$a->nama}}</td> <td>{{$a->nama}}</td>
...@@ -55,12 +57,7 @@ ...@@ -55,12 +57,7 @@
<a href="/img/{{ $a->bukti_pembayaran }}" alt="Bukti Pembayaran" data-lightbox="roadtrip"><img src="/img/{{ $a->bukti_pembayaran }}" style="max-height: 150px; width:200px;"></a> <a href="/img/{{ $a->bukti_pembayaran }}" alt="Bukti Pembayaran" data-lightbox="roadtrip"><img src="/img/{{ $a->bukti_pembayaran }}" style="max-height: 150px; width:200px;"></a>
@endif @endif
</td> </td>
<td>
@if($a->bukti_pembayaran==null)
@else
<a href="{{url('detailpesanan/'.$a->id)}}" class="btn btn-primary"><i class="fa fa-eye"></i> </a>
@endif
</td>
<td> <td>
@if($a->bukti_pembayaran==null) @if($a->bukti_pembayaran==null)
Bukti pembayaran tidak ada Bukti pembayaran tidak ada
...@@ -71,28 +68,20 @@ ...@@ -71,28 +68,20 @@
</td> </td>
<td> <td>
@if($a->status==0) @if($a->status==0)
<td> Menunggu Konfirmasi
<form action="{{url('konfirmasiPemesanan/'.$a->id)}}" method="post">
{{csrf_field()}}
<input type="hidden" name="_method" value="PUT">
<input type="hidden" name="konfirmasi" value="1">
<button type="submit" class="btn btn-info"><i class="fa fa-check"> Terima</i></button>
</form>
<td>
<form action="{{url('konfirmasiPemesanan/'.$a->id)}}" method="post">
{{csrf_field()}}
<input type="hidden" name="_method" value="PUT">
<input type="hidden" name="konfirmasi" value="2">
<button type="submit" class="btn btn-danger"><i class="glyphicon glyphicon-trash"> Tolak</i></button>
</form>
</td>
@elseif($a->status==1) Diterima @elseif($a->status==1) Diterima
@elseif($a->status==2) Ditolak @elseif($a->status==2) Ditolak
@endif @endif
</td> </td>
<td>
<a href="{{url('detailpesanan/'.$a->id)}}" class="btn btn-primary"><i class="fa fa-eye"></i> </a>
</td>
</td> </td>
</tr> </tr>
@endforeach @endforeach
</tbody>
</table> </table>
{!! $data->render() !!} {!! $data->render() !!}
</div> </div>
...@@ -102,4 +91,18 @@ ...@@ -102,4 +91,18 @@
<script type="text/javascript"> <script type="text/javascript">
document.getElementById("download").setAttribute("download", "bukti pembayarans.jpg") document.getElementById("download").setAttribute("download", "bukti pembayarans.jpg")
</script> </script>
<script>
$(function () {
$("#example1").DataTable();
$('#example2').DataTable({
"paging": true,
"lengthChange": false,
"searching": false,
"ordering": true,
"info": true,
"autoWidth": false
});
});
</script>
@endsection @endsection
...@@ -64,11 +64,13 @@ Route::get('DataPemesanan', function(){ ...@@ -64,11 +64,13 @@ Route::get('DataPemesanan', function(){
}); });
Route::group(['middleware' => 'owner'], function () { Route::group(['middleware' => 'owner'], function () {
Route::post('batalkan','OwnerController@batalkan');
Route::post('printreport','OwnerController@printReport'); Route::post('printreport','OwnerController@printReport');
Route::put('asread/{id}','OwnerController@Asread'); Route::put('asread/{id}','OwnerController@Asread');
Route::get('record','OwnerController@Record'); Route::get('record','OwnerController@Record');
Route::get('report','OwnerController@Report'); Route::get('report','OwnerController@Report');
Route::get('report/{id}','OwnerController@findReport'); Route::get('report/{id}/{tahun}','OwnerController@findReport');
Route::get('report/{id}','OwnerController@dfindReport');
Route::put('check/{id}','OwnerController@Check'); Route::put('check/{id}','OwnerController@Check');
Route::put('editRoom/{id}','OwnerController@updateRoom'); Route::put('editRoom/{id}','OwnerController@updateRoom');
Route::post('addManual','OwnerController@addBookManual'); Route::post('addManual','OwnerController@addBookManual');
......
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