Commit 5252f4d5 by Juliper

repair something in role owner adn customer

parent 311fce17
...@@ -21,6 +21,31 @@ class OwnerController extends Controller ...@@ -21,6 +21,31 @@ class OwnerController extends Controller
} }
public function listOfBook(){
$dataPemilik = DB::table('pemilikhomestay')
->select('pemilikhomestay.id')
->where('pemilikhomestay.id_Akun','=',Auth::user()->id)
->get();
$dataHomestay = DB::table('homestay')
->join('pemilikhomestay','homestay.idPemilik','pemilikhomestay.id')
->select('homestay.id')
->where('pemilikhomestay.id','=',$dataPemilik[0]->id)
->get();
$dataListOfBook = DB::table('daftar_book')
->select('daftar_book.*')
->where('daftar_book.homestay','=',$dataHomestay[0]->id)
->get();
//dd('mas',$dataPemilik,$dataHomestay);
//dd('sampai disini dulu');
return view('adminlte::layouts.owner.ListBooking')->with('data',$dataListOfBook)->with('count',$dataListOfBook->count());
}
public function addBookManual(Request $request){ public function addBookManual(Request $request){
$lb = new ListBook(); $lb = new ListBook();
...@@ -35,13 +60,19 @@ class OwnerController extends Controller ...@@ -35,13 +60,19 @@ class OwnerController extends Controller
->select('homestay.id') ->select('homestay.id')
->where('homestay.idPemilik','=',$dataPemilik[0]->id) ->where('homestay.idPemilik','=',$dataPemilik[0]->id)
->get(); ->get();
dd($dataHomestay);
$lb->homestay;
$lb->nama_pemesan;
$lb->jumlah_kamar;
$lb->tanggal_mulai;
dd('ooke gan'); $lb->homestay = $dataHomestay[0]->id;
$lb->nama_pemesan = $request['nama'];
$lb->jumlah_kamar = $request['jumlah_kamar'];
$lb->tanggal_mulai = $request['tanggal_mulai'];
$time = explode('-', $request['tanggal_mulai']);
$time[2] +=$request['jumlah_hari'];
$baru = join('-',$time);
$lb->tanggal_berakhir = $baru;
$lb->save();
return redirect('daftarBooking');
} }
...@@ -117,8 +148,6 @@ class OwnerController extends Controller ...@@ -117,8 +148,6 @@ class OwnerController extends Controller
->select('pemilikhomestay.id') ->select('pemilikhomestay.id')
->where('users.id', '=', Auth::user()->id) ->where('users.id', '=', Auth::user()->id)
->get(); ->get();
$data = new RequestFasilitas(); $data = new RequestFasilitas();
$data->id_pemilik_homestay = $idPemilik[0]->id; $data->id_pemilik_homestay = $idPemilik[0]->id;
...@@ -127,8 +156,19 @@ class OwnerController extends Controller ...@@ -127,8 +156,19 @@ class OwnerController extends Controller
$data->deskripsi = $request['deskripsi']; $data->deskripsi = $request['deskripsi'];
$data->jumlah = $request['jumlah']; $data->jumlah = $request['jumlah'];
if($request->file('gambar')==null){
$data->gambar = $data->gambar;
}else{
$file = $request->file('gambar');
$fileName = $file->getClientOriginalName();
$request->file('gambar')->move("img/",$fileName);
$data->gambar = $fileName;
}
$data->save(); $data->save();
return redirect('listPengajuanFasilitas');
} }
public function pengajuan(){ public function pengajuan(){
......
...@@ -1396,7 +1396,7 @@ ...@@ -1396,7 +1396,7 @@
daysOfWeekDisabled: [], daysOfWeekDisabled: [],
endDate: Infinity, endDate: Infinity,
forceParse: true, forceParse: true,
format: 'yy/mm/dd', format: 'yy-mm-dd',
keyboardNavigation: true, keyboardNavigation: true,
language: 'en', language: 'en',
minViewMode: 0, minViewMode: 0,
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
<td>@if($a->gambar==null) <td>@if($a->gambar==null)
<img alt="Gambar Tidak Ada" class="img-circle img-responsive"> <img alt="Gambar Tidak Ada" class="img-circle img-responsive">
@else @else
<img alt="User Pic" src="img/{{$data->gambar}}" class="img-circle img-responsive"> <img alt="User Pic" src="img/{{$a->gambar}}" style="width: 250px;height: 120px">
@endif @endif
</td> </td>
@if($a->status==1) @if($a->status==1)
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
<div class="input-group-addon"> <div class="input-group-addon">
<i class="fa fa-calendar"></i> <i class="fa fa-calendar"></i>
</div> </div>
<input type="text" class="form-control datepicker" id="datepicker"> <input type="text" name="tanggal_mulai" class="form-control datepicker" id="datepicker">
</div> </div>
<!-- /.input group --> <!-- /.input group -->
</div> </div>
......
@extends('adminlte::layouts.app')
@section('htmlheader_title')
{{ trans('adminlte_lang::message.home') }}
@endsection
@section('main-content')
<div class="box box-warning">
<div class="box-header with-border">
<h3 class="box-title"> Daftar Booked </h3>
@if(Session::has('alert-success'))
<div class="alert alert-success">
{{ Session::get('alert-success') }}
</div>
@endif
@if (count($errors) > 0)
<div class="alert alert-danger">
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
</div>
<div class="box-body">
<div class="col-md-4 col-sm-6 col-xs-12">
<div class="info-box bg-yellow">
<span class="info-box-icon "><i class="glyphicon glyphicon glyphicon-list-alt"></i></span>
<div class="info-box-content">
<span class="info-box-text">Daftar Booked</span>
<span class="info-box-number">{{$count}}</span>
</div>
<!-- /.info-box-content -->
</div>
<!-- /.info-box -->
</div>
<br>
<table class="table table-striped">
<tr>
<th>Nama Pelanggan</th>
<th>Tanggal Mulai</th>
<th>Tanggal Berakhir</th>
<th>Jumlah Kamar</th>
</tr>
@foreach($data as $a)
<tr>
<td>{{$a->nama_pemesan}}</td>
<td>{{$a->tanggal_mulai}}</td>
<td>{{$a->tanggal_berakhir}}</td>
<td>{{$a->jumlah_kamar}}</td>
</tr>
@endforeach
</table>
</div>
</div>
@endsection
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
@if($a->gambar==null) @if($a->gambar==null)
<img alt="Gambar Tidak Ada" class="img-circle img-responsive"> <img alt="Gambar Tidak Ada" class="img-circle img-responsive">
@else @else
<img alt="User Pic" src="img/{{$data->gambar}}" class="img-circle img-responsive"> <img alt="User Pic" src="img/{{$a->gambar}}" style="width: 250px;height: 120px" >
@endif @endif
</td> </td>
<td>@if($a->status==0) Sedang Menunggu <td>@if($a->status==0) Sedang Menunggu
......
...@@ -27,9 +27,8 @@ ...@@ -27,9 +27,8 @@
@endif @endif
</div> </div>
<div class="box-body"> <div class="box-body">
<form action="{{ url('reqFasilitas') }}" method="post"> <form action="{{ url('reqFasilitas') }}" method="post" enctype="multipart/form-data">
<input type="hidden" name="_token" value="{{ csrf_token() }}"> <input type="hidden" name="_token" value="{{ csrf_token() }}">
<div class="form-group"> <div class="form-group">
<label> Judul </label> <label> Judul </label>
<div class="input-group"> <div class="input-group">
...@@ -74,12 +73,13 @@ ...@@ -74,12 +73,13 @@
</div> </div>
<!-- <select name="id_kategoriFasiltas" class=""> <div class="form-group">
<option value=1> Kamar Tidur </option> <label>Foto</label>
<option value=2> Perlatan Kamar Mandi </option> <div class="input-group">
</select> --> <input type="file" name="gambar" id="foto" class="form-corol"><br>
{{--<input id="role" class="form-control" name="role" required>--}} </div>
<br> </div>
<div class="form-group" align="right" style="color: black;"> <div class="form-group" align="right" style="color: black;">
<button type="submit" class="btn btn-primary ">Ajukan</button> <button type="submit" class="btn btn-primary ">Ajukan</button>
</div> </div>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
@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"> FASILITAS </h3> <h3 class="box-title"> Daftar Pesanan </h3>
@if(Session::has('alert-success')) @if(Session::has('alert-success'))
<div class="alert alert-success"> <div class="alert alert-success">
{{ Session::get('alert-success') }} {{ Session::get('alert-success') }}
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<span class="info-box-icon "><i class="glyphicon glyphicon glyphicon-list-alt"></i></span> <span class="info-box-icon "><i class="glyphicon glyphicon glyphicon-list-alt"></i></span>
<div class="info-box-content"> <div class="info-box-content">
<span class="info-box-text">DaftarPesanan</span> <span class="info-box-text">Daftar Pesanan</span>
<span class="info-box-number">{{$count}}</span> <span class="info-box-number">{{$count}}</span>
</div> </div>
<!-- /.info-box-content --> <!-- /.info-box-content -->
......
...@@ -37,13 +37,14 @@ ...@@ -37,13 +37,14 @@
</div> </div>
<div class="form-group" align="right"> <div class="form-group" align="right">
<div class="col-sm-12"> <div class="col-sm-12">
<input type="submit" class="btn btn-primary"></input> <input type="submit" class="btn btn-primary">
</div> </div>
</div> </div>
</div>
</form> </form>
</div> </div>
</div> </div>
</div> </div>
@endsection @endsection
\ No newline at end of file
...@@ -60,6 +60,7 @@ ...@@ -60,6 +60,7 @@
<li class="treeview"><a href="#"><i class='fa fa-inbox'></i> <span> PESANAN </span></a> <li class="treeview"><a href="#"><i class='fa fa-inbox'></i> <span> PESANAN </span></a>
<ul class="treeview-menu" style="display : none;"> <ul class="treeview-menu" style="display : none;">
<li><a href="{{url('pesanan')}}"><i class='fa fa-list'></i> <span>Daftar Pesanan</span></a></li> <li><a href="{{url('pesanan')}}"><i class='fa fa-list'></i> <span>Daftar Pesanan</span></a></li>
<li><a href="{{url('daftarBooking')}}"><i class='fa fa-list'></i> <span>Daftar Booked</span></a></li>
<li><a href="{{url('AddBook')}}"><i class='fa fa-plus'></i> <span>Tambah Pesanan Manual</span></a></li> <li><a href="{{url('AddBook')}}"><i class='fa fa-plus'></i> <span>Tambah Pesanan Manual</span></a></li>
</ul> </ul>
</li> </li>
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<!-- User Account Menu --> <!-- User Account Menu -->
<li class="dropdown user user-menu"> <li class="dropdown user user-menu">
<!-- Menu Toggle Button --> <!-- Menu Toggle Button -->
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<!-- The user image in the navbar--> <!-- The user image in the navbar-->
{{--<img src="{{ Gravatar::get($user->email) }}" class="user-image" alt="User Image"/>--}} {{--<img src="{{ Gravatar::get($user->email) }}" class="user-image" alt="User Image"/>--}}
<!-- hidden-xs hides the username on small devices so only the image appears. --> <!-- hidden-xs hides the username on small devices so only the image appears. -->
......
...@@ -60,6 +60,7 @@ Route::put('editRoom/{id}','OwnerController@updateRoom'); ...@@ -60,6 +60,7 @@ Route::put('editRoom/{id}','OwnerController@updateRoom');
Route::post('addManual','OwnerController@addBookManual'); Route::post('addManual','OwnerController@addBookManual');
Route::get('editRoom/{id}','OwnerController@editRoom') ; Route::get('editRoom/{id}','OwnerController@editRoom') ;
Route::get('daftarBooking','OwnerController@listOfBook');
Route::get('daftarKamar','OwnerController@daftarKamar'); Route::get('daftarKamar','OwnerController@daftarKamar');
Route::get('pesanan','OwnerController@listTransaction'); Route::get('pesanan','OwnerController@listTransaction');
Route::put('upload/{id}','CustomerController@upload'); Route::put('upload/{id}','CustomerController@upload');
......
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