updated db import, views, and api
This commit is contained in:
27
resources/js/app.js
vendored
27
resources/js/app.js
vendored
@@ -8,18 +8,17 @@ m.mount(document.body.querySelector('.container'), {
|
||||
AccessLog.fetch();
|
||||
},
|
||||
view: () => {
|
||||
console.log(_isEmpty(Siswa.current));
|
||||
return [
|
||||
m('span.italic.text-xs', [
|
||||
'Saat ini sudah ',
|
||||
m('strong', [
|
||||
AccessLog.current.accessed,
|
||||
' / ',
|
||||
AccessLog.current.total,
|
||||
]),
|
||||
' siswa yang telah melihat pengumuman kelulusan.'
|
||||
]),
|
||||
m('.header', [
|
||||
m('span.italic.text-xs', [
|
||||
'Saat ini sudah ',
|
||||
m('strong', [
|
||||
AccessLog.current.accessed,
|
||||
' / ',
|
||||
AccessLog.current.total,
|
||||
]),
|
||||
' siswa yang telah melihat pengumuman kelulusan.'
|
||||
]),
|
||||
m('h1.title', 'Pengumuman Kelulusan SMK Bhakti Anindya'),
|
||||
m('span', 'Silahkan masukkan Nama Lengkap dan NISN kamu di bawah ini.'),
|
||||
]),
|
||||
@@ -36,16 +35,20 @@ m.mount(document.body.querySelector('.container'), {
|
||||
m('.form-group', [
|
||||
m('label.form-label[for=input-nisn]', 'NISN'),
|
||||
m('input.form-input.input-text#input-nisn[name=nisn][type=text][autocomplete=off][required]'),
|
||||
m('p.input-helper', 'Nomor Induk Siswa Nasional.'),
|
||||
m('p.input-helper', !_isEmpty(Siswa.error) && Siswa.error.errors.siswa != undefined ? m('span.error', Siswa.error.errors.siswa + ' ') : 'Nomor Induk Siswa Nasional.'),
|
||||
]),
|
||||
m('.form-group', [
|
||||
m('label.form-label[for=input-tanggalLahir]', 'Tanggal Lahir'),
|
||||
m('input.form-input.input-text#input-tanggalLahir[name=tanggalLahir][type=text][autocomplete=off][required]'),
|
||||
m('p.input-helper', 'Tanggal lahir dengan format YYYYMMDD. Contoh: untuk tanggal 29 Mei 2000 ditulis 20000529'),
|
||||
m('p.input-helper', [
|
||||
!_isEmpty(Siswa.error) && Siswa.error.errors.tanggalLahir != undefined ? m('span.error', Siswa.error.errors.tanggalLahir[0] + ' ') : '',
|
||||
'Tanggal lahir dengan format YYYYMMDD. Contoh: untuk tanggal 29 Mei 2000 ditulis 20000529',
|
||||
]),
|
||||
]),
|
||||
m('button.form-submit[type=submit]', 'Lihat'),
|
||||
])),
|
||||
m(!_isEmpty(Siswa.current) ? '.letter' : '.letter.hidden', [
|
||||
m('span.mobile-info', 'Untuk mencetak surat ini, harap gunakan browser di desktop PC.'),
|
||||
m('button.print-button', {
|
||||
onclick: () => {
|
||||
window.print();
|
||||
|
||||
6
resources/js/models/Siswa.js
vendored
6
resources/js/models/Siswa.js
vendored
@@ -3,7 +3,9 @@ import AccessLog from "./AccessLog"
|
||||
|
||||
var model = {
|
||||
current: {},
|
||||
error: {},
|
||||
cariData: data => {
|
||||
model.current = {};
|
||||
m.request({
|
||||
method: 'post',
|
||||
url: '/api/siswa',
|
||||
@@ -12,7 +14,9 @@ var model = {
|
||||
.then(response => {
|
||||
model.current = response;
|
||||
AccessLog.fetch();
|
||||
console.log(model.current);
|
||||
})
|
||||
.catch(e => {
|
||||
model.error = JSON.parse(e.message);
|
||||
});
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user