Commit 9f287095 by Palti Sinaga

H-1

parent 931f9df9
...@@ -26,7 +26,11 @@ class AdminController extends Controller ...@@ -26,7 +26,11 @@ class AdminController extends Controller
public function index() public function index()
{ {
return view('adminlte::home'); $count = User::all()->where('role',"Owner")->count();
$data = User::all()->where('role',"Owner");
//dd($data);
return view('adminlte::layouts.admin.listOwner')->with('data',$data)->with('count',$count);
} }
//Mengakses Daftar Pemesanan //Mengakses Daftar Pemesanan
...@@ -35,7 +39,7 @@ class AdminController extends Controller ...@@ -35,7 +39,7 @@ class AdminController extends Controller
$data = DB::table('homestay') $data = DB::table('homestay')
->join('daftar_book','homestay.id','=','daftar_book.homestay') ->join('daftar_book','homestay.id','=','daftar_book.homestay')
->select('daftar_book.*','homestay.nama_homestay','homestay.owner') ->select('daftar_book.*','homestay.nama_homestay','homestay.owner')
->get(); ->paginate(10);
return view('adminlte::layouts.admin.dataPemesanan')->with('data',$data); return view('adminlte::layouts.admin.dataPemesanan')->with('data',$data);
} }
...@@ -157,7 +161,7 @@ class AdminController extends Controller ...@@ -157,7 +161,7 @@ class AdminController extends Controller
->join('requestfasilitas','pemilikhomestay.id','=','requestfasilitas.id_pemilik_homestay') ->join('requestfasilitas','pemilikhomestay.id','=','requestfasilitas.id_pemilik_homestay')
->select('pemilikhomestay.nama','requestfasilitas.*') ->select('pemilikhomestay.nama','requestfasilitas.*')
->orderBy('requestfasilitas.id','desc') ->orderBy('requestfasilitas.id','desc')
->get(); ->paginate(4);
$count = $data->count(); $count = $data->count();
......
...@@ -50,7 +50,7 @@ class LoginController extends Controller ...@@ -50,7 +50,7 @@ class LoginController extends Controller
]); ]);
if ($validator->fails()) { if ($validator->fails()) {
return redirect('/login'); return redirect('/login')->withErrors($validator->errors());
} else { } else {
if (Auth::attempt(['username' => $request->username, 'password' => $request->password])) { if (Auth::attempt(['username' => $request->username, 'password' => $request->password])) {
//dd(Auth::user()->role); //dd(Auth::user()->role);
......
...@@ -19,6 +19,7 @@ use Illuminate\Contracts\Auth\Guard; ...@@ -19,6 +19,7 @@ use Illuminate\Contracts\Auth\Guard;
use DateTime; use DateTime;
use PhpParser\Node\Stmt\Const_; use PhpParser\Node\Stmt\Const_;
use Psy\Command\ListCommand\ConstantEnumerator; use Psy\Command\ListCommand\ConstantEnumerator;
use Validator;
class GuestController extends Controller class GuestController extends Controller
...@@ -36,6 +37,22 @@ class GuestController extends Controller ...@@ -36,6 +37,22 @@ class GuestController extends Controller
//Menyimpan data Pelanggan disaat melakukan Pendaftaran //Menyimpan data Pelanggan disaat melakukan Pendaftaran
public function registerStore(Request $data){ public function registerStore(Request $data){
$validator = Validator::make($data->all(), [
'name' => 'required',
'username' => 'required',
'email' => 'required|email',
'password' => 'required',
], [
'name.required' => 'Silahkan Masukkan Nama Lengkap!',
'username.required' => 'Silahkan Masukkan Username!',
'email.required' => 'Silahkan Masukkan Email!',
'password.required' => 'Silahkan Masukkan Password!'
]);
if ($validator->fails()) {
return redirect('/daftar')->withErrors($validator->errors());
}else{
$user = new User(); $user = new User();
$user->name = $data['name']; $user->name = $data['name'];
$user->username = $data['username']; $user->username = $data['username'];
...@@ -60,6 +77,7 @@ class GuestController extends Controller ...@@ -60,6 +77,7 @@ class GuestController extends Controller
$cus->save(); $cus->save();
return redirect('login'); return redirect('login');
}
} }
public function register(){ public function register(){
......
...@@ -147,7 +147,7 @@ class OwnerController extends Controller ...@@ -147,7 +147,7 @@ class OwnerController extends Controller
->join('pelanggan','feedback.id_pelanggan','pelanggan.id') ->join('pelanggan','feedback.id_pelanggan','pelanggan.id')
->select('feedback.*','pelanggan.nama') ->select('feedback.*','pelanggan.nama')
->where('feedback.id_pemilik_homestay','=',$dataPemilik[0]->id) ->where('feedback.id_pemilik_homestay','=',$dataPemilik[0]->id)
->get(); ->paginate(5);
return view('adminlte::layouts.owner.listfeedback')->with('data',$dataFeedback); return view('adminlte::layouts.owner.listfeedback')->with('data',$dataFeedback);
} }
...@@ -366,7 +366,7 @@ class OwnerController extends Controller ...@@ -366,7 +366,7 @@ class OwnerController extends Controller
->select('transaksi.*','pelanggan.nama','pelanggan.alamat','pelanggan.no_telepon') ->select('transaksi.*','pelanggan.nama','pelanggan.alamat','pelanggan.no_telepon')
->where('homestay.id_pemilik','=',$dataPel[0]->id) ->where('homestay.id_pemilik','=',$dataPel[0]->id)
->orderBy('transaksi.id','desc') ->orderBy('transaksi.id','desc')
->get(); ->paginate(5);
return view('adminlte::layouts.owner.listPesanan')->with('data',$data)->with('count',$data->count()); return view('adminlte::layouts.owner.listPesanan')->with('data',$data)->with('count',$data->count());
} }
...@@ -418,7 +418,7 @@ class OwnerController extends Controller ...@@ -418,7 +418,7 @@ class OwnerController extends Controller
$data->save(); $data->save();
return redirect('listPengajuanFasilitas'); return redirect('listPengajuanFasilitas')->with('message', 'Permintaan Fasilitas Telah Dikirim');
} }
...@@ -495,10 +495,11 @@ class OwnerController extends Controller ...@@ -495,10 +495,11 @@ class OwnerController extends Controller
->select('pemilikhomestay.nama','requestfasilitas.*') ->select('pemilikhomestay.nama','requestfasilitas.*')
->where('requestfasilitas.id_pemilik_homestay','=',$idPemilik[0]->id) ->where('requestfasilitas.id_pemilik_homestay','=',$idPemilik[0]->id)
->orderBy('requestfasilitas.id','desc') ->orderBy('requestfasilitas.id','desc')
->get(); ->paginate(4);
$count = $data->count(); $count = $data->count();
return view('adminlte::layouts.owner.ListPengajuanFasilitas')->with('data',$data)->with('count',$count); return view('adminlte::layouts.owner.ListPengajuanFasilitas')->with('data',$data)->with('count',$count);
} }
......
...@@ -5,24 +5,28 @@ ...@@ -5,24 +5,28 @@
@endsection @endsection
@section('content') @section('content')
<body class="hold-transition login-page" style="background-image: url(img/Danau2.jpg); background-size: 100% 130%; <body class="hold-transition login-page" style="background-image: url(img/Danau2.jpg); background-size: 100% 130%;
background-repeat:repeat;"> background-repeat:repeat;">
<div id="app"> <div id="app">
<div class="login-box" style="box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 20px 0px, rgba(0, 0, 0, 0.239216) 0px 5px 5px 0px; background-color: rgba(255, 255, 255, 0); ">
<div class="login-box" style="box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 20px 0px, rgba(0, 0, 0, 0.239216) 0px 5px 5px 0px; ">
<!-- <div class="login-logo"> <!-- <div class="login-logo">
<a href="{{ url('/home') }}"><b>SIBH</b></a> <a href="{{ url('/home') }}"><b>SIBH</b></a>
</div><!-- /.login-logo --> </div><!-- /.login-logo -->
@if (count($errors) > 0)
<div class="alert alert-danger">
<strong>Whoops!</strong>Ada beberapa masalah<br><br>
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
@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 class="login-box-body" > <div class="login-box-body" >
<!-- <p class="login-box-msg"> {{ trans('adminlte_lang::message.siginsession') }} </p> --> <!-- <p class="login-box-msg"> {{ trans('adminlte_lang::message.siginsession') }} </p> -->
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
@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> Ada beberapa masalah<br><br>
<ul> <ul>
@foreach ($errors->all() as $error) @foreach ($errors->all() as $error)
<li>{{ $error }}</li> <li>{{ $error }}</li>
...@@ -23,6 +23,14 @@ ...@@ -23,6 +23,14 @@
</div> </div>
@endif @endif
@if(session()->has('message'))
<div class="alert alert-info">
{{session()->get('message')}}
</div>
@endif
<div class="register-box-body"> <div class="register-box-body">
<div class="login-logo"> <div class="login-logo">
<a href="{{ url('/home') }}"><img src="img/bulbulhomestay.jpg" alt=""></a> <a href="{{ url('/home') }}"><img src="img/bulbulhomestay.jpg" alt=""></a>
...@@ -30,11 +38,11 @@ ...@@ -30,11 +38,11 @@
<form action="{{ url('/daftar') }}" method="post"> <form action="{{ url('/daftar') }}" method="post">
<input type="hidden" name="_token" value="{{ csrf_token() }}"> <input type="hidden" name="_token" value="{{ csrf_token() }}">
<div class="form-group has-feedback"> <div class="form-group has-feedback">
<input type="text" class="form-control" placeholder="{{ trans('adminlte_lang::message.fullname') }}" name="name" value="{{ old('name') }}"/> <input type="text" class="form-control" placeholder="Nama Lengkap" name="name" value="{{ old('name') }}"/>
<span class="glyphicon glyphicon-user form-control-feedback"></span> <span class="glyphicon glyphicon-user form-control-feedback"></span>
</div> </div>
<div class="form-group has-feedback"> <div class="form-group has-feedback">
<input type="text" class="form-control" placeholder="username" name="username" value="{{ old('username') }}"/> <input type="text" class="form-control" placeholder="Username" name="username" value="{{ old('username') }}"/>
<span class="glyphicon glyphicon-user form-control-feedback"></span> <span class="glyphicon glyphicon-user form-control-feedback"></span>
</div> </div>
<div class="form-group has-feedback"> <div class="form-group has-feedback">
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
{{ trans('adminlte_lang::message.home') }} {{ trans('adminlte_lang::message.home') }}
@endsection @endsection
@section('main-content') @section('main-content')
<div class="col-md-8">
<div class="box box-primary"> <div class="box box-primary">
<div class="box-header with-border"> <div class="box-header with-border">
<h3 class="box-title"> Tambah Pemilik Homestay </h3> <h3 class="box-title"> Tambah Pemilik Homestay </h3>
...@@ -66,6 +66,6 @@ ...@@ -66,6 +66,6 @@
</div> </div>
</div> </div>
</div> </div>
</div>
@endsection @endsection
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
</tr> </tr>
@endforeach @endforeach
</table> </table>
{!! $data->render() !!}
</div> </div>
</div> </div>
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<th>Deskripsi</th> <th>Deskripsi</th>
<th>Jumlah</th> <th>Jumlah</th>
<th>Gambar</th> <th>Gambar</th>
<th colspan="2">Acction</th> <th colspan="2">Action</th>
</tr> </tr>
@foreach($data as $a) @foreach($data as $a)
<tr> <tr>
...@@ -64,6 +64,7 @@ ...@@ -64,6 +64,7 @@
</tr> </tr>
@endforeach @endforeach
</table> </table>
{!! $data->render() !!}
</div> </div>
</div> </div>
</div> </div>
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
<div class="input-group-addon"> <div class="input-group-addon">
<i class="fa fa-bed"></i> <i class="fa fa-bed"></i>
</div> </div>
<input type="text" name="jumlah_kamar" value="" id="kamar" class="form-control"> <input type="Number" name="jumlah_kamar" value="" id="kamar" class="form-control">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
<form action="{{url('checkout/'.$a->id)}}" method="post"> <form action="{{url('checkout/'.$a->id)}}" method="post">
{{csrf_field()}} {{csrf_field()}}
<input type="hidden" name="_method" value="PUT"> <input type="hidden" name="_method" value="PUT">
<button type="submit" class="btn btn-info"><i class="glyphicon glyphicon-apple"> Checkout</i></button> <button type="submit" class="btn btn-info"><i class="fa fa-check"> Checkout</i></button>
</form> </form>
@endif @endif
</td> </td>
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
<td>{{$a->deskripsi}}</td> <td>{{$a->deskripsi}}</td>
<td> <td>
@if($a->gambar==null) @if($a->gambar==null)
<img alt="Gambar Tidak Ada" class="img-circle img-responsive"> Tidak ada gambar
@else @else
<img alt="User Pic" src="img/{{$a->gambar}}" style="width: 250px;height: 120px" > <img alt="User Pic" src="img/{{$a->gambar}}" style="width: 250px;height: 120px" >
@endif @endif
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
</tr> </tr>
@endforeach @endforeach
</table> </table>
{!! $data->render() !!}
</div> </div>
</div> </div>
@endsection @endsection
...@@ -52,9 +52,15 @@ ...@@ -52,9 +52,15 @@
<td>{{$a->lama_menginap}} Hari</td> <td>{{$a->lama_menginap}} Hari</td>
<td>{{$a->jumlah_kamar}}</td> <td>{{$a->jumlah_kamar}}</td>
<td> <td>
@if($a->bukti_pembayaran==null)
Bukti pembayaran tidak ada
@else
<img src="/img/{{ $a->bukti_pembayaran }}" style="width: 100px" alt="User Image" onclick="document.getElementById('modal').style.display='block'"/>
@endif
<img src="/img/{{ $a->bukti_pembayaran }}" style="width: 100px" alt="User Image" onclick="document.getElementById('modal').style.display='block'"/>
</td> </td>
<td> <td>
@if($a->status==0) @if($a->status==0)
<td> <td>
...@@ -62,7 +68,7 @@ ...@@ -62,7 +68,7 @@
{{csrf_field()}} {{csrf_field()}}
<input type="hidden" name="_method" value="PUT"> <input type="hidden" name="_method" value="PUT">
<input type="hidden" name="konfirmasi" value="1"> <input type="hidden" name="konfirmasi" value="1">
<button type="submit" class="btn btn-info"><i class="glyphicon glyphicon-apple"> Terima</i></button> <button type="submit" class="btn btn-info"><i class="fa fa-check"> Terima</i></button>
</form> </form>
<td> <td>
<form action="{{url('konfirmasiPemesanan/'.$a->id)}}" method="post"> <form action="{{url('konfirmasiPemesanan/'.$a->id)}}" method="post">
...@@ -76,9 +82,11 @@ ...@@ -76,9 +82,11 @@
@elseif($a->status==2) Ditolak @elseif($a->status==2) Ditolak
@endif @endif
</td> </td>
</td>
</tr> </tr>
@endforeach @endforeach
</table> </table>
{!! $data->render() !!}
</div> </div>
</div> </div>
@endsection @endsection
...@@ -24,13 +24,19 @@ ...@@ -24,13 +24,19 @@
</ul> </ul>
</div> </div>
@endif @endif
@if(session()->has('message'))
<div class="alert alert-info">
{{session()->get('message')}}
</div>
@endif
</div> </div>
<div class="box-body"> <div class="box-body">
<div class="col-md-4 col-sm-6 col-xs-12"> <div class="col-md-4 col-sm-6 col-xs-12">
<!-- /.info-box --> <!-- /.info-box -->
</div> </div>
<br>
<table class="table table-striped"> <table class="table table-striped">
<tr> <tr>
<th>Nama Pelanggan</th> <th>Nama Pelanggan</th>
...@@ -45,6 +51,7 @@ ...@@ -45,6 +51,7 @@
</tr> </tr>
@endforeach @endforeach
</table> </table>
{!! $data->render() !!}
</div> </div>
</div> </div>
@endsection @endsection
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
<i class="fa fa-angle-left pull-right"></i> <i class="fa fa-angle-left pull-right"></i>
</span></a> </span></a>
<ul class="treeview-menu" style="display : none;"> <ul class="treeview-menu" style="display : none;">
<li><a href="{{url('reqFasilitas')}}"><i class='fa fa-external-link-square'></i> <span>Daftar Permintaan Fasilitas</span></a></li> <li><a href="{{url('reqFasilitas')}}"><i class='fa fa-external-link-square'></i> <span>Tambah Permintaan Fasilitas</span></a></li>
<li><a href="{{url('listPengajuanFasilitas')}}"><i class='fa fa-list'></i> <span>Daftar Pengajuan Fasilitas</span></a></li> <li><a href="{{url('listPengajuanFasilitas')}}"><i class='fa fa-list'></i> <span>Daftar Pengajuan Fasilitas</span></a></li>
</ul> </ul>
</li> </li>
......
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