fix skit2
This commit is contained in:
@@ -6,6 +6,8 @@ use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Session;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
|
||||
use Carbon\Carbon;
|
||||
|
||||
class PermohonanController extends Controller
|
||||
@@ -17,4 +19,13 @@ class PermohonanController extends Controller
|
||||
|
||||
return view('permohonan.index',compact('api_url','auth_user'));
|
||||
}
|
||||
|
||||
public function MintaKelulusan(Request $request)
|
||||
{
|
||||
$auth_user = Auth::user();
|
||||
if(Hash::check($request->passsemula, Auth::user()->password))
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,167 +1,248 @@
|
||||
<template>
|
||||
<div class="mx-auto">
|
||||
<div class="mx-auto">
|
||||
|
||||
<div class="mx-auto flex justify-between mb-4">
|
||||
<div class="mx-auto flex justify-between mb-4">
|
||||
<h1 class="font-bold flex flex-row justify-end">Permohonan Yang Masih Aktif</h1>
|
||||
<button class="p-2 text-white bg-blue-500 rounded">Rekod Permohonan</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table class="min-w-full leading-normal">
|
||||
<thead class="text-center">
|
||||
<tr>
|
||||
<table class="min-w-full leading-normal">
|
||||
<thead class="text-center">
|
||||
<tr>
|
||||
<th class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">
|
||||
Cawangan
|
||||
Cawangan
|
||||
</th>
|
||||
<th class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">
|
||||
Baki PetiBesi(RM)
|
||||
PetiBesi (RM)
|
||||
</th>
|
||||
<th class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">
|
||||
No Permohonan
|
||||
No Permohonan
|
||||
</th>
|
||||
<th class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">
|
||||
Tarikh Mohon
|
||||
Tarikh Mohon
|
||||
</th>
|
||||
<th class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">
|
||||
Jumlah Mohon (RM)
|
||||
</th>
|
||||
<!-- <th class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">
|
||||
Status
|
||||
</th> -->
|
||||
<th class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">
|
||||
Jenis Permohonan
|
||||
Jumlah Mohon (RM)
|
||||
</th>
|
||||
<th class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">
|
||||
Act
|
||||
Semak
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(mohon,i) in showpermohonan.data" :key="i">
|
||||
<th class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">
|
||||
Jenis Permohonan
|
||||
</th>
|
||||
<th class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">
|
||||
Tindakan
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(mohon,i) in showpermohonan.data" :key="i">
|
||||
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">
|
||||
<div class="flex items-center">
|
||||
<div class="ml-3">
|
||||
<p class="text-gray-900 whitespace-no-wrap" v-text="mohon.kodcaw">
|
||||
</p>
|
||||
<div class="flex items-center">
|
||||
<div class="ml-3">
|
||||
<p class="text-gray-900 whitespace-no-wrap" v-text="namacawangan(mohon.kodcaw)">
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">
|
||||
<div class="flex items-center">
|
||||
<div class="ml-3">
|
||||
<p class="text-gray-900 whitespace-no-wrap" v-text="formatterfunction(mohon.baki_petibesi)">
|
||||
</p>
|
||||
<div class="flex items-center">
|
||||
<div class="ml-3">
|
||||
<p class="text-gray-900 whitespace-no-wrap" v-text="formatterfunction(mohon.baki_petibesi)">
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">
|
||||
<div class="flex items-center">
|
||||
<div class="ml-3">
|
||||
<p class="text-gray-900 whitespace-no-wrap" v-text="mohon.nopermohonan">
|
||||
</p>
|
||||
<div class="flex items-center">
|
||||
<div class="ml-3">
|
||||
<p class="text-gray-900 whitespace-no-wrap" v-text="mohon.nopermohonan">
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">
|
||||
<div class="flex items-center">
|
||||
<div class="ml-3">
|
||||
<p class="text-gray-900 whitespace-no-wrap" v-text="mohon.tarikh_permohonan">
|
||||
</p>
|
||||
<div class="flex items-center">
|
||||
<div class="ml-3">
|
||||
<p class="text-gray-900 whitespace-no-wrap" v-text="mohon.tarikh_permohonan">
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">
|
||||
<div class="flex items-center">
|
||||
<div class="ml-3">
|
||||
<p class="text-gray-900 whitespace-no-wrap" v-text="formatterfunction(mohon.amaun_mohon)">
|
||||
</p>
|
||||
<div class="flex items-center">
|
||||
<div class="ml-3">
|
||||
<p class="text-gray-900 whitespace-no-wrap" v-text="formatterfunction(mohon.amaun_mohon)">
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<!-- <td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">
|
||||
<div class="flex items-center">
|
||||
<div class="ml-3">
|
||||
<p class="text-gray-900 whitespace-no-wrap">
|
||||
<span class="p-2 w-full bg-green-500 rounded text-white">Baru</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</td> -->
|
||||
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">
|
||||
<div class="flex items-center">
|
||||
<div class="ml-3">
|
||||
<p :class="mohon.jenismohon == 'permohonanwang' ? 'bg-green-500' : 'bg-red-500'" class="text-white whitespace-no-wrap p-2 rounded" v-text="checkjenismohon(mohon.jenismohon)">
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">
|
||||
<div class="flex items-center">
|
||||
<div class="ml-3">
|
||||
<div class="border border-yellow-600 text-yellow-600 font-montserrat py-2 px-4 font-medium rounded-xl hover:bg-yellow-600 hover:text-white transition-all duration-300">
|
||||
<router-link :to="{ name: 'permohonanstatus', params: { mohonid: mohon.mohonid }}">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-card-checklist" viewBox="0 0 16 16">
|
||||
<path d="M14.5 3a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5h-13a.5.5 0 0 1-.5-.5v-9a.5.5 0 0 1 .5-.5h13zm-13-1A1.5 1.5 0 0 0 0 3.5v9A1.5 1.5 0 0 0 1.5 14h13a1.5 1.5 0 0 0 1.5-1.5v-9A1.5 1.5 0 0 0 14.5 2h-13z"/>
|
||||
<path d="M7 5.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1h-5a.5.5 0 0 1-.5-.5zm-1.496-.854a.5.5 0 0 1 0 .708l-1.5 1.5a.5.5 0 0 1-.708 0l-.5-.5a.5.5 0 1 1 .708-.708l.146.147 1.146-1.147a.5.5 0 0 1 .708 0zM7 9.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1h-5a.5.5 0 0 1-.5-.5zm-1.496-.854a.5.5 0 0 1 0 .708l-1.5 1.5a.5.5 0 0 1-.708 0l-.5-.5a.5.5 0 0 1 .708-.708l.146.147 1.146-1.147a.5.5 0 0 1 .708 0z"/>
|
||||
</svg>
|
||||
</router-link>
|
||||
<div class="flex items-center">
|
||||
<div class="ml-3">
|
||||
<router-link :to="{ name: 'permohonanstatus', params: { mohonid: mohon.mohonid }}">
|
||||
<div class="border border-green-600 text-green-600 font-montserrat py-2 px-4 font-medium rounded-xl hover:bg-green-600 hover:text-white transition-all duration-300">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" />
|
||||
</svg>
|
||||
</div>
|
||||
</router-link>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">
|
||||
<div class="flex items-center">
|
||||
<div class="ml-3">
|
||||
<p :class="mohon.jenismohon == 'permohonanwang' ? 'bg-yellow-500' : 'bg-gray-500'" class="text-white whitespace-no-wrap p-2 rounded" v-text="checkjenismohon(mohon.jenismohon)">
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">
|
||||
<div class="flex items-center">
|
||||
<div v-if="mohon.tagoperasi == 0" class="ml-3">
|
||||
<button @click="funcsetuju(mohon.mohonid)" class="border border-blue-600 text-blue-600 font-montserrat py-2 px-4 font-medium rounded-xl hover:bg-blue-600 hover:text-white transition-all duration-300">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M14 10h4.764a2 2 0 011.789 2.894l-3.5 7A2 2 0 0115.263 21h-4.017c-.163 0-.326-.02-.485-.06L7 20m7-10V5a2 2 0 00-2-2h-.095c-.5 0-.905.405-.905.905 0 .714-.211 1.412-.608 2.006L7 11v9m7-10h-2M7 20H5a2 2 0 01-2-2v-6a2 2 0 012-2h2.5" />
|
||||
</svg>
|
||||
</button>
|
||||
<button @click="funcbatal(mohon.mohonid)" class="border border-red-600 text-red-600 font-montserrat py-2 px-4 font-medium rounded-xl hover:bg-red-600 hover:text-white transition-all duration-300">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M10 14H5.236a2 2 0 01-1.789-2.894l3.5-7A2 2 0 018.736 3h4.018a2 2 0 01.485.06l3.76.94m-7 10v5a2 2 0 002 2h.096c.5 0 .905-.405.905-.904 0-.715.211-1.413.608-2.008L17 13V4m-7 10h2m5-10h2a2 2 0 012 2v6a2 2 0 01-2 2h-2.5" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
<div v-else class="ml-3">
|
||||
<p class="text-white whitespace-no-wrap p-2 rounded bg-green-500">
|
||||
Telah Lulus
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<pagination :data="paginate" @clickEvent_="getSenaraiMohon"></pagination>
|
||||
<pagination :data="paginate" @clickEvent_="getSenaraiMohon"></pagination>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
|
||||
<script>
|
||||
import pagination from '../components/pagination.vue'
|
||||
|
||||
const formatter = new Intl.NumberFormat('en-US', {
|
||||
minimumFractionDigits: 2
|
||||
minimumFractionDigits: 2
|
||||
});
|
||||
|
||||
export default {
|
||||
components: {
|
||||
pagination
|
||||
},
|
||||
data(){
|
||||
return{
|
||||
showpermohonan:{},
|
||||
currentPage:1,
|
||||
paginate: {}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getSenaraiMohon(this.currentPage)
|
||||
},
|
||||
methods:{
|
||||
getSenaraiMohon(pageNumber){
|
||||
this.axios.get(this.$hostname + '/admin/permohonan/get/admin',{
|
||||
params: {
|
||||
page: pageNumber
|
||||
}
|
||||
}).then(response => {
|
||||
this.showpermohonan = response.data
|
||||
this.paginate = response.data
|
||||
this.currentPage = pageNumber
|
||||
});
|
||||
components: {
|
||||
pagination
|
||||
},
|
||||
formatterfunction(value){
|
||||
return formatter.format(value)
|
||||
data() {
|
||||
return {
|
||||
showpermohonan: {},
|
||||
currentPage: 1,
|
||||
paginate: {},
|
||||
cawangan: {}
|
||||
}
|
||||
},
|
||||
checkjenismohon(value){
|
||||
if(value === 'permohonanwang')
|
||||
{
|
||||
return 'Permohonan Wang'
|
||||
}else{
|
||||
return 'Bayaran Balik'
|
||||
}
|
||||
created() {
|
||||
this.getSenaraiMohon(this.currentPage)
|
||||
this.axios.get('/api/check/cawangan').then(response => {
|
||||
this.cawangan = response.data;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
getSenaraiMohon(pageNumber) {
|
||||
this.axios.get(this.$hostname + '/admin/permohonan/get/admin', {
|
||||
params: {
|
||||
page: pageNumber
|
||||
}
|
||||
}).then(response => {
|
||||
this.showpermohonan = response.data
|
||||
this.paginate = response.data
|
||||
this.currentPage = pageNumber
|
||||
});
|
||||
},
|
||||
namacawangan(cawangannama) {
|
||||
let namcaw = '';
|
||||
if (this.cawangan.length > 0) {
|
||||
this.cawangan.some(function (value, key) {
|
||||
|
||||
if (cawangannama === value.kodcaw) {
|
||||
namcaw = value.details_caw
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return namcaw;
|
||||
},
|
||||
formatterfunction(value) {
|
||||
return formatter.format(value)
|
||||
},
|
||||
checkjenismohon(value) {
|
||||
if (value === 'permohonanwang') {
|
||||
return 'Permohonan Wang'
|
||||
} else {
|
||||
return 'Bayaran Balik'
|
||||
}
|
||||
},
|
||||
async funcbatal(mohonid) {
|
||||
const {
|
||||
value: katalaluan
|
||||
} = await this.$swal({
|
||||
title: 'Masukkan Katalaluan Semula',
|
||||
input: 'password',
|
||||
inputPlaceholder: 'Katalaluan',
|
||||
confirmButtonText: 'Hantar',
|
||||
showCancelButton: true,
|
||||
cancelButtonText: 'Batal',
|
||||
allowOutsideClick: true
|
||||
})
|
||||
|
||||
if (katalaluan !== undefined)
|
||||
await this.axios.get('/mintasemulakelulusan', {
|
||||
params: {
|
||||
passsemula: katalaluan
|
||||
}
|
||||
}).then(response => {
|
||||
|
||||
if (response.data === 1)
|
||||
console.log('true', mohonid, katalaluan)
|
||||
else
|
||||
console.log('false', mohonid, katalaluan)
|
||||
});
|
||||
|
||||
},
|
||||
async funcsetuju(mohonid) {
|
||||
const {
|
||||
value: katalaluan
|
||||
} = await this.$swal({
|
||||
title: 'Masukkan Katalaluan Semula',
|
||||
input: 'password',
|
||||
inputPlaceholder: 'Katalaluan',
|
||||
confirmButtonText: 'Hantar',
|
||||
showCancelButton: true,
|
||||
cancelButtonText: 'Batal',
|
||||
allowOutsideClick: true
|
||||
})
|
||||
|
||||
if (katalaluan !== undefined)
|
||||
await this.axios.get('/mintasemulakelulusan', {
|
||||
params: {
|
||||
passsemula: katalaluan
|
||||
}
|
||||
}).then(response => {
|
||||
|
||||
if (response.data === 1)
|
||||
console.log('true', mohonid, katalaluan)
|
||||
else
|
||||
console.log('false', mohonid, katalaluan)
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
|
||||
@@ -96,6 +96,8 @@ Route::get('/resit/belumtebus/{id}',['as'=>'resit.belumtebus','uses'=>'App\Http\
|
||||
Route::get('/resit/tambahpinjam/{id}',['as'=>'resit.tambahpinjam','uses'=>'App\Http\Controllers\ResitController@resittambahpinjam']);
|
||||
Route::get('/resit/tebusautotawarruq/{id}',['as'=>'resit.autotawarruq','uses'=>'App\Http\Controllers\ResitController@resitautotawarruq']);
|
||||
|
||||
//Katalaluan
|
||||
Route::get('/mintasemulakelulusan','App\Http\Controllers\PermohonanController@MintaKelulusan');
|
||||
|
||||
//Permohonan Wang
|
||||
Route::get('/permohonan',['as'=>'permohonan.index','uses'=>'App\Http\Controllers\PermohonanController@index']);
|
||||
|
||||
Reference in New Issue
Block a user