Commit f99148e8 by Rinto

New

parent 8362e985
......@@ -2,6 +2,7 @@
namespace App\Http\Controllers;
use App\Models\Batal;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\DB;
......@@ -112,7 +113,7 @@ class AdminController extends Controller
}
public function edit(Request $request, $id){
// code : from itsolutionstuff.com and modified by group 9 using intervention image
$input = $request->all();
if($request->file('image')){
$this->validate($request, [
......@@ -196,7 +197,7 @@ class AdminController extends Controller
}
public function editsupir(Request $request, $id){
// code : from itsolutionstuff.com and modified by group 9 using intervention image
$input = $request->all();
if($request->file('image')){
$this->validate($request, [
......@@ -225,6 +226,21 @@ class AdminController extends Controller
return view('admin.profil.index',$this->data);
}
public function history(){
$key = Input::get('search');
$this->data['title'] = ' Riwayat Pemesanan Bus IT Del';
if(isset($key)){
$this->data['batal'] = Batal::where('client_username','like','%'.$key.'%')->orderBy('id','desc')->paginate(10);
$this->data['pemesanan'] = Pemesanan::where('client_username','like','%'.$key.'%')->orderBy('id','desc')->paginate(10);
}else{
$this->data['batal'] = Batal::orderBy('id','desc')->paginate(10);
$this->data['pemesanan'] = Pemesanan::orderBy('id','desc')->paginate(10);
}
$this->data['total'] = DB::table('batal')->get();
$this->data['total'] = DB::table('pemesanan')->get();
return view('admin.history.index',$this->data);
}
public function pemesanan(){
$key = Input::get('search');
$this->data['title'] = 'Pemesanan Bus IT Del';
......@@ -247,4 +263,10 @@ class AdminController extends Controller
pemesanan::find($id)->delete();
return redirect(url('/admin/pemesanan'))->with('info','Pembatalan pemesanan berhasil dilakukan');
}
public function konfirmasi(Request $request, $id){
$input = $request->all();
pemesanan::find($id)->update($input);
return redirect(url('/admin/pemesanan'))->with('info','Pemesanan Bus Berhasil di Konfirmasi');
}
}
......@@ -68,6 +68,8 @@ class KlienController extends Controller
$this->data['history'] = DB::table('batal')->where('client_username' , $username)->orderBy('id','desc')->paginate(10);
$this->data['total'] = DB::table('batal')->where('client_username' , $username)->get();
$this->data['status'] = DB::table('pemesanan')->where('client_username' , $username)->orderBy('id','desc')->paginate(10);
$this->data['total'] = DB::table('pemesanan')->where('client_username' , $username)->get();
return view('klien.history.index',$this->data);
}
......@@ -93,6 +95,7 @@ class KlienController extends Controller
public function batal($id){
$this->data['title'] = 'Detail Pemesanan';
$this->data['pemesanan'] = Pemesanan::find($id);
pemesanan::find($id)->delete();
return view('klien.status.batal',$this->data);
}
......
......@@ -7,6 +7,6 @@ use Illuminate\Database\Eloquent\Model;
class Pemesanan extends Model
{
protected $table = 'pemesanan';
protected $fillable = ['id','tujuan','jumlah','alasan','berangkat','kembali','client_username','plat_bus'];
protected $fillable = ['id','tujuan','jumlah','alasan','berangkat','kembali','client_username','plat_bus','status'];
//
}
\ No newline at end of file
@if(Auth::check())
@extends('layouts.layout')
@include('layouts.header')
<body class="skin-blue sidebar-mini" style="height: auto;">
<div class="wrapper" style="height: auto;">
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section id="content-menu" class="content-menu">
<div class="module-menu-container"></div>
<ol class="breadcrumb"><li><a href="/"><i class="fa-home"></i> Home</a></li>
<li class="active"><i class="fa-bus"></i>Riwayat Pemesanan Bus</li>
</ol><!-- breadcrumbs -->
</section>
<!-- Main content -->
<section class="content">
<!-- /.row -->
<div class="row">
<div class="col-xs-12">
<div class="box">
<div class="box-header">
<h3 class="box-title">List Pemesanan</h3>
<div class="box-tools">
<form action="{{url('/admin/pemesanan')}}">
<div class="input-group input-group-sm" style="width: 150px;">
<input type="text" name="search" class="form-control pull-right"
placeholder="Username" id="search" type="text">
<div class="input-group-btn">
<button type="submit" class="btn btn-default"><i class="fa fa-search"></i></button>
</div>
</div>
</form>
</div>
</div>
<!-- /.box-header -->
<div class="box-body table-responsive no-padding">
<table class="table table-hover">
<thead><tr>
<th>Nama Pemesan</th>
<th>Tujuan</th>
<th>Berangkat</th>
<th>Alasan Pembatalan</th>
<th>Status</th>
</tr></thead>
<tbody>
@foreach($batal as $bata)
<tr>
<td>{{$bata->client_username}}</td>
<td>{{$bata->tujuan}}</td>
<td>{{$bata->berangkat}}</td>
<td>{{$bata->alasan_batal}}</td>
<td><span class="label label-danger">Dibatalkan</span>
</tr>
</form>
@endforeach
@foreach($pemesanan as $pesan)
<tr>
<td>{{$pesan->client_username}}</td>
<td>{{$pesan->tujuan}}</td>
<td>{{$pesan->berangkat}}</td>
<td></td>
<td><span class="label label-info">{{$pesan->status}}</span>
</tr>
</form>
@endforeach
</tbody>
</table>
</div>
<!-- /.box-body -->
</div>
<!-- /.box -->
</div>
</div>
</section>
<!-- /.content -->
</div>
</div>
</body>
@endif
\ No newline at end of file
......@@ -33,7 +33,7 @@
</div>
<!-- /.box-footer -->
<div class="box-footer">
<form action="" method="post">
<form action="{{url('/admin/pemesanan/konfirmasi',$pemesanan->id)}}" method="post" enctype="multipart/form-data">
{{ csrf_field() }}
<div class="form-group has-feedback">
<label class="col-md-4 control-label">Nama Pemesan</label>
......@@ -63,6 +63,12 @@
<label class="col-md-4 control-label">Plat Bus</label>
<input type="text" class="form-control" name="plat_bus" value="{{$pemesanan->plat_bus}}" readonly>
</div>
<div class="form-group">
<label class="col-md-4 control-label">Status</label>
<input type="text" value="diproses" class="form-control" name="status" readonly>
</div>
<div class="form-group has-feedback">
<a href="{{url('admin/pemesanan/konfirmasi',$pemesanan->id)}}" class="btn btn-danger">Konfirmasi</a>
<a href="{{url('admin/pemesanan/tolak',$pemesanan->id)}}" class="btn btn-danger">Tolak</a>
......
......@@ -49,7 +49,7 @@
<td>{{$pesan->client_username}}</td>
<td>{{$pesan->tujuan}}</td>
<td>{{$pesan->berangkat}}</td>
<td><span class="label label-info">Request</span></td>
<td><span class="label label-info">{{$pesan->status}}</span></td>
<td colspan="3">
<a href="{{url('admin/pemesanan/detail',$pesan->id)}}" class="btn btn-danger">Detail</a>
</td>
......
......@@ -29,8 +29,7 @@
<thead><tr>
<th>Nama Pemesan</th>
<th>Tujuan</th>
<th>Berangkat</th>
<th>Alasan Pembatalan</th>
<th>Tanggal Berangkat</th>
<th>Status</th>
</tr></thead>
<tbody>
......@@ -39,11 +38,17 @@
<td>{{$his->client_username}}</td>
<td>{{$his->tujuan}}</td>
<td>{{$his->berangkat}}</td>
<td>{{$his->alasan_batal}}</td>
<td><span class="label label-danger">Dibatalkan</span>
</tr>
</form>
@endforeach
@foreach($status as $stat)
<tr>
<td>{{$stat->client_username}}</td>
<td>{{$stat->tujuan}}</td>
<td>{{$stat->berangkat}}</td>
<td><span class="label label-info">Request</span>
@endforeach
</tbody>
</table>
</div>
......
......@@ -84,6 +84,11 @@
</div>
<div class="form-group">
<label>Status</label>
<input type="text" value="request" class="form-control" name="status" readonly>
</div>
<div class="form-group">
</div>
<!-- /.form-group -->
......
......@@ -40,7 +40,7 @@
<td>{{$stat->tujuan}}</td>
<td>{{$stat->berangkat}}</td>
<td>{{$stat->plat_bus}}</td>
<td><span class="label label-info">Request</span>
<td><span class="label label-info">{{$stat->status}}</span>
<button class="label label-danger">Batalkan</button></td>
</tr>
</form>
......
......@@ -49,7 +49,7 @@
<input type="text" class="form-control" name="jumlah" value="{{$pemesanan->jumlah}}" readonly>
</div>
<div class="form-group has-feedback">
<label class="col-md-4 control-label">Alasan</label>
<label class="col-md-6 control-label">Keperluan Pemesanan</label>
<textarea class="form-control" placeholder="Berikan deskripsi disini" rows="3" name="alasan" readonly>{{$pemesanan->alasan}}</textarea>
</div>
<div class="form-group has-feedback">
......
......@@ -3,9 +3,9 @@
<!-- Logo -->
<a href="index2.html" class="logo">
<!-- mini logo for sidebar mini 50x50 pixels -->
<span class="logo-mini"><b>SI</b>PB</span>
<span class="logo-mini"><b>BoD</b>IS</span>
<!-- logo for regular state and mobile devices -->
<span class="logo-lg"><b>SI</b>Pemesanan_Bus</span>
<span class="logo-lg">Booking Driver<b>IS</b></span>
</a>
<!-- Header Navbar: style can be found in header.less -->
<nav class="navbar navbar-static-top" role="navigation">
......
......@@ -59,6 +59,13 @@
</a>
</li>
<li class="{{Request::segment(2) == 'riwayat' ? 'active' : ''}}">
<a href="{{url('admin/history')}}">
<i class="fa fa-group"></i>
<span>Riwayat</span>
</a>
</li>
</ul>
@elseif(Auth::user()->role == 'k_supir')
......
......@@ -3,6 +3,7 @@ Use App\Models\Bus;
Use App\Models\Supir;
Use App\Models\Users;
Use App\Models\Pemesanan;
Use App\Models\Batal;
/*
|--------------------------------------------------------------------------
| Web Routes
......@@ -24,7 +25,7 @@ Route::group(['namespace' => 'auth'],function(){
Auth::logout();
return redirect('/');
})->name('logout');
Route::post('/register','RegisterController@store');
Route::get('/register','RegisterController@store');
});
......@@ -57,8 +58,12 @@ Route::group(['prefix' => 'admin','middleware' => 'admin'], function() {
Route::get('/profil','AdminController@profil');
Route::get('/history','AdminController@history');
Route::get('/pemesanan','AdminController@pemesanan');
Route::get('/pemesanan/detail/{id}','AdminController@detailpemesanan');
Route::get('/pemesanan/tolak/{id}','AdminController@tolak');
Route::get('/pemesanan/konfirmasi/{id}','AdminController@konfirmasi');
});
Route::group(['prefix' => 'k_supir','middleware' => 'k_supir'], function() {
......@@ -83,4 +88,6 @@ Route::group(['prefix' => 'klien','middleware' => 'klien'], function() {
Route::get('/status','KlienController@status');
Route::get('/pemesanan/batal/{id}','KlienController@batal');
Route::get('/pesan/pilih_bus/{id}','KlienController@pilih_bus');
Route::get('/status/batal/{id}','KlienController@batal');
Route::post('/kirim_pembatalan','KlienController@kirim_pembatalan');
});
\ No newline at end of file
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