update pengesahan pembida
This commit is contained in:
@@ -96,6 +96,12 @@ class AuthController extends Controller
|
||||
'message' => 'User Banned'
|
||||
], 401);
|
||||
}
|
||||
else if($user->status == 'rejected')
|
||||
{
|
||||
return response([
|
||||
'message' => 'Permohonan Ditolak'
|
||||
], 401);
|
||||
}
|
||||
else
|
||||
{
|
||||
return response([
|
||||
|
||||
@@ -34,6 +34,7 @@ class PembidaController extends Controller
|
||||
// $alluser = User::all();
|
||||
$alluser = User::doesntHave('roles')
|
||||
->where('user_type','=',2)
|
||||
->where('status', '!=', 'rejected')
|
||||
->get();
|
||||
|
||||
// dd($alluser);
|
||||
@@ -92,6 +93,23 @@ class PembidaController extends Controller
|
||||
->with('success','Pengesahan Berjaya');
|
||||
}
|
||||
|
||||
public function reject(Request $request)
|
||||
{
|
||||
// dd($request->all());
|
||||
$currentdate = Carbon::now();
|
||||
$currentdate = $currentdate->toDateString();
|
||||
|
||||
$user = User::where('id','=',$request->user_id)->first();
|
||||
$user->disahkan_pada = $currentdate;
|
||||
$user->disahkan_oleh = Auth::user()->id;
|
||||
$user->note = $request->note;
|
||||
$user->status = 'rejected';
|
||||
$user->save();
|
||||
|
||||
return redirect()->route('pembida.senaraipembida')
|
||||
->with('unsuccessful','Pengesahan Ditolak');
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -67,6 +67,10 @@ class RolesSeeder extends Seeder
|
||||
'name' => 'pengesahanbayarancash',
|
||||
'description' => 'Pengesahan bayaran pembida di cawangan (cash)'
|
||||
]);
|
||||
Permission::create([
|
||||
'name' => 'serahan',
|
||||
'description' => 'Penyerahan Marhun Kepada Pembida Yang Menang'
|
||||
]);
|
||||
|
||||
//jurulelong
|
||||
Permission::create([
|
||||
@@ -138,6 +142,7 @@ class RolesSeeder extends Seeder
|
||||
$role4->givePermissionTo('pendaftaranpembida');
|
||||
$role4->givePermissionTo('jananotis');
|
||||
$role4->givePermissionTo('pengesahanbayarancash');
|
||||
$role4->givePermissionTo('serahan');
|
||||
|
||||
|
||||
$role5 = Role::create(['name' => 'jurulelong']);
|
||||
|
||||
@@ -5,7 +5,12 @@
|
||||
<div class="container-fluid">
|
||||
<div class="row ">
|
||||
<div class="col-md-11 mx-auto card p-4">
|
||||
<table class="table table-striped table-xl text-center" style="width:100%">
|
||||
@if ($message = Session::get('success'))
|
||||
<div class="alert alert-success">
|
||||
<p>{{ $message }}</p>
|
||||
</div>
|
||||
@endif
|
||||
<table class="table table-striped table-xl text-center" id="senarailelongonline" style="width:100%">
|
||||
<thead class="bg-primary text-white">
|
||||
<tr>
|
||||
<th>No</th>
|
||||
@@ -29,4 +34,55 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var tablesenarailelongonline = $('#senarailelongonline').DataTable({
|
||||
"columnDefs": [
|
||||
{
|
||||
"targets": 0,
|
||||
"orderable": false
|
||||
},
|
||||
{
|
||||
"targets": 3,
|
||||
"orderable": false
|
||||
}
|
||||
],
|
||||
order: [[1, 'asc']],
|
||||
"info": false,
|
||||
"lengthChange": false,
|
||||
"pageLength": 15,
|
||||
dom: 'Bfrtip',
|
||||
// buttons: [
|
||||
// {
|
||||
// className: 'btn btn-outline-success pl-4 pr-4 btn-sm addcaw',
|
||||
// text: '<i class="fas fa-plus" id="test"></i>',
|
||||
// titleAttr: 'Tambah Cawangan',
|
||||
// action: function ( e, dt, node, config ) {
|
||||
// // alert( 'Button activated' );
|
||||
// // console.log('hye');
|
||||
|
||||
// $('#myModal').modal("show");
|
||||
// $('#myModal').on('shown.bs.modal', function () {
|
||||
// $('#rolename').trigger('focus')
|
||||
// })
|
||||
// }
|
||||
// },
|
||||
// {
|
||||
// className: 'btn btn-outline-secondary pl-4 pr-4 btn-sm export',
|
||||
// titleAttr: 'Export to CSV',
|
||||
// text: '<i class="fas fa-download"></i>',
|
||||
// action: function ( e, dt, node, config ) {
|
||||
// $("#exportform").submit();
|
||||
// }
|
||||
// }
|
||||
// ]
|
||||
});
|
||||
|
||||
// $('.addcaw').tooltip();
|
||||
// $('.export').tooltip();
|
||||
// // $( '.dt-buttons').addClass('btn-group');
|
||||
// $( '.addcaw').removeClass('dt-button');
|
||||
// $( '.export').removeClass('dt-button');
|
||||
|
||||
</script>
|
||||
|
||||
@endsection
|
||||
@@ -49,14 +49,54 @@
|
||||
<input type="hidden" name="userid" value="{{$user->id}}">
|
||||
<a href="{{url('pembida/senaraipembida')}}" class="btn btn-primary">Kembali</a>
|
||||
<button type="button" class="btn btn-success" onclick="confirm()">Sah</button>
|
||||
<button type="button" class="btn btn-danger" data-user_id="{{$user->id}}" onclick="reject(this)">Tolak</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
{{-- <button class="btn btn-primary" onclick="confirm()">Simpan</button> --}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" tabindex="-1" id="modaltolak">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">New Connection</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form action="{{ route('pembida.reject') }}" method="POST" id="formtolakpembida">
|
||||
@csrf
|
||||
<input type="hidden" name="user_id" id="user_id" value="" />
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<label for="caw_name">Nota</label>
|
||||
<input type="text" class="form-control" name="nota" id="nota" >
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Tutup</button>
|
||||
<button type="button" class="btn btn-primary" onclick="simpantolak()">Simpan</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
|
||||
function simpantolak() {
|
||||
$('#modaltolak').modal('hide');
|
||||
$("#formtolakpembida").submit();
|
||||
}
|
||||
function reject(e) {
|
||||
var userid= $(e).data('user_id');
|
||||
// console.log(userid);
|
||||
$('#user_id').val(userid);
|
||||
$('#modaltolak').modal('show');
|
||||
}
|
||||
function confirm() {
|
||||
$.confirm({
|
||||
title: 'Confirmation',
|
||||
@@ -75,8 +115,28 @@
|
||||
action: function () {}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
// function reject() {
|
||||
// $.reject({
|
||||
// title: 'Confirmation',
|
||||
// content: 'Anda pasti?',
|
||||
// type: 'green',
|
||||
// typeAnimated: true,
|
||||
// buttons: {
|
||||
// Sah: {
|
||||
// btnClass: 'btn-success',
|
||||
// action: function () {
|
||||
// $("#formpengguna").submit();
|
||||
// }
|
||||
// },
|
||||
// Batal: {
|
||||
// btnClass: 'btn-default',
|
||||
// action: function () {}
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
@@ -133,6 +133,7 @@ Route::group(['middleware' => ['permission:pengesahanpembida'],'prefix'=>'pembid
|
||||
Route::get('/pembida/{id}',['as'=>'pembida.show','uses'=>'PembidaController@show']);
|
||||
Route::get('/deletepembida/{id}',['as'=>'pembida.delete','uses'=>'PembidaController@delete']);
|
||||
Route::get('/sahkanpembida/{id}',['as'=>'pembida.sah','uses'=>'PembidaController@sah']);
|
||||
Route::post('/reject',['as'=>'pembida.reject','uses'=>'PembidaController@reject']);
|
||||
});
|
||||
|
||||
Route::group(['middleware' => ['permission:serahan'],'prefix'=>'serahan'], function () {
|
||||
|
||||
Reference in New Issue
Block a user