Added page to print sk-hasil-belajar freely
This commit is contained in:
parent
b2f78ed656
commit
193a5d3b6c
43
app/Console/Commands/PendopoPassword.php
Normal file
43
app/Console/Commands/PendopoPassword.php
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
|
use Illuminate\Console\Command;
|
||||||
|
use Carbon\Carbon;
|
||||||
|
|
||||||
|
class PendopoPassword extends Command
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The name and signature of the console command.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $signature = 'pendopo:password';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The console command description.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $description = 'Get the current pendopo password.';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new command instance.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
parent::__construct();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Execute the console command.
|
||||||
|
*
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function handle()
|
||||||
|
{
|
||||||
|
echo substr(md5(Carbon::now()->toDateString().'ba'), 0, 6);
|
||||||
|
}
|
||||||
|
}
|
@ -46,8 +46,7 @@ class SiswaController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
$siswa = Siswa::where('nisn', $request->nisn)
|
$siswa = Siswa::where('nisn', $request->nisn)
|
||||||
->where('tanggal_lahir', $tanggalLahir)
|
->where('tanggal_lahir', $tanggalLahir);
|
||||||
->first();
|
|
||||||
if ($request->with !== null)
|
if ($request->with !== null)
|
||||||
$siswa = $siswa->with($request->with);
|
$siswa = $siswa->with($request->with);
|
||||||
|
|
||||||
|
@ -60,6 +60,7 @@ class Kernel extends HttpKernel
|
|||||||
'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
|
'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
|
||||||
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
|
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
|
||||||
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
|
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
|
||||||
|
'pendopo' => \App\Http\Middleware\IzinMasukPendopo::class,
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
35
app/Http/Middleware/IzinMasukPendopo.php
Normal file
35
app/Http/Middleware/IzinMasukPendopo.php
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Middleware;
|
||||||
|
|
||||||
|
use Closure;
|
||||||
|
use Carbon\Carbon;
|
||||||
|
|
||||||
|
class IzinMasukPendopo
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Handle an incoming request.
|
||||||
|
*
|
||||||
|
* @param \Illuminate\Http\Request $request
|
||||||
|
* @param \Closure $next
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function handle($request, Closure $next)
|
||||||
|
{
|
||||||
|
$AUTH_USER = 'tatausaha';
|
||||||
|
$AUTH_PASS = substr(md5(Carbon::now()->toDateString().'ba'), 0, 6);
|
||||||
|
header('Cache-Control: no-cache, must-revalidate, max-age=0');
|
||||||
|
$has_supplied_credentials = !(empty($_SERVER['PHP_AUTH_USER']) && empty($_SERVER['PHP_AUTH_PW']));
|
||||||
|
$is_not_authenticated = (
|
||||||
|
!$has_supplied_credentials ||
|
||||||
|
$_SERVER['PHP_AUTH_USER'] != $AUTH_USER ||
|
||||||
|
$_SERVER['PHP_AUTH_PW'] != $AUTH_PASS
|
||||||
|
);
|
||||||
|
if ($is_not_authenticated) {
|
||||||
|
header('HTTP/1.1 401 Authorization Required');
|
||||||
|
header('WWW-Authenticate: Basic realm="Access denied"');
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
return $next($request);
|
||||||
|
}
|
||||||
|
}
|
234
public/js/app.js
vendored
234
public/js/app.js
vendored
File diff suppressed because one or more lines are too long
111
resources/js/app.js
vendored
111
resources/js/app.js
vendored
@ -1,65 +1,70 @@
|
|||||||
import m from "mithril"
|
import m from "mithril"
|
||||||
import SuratKelulusan from "./components/SuratKelulusan"
|
import SuratKelulusan from "./components/SuratKelulusan"
|
||||||
import SKHasilBelajar from "./components/SKHasilBelajar"
|
import SKHasilBelajar from "./components/SKHasilBelajar"
|
||||||
|
import Pendopo from "./components/Pendopo"
|
||||||
import Siswa from "./models/Siswa"
|
import Siswa from "./models/Siswa"
|
||||||
import AccessLog from "./models/AccessLog"
|
import AccessLog from "./models/AccessLog"
|
||||||
|
|
||||||
m.route.prefix('#');
|
if (document.body.querySelector('.container#pendopo') === null) {
|
||||||
m.route(document.body.querySelector('.container'), '/', {
|
m.route.prefix('#');
|
||||||
'/': SuratKelulusan,
|
m.route(document.body.querySelector('.container'), '/', {
|
||||||
'/hasil-belajar': SKHasilBelajar,
|
'/': SuratKelulusan,
|
||||||
});
|
'/hasil-belajar': SKHasilBelajar,
|
||||||
|
});
|
||||||
|
|
||||||
// Below is to handle Ctrl+P or MouseR->Print
|
// Below is to handle Ctrl+P or MouseR->Print
|
||||||
window.addEventListener("beforeprint", function () {
|
window.addEventListener("beforeprint", function () {
|
||||||
if (m.route.get() === '/hasil-belajar') {
|
if (m.route.get() === '/hasil-belajar') {
|
||||||
// If the print button did not exists, show nothing when printing
|
// If the print button did not exists, show nothing when printing
|
||||||
if (document.body.querySelector('button.print-button') === null)
|
if (document.body.querySelector('button.print-button') === null)
|
||||||
document.body.style.display = 'none';
|
document.body.style.display = 'none';
|
||||||
else {
|
else {
|
||||||
if (!component.confirmPrint) {
|
if (!component.confirmPrint) {
|
||||||
alert('Surat Keterangan ini hanya dapat dicetak satu kali. Lanjutkan?');
|
alert('Surat Keterangan ini hanya dapat dicetak satu kali. Lanjutkan?');
|
||||||
component.confirmPrint = 1;
|
component.confirmPrint = 1;
|
||||||
AccessLog.create({siswaId: Siswa.current.id, src: 'sk-hasil-belajar'}).then(() => {
|
AccessLog.create({siswaId: Siswa.current.id, src: 'sk-hasil-belajar'}).then(() => {
|
||||||
AccessLog.fetch('sk-hasil-belajar');
|
AccessLog.fetch('sk-hasil-belajar');
|
||||||
})
|
})
|
||||||
.catch(e => {
|
.catch(e => {
|
||||||
if (e.code === 0) {
|
if (e.code === 0) {
|
||||||
AccessLog.error = {
|
AccessLog.error = {
|
||||||
message: e.message,
|
message: e.message,
|
||||||
errors: {
|
errors: {
|
||||||
create: ['Terjadi kesalahan saat menghubungkan ke server.'],
|
create: ['Terjadi kesalahan saat menghubungkan ke server.'],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
AccessLog.error = JSON.parse(e.message);
|
AccessLog.error = JSON.parse(e.message);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
|
||||||
|
|
||||||
window.addEventListener("afterprint", function () {
|
window.addEventListener("afterprint", function () {
|
||||||
if (m.route.get() === '/hasil-belajar') {
|
if (m.route.get() === '/hasil-belajar') {
|
||||||
// Give back the whole document.body
|
// Give back the whole document.body
|
||||||
if (document.body.querySelector('button.print-button') === null)
|
if (document.body.querySelector('button.print-button') === null)
|
||||||
document.body.style.display = 'block';
|
document.body.style.display = 'block';
|
||||||
|
|
||||||
// Hide the print button
|
// Hide the print button
|
||||||
if (document.body.querySelector('button.print-button') !== null)
|
if (document.body.querySelector('button.print-button') !== null)
|
||||||
document.body.querySelector('button.print-button').style.display = 'none';
|
document.body.querySelector('button.print-button').style.display = 'none';
|
||||||
|
|
||||||
// To redraw the content to prevent printing
|
|
||||||
let nisn = document.body.querySelector('input[name=nisn]').value,
|
|
||||||
tanggalLahir = document.body.querySelector('input[name=tanggalLahir]').value;
|
|
||||||
Siswa.cariData({
|
|
||||||
nisn,
|
|
||||||
tanggalLahir,
|
|
||||||
src: 'sk-hasil-belajar',
|
|
||||||
with: ['hasilBelajar', 'accessLog'],
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
// To redraw the content to prevent printing
|
||||||
|
let nisn = document.body.querySelector('input[name=nisn]').value,
|
||||||
|
tanggalLahir = document.body.querySelector('input[name=tanggalLahir]').value;
|
||||||
|
Siswa.cariData({
|
||||||
|
nisn,
|
||||||
|
tanggalLahir,
|
||||||
|
src: 'sk-hasil-belajar',
|
||||||
|
with: ['hasilBelajar', 'accessLog'],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
m.mount(document.body.querySelector('.container#pendopo'), Pendopo);
|
||||||
|
}
|
||||||
|
318
resources/js/components/Pendopo.js
vendored
Normal file
318
resources/js/components/Pendopo.js
vendored
Normal file
@ -0,0 +1,318 @@
|
|||||||
|
import m from "mithril"
|
||||||
|
import _isEmpty from "lodash.isempty"
|
||||||
|
import _map from "lodash.map"
|
||||||
|
import Siswa from "../models/Siswa"
|
||||||
|
|
||||||
|
var component = {
|
||||||
|
oninit: () => {
|
||||||
|
document.title = 'Surat Keterangan Hasil Belajar Siswa - SMK Bhakti Anindya';
|
||||||
|
Siswa.current = {};
|
||||||
|
},
|
||||||
|
namaMapel: {
|
||||||
|
'agama': 'Pendidikan Agama',
|
||||||
|
'pkn': 'Pendidikan Kewarganegaraan',
|
||||||
|
'indo': 'Bahasa Indonesia',
|
||||||
|
'penjas': 'Pendidikan Jasmani dan Kesehatan',
|
||||||
|
'senbud': 'Seni Budaya',
|
||||||
|
'mtk': 'Matematika',
|
||||||
|
'inggris': 'Bahasa Inggris',
|
||||||
|
'ipa': 'Ilmu Pengetahuan Alam',
|
||||||
|
'ips': 'Ilmu Pengetahuan Sosial',
|
||||||
|
'fisika': 'Fisika',
|
||||||
|
'kimia': 'Kimia',
|
||||||
|
'kwh': 'Kewirausahaan',
|
||||||
|
'kkpi': 'Keterampilan Komputer dan Pengelolaan Informasi',
|
||||||
|
'dkk': 'Dasar Kompetensi Keahlian',
|
||||||
|
'kk': 'Kompetensi Keahlian',
|
||||||
|
'mandarin': 'Bahasa Mandarin',
|
||||||
|
'kbi': 'Korespondensi Bahasa Inggris',
|
||||||
|
'pap': 'Praktek Administrasi Perkantoran',
|
||||||
|
'myob': 'MYOB',
|
||||||
|
},
|
||||||
|
rataRata: {
|
||||||
|
raport: [],
|
||||||
|
usbn: [],
|
||||||
|
unbk: [],
|
||||||
|
},
|
||||||
|
view: () => {
|
||||||
|
component.rataRata = {
|
||||||
|
raport: [],
|
||||||
|
usbn: [],
|
||||||
|
unbk: [],
|
||||||
|
};
|
||||||
|
return [
|
||||||
|
m('.header', [
|
||||||
|
m('h1.title', 'Surat Keterangan Hasil Belajar Siswa SMK Bhakti Anindya'),
|
||||||
|
m('span', 'Silahkan masukkan Nama Lengkap dan NISN kamu di bawah ini.'),
|
||||||
|
]),
|
||||||
|
m('form.form', {
|
||||||
|
onsubmit: e => {
|
||||||
|
e.preventDefault();
|
||||||
|
Siswa.cariData({
|
||||||
|
nisn: e.target.elements.nisn.value,
|
||||||
|
tanggalLahir: e.target.elements.tanggalLahir.value,
|
||||||
|
src: 'sk-hasil-belajar',
|
||||||
|
with: 'hasilBelajar',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
m('.form-grid', [
|
||||||
|
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. ',
|
||||||
|
!_isEmpty(Siswa.error) ?
|
||||||
|
Siswa.error.errors.siswa != undefined ? m('span.error', Siswa.error.errors.siswa[0] + ' ')
|
||||||
|
: Siswa.error.errors.nisn != undefined ? m('span.error', Siswa.error.errors.nisn[0] + ' ')
|
||||||
|
: '' : '',
|
||||||
|
]),
|
||||||
|
]),
|
||||||
|
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. ',
|
||||||
|
!_isEmpty(Siswa.error) && Siswa.error.errors.tanggalLahir != undefined ? m('span.error', Siswa.error.errors.tanggalLahir[0] + ' ') : '',
|
||||||
|
]),
|
||||||
|
]),
|
||||||
|
m('button.form-submit#input-submit[type=submit]', 'Lihat'),
|
||||||
|
])),
|
||||||
|
_isEmpty(Siswa.current) ? null : m('.letter', [
|
||||||
|
m('span.mobile-info', 'Untuk mencetak surat ini, harap gunakan browser di desktop PC.'),
|
||||||
|
!_isEmpty(Siswa.current.access_log) ? null
|
||||||
|
: m('button.print-button', {
|
||||||
|
onclick: () => {
|
||||||
|
window.print();
|
||||||
|
}
|
||||||
|
}, [
|
||||||
|
m.trust('⎙'),
|
||||||
|
' Print',
|
||||||
|
]),
|
||||||
|
m('.letter__header', [
|
||||||
|
m('img[src=img/letter-head.jpg]'),
|
||||||
|
]),
|
||||||
|
m('', {
|
||||||
|
style: {
|
||||||
|
height: '1px',
|
||||||
|
width: '100%',
|
||||||
|
backgroundColor: '#000',
|
||||||
|
marginTop: '.5rem',
|
||||||
|
}}),
|
||||||
|
m('', {
|
||||||
|
style: {
|
||||||
|
height: '3px',
|
||||||
|
width: '100%',
|
||||||
|
}}),
|
||||||
|
m('', {
|
||||||
|
style: {
|
||||||
|
height: '3px',
|
||||||
|
width: '100%',
|
||||||
|
backgroundColor: '#000',
|
||||||
|
marginBottom: '1rem',
|
||||||
|
}}),
|
||||||
|
m('.letter__body', [
|
||||||
|
m('strong.letter__body-header', [
|
||||||
|
m('p', m('span.border-b.border-black', 'SURAT KETERANGAN')),
|
||||||
|
m('p.font-normal.mt-1', 'Nomor: 077/SMK-BA/V/2019'),
|
||||||
|
]),
|
||||||
|
m('br'),
|
||||||
|
m('table', [
|
||||||
|
m('tr',
|
||||||
|
m('td[colspan=6]', 'Yang bertanda tangan di bawah ini :')),
|
||||||
|
m('tr', [
|
||||||
|
m('td'),
|
||||||
|
m('td', 'Nama'),
|
||||||
|
m('td', ':'),
|
||||||
|
m('td[colspan=3]', 'Drs. Engkos Kosasih, M.M.'),
|
||||||
|
]),
|
||||||
|
m('tr', [
|
||||||
|
m('td'),
|
||||||
|
m('td', 'Jabatan'),
|
||||||
|
m('td', ':'),
|
||||||
|
m('td[colspan=3]', 'Kepala Sekolah'),
|
||||||
|
]),
|
||||||
|
m('tr', [
|
||||||
|
m('td'),
|
||||||
|
m('td', 'Asal Sekolah'),
|
||||||
|
m('td', ':'),
|
||||||
|
m('td[colspan=3]', 'SMK Bhakti Anindya'),
|
||||||
|
]),
|
||||||
|
m('tr',
|
||||||
|
m('td',
|
||||||
|
m.trust(' '))),
|
||||||
|
m('tr',
|
||||||
|
m('td[colspan=6]', 'Menerangkan bahwa')),
|
||||||
|
m('tr',
|
||||||
|
m('td',
|
||||||
|
m.trust(' '))),
|
||||||
|
m('tr', [
|
||||||
|
m('td'),
|
||||||
|
m('td', 'Nama'),
|
||||||
|
m('td', ':'),
|
||||||
|
m('td[colspan=3]', Siswa.current.nama),
|
||||||
|
]),
|
||||||
|
m('tr', [
|
||||||
|
m('td'),
|
||||||
|
m('td', 'Tempat / Tanggal Lahir'),
|
||||||
|
m('td', ':'),
|
||||||
|
m('td', Siswa.current.tempat_lahir + ' , ' + Siswa.current.tanggal_lahir),
|
||||||
|
]),
|
||||||
|
m('tr', [
|
||||||
|
m('td'),
|
||||||
|
m('td', 'NIS / NISN'),
|
||||||
|
m('td', ':'),
|
||||||
|
m('td', Siswa.current.nis + ' / ' + Siswa.current.nisn),
|
||||||
|
]),
|
||||||
|
m('tr', [
|
||||||
|
m('td'),
|
||||||
|
m('td', 'Nomor Peserta'),
|
||||||
|
m('td', ':'),
|
||||||
|
m('td[colspan=3]', Siswa.current.nopes),
|
||||||
|
]),
|
||||||
|
m('tr', [
|
||||||
|
m('td'),
|
||||||
|
m('td', 'Kelas'),
|
||||||
|
m('td', ':'),
|
||||||
|
m('td[colspan=3]', Siswa.current.kelas),
|
||||||
|
]),
|
||||||
|
m('tr', [
|
||||||
|
m('td'),
|
||||||
|
m('td', 'Bidang Studi Keahlian'),
|
||||||
|
m('td', ':'),
|
||||||
|
m('td[colspan=3]', Siswa.current.bsk),
|
||||||
|
]),
|
||||||
|
m('tr', [
|
||||||
|
m('td'),
|
||||||
|
m('td', 'Program Studi Keahlian'),
|
||||||
|
m('td', ':'),
|
||||||
|
m('td[colspan=3]', Siswa.current.psk),
|
||||||
|
]),
|
||||||
|
m('tr', [
|
||||||
|
m('td'),
|
||||||
|
m('td', 'Kompetensi Keahlian'),
|
||||||
|
m('td', ':'),
|
||||||
|
m('td[colspan=3]', Siswa.current.kk),
|
||||||
|
]),
|
||||||
|
m('tr',
|
||||||
|
m('td',
|
||||||
|
m.trust(' '))),
|
||||||
|
m('tr',
|
||||||
|
m('td[colspan=6]', 'Adalah benar siswa SMK Bhakti Anindya, Kota Tangerang dan pada tanggal 13 Mei 2019 telah dinyatakan lulus')),
|
||||||
|
m('tr',
|
||||||
|
m('td[colspan=6]', 'Berikut hasil belajar siswa tersebut :')),
|
||||||
|
m('tr',
|
||||||
|
m('td',
|
||||||
|
m.trust(' '))),
|
||||||
|
m('tr',
|
||||||
|
m('td[colspan=6]',
|
||||||
|
m('table.nilai', [
|
||||||
|
m('tr', [
|
||||||
|
m('th', { style: { width: '5%' } }, 'No.'),
|
||||||
|
m('th[colspan=2]', 'Mata Pelajaran'),
|
||||||
|
m('th.long.md:w-1/5', 'Rata-rata Raport Semester 1-6'),
|
||||||
|
m('th.short.md:w-1/5', 'Raport'),
|
||||||
|
m('th.long.md:w-1/5', 'Ujian Sekolah Berstandar Nasional'),
|
||||||
|
m('th.short.md:w-1/5', 'USBN'),
|
||||||
|
m('th.long.md:w-1/5', 'Ujian Nasional Berbasis Komputer'),
|
||||||
|
m('th.short.md:w-1/5', 'UNBK'),
|
||||||
|
]),
|
||||||
|
m('tr', [
|
||||||
|
m('th', 'A.'),
|
||||||
|
m('th[colspan=5].text-left', 'Normatif'),
|
||||||
|
]),
|
||||||
|
m('tbody.counter',
|
||||||
|
_map(Siswa.current.hasil_belajar.meta.normatif, (nilai, mapel) => {
|
||||||
|
if (nilai.raport != 0) component.rataRata.raport.push(nilai.raport);
|
||||||
|
if (nilai.usbn != 0) component.rataRata.usbn.push(nilai.usbn);
|
||||||
|
if (nilai.unbk != 0) component.rataRata.unbk.push(nilai.unbk);
|
||||||
|
return nilai.raport == 0 && nilai.usbn == 0 && nilai.unbk == 0 ? null : m('tr', [
|
||||||
|
m('td.text-right'),
|
||||||
|
m('td[colspan=2]', component.namaMapel[mapel]),
|
||||||
|
m('td.text-center', nilai.raport !== 0 ? nilai.raport.toFixed(2) : null),
|
||||||
|
m('td.text-center', nilai.usbn !== 0 ? nilai.usbn.toFixed(2) : null),
|
||||||
|
m('td.text-center', nilai.unbk !== 0 ? nilai.unbk.toFixed(2) : null),
|
||||||
|
]);
|
||||||
|
})),
|
||||||
|
m('tr', [
|
||||||
|
m('th', 'B.'),
|
||||||
|
m('th[colspan=5].text-left', 'Adaptif'),
|
||||||
|
]),
|
||||||
|
m('tbody.counter',
|
||||||
|
_map(Siswa.current.hasil_belajar.meta.adaptif, (nilai, mapel) => {
|
||||||
|
if (nilai.raport != 0) component.rataRata.raport.push(nilai.raport);
|
||||||
|
if (nilai.usbn != 0) component.rataRata.usbn.push(nilai.usbn);
|
||||||
|
if (nilai.unbk != 0) component.rataRata.unbk.push(nilai.unbk);
|
||||||
|
return nilai.raport == 0 && nilai.usbn == 0 && nilai.unbk == 0 ? null : m('tr', [
|
||||||
|
m('td.text-right'),
|
||||||
|
m('td[colspan=2]', component.namaMapel[mapel]),
|
||||||
|
m('td.text-center', nilai.raport !== 0 ? nilai.raport.toFixed(2) : null),
|
||||||
|
m('td.text-center', nilai.usbn !== 0 ? nilai.usbn.toFixed(2) : null),
|
||||||
|
m('td.text-center', nilai.unbk !== 0 ? nilai.unbk.toFixed(2) : null),
|
||||||
|
]);
|
||||||
|
}),
|
||||||
|
m('tr', [
|
||||||
|
m('th', 'C.'),
|
||||||
|
m('th[colspan=5].text-left', 'Produktif'),
|
||||||
|
])),
|
||||||
|
m('tbody.counter',
|
||||||
|
_map(Siswa.current.hasil_belajar.meta.produktif, (nilai, mapel) => {
|
||||||
|
if (nilai.raport != 0) component.rataRata.raport.push(nilai.raport);
|
||||||
|
if (nilai.usbn != 0) component.rataRata.usbn.push(nilai.usbn);
|
||||||
|
if (nilai.unbk != 0) component.rataRata.unbk.push(nilai.unbk);
|
||||||
|
return nilai.raport == 0 && nilai.usbn == 0 && nilai.unbk == 0 ? null : m('tr', [
|
||||||
|
m('td.text-right'),
|
||||||
|
m('td[colspan=2]', component.namaMapel[mapel]),
|
||||||
|
m('td.text-center', nilai.raport !== 0 ? nilai.raport.toFixed(2) : null),
|
||||||
|
m('td.text-center', nilai.usbn !== 0 ? nilai.usbn.toFixed(2) : null),
|
||||||
|
m('td.text-center', nilai.unbk !== 0 ? nilai.unbk.toFixed(2) : null),
|
||||||
|
]);
|
||||||
|
})),
|
||||||
|
m('tr', [
|
||||||
|
m('th', 'D.'),
|
||||||
|
m('th[colspan=5].text-left', 'Mulok'),
|
||||||
|
]),
|
||||||
|
m('tbody.counter',
|
||||||
|
_map(Siswa.current.hasil_belajar.meta.mulok, (nilai, mapel) => {
|
||||||
|
if (nilai.raport != 0) component.rataRata.raport.push(nilai.raport);
|
||||||
|
if (nilai.usbn != 0) component.rataRata.usbn.push(nilai.usbn);
|
||||||
|
if (nilai.unbk != 0) component.rataRata.unbk.push(nilai.unbk);
|
||||||
|
return nilai.raport == 0 && nilai.usbn == 0 && nilai.unbk == 0 ? null : m('tr', [
|
||||||
|
m('td.text-right'),
|
||||||
|
m('td[colspan=2]', component.namaMapel[mapel]),
|
||||||
|
m('td.text-center', nilai.raport !== 0 ? nilai.raport.toFixed(2) : null),
|
||||||
|
m('td.text-center', nilai.usbn !== 0 ? nilai.usbn.toFixed(2) : null),
|
||||||
|
m('td.text-center', nilai.unbk !== 0 ? nilai.unbk.toFixed(2) : null),
|
||||||
|
]);
|
||||||
|
})),
|
||||||
|
m('tr', [
|
||||||
|
m('th[colspan=3]', 'Rata-rata'),
|
||||||
|
m('td.text-center', (component.rataRata.raport.reduce((total, num) => total + num) / component.rataRata.raport.length).toFixed(2)),
|
||||||
|
m('td.text-center', (component.rataRata.usbn.reduce((total, num) => total + num) / component.rataRata.usbn.length).toFixed(2)),
|
||||||
|
m('td.text-center', (component.rataRata.unbk.reduce((total, num) => total + num) / component.rataRata.unbk.length).toFixed(2)),
|
||||||
|
]),
|
||||||
|
]))),
|
||||||
|
m('tr',
|
||||||
|
m('td',
|
||||||
|
m.trust(' '))),
|
||||||
|
m('tr',
|
||||||
|
m('td[colspan=6]', 'Demikian Surat Keterangan ini dibuat untuk siswa yang bersangkutan melanjutkan ke jenjang yang lebih tinggi.')),
|
||||||
|
]),
|
||||||
|
m('table.signature', [
|
||||||
|
m('tr',
|
||||||
|
m('td', 'Tangerang, 13 Mei 2019')),
|
||||||
|
m('tr',
|
||||||
|
m('td', 'Kepala Sekolah,')),
|
||||||
|
m('tr',
|
||||||
|
m('td',
|
||||||
|
m('.letter__sign', { style: { height: '3rem' } }))),
|
||||||
|
m('tr',
|
||||||
|
m('td', 'Drs. Engkos Kosasih, M.M.')),
|
||||||
|
]),
|
||||||
|
]),
|
||||||
|
]),
|
||||||
|
];
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default component;
|
2
resources/js/components/SKHasilBelajar.js
vendored
2
resources/js/components/SKHasilBelajar.js
vendored
@ -7,7 +7,7 @@ import AccessLog from "../models/AccessLog"
|
|||||||
var component = {
|
var component = {
|
||||||
oninit: () => {
|
oninit: () => {
|
||||||
document.title = 'Surat Keterangan Hasil Belajar Siswa - SMK Bhakti Anindya';
|
document.title = 'Surat Keterangan Hasil Belajar Siswa - SMK Bhakti Anindya';
|
||||||
Siswa.current = {},
|
Siswa.current = {};
|
||||||
AccessLog.fetch('sk-hasil-belajar');
|
AccessLog.fetch('sk-hasil-belajar');
|
||||||
},
|
},
|
||||||
namaMapel: {
|
namaMapel: {
|
||||||
|
@ -10,12 +10,12 @@
|
|||||||
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro" rel="stylesheet">
|
||||||
|
|
||||||
<!-- Styles -->
|
<!-- Styles -->
|
||||||
<link rel="stylesheet" href="css/main.css">
|
<link rel="stylesheet" href="{{ asset('css/main.css') }}">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="js/app.js"></script>
|
<script src="{{ asset('js/app.js') }}"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
21
resources/views/pendopo.blade.php
Normal file
21
resources/views/pendopo.blade.php
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
|
||||||
|
<title>Pendopo</title>
|
||||||
|
|
||||||
|
<!-- Fonts -->
|
||||||
|
<link href="https://fonts.googleapis.com/css?family=Nunito:200,600" rel="stylesheet">
|
||||||
|
|
||||||
|
<!-- Style -->
|
||||||
|
<link href="{{ asset('css/main.css') }}" rel="stylesheet">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="pendopo" class="container">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script src="{{ asset('js/app.js') }}"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -14,3 +14,7 @@
|
|||||||
Route::get('/', function () {
|
Route::get('/', function () {
|
||||||
return view('main');
|
return view('main');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Route::get('/pendopo', function () {
|
||||||
|
return view('pendopo');
|
||||||
|
})->middleware('pendopo');
|
||||||
|
Loading…
Reference in New Issue
Block a user