Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
sibiling
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Syaifur
sibiling
Commits
0cfe942f
Commit
0cfe942f
authored
Oct 23, 2024
by
syaifurplus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
konferensi re-added
parent
c4caaefb
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
553 additions
and
0 deletions
+553
-0
KonferensiBeritaAcaraController.php
...in/Layanan/Konferensi/KonferensiBeritaAcaraController.php
+239
-0
KonferensiKegiatanController.php
...Admin/Layanan/Konferensi/KonferensiKegiatanController.php
+180
-0
KonferensiRPLController.php
...lers/Admin/Layanan/Konferensi/KonferensiRPLController.php
+134
-0
No files found.
app/Http/Controllers/Admin/Layanan/Konferensi/KonferensiBeritaAcaraController.php
0 → 100644
View file @
0cfe942f
<?php
namespace
App\Http\Controllers\Admin\Layanan\Konferensi
;
use
App\Http\Controllers\Controller
;
use
Illuminate\Http\Request
;
use
App\Models\Master\PeriodeModel
;
use
App\Models\Perpus\SekolahModel
;
use
App\Models\Perpus\KelasModel
;
use
App\Models\Perpus\KelasKodeModel
;
use
App\Models\Perpus\JurusanModel
;
use
App\Models\Stakeholder\KepsekModel
;
use
App\Models\Stakeholder\GuruModel
;
use
App\Models\Stakeholder\WakaKesiswaanModel
;
use
App\Models\Stakeholder\SekolahWaliModel
;
use
App\Models\Stakeholder\KonselorModel
;
use
App\Models\Siswa\SiswaModel
;
use
App\Models\Layanan\Konferensi\KonKegiatanModel
;
use
App\Models\Layanan\Konferensi\KonRPLModel
;
use
App\Models\Layanan\Konferensi\KonBeritaAcaraModel
;
use
PhpOffice\PhpWord\TemplateProcessor
;
class
KonferensiBeritaAcaraController
extends
Controller
{
private
$views
=
'admin/layanan/konferensi/konferensi_beritaAcara'
;
private
$url
=
'admin/layanan/lainnya/konferensi/berita-acara'
;
private
$url2
=
'admin/layanan/lainnya/konferensi/kegiatan'
;
private
$title
=
'Halaman Konferensi Berita Acara'
;
public
function
__construct
()
{
createLogActivity
();
$this
->
mPeriode
=
new
PeriodeModel
();
$this
->
mPerpusSekolah
=
new
SekolahModel
();
$this
->
mPerpusKelas
=
new
KelasModel
();
$this
->
mPerpusJurusan
=
new
JurusanModel
();
$this
->
mPerpusKelasKode
=
new
KelasKodeModel
();
$this
->
mGuru
=
new
GuruModel
();
$this
->
mWakaKesiswaan
=
new
WakaKesiswaanModel
();
$this
->
mWali
=
new
SekolahWaliModel
();
$this
->
mKonselor
=
new
KonselorModel
();
$this
->
mKepsek
=
new
KepsekModel
();
$this
->
mSiswa
=
new
SiswaModel
();
$this
->
mKonKegiatan
=
new
KonKegiatanModel
();
$this
->
mKonBeritaAcara
=
new
KonBeritaAcaraModel
();
$this
->
mKonRPL
=
new
KonRPLModel
();
}
public
function
create
(
$id
)
{
$kegiatan
=
$this
->
mKonKegiatan
->
where
(
'kode_unik'
,
$id
)
->
first
();
$wherehehe
=
[
'idPSekolah'
=>
session
()
->
get
(
'idPSekolah'
),
'status'
=>
1
];
$kepsek
=
$this
->
mKepsek
->
where
(
$wherehehe
)
->
first
();
$kesiswaan
=
$this
->
mWakaKesiswaan
->
where
(
$wherehehe
)
->
first
();
$konselor
=
$this
->
mKonselor
->
where
(
$wherehehe
)
->
get
();
$konrpl
=
$this
->
mKonRPL
->
where
(
'idLKKegiatan'
,
$kegiatan
[
'id'
])
->
first
();
$data
=
[
'title'
=>
$this
->
title
,
'url'
=>
$this
->
url
,
'page'
=>
'Tambah Data Konferensi Berita Acara'
,
'id'
=>
$id
,
'konselor'
=>
$konselor
,
'kepsek'
=>
$kepsek
,
'kegiatan'
=>
$kegiatan
,
'kesiswaan'
=>
$kesiswaan
,
'konrpl'
=>
$konrpl
,
];
return
view
(
$this
->
views
.
"/create"
,
$data
);
}
public
function
store
(
Request
$request
,
$id
)
{
$kegiatan
=
$this
->
mKonKegiatan
->
where
(
'kode_unik'
,
$id
)
->
first
();
$siswa
=
$this
->
mSiswa
->
where
(
'id'
,
$kegiatan
[
'idSiswa'
])
->
first
();
$whereKons
=
[
'id'
=>
$siswa
[
'idSKonselor'
],
'status'
=>
1
,
];
$konselor
=
$this
->
mKonselor
->
where
(
$whereKons
)
->
first
();
if
(
!
isset
(
$konselor
)){
return
redirect
(
"
$this->url
"
)
->
with
(
'gagal'
,
'Guru Konseling belum di set atau tidak aktif'
);
};
$wherehehe
=
[
'status'
=>
1
,
'idPKKode'
=>
$siswa
[
'idPKKode'
]
];
$wali
=
$this
->
mWali
->
where
(
$wherehehe
)
->
first
();
if
(
!
isset
(
$wali
)){
return
redirect
(
"
$this->url
"
)
->
with
(
'gagal'
,
'Wali belum di set'
);
};
$wherehehehe
=
[
'idPSekolah'
=>
session
()
->
get
(
'idPSekolah'
),
'status'
=>
1
];
$kepsek
=
$this
->
mKepsek
->
where
(
$wherehehehe
)
->
first
();
if
(
!
isset
(
$kepsek
)){
return
redirect
(
"
$this->url
"
)
->
with
(
'gagal'
,
'Kepsek belum di set'
);
};
$kesiswaan
=
$this
->
mWakaKesiswaan
->
where
(
$wherehehehe
)
->
first
();
if
(
!
isset
(
$kesiswaan
)){
return
redirect
(
"
$this->url
"
)
->
with
(
'gagal'
,
'Kesiswaan belum di set'
);
};
$isianTanggal
=
$request
->
isian_tanggal
;
$isianTanggalnew
=
date
(
"d"
,
strtotime
(
$isianTanggal
));
$isianBulan
=
$request
->
isian_tanggal
;
$isianBulannew
=
date
(
"m"
,
strtotime
(
$isianBulan
));
$isianTahun
=
$request
->
isian_tanggal
;
$isianTahunnew
=
date
(
"Y"
,
strtotime
(
$isianTahun
));
$dataBeritaAcara
=
[
'idLKKegiatan'
=>
$kegiatan
[
'id'
],
'idSWali'
=>
$wali
[
'id'
],
'idSKepsek'
=>
$kepsek
[
'id'
],
'idSKonselor'
=>
$konselor
[
'id'
],
'idSKesiswaan'
=>
$kesiswaan
[
'id'
],
'isian_hari'
=>
$request
->
isian_hari
,
'isian_tanggal'
=>
$isianTanggalnew
,
'isian_bulan'
=>
$isianBulannew
,
'isian_tahun'
=>
$isianTahunnew
,
'isian_dilaksanakan'
=>
$request
->
isian_dilaksanakan
,
'isian_pukuld'
=>
$request
->
isian_pukuld
,
'isian_pukuls'
=>
$request
->
isian_pukuls
,
'isian_ruang'
=>
$request
->
isian_ruang
,
'arrayPihak'
=>
$request
->
arrayPihak
,
'isian_kasus'
=>
$request
->
isian_kasus
,
'isian_catatan'
=>
$request
->
isian_catatan
,
'isian_solusi'
=>
$request
->
isian_solusi
,
];
$this
->
mKonBeritaAcara
->
create
(
$dataBeritaAcara
);
$dataStatus
=
[
'status'
=>
2
// update semua statusya jadi 0
];
$this
->
mKonKegiatan
->
where
(
'kode_unik'
,
$id
)
->
update
(
$dataStatus
);
return
redirect
(
"
$this->url2
"
)
->
with
(
'sukses'
,
'Data Konferensi Berita Acara berhasil di tambahkan'
);
}
public
function
show
(
$id
)
{
// Get Data
$konberitaacara
=
$this
->
mKonBeritaAcara
->
where
(
'id'
,
$id
)
->
first
();
$data
=
[
'title'
=>
$this
->
title
,
'url'
=>
$this
->
url
,
'url2'
=>
$this
->
url2
,
'page'
=>
'Data Konferensi Berita Acara'
,
'konberitaacara'
=>
$konberitaacara
,
];
return
view
(
$this
->
views
.
"/show"
,
$data
);
}
public
function
download
(
request
$request
)
{
$sekolah
=
$this
->
mPerpusSekolah
->
where
(
'id'
,
session
()
->
get
(
'idPSekolah'
))
->
first
();
$konberitaacara
=
$this
->
mKonBeritaAcara
->
where
(
'id'
,
$request
->
id
)
->
first
();
// dd($mundur);
$datakonberitaacara
=
[
'KopSurat'
=>
$sekolah
->
logo
,
'isian_hari'
=>
$konberitaacara
->
isian_hari
,
'isian_tanggal'
=>
$konberitaacara
->
isian_tanggal
,
'isian_bulan'
=>
$konberitaacara
->
isian_bulan
,
'isian_tahun'
=>
$konberitaacara
->
isian_tahun
,
'isian_dilaksanakan'
=>
$konberitaacara
->
isian_dilaksanakan
,
'isian_pukuld'
=>
$konberitaacara
->
isian_pukuld
,
'isian_pukuls'
=>
$konberitaacara
->
isian_pukuls
,
'isian_ruang'
=>
$konberitaacara
->
isian_ruang
,
'idSiswa'
=>
$konberitaacara
->
konkegiatan
->
siswa
->
nama
,
'nisn'
=>
$konberitaacara
->
konkegiatan
->
siswa
->
nisn
,
'idPKKode'
=>
$konberitaacara
->
konkegiatan
->
kelaskode
->
kelas
->
nama
.
' '
.
$konberitaacara
->
konkegiatan
->
kelaskode
->
kelas
->
jurusan
->
nama
.
' '
.
$konberitaacara
->
konkegiatan
->
kelaskode
->
nama
,
'arrayPihak'
=>
$konberitaacara
->
arrayPihak
,
'isian_kasus'
=>
$konberitaacara
->
isian_kasus
,
'isian_catatan'
=>
$konberitaacara
->
isian_catatan
,
'isian_solusi'
=>
$konberitaacara
->
isian_solusi
,
'namaKonselor'
=>
$konberitaacara
->
konselor
->
guru
->
nama
??
'Guru Konseling belum di SET'
,
'nipKonselor'
=>
$konberitaacara
->
konselor
->
guru
->
nip
??
'Guru Konseling belum di SET'
,
'namaKepsek'
=>
$konberitaacara
->
kepsek
->
guru
->
nama
??
'Kepsek belum di SET'
,
'nipKepsek'
=>
$konberitaacara
->
kepsek
->
guru
->
nip
??
'Kepsek belum di SET'
,
'namaWakaKesiswaan'
=>
$konberitaacara
->
kesiswaan
->
guru
->
nama
??
'Kesiswaan belum di SET'
,
'nipWakaKesiswaan'
=>
$konberitaacara
->
kesiswaan
->
guru
->
nip
??
'Kesiswaan belum di SET'
,
'namaWali'
=>
$konberitaacara
->
wali
->
guru
->
nama
??
'Wali belum di SET'
,
'nipWali'
=>
$konberitaacara
->
wali
->
guru
->
nip
??
'Wali belum di SET'
,
];
// pakai dari sini. sambil buka word coba.docx
$templateProcessor
=
new
TemplateProcessor
(
'word-template/konferensi_kasus/konferensikasus_beritaacara.docx'
);
// load template word
$templateProcessor
->
setImageValue
(
'KopSurat'
,
array
(
'path'
=>
"upload/logo_sekolah/"
.
$datakonberitaacara
[
'KopSurat'
],
'width'
=>
400
,
'height'
=>
200
,
'ratio'
=>
true
));
$templateProcessor
->
setValue
(
'isian_hari'
,
$datakonberitaacara
[
'isian_hari'
]);
$templateProcessor
->
setValue
(
'isian_tanggal'
,
$datakonberitaacara
[
'isian_tanggal'
]);
$templateProcessor
->
setValue
(
'isian_bulan'
,
$datakonberitaacara
[
'isian_bulan'
]);
$templateProcessor
->
setValue
(
'isian_tahun'
,
$datakonberitaacara
[
'isian_tahun'
]);
$templateProcessor
->
setValue
(
'isian_dilaksanakan'
,
$datakonberitaacara
[
'isian_dilaksanakan'
]);
$templateProcessor
->
setValue
(
'isian_pukuld'
,
$datakonberitaacara
[
'isian_pukuld'
]);
$templateProcessor
->
setValue
(
'isian_pukuls'
,
$datakonberitaacara
[
'isian_pukuls'
]);
$templateProcessor
->
setValue
(
'isian_ruang'
,
$datakonberitaacara
[
'isian_ruang'
]);
$templateProcessor
->
setValue
(
'idSiswa'
,
$datakonberitaacara
[
'idSiswa'
]);
$templateProcessor
->
setValue
(
'nisn'
,
$datakonberitaacara
[
'nisn'
]);
$templateProcessor
->
setValue
(
'idPKKode'
,
$datakonberitaacara
[
'idPKKode'
]);
$templateProcessor
->
setValue
(
'arrayPihak'
,
$datakonberitaacara
[
'arrayPihak'
]);
$templateProcessor
->
setValue
(
'isian_kasus'
,
$datakonberitaacara
[
'isian_kasus'
]);
$templateProcessor
->
setValue
(
'isian_catatan'
,
$datakonberitaacara
[
'isian_catatan'
]);
$templateProcessor
->
setValue
(
'isian_solusi'
,
$datakonberitaacara
[
'isian_solusi'
]);
$templateProcessor
->
setValue
(
'namaKonselor'
,
$datakonberitaacara
[
'namaKonselor'
]);
$templateProcessor
->
setValue
(
'nipKonselor'
,
$datakonberitaacara
[
'nipKonselor'
]);
$templateProcessor
->
setValue
(
'namaKepsek'
,
$datakonberitaacara
[
'namaKepsek'
]);
$templateProcessor
->
setValue
(
'nipKepsek'
,
$datakonberitaacara
[
'nipKepsek'
]);
$templateProcessor
->
setValue
(
'namaWakaKesiswaan'
,
$datakonberitaacara
[
'namaWakaKesiswaan'
]);
$templateProcessor
->
setValue
(
'nipWakaKesiswaan'
,
$datakonberitaacara
[
'nipWakaKesiswaan'
]);
$templateProcessor
->
setValue
(
'namaWali'
,
$datakonberitaacara
[
'namaWali'
]);
$templateProcessor
->
setValue
(
'nipWali'
,
$datakonberitaacara
[
'nipWali'
]);
$fileName
=
'konferensikasus_beritaacara'
;
// nama filenya
// biar bisa dunlud
$templateProcessor
->
saveAs
(
'tempor/'
.
$fileName
.
'.docx'
);
return
response
()
->
download
(
'tempor/'
.
$fileName
.
'.docx'
)
->
deleteFileAfterSend
(
true
);
// dd($datamundur);
}
}
app/Http/Controllers/Admin/Layanan/Konferensi/KonferensiKegiatanController.php
0 → 100644
View file @
0cfe942f
<?php
namespace
App\Http\Controllers\Admin\Layanan\Konferensi
;
use
App\Http\Controllers\Controller
;
use
Illuminate\Http\Request
;
use
App\Models\Master\PeriodeModel
;
use
App\Models\Perpus\SekolahModel
;
use
App\Models\Perpus\KelasModel
;
use
App\Models\Perpus\KelasKodeModel
;
use
App\Models\Perpus\JurusanModel
;
use
App\Models\Stakeholder\KepsekModel
;
use
App\Models\Stakeholder\KonselorModel
;
use
App\Models\Siswa\SiswaModel
;
use
App\Models\Layanan\Konferensi\KonKegiatanModel
;
use
App\Models\Layanan\Konferensi\KonRPLModel
;
use
App\Models\Layanan\Konferensi\KonBeritaAcaraModel
;
use
PhpOffice\PhpWord\TemplateProcessor
;
class
KonferensiKegiatanController
extends
Controller
{
private
$views
=
'admin/layanan/konferensi/konferensi_kegiatan'
;
private
$url
=
'admin/layanan/lainnya/konferensi/kegiatan'
;
private
$url2
=
'admin/layanan/lainnya/konferensi/rpl'
;
private
$url3
=
'admin/layanan/lainnya/konferensi/berita-acara'
;
private
$title
=
'Halaman Konferensi Kegiatan'
;
public
function
__construct
()
{
createLogActivity
();
// Di isi Construct
$this
->
mPeriode
=
new
PeriodeModel
();
$this
->
mPerpusSekolah
=
new
SekolahModel
();
$this
->
mPerpusJurusan
=
new
JurusanModel
();
$this
->
mPerpusKelas
=
new
KelasModel
();
$this
->
mPerpusKelasKode
=
new
KelasKodeModel
();
$this
->
mKepsek
=
new
KepsekModel
();
$this
->
mKonselor
=
new
KonselorModel
();
$this
->
mSiswa
=
new
SiswaModel
();
$this
->
mKonKegiatan
=
new
KonKegiatanModel
();
$this
->
mKonRPL
=
new
KonRPLModel
();
$this
->
mKonBeritaAcara
=
new
KonBeritaAcaraModel
();
}
public
function
index
()
{
$wherenyaa
=
[
'idPSekolah'
=>
session
()
->
get
(
'idPSekolah'
),
'idSKonselor'
=>
session
()
->
get
(
'idSKonselor'
),
];
$konkegiatan
=
$this
->
mKonKegiatan
->
where
(
$wherenyaa
)
->
get
();
$data
=
[
'title'
=>
$this
->
title
,
'url'
=>
$this
->
url
,
'page'
=>
'Data Konferensi Kegiatan'
,
'konkegiatan'
=>
$konkegiatan
,
];
return
view
(
$this
->
views
.
"/index"
,
$data
);
}
public
function
create
()
{
$periode
=
$this
->
mPeriode
->
get
();
$konselor
=
$this
->
mKonselor
->
where
(
'idPSekolah'
,
session
()
->
get
(
'idPSekolah'
))
->
get
();
// $kepsek = $this->mKepsek->where('idPSekolah', session()->get('idPSekolah'))->get();
$whereKep
=
[
'status'
=>
1
,
'idPSekolah'
=>
session
()
->
get
(
'idPSekolah'
)
];
$kepsek
=
$this
->
mKepsek
->
where
(
$whereKep
)
->
get
();
$data
=
[
'title'
=>
$this
->
title
,
'url'
=>
$this
->
url
,
'page'
=>
'Tambah Data Konferensi Kegiatan'
,
'periode'
=>
$periode
,
'konselor'
=>
$konselor
,
'kepsek'
=>
$kepsek
,
];
return
view
(
$this
->
views
.
"/create"
,
$data
);
}
public
function
show
(
$id
)
{
// Get Data
$konKegiatan
=
$this
->
mKonKegiatan
->
where
(
'kode_unik'
,
$id
)
->
first
();
$konrpl
=
$this
->
mKonRPL
->
where
(
'idLKKegiatan'
,
$konKegiatan
[
'id'
])
->
first
();
$data
=
[
'title'
=>
$this
->
title
,
'url'
=>
$this
->
url
,
'url2'
=>
$this
->
url2
,
'url3'
=>
$this
->
url3
,
'page'
=>
'Detail Data Konferensi Kegiatan'
,
'id'
=>
$id
,
'konrpl'
=>
$konrpl
,
'konkegiatan'
=>
$konKegiatan
,
];
if
(
$konKegiatan
[
'status'
]
==
2
){
// PANGGIL MODEL BERITA ACARA
$konberitaacara
=
$this
->
mKonBeritaAcara
->
where
(
'idLKKegiatan'
,
$konKegiatan
[
'id'
])
->
first
();
$data
[
'konberitaacara'
]
=
$konberitaacara
;
}
// echo json_encode($konrpl); die;
return
view
(
$this
->
views
.
"/show"
,
$data
);
}
public
function
store
(
Request
$request
)
{
$siswa
=
$this
->
mSiswa
->
where
(
'id'
,
$request
->
idSiswa
)
->
first
();
$whereKons
=
[
'id'
=>
$siswa
[
'idSKonselor'
],
'status'
=>
1
,
];
$konselor
=
$this
->
mKonselor
->
where
(
$whereKons
)
->
first
();
if
(
!
isset
(
$konselor
)){
return
redirect
(
"
$this->url
"
)
->
with
(
'gagal'
,
'Guru Konseling belum di set atau tidak aktif'
);
};
$whereKep
=
[
'idPSekolah'
=>
session
()
->
get
(
'idPSekolah'
),
'status'
=>
1
];
$kepsek
=
$this
->
mKepsek
->
where
(
$whereKep
)
->
first
();
if
(
!
isset
(
$kepsek
)){
return
redirect
(
"
$this->url
"
)
->
with
(
'gagal'
,
'Kepsek belum di set'
);
};
$suratWaktu
=
$request
->
surat_waktu
;
$suratWaktunew
=
date
(
"d-m-Y"
,
strtotime
(
$suratWaktu
));
$isianWaktu
=
$request
->
isian_waktu
;
$isianWaktunew
=
date
(
"d-m-Y"
,
strtotime
(
$isianWaktu
));
$dataKonKegiatan
=
[
'idPSekolah'
=>
session
()
->
get
(
'idPSekolah'
),
'idSKonselor'
=>
session
()
->
get
(
'idSKonselor'
),
'idPKKode'
=>
$request
->
idPKKode
,
'idPPeriode'
=>
session
()
->
get
(
'idPPeriode'
),
'idSiswa'
=>
$request
->
idSiswa
,
'kode_unik'
=>
strtoupper
(
bin2hex
(
random_bytes
(
3
))),
'status'
=>
1
];
$KonKegiatan
=
$this
->
mKonKegiatan
->
create
(
$dataKonKegiatan
);
$dataRPL
=
[
'idLKKegiatan'
=>
$KonKegiatan
[
'id'
],
// untuk mmebuat relasi yang baik
'idSKepsek'
=>
$kepsek
[
'id'
],
'idSKonselor'
=>
$konselor
[
'id'
],
'surat_tempat'
=>
$request
->
surat_tempat
,
'surat_waktu'
=>
$suratWaktunew
,
'isian_judul'
=>
$request
->
isian_judul
,
'isian_fungsi'
=>
$request
->
isian_fungsi
,
'isian_tujuan'
=>
$request
->
isian_tujuan
,
'isian_hasil'
=>
$request
->
isian_hasil
,
'isian_gambaran'
=>
$request
->
isian_gambaran
,
'isian_tempat'
=>
$request
->
isian_tempat
,
'isian_waktu'
=>
$isianWaktunew
,
'isian_tanggal'
=>
$request
->
isian_tanggal
,
'isian_semester'
=>
$request
->
isian_semester
,
'isian_penyelenggara'
=>
$request
->
isian_penyelenggara
,
'isian_pihak'
=>
$request
->
isian_pihak
,
'isian_bahan'
=>
$request
->
isian_bahan
,
'isian_penggunaan'
=>
$request
->
isian_penggunaan
,
'isian_rencana'
=>
$request
->
isian_rencana
,
'isian_catatan'
=>
$request
->
isian_catatan
,
];
$this
->
mKonRPL
->
create
(
$dataRPL
);
return
redirect
(
"
$this->url
"
)
->
with
(
'sukses'
,
'Data Konferensi Kegiatan berhasil di tambahkan'
);
}
}
app/Http/Controllers/Admin/Layanan/Konferensi/KonferensiRPLController.php
0 → 100644
View file @
0cfe942f
<?php
namespace
App\Http\Controllers\Admin\Layanan\Konferensi
;
use
App\Http\Controllers\Controller
;
use
Illuminate\Http\Request
;
use
App\Models\Master\PeriodeModel
;
use
App\Models\Perpus\SekolahModel
;
use
App\Models\Perpus\KelasModel
;
use
App\Models\Perpus\KelasKodeModel
;
use
App\Models\Perpus\JurusanModel
;
use
App\Models\Stakeholder\KepsekModel
;
use
App\Models\Stakeholder\KonselorModel
;
use
App\Models\Stakeholder\GuruModel
;
use
App\Models\Siswa\SiswaModel
;
use
App\Models\Layanan\Konferensi\KonKegiatanModel
;
use
App\Models\Layanan\Konferensi\KonRPLModel
;
use
PhpOffice\PhpWord\TemplateProcessor
;
class
KonferensiRPLController
extends
Controller
{
private
$views
=
'admin/layanan/konferensi/konferensi_RPL'
;
private
$url
=
'admin/layanan/lainnya/konferensi/rpl'
;
private
$url2
=
'admin/layanan/lainnya/konferensi/kegiatan'
;
private
$title
=
'Halaman Konferensi RPL'
;
public
function
__construct
()
{
createLogActivity
();
// Di isi Construct
$this
->
mPeriode
=
new
PeriodeModel
();
$this
->
mPerpusSekolah
=
new
SekolahModel
();
$this
->
mPerpusJurusan
=
new
JurusanModel
();
$this
->
mPerpusKelas
=
new
KelasModel
();
$this
->
mPerpusKelasKode
=
new
KelasKodeModel
();
$this
->
mKepsek
=
new
KepsekModel
();
$this
->
mGuru
=
new
GuruModel
();
$this
->
mSiswa
=
new
SiswaModel
();
$this
->
mKonKegiatan
=
new
KonKegiatanModel
();
$this
->
mKonselor
=
new
KonselorModel
();
$this
->
mKonRPL
=
new
KonRPLModel
();
}
public
function
show
(
$id
)
{
// Get Data
$konrpl
=
$this
->
mKonRPL
->
where
(
'id'
,
$id
)
->
first
();
$data
=
[
'title'
=>
$this
->
title
,
'url'
=>
$this
->
url
,
'url2'
=>
$this
->
url2
,
'page'
=>
'Data Konferensi RPL'
,
'konrpl'
=>
$konrpl
,
];
return
view
(
$this
->
views
.
"/show"
,
$data
);
}
public
function
download
(
$id
)
{
if
(
!
cekKopSurat
(
session
()
->
get
(
'idPSekolah'
)))
{
return
redirect
(
"admin/dashboard"
)
->
with
(
'gagal'
,
'Kop Surat tidak ditemukan, mohon upload ulang melalui login Admin Sekolah'
);
}
$sekolah
=
$this
->
mPerpusSekolah
->
where
(
'id'
,
session
()
->
get
(
'idPSekolah'
))
->
first
();
$konrpl
=
$this
->
mKonRPL
->
where
(
'id'
,
$id
)
->
first
();
// dd($mundur);
$datakonrpl
=
[
'KopSurat'
=>
$sekolah
->
logo
,
'surat_tempat'
=>
$konrpl
->
surat_tempat
,
'surat_waktu'
=>
$konrpl
->
surat_waktu
,
'namaKonselor'
=>
$konrpl
->
konselor
->
guru
->
nama
??
'Guru Konseling belum di SET'
,
'nipKonselor'
=>
$konrpl
->
konselor
->
guru
->
nip
??
'Guru Konseling belum di SET'
,
'namaKepsek'
=>
$konrpl
->
kepsek
->
guru
->
nama
??
'Kepsek belum di SET'
,
'nipKepsek'
=>
$konrpl
->
kepsek
->
guru
->
nip
??
'Kepsek belum di SET'
,
'isian_judul'
=>
$konrpl
->
isian_judul
,
'isian_fungsi'
=>
$konrpl
->
isian_fungsi
,
'isian_tujuan'
=>
$konrpl
->
isian_tujuan
,
'isian_hasil'
=>
$konrpl
->
isian_hasil
,
'idSiswa'
=>
$konrpl
->
konkegiatan
->
siswa
->
nama
,
'isian_gambaran'
=>
$konrpl
->
isian_gambaran
,
'isian_tempat'
=>
$konrpl
->
isian_tempat
,
'isian_waktu'
=>
$konrpl
->
isian_waktu
,
'isian_tanggal'
=>
$konrpl
->
isian_tanggal
,
'isian_semester'
=>
$konrpl
->
isian_semester
,
'isian_penyelenggara'
=>
$konrpl
->
isian_penyelenggara
,
'isian_pihak'
=>
$konrpl
->
isian_pihak
,
'isian_bahan'
=>
$konrpl
->
isian_bahan
,
'isian_penggunaan'
=>
$konrpl
->
isian_penggunaan
,
'isian_rencana'
=>
$konrpl
->
isian_rencana
,
'isian_catatan'
=>
$konrpl
->
isian_catatan
,
];
// pakai dari sini. sambil buka word coba.docx
$templateProcessor
=
new
TemplateProcessor
(
'word-template/konferensi_kasus/konferensikasus_kegiatan.docx'
);
// load template word
$templateProcessor
->
setImageValue
(
'KopSurat'
,
array
(
'path'
=>
"upload/logo_sekolah/"
.
$datakonrpl
[
'KopSurat'
],
'width'
=>
500
,
'height'
=>
200
,
'ratio'
=>
true
));
$templateProcessor
->
setValue
(
'surat_tempat'
,
$datakonrpl
[
'surat_tempat'
]);
$templateProcessor
->
setValue
(
'surat_waktu'
,
$datakonrpl
[
'surat_waktu'
]);
$templateProcessor
->
setValue
(
'namaKonselor'
,
$datakonrpl
[
'namaKonselor'
]);
$templateProcessor
->
setValue
(
'nipKonselor'
,
$datakonrpl
[
'nipKonselor'
]);
$templateProcessor
->
setValue
(
'namaKepsek'
,
$datakonrpl
[
'namaKepsek'
]);
$templateProcessor
->
setValue
(
'nipKepsek'
,
$datakonrpl
[
'nipKepsek'
]);
$templateProcessor
->
setValue
(
'isian_judul'
,
$datakonrpl
[
'isian_judul'
]);
$templateProcessor
->
setValue
(
'isian_fungsi'
,
$datakonrpl
[
'isian_fungsi'
]);
$templateProcessor
->
setValue
(
'isian_tujuan'
,
$datakonrpl
[
'isian_tujuan'
]);
$templateProcessor
->
setValue
(
'isian_hasil'
,
$datakonrpl
[
'isian_hasil'
]);
$templateProcessor
->
setValue
(
'idSiswa'
,
$datakonrpl
[
'idSiswa'
]);
$templateProcessor
->
setValue
(
'isian_gambaran'
,
$datakonrpl
[
'isian_gambaran'
]);
$templateProcessor
->
setValue
(
'isian_tempat'
,
$datakonrpl
[
'isian_tempat'
]);
$templateProcessor
->
setValue
(
'isian_waktu'
,
$datakonrpl
[
'isian_waktu'
]);
$templateProcessor
->
setValue
(
'isian_tanggal'
,
$datakonrpl
[
'isian_tanggal'
]);
$templateProcessor
->
setValue
(
'isian_semester'
,
$datakonrpl
[
'isian_semester'
]);
$templateProcessor
->
setValue
(
'isian_penyelenggara'
,
$datakonrpl
[
'isian_penyelenggara'
]);
$templateProcessor
->
setValue
(
'isian_pihak'
,
$datakonrpl
[
'isian_pihak'
]);
$templateProcessor
->
setValue
(
'isian_bahan'
,
$datakonrpl
[
'isian_bahan'
]);
$templateProcessor
->
setValue
(
'isian_penggunaan'
,
$datakonrpl
[
'isian_penggunaan'
]);
$templateProcessor
->
setValue
(
'isian_rencana'
,
$datakonrpl
[
'isian_rencana'
]);
$templateProcessor
->
setValue
(
'isian_catatan'
,
$datakonrpl
[
'isian_catatan'
]);
$fileName
=
'konferensikasus_kegiatan'
;
// nama filenya
// biar bisa dunlud
$templateProcessor
->
saveAs
(
'tempor/'
.
$fileName
.
'.docx'
);
return
response
()
->
download
(
'tempor/'
.
$fileName
.
'.docx'
)
->
deleteFileAfterSend
(
true
);
// dd($datamundur);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment