Commit 5252f4d5 by Juliper

repair something in role owner adn customer

parent 311fce17
......@@ -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){
$lb = new ListBook();
......@@ -35,13 +60,19 @@ class OwnerController extends Controller
->select('homestay.id')
->where('homestay.idPemilik','=',$dataPemilik[0]->id)
->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
->select('pemilikhomestay.id')
->where('users.id', '=', Auth::user()->id)
->get();
$data = new RequestFasilitas();
$data->id_pemilik_homestay = $idPemilik[0]->id;
......@@ -127,8 +156,19 @@ class OwnerController extends Controller
$data->deskripsi = $request['deskripsi'];
$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();
return redirect('listPengajuanFasilitas');
}
public function pengajuan(){
......
......@@ -1396,7 +1396,7 @@
daysOfWeekDisabled: [],
endDate: Infinity,
forceParse: true,
format: 'yy/mm/dd',
format: 'yy-mm-dd',
keyboardNavigation: true,
language: 'en',
minViewMode: 0,
......
......@@ -50,7 +50,7 @@
<td>@if($a->gambar==null)
<img alt="Gambar Tidak Ada" class="img-circle img-responsive">
@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
</td>
@if($a->status==1)
......
......@@ -49,7 +49,7 @@
<div class="input-group-addon">
<i class="fa fa-calendar"></i>
</div>
<input type="text" class="form-control datepicker" id="datepicker">
<input type="text" name="tanggal_mulai" class="form-control datepicker" id="datepicker">
</div>
<!-- /.input group -->
</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 @@
@if($a->gambar==null)
<img alt="Gambar Tidak Ada" class="img-circle img-responsive">
@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
</td>
<td>@if($a->status==0) Sedang Menunggu
......
......@@ -27,9 +27,8 @@
@endif
</div>
<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() }}">
<div class="form-group">
<label> Judul </label>
<div class="input-group">
......@@ -74,12 +73,13 @@
</div>
<!-- <select name="id_kategoriFasiltas" class="">
<option value=1> Kamar Tidur </option>
<option value=2> Perlatan Kamar Mandi </option>
</select> -->
{{--<input id="role" class="form-control" name="role" required>--}}
<br>
<div class="form-group">
<label>Foto</label>
<div class="input-group">
<input type="file" name="gambar" id="foto" class="form-corol"><br>
</div>
</div>
<div class="form-group" align="right" style="color: black;">
<button type="submit" class="btn btn-primary ">Ajukan</button>
</div>
......
......@@ -7,7 +7,7 @@
@section('main-content')
<div class="box box-warning">
<div class="box-header with-border">
<h3 class="box-title"> FASILITAS </h3>
<h3 class="box-title"> Daftar Pesanan </h3>
@if(Session::has('alert-success'))
<div class="alert alert-success">
{{ Session::get('alert-success') }}
......@@ -30,7 +30,7 @@
<span class="info-box-icon "><i class="glyphicon glyphicon glyphicon-list-alt"></i></span>
<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>
</div>
<!-- /.info-box-content -->
......
......@@ -37,13 +37,14 @@
</div>
<div class="form-group" align="right">
<div class="col-sm-12">
<input type="submit" class="btn btn-primary"></input>
<input type="submit" class="btn btn-primary">
</div>
</div>
</div>
</form>
</div>
</div>
</div>
@endsection
\ No newline at end of file
......@@ -60,6 +60,7 @@
<li class="treeview"><a href="#"><i class='fa fa-inbox'></i> <span> PESANAN </span></a>
<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('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>
</ul>
</li>
......
......@@ -25,7 +25,7 @@
<!-- User Account Menu -->
<li class="dropdown user user-menu">
<!-- Menu Toggle Button -->
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<!-- The user image in the navbar-->
{{--<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. -->
......
......@@ -60,6 +60,7 @@ Route::put('editRoom/{id}','OwnerController@updateRoom');
Route::post('addManual','OwnerController@addBookManual');
Route::get('editRoom/{id}','OwnerController@editRoom') ;
Route::get('daftarBooking','OwnerController@listOfBook');
Route::get('daftarKamar','OwnerController@daftarKamar');
Route::get('pesanan','OwnerController@listTransaction');
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