Commit 7bb7ca8f by Juliper
parents 4ca66c00 16c62102
...@@ -25,6 +25,33 @@ class AdminController extends Controller ...@@ -25,6 +25,33 @@ class AdminController extends Controller
$this->middleware('dinaspariwisata'); $this->middleware('dinaspariwisata');
} }
public function Home(){
$count = User::all()->where('role',"Owner")->count();
$data = User::all()->where('role',"Owner");
//dd($data);
$dataF = DB::table('pemilikhomestay')
->join('requestfasilitas','pemilikhomestay.id','=','requestfasilitas.id_pemilik_homestay')
->select('pemilikhomestay.nama','requestfasilitas.*')
->orderBy('requestfasilitas.id','desc')
->get();
$dataH = DB::table('homestay')
->get();
$dataP = DB::table('pengajuan_homestay')
->get();
return view('adminlte::layouts.admin.home')->with('data',$data)->with('count',$count)->with('dataF',$dataF)->with('countF',$dataF->count())
->with('dataH',$dataH)->with('countH',$dataH->count())
->with('dataP',$dataP)->with('countP',$dataP->count());
}
public function listhomestay(){
$data = DB::table('homestay')
->get();
return view('adminlte::layouts.admin.listhomestay')->with('data',$data);
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();
...@@ -97,6 +124,7 @@ class AdminController extends Controller ...@@ -97,6 +124,7 @@ class AdminController extends Controller
return view('adminlte::layouts.admin.feedback')->with('data',$dataFeedback); return view('adminlte::layouts.admin.feedback')->with('data',$dataFeedback);
} }
public function index() public function index()
{ {
$count = User::all()->where('role',"Owner")->count(); $count = User::all()->where('role',"Owner")->count();
...@@ -281,6 +309,22 @@ class AdminController extends Controller ...@@ -281,6 +309,22 @@ class AdminController extends Controller
return view('adminlte::layouts.admin.listRequestFasilitas')->with('data',$data)->with('count',$count); return view('adminlte::layouts.admin.listRequestFasilitas')->with('data',$data)->with('count',$count);
} }
//DEtail REq Fasilitas
public function detailreqFasilitas($id){
$data = DB::table('pemilikhomestay')
->join('requestfasilitas','pemilikhomestay.id','=','requestfasilitas.id_pemilik_homestay')
->select('pemilikhomestay.nama','requestfasilitas.*')
->where('requestfasilitas.id','=',$id)
->get();
//dd($data);
$count = $data->count();
return view('adminlte::layouts.admin.detailreqFasilitas')->with('data',$data[0])->with('count',$count);
}
//Menolak pengajuan homestay //Menolak pengajuan homestay
public function RejectPengajuanHomestay($id){ public function RejectPengajuanHomestay($id){
//dd($id,"masuk agan"); //dd($id,"masuk agan");
......
@extends('adminlte::layouts.app')
@section('htmlheader_title')
{{ trans('adminlte_lang::message.home') }}
@endsection
@section('main-content')
<div class="box box-info">
<div class="box-header with-border">
<h3 class="box-title"> DETAIL PEMESANAN </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="col-md-10 box-body">
<table class="table table-user-information ">
<tr>
<th>Nama Pengaju</th>
<td>: </td>
<td>{{$data->nama}}</td>
</tr>
<tr>
<th>Judul Request</th>
<td>: </td>
<td>{{$data->nama_request_fasilitas}}</td>
</tr>
<tr>
<th>Keterangan</th>
<td>: </td>
<td>{{$data->deskripsi}}</td>
</tr>
<tr>
<th>Status</th>
<td>: </td>
<td>
@if($data->status==1)
Di Terima
@elseif($data->status==2)
Ditolak
@endif
</td>
</tr>
<tr>
<th>Gambar</th>
<td>: </td>
<td> <a href="/img/{{$data->gambar}}" alt="Bukti Pembayaran" data-lightbox="roadtrip"><img src="/img/{{$data->gambar}}" style="max-height:200px;"></a></td>
</tr>
<tr>
<th>Aksi</th>
<td>: </td>
<td>
@if($data->status==1)
@elseif($data->status==2)
@elseif($data->status==0)
<td>
<form action="{{url('requestFasilitas/'.$data->id)}}" method="post">
{{csrf_field()}}
<input type="hidden" name="_method" value="PUT">
<button type="submit" class="btn btn-info"><i class="fa fa-check"> Terima</i></button>
</form>
</td>
<td>
<form action="{{url('requestFasilitass/'.$data->id)}}" method="post">
{{csrf_field()}}
<input type="hidden" name="_method" value="PUT">
<button type="submit" class="btn btn-danger"><i class="fa fa-close"> Tolak</i></button>
</form>
</td>
@endif
</td>
</tr>
</table><br>
<form class="" action="index.html" method="post">
<div class="form-group">
<label> <b>Kirim Pesan : </b> </label>
<div class="input-group">
<div class="input-group-addon">
<i class="fa fa-newspaper-o"></i>
</div>
<textarea class="form-control" placeholder="Deskripsi" style="height:200px;" name="deskripsi"> </textarea>
</div>
<span id="errfn2" style="color: red"></span>
</div>
</form>
</div>
<div class="box-footer">
<form action="{{url('pesanan/'.$data->id)}}" enctype="multipart/form-data">
<div class="form-group" align="right">
<input type="submit" class="btn btn-warning" value="Print">
</div>
</form>
</div>
</div>
@endsection
@extends('adminlte::layouts.app')
@section('htmlheader_title')
{{ trans('adminlte_lang::message.home') }}
@endsection
@section('main-content')
<section class="content">
<!-- Small boxes (Stat box) -->
<div class="row">
<div class="col-lg-3 col-xs-6">
<div class="small-box bg-aqua">
<div class="inner">
<h3>{{$count}}</h3><br><br>
<p>Jumlah Pemilik Homestay</p>
</div>
<div class="icon">
<i class="fa fa-users"></i>
</div>
<a href="/listowner" class="small-box-footer">Lihat <i class="fa fa-arrow-circle-right"></i></a>
</div>
</div>
<div class="col-lg-3 col-xs-6">
<!-- small box -->
<div class="small-box bg-green">
<div class="inner">
<h3>{{$countH}}</h3><br><br>
<p>Jumlah Homestay</p>
</div>
<div class="icon">
<i class="fa fa-home"></i>
</div>
<a href="/listhomestay" class="small-box-footer">Lihat <i class="fa fa-arrow-circle-right"></i></a>
</div>
</div>
<div class="col-lg-3 col-xs-6">
<div class="small-box bg-yellow">
<div class="inner">
<h3>{{$countF}}</h3><br><br>
<p>Permintaan Fasilitas</p>
</div>
<div class="icon">
<i class="fa fa-cubes"></i>
</div>
<a href="/requestFasilitas" class="small-box-footer">Lihat <i class="fa fa-arrow-circle-right"></i></a>
</div>
</div>
<div class="col-lg-3 col-xs-6">
<div class="small-box bg-yellow">
<div class="inner">
<h3>{{$countP}}</h3><br><br>
<p>Pengajuan Homestay </p>
</div>
<div class="icon">
<i class="fa fa-home"></i>
</div>
<a href="/requestFasilitas" class="small-box-footer">Lihat <i class="fa fa-arrow-circle-right"></i></a>
</div>
</div>
</div>
<!-- /.row (main row) -->
</section>
@endsection
@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 HOMESTAY </h3>
@if (count($errors) > 0)
<div class="alert alert-danger">
<strong>Whoops!</strong> {{ trans('adminlte_lang::message.someproblems') }}<br><br>
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
</div>
<div class="box-body">
<table id="example2" class="table table-bordered table-hover">
<thead>
<tr>
<th>Nama Homestay</th>
<th>Alamat</th>
<th>Jumlah Kamar</th>
<th>Nama Pemilik</th>
</tr>
</thead>
<tbody>
@foreach($data as $a)
<tr>
<td>{{$a->nama_homestay }}</td>
<td>{{$a->alamat}}</td>
<td>{{$a->jumlah_kamar}}</td>
<td>{{$a->owner}}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
<script>
$(function () {
$("#example1").DataTable();
$('#example2').DataTable({
"paging": false,
"lengthChange": false,
"searching": false,
"ordering": true,
"info": true,
"autoWidth": false
});
});
</script>
@endsection
...@@ -25,8 +25,7 @@ ...@@ -25,8 +25,7 @@
<tr> <tr>
<th>Pengaju</th> <th>Pengaju</th>
<th>Nama Request Fasilitas</th> <th>Nama Request Fasilitas</th>
<th>Deskripsi</th> <th>Lihat</th>
<th>Jumlah</th>
<th>Gambar</th> <th>Gambar</th>
<th colspan="2">Action</th> <th colspan="2">Action</th>
</tr> </tr>
...@@ -34,12 +33,11 @@ ...@@ -34,12 +33,11 @@
<tr> <tr>
<td>{{$a->nama}}</td> <td>{{$a->nama}}</td>
<td>{{$a->nama_request_fasilitas}}</td> <td>{{$a->nama_request_fasilitas}}</td>
<td>{{$a->deskripsi}}</td> <td><a href="{{url('detailreqFasilitas/'.$a->id)}}" class="btn btn-primary"><i class="fa fa-eye"></i> </a></td>
<td>{{$a->jumlah}}</td>
<td>@if($a->gambar==null) <td>@if($a->gambar==null)
Tidak ada gambar Tidak ada gambar
@else @else
<img alt="User Pic" src="img/{{$a->gambar}}" style="width: 250px;height: 120px"> <a href="img/{{$a->gambar}}" alt="Bukti Pembayaran" data-lightbox="roadtrip"><img src="img/{{$a->gambar}}" style="width: 250px;height: 120px"></a>
@endif @endif
</td> </td>
@if($a->status==1) @if($a->status==1)
......
...@@ -45,10 +45,10 @@ ...@@ -45,10 +45,10 @@
<div class="input-group-addon"> <div class="input-group-addon">
<i class="fa fa-bookmark"></i> <i class="fa fa-bookmark"></i>
</div> </div>
<input type="text" name="username" class="form-control" placeholder="Username" value="{{$data->username}}"> <input type="text" class="form-control" placeholder="username" name="username" value="{{$data->username}}">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label> Alamat </label> <label> Alamat </label>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<!-- Logo --> <!-- Logo -->
@if(Auth::user()->role =="DinasPariwisata") @if(Auth::user()->role =="DinasPariwisata")
<a href="{{ url('/') }}" class="logo"> <a href="{{ url('/home') }}" class="logo">
<!-- mini logo for sidebar mini 50x50 pixels --> <!-- mini logo for sidebar mini 50x50 pixels -->
<span class="logo-mini"><b>SI</b>PH</span> <span class="logo-mini"><b>SI</b>PH</span>
<!-- logo for regular state and mobile devices --> <!-- logo for regular state and mobile devices -->
......
...@@ -131,4 +131,8 @@ Route::group(['middleware' => 'dinaspariwisata'], function () { ...@@ -131,4 +131,8 @@ Route::group(['middleware' => 'dinaspariwisata'], function () {
Route::get('ownerprofil/{id}','AdminController@profileowner'); Route::get('ownerprofil/{id}','AdminController@profileowner');
Route::get('Allfeedback','AdminController@Allfeedback'); Route::get('Allfeedback','AdminController@Allfeedback');
Route::get('feedback/{id}','AdminController@feedback'); Route::get('feedback/{id}','AdminController@feedback');
Route::get('home','AdminController@Home');
Route::get('detailreqFasilitas/{id}','AdminController@detailreqFasilitas');
Route::get('listhomestay','AdminController@listhomestay');
}); });
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