Commit 0d4ce676 by Juliper

pembayaran

parent ee014bec
...@@ -9,7 +9,7 @@ class Homestay extends Model ...@@ -9,7 +9,7 @@ class Homestay extends Model
protected $table = "homestay"; protected $table = "homestay";
protected $fillable = [ protected $fillable = [
'idPemilik', 'nama', 'owner','alamat','jumlahKamar','harga','status', 'idPemilik', 'namaHomestay', 'owner','alamat','jumlahKamar','harga','status',
]; ];
} }
...@@ -127,7 +127,7 @@ class AdminController extends Controller ...@@ -127,7 +127,7 @@ class AdminController extends Controller
$hs = new Homestay(); $hs = new Homestay();
$hs->idPemilik = $RH->idPemilikHomestay; $hs->idPemilik = $RH->idPemilikHomestay;
$hs->nama = $RH->namaHomestay; $hs->namaHomestay = $RH->namaHomestay;
$hs->owner = $data[0]->nama ; $hs->owner = $data[0]->nama ;
$hs->alamat = $data[0]->alamat; $hs->alamat = $data[0]->alamat;
$hs->jumlahKamar = $RH->jumlahKamar; $hs->jumlahKamar = $RH->jumlahKamar;
......
...@@ -19,9 +19,39 @@ use Psy\Command\ListCommand\ConstantEnumerator; ...@@ -19,9 +19,39 @@ use Psy\Command\ListCommand\ConstantEnumerator;
class CustomerController extends Controller class CustomerController extends Controller
{ {
public function hitory($id){ public function upload(Request $request,$id){
$data = Transaksi::find($id);
return view('adminlte::layouts.customers.History');
return redirect()->action(
'CustomerController@detailhomestay', ['id' => $request['id']]
);
}
public function bukti($id){
$data = Transaksi::find($id);
return view('adminlte::layouts.customers.Upload')->with('data',$data);
}
public function history(){
$data = DB::table('pelanggan')
->select('pelanggan.*')
->where('pelanggan.id_Akun','=',Auth::user()->id)
->get();
$dataTrans = DB::table('homestay')
->join('transaksi','homestay.id','=','transaksi.id_homestay')
->join('pemilikhomestay','homestay.idPemilik','=','pemilikhomestay.id')
->select('transaksi.*','pemilikhomestay.nama','pemilikhomestay.noRekening')
->where('transaksi.id_pelanggan','=',$data[0]->id)
->get();
//dd("masuk agan",Auth::user()->id,$data[0]->id,$dataTrans);
return view('adminlte::layouts.customers.History')->with('data',$dataTrans);
} }
public function profile(){ public function profile(){
...@@ -146,6 +176,7 @@ class CustomerController extends Controller ...@@ -146,6 +176,7 @@ class CustomerController extends Controller
$trans = new Transaksi(); $trans = new Transaksi();
$trans->id_pelanggan = $data2[0]->id; $trans->id_pelanggan = $data2[0]->id;
$trans->id_homestay = $request['id'];
$trans->tanggal_mulai = $request['tanggal']; $trans->tanggal_mulai = $request['tanggal'];
$trans->tanggal_berakhir = $baru; $trans->tanggal_berakhir = $baru;
$trans->jumlah_kamar =$request['jumlah_kamar']; $trans->jumlah_kamar =$request['jumlah_kamar'];
......
...@@ -5,26 +5,32 @@ ...@@ -5,26 +5,32 @@
<div class="container"> <div class="container">
<table class="table table-striped"> <table class="table table-striped">
<thead> <thead>
<tr> <tr>
<th> No. </th>
<th> No. Rekening </th> <th> No. Rekening </th>
<th> Atas Nama </th> <th> Atas Nama </th>
<th> Total Pembayaran </th> <th> Total Pembayaran </th>
<th> Bukti Pembayaran </th>
<th> Unggah Pembayaran </th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr> @foreach($data as $a)
<td>1</td> <tr class="success">
<td>456141923</td> <td>{{$a->noRekening}}</td>
<td>Palti Sinaga</td> <td>{{$a->nama}}</td>
<td>2.400.000</td> <td>{{$a->total_pembayaran}}</td>
</tr> <td>
<tr class="success"> @if($a->bukti_pembayaran==null)
<td>2</td> <img alt="Buku Transfer Tidak Ada" class="img-circle img-responsive">
<td>09179287213</td> @else
<td>Lestari Siregar</td> <img alt="User Pic" src="img/{{$data->gambar}}" class="img-circle img-responsive">
<td>2.123.091</td> @endif
</tr> </td>
<td>
<a href="{{url('buktipembayaran/'.$a->id)}}">Upload Bukti</a>
</td>
</tr>
@endforeach
</tbody> </tbody>
</table> </table>
......
@extends('adminlte::layouts.master')
@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">
<input type="hidden" name="_method" value="PUT">
{{csrf_field()}}
<label>Tanggal Mulai</label>
<input type="text" name="tanggal_mulai" value="{{$data->tanggal_mulai}}" id="noTelepon" class="form-control">
<label>Tanggal Berakhir</label>
<input type="text" name="tanggal_berakhir" value="{{$data->tanggal_berakhir}}" class="form-control">
<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>
<div class="form-group" align="right">
<input type="submit" class="btn btn-primary" value="simpan">
</div>
</form>
</div>
</div>
@endsection
\ No newline at end of file
...@@ -42,9 +42,11 @@ ...@@ -42,9 +42,11 @@
<input type="submit" class="btn btn-primary"> <input type="submit" class="btn btn-primary">
</div> </div>
</div> </div>
</div>
</form> </form>
</div> </div>
</div> </div>
</div> </div>
@endsection @endsection
\ No newline at end of file
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
<li class="user-header"> <li class="user-header">
{{--<img src="{{ Gravatar::get($user->email) }}" class="img-circle" alt="User Image" />--}} {{--<img src="{{ Gravatar::get($user->email) }}" class="img-circle" alt="User Image" />--}}
<p> <p>
<img src="img/{{ Auth::user()->foto }}" class="img-circle" alt="User Image" /> <img src="/img/{{ Auth::user()->foto }}" class="img-circle" alt="User Image" />
</p> </p>
</li> </li>
...@@ -55,6 +55,10 @@ ...@@ -55,6 +55,10 @@
<a href="{{ url('customerProfile') }}" class="btn btn-default btn-flat">{{ trans('adminlte_lang::message.profile') }}</a> <a href="{{ url('customerProfile') }}" class="btn btn-default btn-flat">{{ trans('adminlte_lang::message.profile') }}</a>
</div> </div>
<div class="pull-left" style="margin-left: 20px">
<a href="{{ url('customerHistory') }}" class="btn btn-default btn-flat">History</a>
</div>
<div class="pull-right"> <div class="pull-right">
<a href="{{ url('/logout') }}" class="btn btn-default btn-flat" <a href="{{ url('/logout') }}" class="btn btn-default btn-flat"
onclick="event.preventDefault(); onclick="event.preventDefault();
......
...@@ -45,13 +45,13 @@ Route::group(['middleware' => 'auth'], function () { ...@@ -45,13 +45,13 @@ Route::group(['middleware' => 'auth'], function () {
//Please do not remove this if you want adminlte:route and adminlte:link commands to works correctly. //Please do not remove this if you want adminlte:route and adminlte:link commands to works correctly.
#adminlte_routes #adminlte_routes
}); });
Route::put('upload/{id}','CustomerController@upload');
Route::get('detailhomestay/{id}','CustomerController@detailhomestay'); Route::get('detailhomestay/{id}','CustomerController@detailhomestay');
Route::get('history/{id}','CustomerController@hitory'); Route::get('customerHistory','CustomerController@history');
Route::get('daftar','CustomerController@register'); Route::get('daftar','CustomerController@register');
Route::post('daftar','CustomerController@registerStore'); Route::post('daftar','CustomerController@registerStore');
Route::post('book','CustomerController@booking'); Route::post('book','CustomerController@booking');
//Route::post('editProfileCustomer/{id}','CustomerController@update'); Route::get('buktipembayaran/{id}','CustomerController@bukti');
//Route::put('editProfile/{id}','CustomerController@updateProfile');
Route::get('editProfileCustomer/{id}','CustomerController@editProfile'); Route::get('editProfileCustomer/{id}','CustomerController@editProfile');
Route::put('editProfileCustomer/{id}','CustomerController@updateProfile'); Route::put('editProfileCustomer/{id}','CustomerController@updateProfile');
Route::resource('admin', 'AdminController'); Route::resource('admin', 'AdminController');
......
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