diff --git a/app/Http/Controllers/API/v1/Voter/GetController.php b/app/Http/Controllers/API/v1/Voter/GetController.php index 0a95c17..2fdeb18 100644 --- a/app/Http/Controllers/API/v1/Voter/GetController.php +++ b/app/Http/Controllers/API/v1/Voter/GetController.php @@ -11,6 +11,6 @@ class GetController extends Controller { public function __invoke() { - return Voter::where('election_id', Util::getCurrentElection())->paginate(10); + return Voter::where('election_id', Util::getCurrentElection())->paginate(50); } } diff --git a/config/onewaysms.php b/config/onewaysms.php index 5678388..21f8b88 100644 --- a/config/onewaysms.php +++ b/config/onewaysms.php @@ -1,8 +1,8 @@ 'KoPKB : %s is your TAC to log in to your myKoPKB Member account. It will expire in 3 minutes.', - 'minutes' => 3 + 'message' => 'KoPKB : %s is your TAC to log in to your myKoPKB Member account. It will expire in 1 minutes.', + 'minutes' => 1 ]; ?> \ No newline at end of file diff --git a/resources/assets/js/components/demo/admin/home/final.vue b/resources/assets/js/components/demo/admin/home/final.vue index 31d5de1..a6e06d2 100644 --- a/resources/assets/js/components/demo/admin/home/final.vue +++ b/resources/assets/js/components/demo/admin/home/final.vue @@ -1,48 +1,47 @@ \ No newline at end of file diff --git a/resources/assets/js/components/demo/admin/voter/viewkehadiran.vue b/resources/assets/js/components/demo/admin/voter/viewkehadiran.vue new file mode 100644 index 0000000..a8a0ad7 --- /dev/null +++ b/resources/assets/js/components/demo/admin/voter/viewkehadiran.vue @@ -0,0 +1,113 @@ + + + \ No newline at end of file diff --git a/resources/assets/js/components/demo/voter/home/attendance.vue b/resources/assets/js/components/demo/voter/home/attendance.vue index a18d3e2..a7d78b9 100644 --- a/resources/assets/js/components/demo/voter/home/attendance.vue +++ b/resources/assets/js/components/demo/voter/home/attendance.vue @@ -16,7 +16,8 @@
- +
@@ -37,7 +38,8 @@

*Pendaftaran online sehingga jam 10 pagi

-
+
@@ -49,19 +51,24 @@ export default { data: function () { return { - loading: false + loading: false, + userSubmitted: false // Add a flag to track if the user has already submitted } }, methods: { // refreshUser: function () { + // var vm = this; // axios.get(config.API + 'voter/' + this.data.user.id) // .then(response => { // vm.data.user = response.data; + // console.log(response.data) // }) // }, + + edit: function () { if (this.loading) return; this.loading = true; @@ -72,8 +79,10 @@ export default { $.notifyClose(); vm.loading = false; if (vm.util.showResult(response, 'success')) { - vm.refreshUser(); - vm.$router.push({ name: 'Voter Home' }); + // vm.refreshUser(); + location.reload(); + + } }) .catch(error => { diff --git a/resources/assets/js/components/demo/voter/home/index.vue b/resources/assets/js/components/demo/voter/home/index.vue index 013357f..65cd688 100644 --- a/resources/assets/js/components/demo/voter/home/index.vue +++ b/resources/assets/js/components/demo/voter/home/index.vue @@ -1,223 +1,218 @@ + + + diff --git a/resources/assets/js/components/demo/voter/home/vote.vue b/resources/assets/js/components/demo/voter/home/vote.vue index bea47dc..6e4fc1b 100644 --- a/resources/assets/js/components/demo/voter/home/vote.vue +++ b/resources/assets/js/components/demo/voter/home/vote.vue @@ -24,7 +24,7 @@

Pilih Calon


@@ -161,21 +161,25 @@ export default { selected[i]['nominee_id'] = null; } }, - vote: function (position_id, nominee_id) { - if (!this.selected[0]['position_id']) { - this.$set(this.selected[0], position_id, []); - } - const index = this.selected[0]['nominee_id'].indexOf(nominee_id); - if (index === -1) { - // Nominee not found, add it - this.selected[0]['nominee_id'].push(nominee_id); - } else { - // Nominee found, remove it - this.selected[0]['nominee_id'].splice(index, 1); - } - console.log(this.selected[0]) - }, + if (!this.selected[0]['position_id']) { + this.$set(this.selected[0], position_id, []); + } + const index = this.selected[0]['nominee_id'].indexOf(nominee_id); + if (index === -1) { + // Nominee not found, add it + if (this.selected[0]['nominee_id'].length < 2) { + this.selected[0]['nominee_id'].push(nominee_id); + } else { + // Display warning message if more than 2 nominees are selected + this.util.notify('Boleh mengundi (2) calon sahaja!', 'warning'); + } + } else { + // Nominee found, remove it + this.selected[0]['nominee_id'].splice(index, 1); + } + console.log(this.selected[0]) + }, getSelectedNomineeName: function (id) { return this.getNominee(id); diff --git a/resources/assets/js/components/demo/voter/index.vue b/resources/assets/js/components/demo/voter/index.vue index c7de48b..009a013 100644 --- a/resources/assets/js/components/demo/voter/index.vue +++ b/resources/assets/js/components/demo/voter/index.vue @@ -39,7 +39,9 @@ UNDIAN - +