Commit b5a915ec by Palti Sinaga

H-1 lagi1

parent 16c62102
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
namespace App\Http\Controllers; namespace App\Http\Controllers;
use App\Homestay; use App\Homestay;
use App\Transaksi;
use App\ListBook; use App\ListBook;
use App\RequestHomestay; use App\RequestHomestay;
use App\Room; use App\Room;
...@@ -42,9 +43,19 @@ class AdminController extends Controller ...@@ -42,9 +43,19 @@ class AdminController extends Controller
$dataP = DB::table('pengajuan_homestay') $dataP = DB::table('pengajuan_homestay')
->get(); ->get();
$dataPesan = DB::table('homestay')
->join('daftar_book','homestay.id','=','daftar_book.homestay')
->select('daftar_book.*','homestay.nama_homestay','homestay.owner')
->get();
return view('adminlte::layouts.admin.home')->with('data',$data)->with('count',$count)->with('dataF',$dataF)->with('countF',$dataF->count()) 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('dataH',$dataH)->with('countH',$dataH->count())
->with('dataP',$dataP)->with('countP',$dataP->count()); ->with('dataP',$dataP)->with('countP',$dataP->count())
->with('dataPesan',$dataPesan)->with('countPesan',$dataPesan->count());
} }
public function listhomestay(){ public function listhomestay(){
...@@ -52,6 +63,7 @@ class AdminController extends Controller ...@@ -52,6 +63,7 @@ class AdminController extends Controller
->get(); ->get();
return view('adminlte::layouts.admin.listhomestay')->with('data',$data); 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();
...@@ -61,14 +73,17 @@ class AdminController extends Controller ...@@ -61,14 +73,17 @@ class AdminController extends Controller
//$dataBok = DB::table('daftar_book') //$dataBok = DB::table('daftar_book')
// ->where('da'); // ->where('da');
$asd = Transaksi::all()->where('status',1);
//dd($asd);
$data = DB::table('daftar_book') $data = DB::table('daftar_book')
->join('transaksi','daftar_book.id_transaksi','=','transaksi.id') ->join('transaksi','daftar_book.id_transaksi','=','transaksi.id')
->join('homestay','daftar_book.homestay','=','homestay.id') ->join('homestay','daftar_book.homestay','=','homestay.id')
->join('pelanggan','transaksi.id_pelanggan','=','pelanggan.id') //->join('pelanggan','transaksi.id_pelanggan','=','pelanggan.id')
->where('daftar_book.homestay','=',$dataHomestay[0]->id) ->where('daftar_book.homestay','=',$dataHomestay[0]->id)
->whereMonth('daftar_book.tanggal_mulai','=',$request['bulan']) ->whereMonth('daftar_book.tanggal_mulai','=',$request['bulan'])
->where('transaksi.status','=',1) //->where('transaksi.status','=',1)
->select('homestay.nama_homestay','homestay.owner','pelanggan.nama','transaksi.total_pembayaran','transaksi.jumlah_kamar','daftar_book.*') ->select('homestay.nama_homestay','homestay.owner','transaksi.total_pembayaran','transaksi.jumlah_kamar','daftar_book.*')
->get(); ->get();
//$i=0; //$i=0;
...@@ -151,10 +166,12 @@ class AdminController extends Controller ...@@ -151,10 +166,12 @@ class AdminController extends Controller
$dataOw->no_telepon; $dataOw->no_telepon;
$dataOw->no_rekening; $dataOw->no_rekening;
//dd('aman',$dataOw->id_akun); //dd('aman',$dataOw->id_akun);
$dataUs = User::find($dataOw->id_akun); $dataUs = User::find($dataOw->id_akun);
$dataUs->username = $request['username']; $dataUs->username = $request['username'];
$dataUs->password = bcrypt($request['password']); $dataUs->password = bcrypt($request['password']);
......
...@@ -21,12 +21,21 @@ ...@@ -21,12 +21,21 @@
</div> </div>
<div class="box-body"> <div class="box-body">
<form action="{{url('caripesanan')}}"> <form action="{{url('caripesanan')}}">
<label>Bulan</label> <div class="form-group" align="right">
<input type="number" min="1" max="12" name="bulan"> <label>Bulan</label>
<label>Nama Homestay</label> <input type="number" min="1" max="12" name="bulan">
<input type="text" name="nama_homestay"> </div>
<input type="submit" value="Cari">
<div class="form-group" align="right">
<label>Nama Homestay</label>
<input type="text" name="nama_homestay">
</div>
<div class="form-group" align="right">
<input type="submit" class="btn btn-warning" value="Cari" >
</div>
</form> </form>
<table class="table table-striped"> <table class="table table-striped">
<tr> <tr>
<th>Nama Homestay</th> <th>Nama Homestay</th>
......
...@@ -20,17 +20,27 @@ ...@@ -20,17 +20,27 @@
@endif @endif
</div> </div>
<div class="box-body"> <div class="box-body">
<form action="{{url('caripesanan')}}"> <form action="{{url('caripesanan')}}">
<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>Nama Homestay</label> <label>Nama Homestay</label>
<input type="text" name="nama_homestay"> <input type="text" name="nama_homestay">
<input type="submit" value="Cari"> <input type="submit" class="btn btn-warning" value="Cari" >
</form> </div>
<div class="form-group" align="right">
</div>
<div class="form-group" align="right">
</div>
</form>
<table class="table table-striped"> <table class="table table-striped">
<tr> <tr>
<th>Nama Homestay</th> <th>Nama Homestay</th>
<th>Nama Pemilik Homstay</th> <th>Nama Pemilik Homestay</th>
<th>Nama Pemesan</th> <th>Nama Pemesan</th>
<th>Tanggal Mulai</th> <th>Tanggal Mulai</th>
<th>Tanggal Berakhir</th> <th>Tanggal Berakhir</th>
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<div class="small-box bg-aqua"> <div class="small-box bg-aqua">
<div class="inner"> <div class="inner">
<h3>{{$count}}</h3><br><br> <h3>{{$count}}</h3><br><br>
<p>Jumlah Pemilik Homestay</p> <p>Data Pemilik Homestay</p>
</div> </div>
<div class="icon"> <div class="icon">
<i class="fa fa-users"></i> <i class="fa fa-users"></i>
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<div class="small-box bg-green"> <div class="small-box bg-green">
<div class="inner"> <div class="inner">
<h3>{{$countH}}</h3><br><br> <h3>{{$countH}}</h3><br><br>
<p>Jumlah Homestay</p> <p>Data Homestay</p>
</div> </div>
<div class="icon"> <div class="icon">
<i class="fa fa-home"></i> <i class="fa fa-home"></i>
...@@ -50,15 +50,28 @@ ...@@ -50,15 +50,28 @@
</div> </div>
<div class="col-lg-3 col-xs-6"> <div class="col-lg-3 col-xs-6">
<div class="small-box bg-yellow"> <div class="small-box bg-green">
<div class="inner"> <div class="inner">
<h3>{{$countP}}</h3><br><br> <h3>{{$countP}}</h3><br><br>
<p>Pengajuan Homestay </p> <p>Pengajuan Homestay </p>
</div> </div>
<div class="icon"> <div class="icon">
<i class="fa fa-home"></i> <i class="fa fa-list"></i>
</div> </div>
<a href="/requestFasilitas" class="small-box-footer">Lihat <i class="fa fa-arrow-circle-right"></i></a> <a href="/requestHomestay" 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-red">
<div class="inner">
<h3>{{$countPesan}}</h3><br><br>
<p>Data Pemesanan </p>
</div>
<div class="icon">
<i class="fa fa-mail-reply"></i>
</div>
<a href="/listPemesanan" class="small-box-footer">Lihat <i class="fa fa-arrow-circle-right"></i></a>
</div> </div>
</div> </div>
......
...@@ -25,9 +25,9 @@ ...@@ -25,9 +25,9 @@
<tr> <tr>
<th>Nama Lengkap</th> <th>Nama Lengkap</th>
<th>Username</th> <th>Username</th>
<th>Email(s)</th> <th>Email</th>
<th >Engine version</th> <th>Lihat Data</th>
<th></th> <th>Perbaharui Data</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
...@@ -38,12 +38,12 @@ ...@@ -38,12 +38,12 @@
<td>{{$a->email}}</td> <td>{{$a->email}}</td>
<td> <td>
<form action="{{url('rincianpemilik/'.$a->id)}}"> <form action="{{url('rincianpemilik/'.$a->id)}}">
<input type="submit" value="Rincian" class="btn btn-warning"> <input type="submit" value="Lihat" class="btn btn-info">
</form> </form>
</td> </td>
<td> <td>
<form action="{{url('ownerr/'.$a->id)}}"> <form action="{{url('ownerr/'.$a->id)}}">
<input type="submit" value="Perbaharui" class="btn btn-success"> <input type="submit" value="Perbaharui" class="btn btn-warning">
</form> </form>
</td> </td>
<!-- <td> <a href="{{url('ownerprofil/'.$a->id)}}" class="btn btn-primary"><i class="glyphicon glyphicon-edit"></i> </a></td> --> <!-- <td> <a href="{{url('ownerprofil/'.$a->id)}}" class="btn btn-primary"><i class="glyphicon glyphicon-edit"></i> </a></td> -->
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
$(function () { $(function () {
$("#example1").DataTable(); $("#example1").DataTable();
$('#example2').DataTable({ $('#example2').DataTable({
"paging": true, "paging": false,
"lengthChange": false, "lengthChange": false,
"searching": false, "searching": false,
"ordering": true, "ordering": true,
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
@section('main-content') @section('main-content')
<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"> UPDATE PROFIL</h3> <h3 class="box-title"> UPDATE DATA OWNER</h3>
@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>
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
<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" class="form-control" placeholder="username" name="username" value="{{$data->username}}"> <input type="text" class="form-control" placeholder="username" name="username" value="{{$dataUS->username}}">
</div> </div>
</div> </div>
......
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