Commit 930c3f41 by Juliper

pembayaran has

parent 3043f861
......@@ -19,14 +19,28 @@ use Psy\Command\ListCommand\ConstantEnumerator;
class CustomerController extends Controller
{
public function upload(Request $request,$id){
public function upload(Request $request,$id)
{
//dd("masuk agan");
$data = Transaksi::find($id);
return redirect()->action(
'CustomerController@detailhomestay', ['id' => $request['id']]
);
if($request->file('bukti_pembayaran')==null){
$data->foto = $data->foto;
}else{
$file = $request->file('bukti_pembayaran');
$fileName = $file->getClientOriginalName();
$request->file('bukti_pembayaran')->move("img/",$fileName);
$data->bukti_pembayaran = $fileName;
}
//$cus->update();
$data->update();
return redirect('customerHistory');
}
public function bukti($id){
$data = Transaksi::find($id);
......@@ -50,7 +64,7 @@ class CustomerController extends Controller
//dd("masuk agan",Auth::user()->id,$data[0]->id,$dataTrans);
// dd($dataTrans);
return view('adminlte::layouts.customers.History')->with('data',$dataTrans);
}
......
......@@ -23,7 +23,7 @@
@if($a->bukti_pembayaran==null)
<img alt="Buku Transfer Tidak Ada" class="img-circle img-responsive">
@else
<img alt="User Pic" src="img/{{$data->gambar}}" class="img-circle img-responsive">
<img alt="User Pic" src="{{ url('/img/'.$a ->bukti_pembayaran) }}" class="img-responsive" >
@endif
</td>
<td>
......
......@@ -3,7 +3,7 @@
@section('main-content')
<div class="cuisines agileits w3layouts" style="padding-top: 50px; margin-top: 80px; margin-bottom: 100px;">
<div class="container">
<form class="form-horizontal" action="{{url('')}}" method="post" enctype="multipart/form-data">
<form class="form-horizontal" action="{{url('upload/'.$data->id)}}" method="post" enctype="multipart/form-data">
<input type="hidden" name="_method" value="PUT">
{{csrf_field()}}
<label>Tanggal Mulai</label>
......@@ -13,7 +13,7 @@
<label>Jumlah Kamar</label>
<input type="text" name="jumlah_kamar" value="{{$data->jumlah_kamar}}" class="form-control">
<label>Bukti Pembayaran</label>
<input type="file" name="picture" id="picture" class="form-control"><br>
<input type="file" name="bukti_pembayaran" id="foto" class="form-corol">nt<br>
<div class="form-group" align="right">
<input type="submit" class="btn btn-primary" value="simpan">
</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