Commit 78444b0d by Palti Sinaga

qweqwe

parent e98ea325
...@@ -17,6 +17,7 @@ use App\Owner; ...@@ -17,6 +17,7 @@ use App\Owner;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
use App\RequestFasilitas; use App\RequestFasilitas;
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Auth;
use PDF;
class AdminController extends Controller class AdminController extends Controller
{ {
...@@ -65,7 +66,7 @@ class AdminController extends Controller ...@@ -65,7 +66,7 @@ class AdminController extends Controller
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){
...@@ -115,9 +116,6 @@ class AdminController extends Controller ...@@ -115,9 +116,6 @@ class AdminController extends Controller
} }
public function resultlistpesanan(){
}
public function Allfeedback(){ public function Allfeedback(){
$data = DB::table('homestay') $data = DB::table('homestay')
...@@ -352,6 +350,18 @@ class AdminController extends Controller ...@@ -352,6 +350,18 @@ class AdminController extends Controller
return view('adminlte::layouts.admin.detailreqFasilitas')->with('data',$data[0])->with('count',$count); return view('adminlte::layouts.admin.detailreqFasilitas')->with('data',$data[0])->with('count',$count);
} }
public function printFasilitas($id){
$data = DB::table('pemilikhomestay')
->join('requestfasilitas','pemilikhomestay.id','=','requestfasilitas.id_pemilik_homestay')
->join('homestay','pemilikhomestay.id','=','homestay.id_pemilik')
->select('pemilikhomestay.nama','pemilikhomestay.no_telepon','requestfasilitas.*','homestay.*')
->where('requestfasilitas.id','=',$id)
->get();
$pdf = PDF::loadView('pdf.adminfasilitas',['data' => $data[0]]);
return $pdf->stream('adminfasilitas.pdf');
}
//Menolak pengajuan homestay //Menolak pengajuan homestay
......
...@@ -25,4 +25,18 @@ class PDFController extends Controller ...@@ -25,4 +25,18 @@ class PDFController extends Controller
return $pdf->stream('detailpesanan.pdf'); return $pdf->stream('detailpesanan.pdf');
//return $pdf->download('detailpesanan.pdf'); //return $pdf->download('detailpesanan.pdf');
} }
public function printFasilitas($id){
$dataFasilitas = DB::table('pemilikhomestay')
->join('requestfasilitas','pemilikhomestay.id','=','requestfasilitas.id_pemilik_homestay')
->join('homestay','pemilikhomestay.id','=','homestay.id_pemilik')
->select('pemilikhomestay.nama','pemilikhomestay.no_telepon','requestfasilitas.*','homestay.nama_homestay')
->where('requestfasilitas.id','=',$id)
->get();
$pdf = PDF::loadView('pdf.adminfasilitas',['data'=>$dataFasilitas[0]]);
return $pdf->stream('adminfasilitas.pdf');
}
} }
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<p style="float:right;"><b>Tanggal : </b> <?php echo date("Y/m/d") ;?></p>
<br> <br> <br> <center><h1>Permintan Fasilitas</h1></center>
<table class="table table-user-information">
<tr>
<th>Judul Pengajuan</th>
<td>: </td>
<td>{{$data->nama_request_fasilitas}}</td>
</tr>
<tr>
<th>Nama Pengaju</th>
<td>: </td>
<td>{{$data->nama}}</td>
</tr>
<tr>
<th>Nama Homestay</th>
<td>: </td>
<td>{{$data->nama_homestay}}</td>
</tr>
<tr>
<th>Alamat</th>
<td>: </td>
<td>{{$data->alamat}}</td>
</tr>
<tr>
<th>No Telepon</th>
<td>: </td>
<td>{{$data->no_telepon}}</td>
</tr>
<tr>
<th>Keterangan</th>
<td>: </td>
<td>{{$data->deskripsi}}</td>
</tr>
</table>
</body>
</html>
...@@ -57,54 +57,44 @@ ...@@ -57,54 +57,44 @@
<td>: </td> <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> <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>
<tr> <tr>
<th>Aksi</th> <th>Kirim Pesan </th>
<td>: </td> <td>: </td>
<td> <td> <form class="" action="index.html" method="post">
@if($data->status==1) <div class="form-group">
<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>
</tr>
<tr>
<th>Aksi</th>
<td> </td>
@if($data->status==1)
@elseif($data->status==2) @elseif($data->status==2)
@elseif($data->status==0) @elseif($data->status==0)
<td> <td>
<form action="{{url('requestFasilitas/'.$data->id)}}" method="post"> <form action="{{url('requestFasilitas/'.$data->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="fa fa-check"> Terima</i></button> <button type="submit" class="btn btn-info"><i class="fa fa-check"> Terima</i></button>
<button type="submit" class="btn btn-danger"><i class="fa fa-close"> Tolak</i></button>
</form> </form>
</td> </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 @endif
</td>
</tr> </tr>
</table><br> </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>
<div class="box-footer"> <div class="box-footer">
<form action="{{url('pesanan/'.$data->id)}}" enctype="multipart/form-data"> <form action="{{url('printFasilitas/'.$data->id)}}" enctype="multipart/form-data">
<div class="form-group" align="right"> <div class="form-group" align="right">
<input type="submit" class="btn btn-warning" value="Print"> <input type="submit" class="btn btn-warning" value="Print">
</div> </div>
......
...@@ -25,45 +25,28 @@ ...@@ -25,45 +25,28 @@
<tr> <tr>
<th>Pengaju</th> <th>Pengaju</th>
<th>Nama Request Fasilitas</th> <th>Nama Request Fasilitas</th>
<th>Lihat</th>
<th>Gambar</th> <th>Gambar</th>
<th colspan="2">Action</th> <th>Lihat</th>
</tr> </tr>
@foreach($data as $a) @foreach($data as $a)
<tr> <tr>
<td>{{$a->nama}}</td> <td>{{$a->nama}}</td>
<td>{{$a->nama_request_fasilitas}}</td> <td>{{$a->nama_request_fasilitas}}</td>
<td><a href="{{url('detailreqFasilitas/'.$a->id)}}" class="btn btn-primary"><i class="fa fa-eye"></i> </a></td>
<td>@if($a->gambar==null) <td>@if($a->gambar==null)
Tidak ada gambar Tidak ada gambar
@else @else
<a href="img/{{$a->gambar}}" alt="Bukti Pembayaran" data-lightbox="roadtrip"><img src="img/{{$a->gambar}}" style="width: 250px;height: 120px"></a> <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)
<td>Di Terima</td>
@elseif($a->status==2)
<td>Ditolak</td>
@elseif($a->status==0)
<td> <td>
<form action="{{url('requestFasilitas/'.$a->id)}}" method="post"> <a href="{{url('detailreqFasilitas/'.$a->id)}}" class="btn btn-primary"><i class="fa fa-eye"></i> </a></td>
{{csrf_field()}} </td>
<input type="hidden" name="_method" value="PUT">
<button type="submit" class="btn btn-info"><i class="glyphicon glyphicon-apple"> Terima</i></button>
</form>
<td>
<form action="{{url('requestFasilitass/'.$a->id)}}" method="post">
{{csrf_field()}}
<input type="hidden" name="_method" value="PUT">
<button type="submit" class="btn btn-danger"><i class="glyphicon glyphicon-trash"> Tolak</i></button>
</form>
</td>
@endif
</tr> </tr>
@endforeach @endforeach
</table> </table>
{!! $data->render() !!} {!! $data->render() !!}
</div> </div>
</div> </div>
</div>
@endsection @endsection
...@@ -26,19 +26,20 @@ ...@@ -26,19 +26,20 @@
<table class="table table-striped"> <table class="table table-striped">
<tr> <tr>
<th>Judul</th> <th>Judul</th>
<th>Keterangan</th> <th >Keterangan</th>
<th>Gambar</th> <th>Gambar</th>
<th>Status</th> <th>Status</th>
</tr> </tr>
@foreach($data as $a) @foreach($data as $a)
<tr> <tr>
<td>{{$a->nama_request_fasilitas}}</td> <td>{{$a->nama_request_fasilitas}}</td>
<td>{{$a->deskripsi}}</td> <td style="max-width:200px;">{{$a->deskripsi}}</td>
<td> <td>
@if($a->gambar==null) @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>
<td>@if($a->status==0) Sedang Menunggu <td>@if($a->status==0) Sedang Menunggu
......
...@@ -140,4 +140,5 @@ Route::group(['middleware' => 'dinaspariwisata'], function () { ...@@ -140,4 +140,5 @@ Route::group(['middleware' => 'dinaspariwisata'], function () {
Route::get('detailreqFasilitas/{id}','AdminController@detailreqFasilitas'); Route::get('detailreqFasilitas/{id}','AdminController@detailreqFasilitas');
Route::get('listhomestay','AdminController@listhomestay'); Route::get('listhomestay','AdminController@listhomestay');
Route::get('resultlistpesanan','AdminController@listhomestay'); Route::get('resultlistpesanan','AdminController@listhomestay');
Route::get('printFasilitas/{id}','AdminController@printFasilitas');
}); });
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