Commit 78444b0d by Palti Sinaga

qweqwe

parent e98ea325
......@@ -17,6 +17,7 @@ use App\Owner;
use Illuminate\Support\Facades\DB;
use App\RequestFasilitas;
use Illuminate\Support\Facades\Auth;
use PDF;
class AdminController extends Controller
{
......@@ -115,9 +116,6 @@ class AdminController extends Controller
}
public function resultlistpesanan(){
}
public function Allfeedback(){
$data = DB::table('homestay')
......@@ -352,6 +350,18 @@ class AdminController extends Controller
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
......
......@@ -25,4 +25,18 @@ class PDFController extends Controller
return $pdf->stream('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 @@
<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>
<th>Kirim Pesan </th>
<td>: </td>
<td>
@if($data->status==1)
<td> <form class="" action="index.html" method="post">
<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==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">
<form action="{{url('printFasilitas/'.$data->id)}}" enctype="multipart/form-data">
<div class="form-group" align="right">
<input type="submit" class="btn btn-warning" value="Print">
</div>
......
......@@ -25,45 +25,28 @@
<tr>
<th>Pengaju</th>
<th>Nama Request Fasilitas</th>
<th>Lihat</th>
<th>Gambar</th>
<th colspan="2">Action</th>
<th>Lihat</th>
</tr>
@foreach($data as $a)
<tr>
<td>{{$a->nama}}</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)
Tidak ada gambar
@else
<a href="img/{{$a->gambar}}" alt="Bukti Pembayaran" data-lightbox="roadtrip"><img src="img/{{$a->gambar}}" style="width: 250px;height: 120px"></a>
@endif
</td>
@if($a->status==1)
<td>Di Terima</td>
@elseif($a->status==2)
<td>Ditolak</td>
@elseif($a->status==0)
<td>
<form action="{{url('requestFasilitas/'.$a->id)}}" method="post">
{{csrf_field()}}
<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>
<a href="{{url('detailreqFasilitas/'.$a->id)}}" class="btn btn-primary"><i class="fa fa-eye"></i> </a></td>
</td>
@endif
</tr>
@endforeach
</table>
{!! $data->render() !!}
</div>
</div>
</div>
@endsection
......@@ -26,19 +26,20 @@
<table class="table table-striped">
<tr>
<th>Judul</th>
<th>Keterangan</th>
<th >Keterangan</th>
<th>Gambar</th>
<th>Status</th>
</tr>
@foreach($data as $a)
<tr>
<td>{{$a->nama_request_fasilitas}}</td>
<td>{{$a->deskripsi}}</td>
<td style="max-width:200px;">{{$a->deskripsi}}</td>
<td>
@if($a->gambar==null)
Tidak ada gambar
@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
</td>
<td>@if($a->status==0) Sedang Menunggu
......
......@@ -140,4 +140,5 @@ Route::group(['middleware' => 'dinaspariwisata'], function () {
Route::get('detailreqFasilitas/{id}','AdminController@detailreqFasilitas');
Route::get('listhomestay','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