Commit 0398fd36 authored by Syaifur Rohman's avatar Syaifur Rohman

fix url back and siswa on delete

parent e00ce48b
...@@ -36,7 +36,7 @@ public function __construct() ...@@ -36,7 +36,7 @@ public function __construct()
createLogActivity(); createLogActivity();
// Di isi Construct // Di isi Construct
$this->mPeriode = New PeriodeModel(); $this->mPeriode = New PeriodeModel();
$this->mPerpusJurusan = new JurusanModel(); $this->mPerpusJurusan = new JurusanModel();
$this->mPerpusKelas = new KelasModel(); $this->mPerpusKelas = new KelasModel();
$this->mKelasKode = new KelasKodeModel(); $this->mKelasKode = new KelasKodeModel();
...@@ -59,7 +59,7 @@ public function __construct() ...@@ -59,7 +59,7 @@ public function __construct()
'idPSekolah' => session()->get('idPSekolah'), 'idPSekolah' => session()->get('idPSekolah'),
'idSKonselor' => session()->get('idSKonselor'), 'idSKonselor' => session()->get('idSKonselor'),
]; ];
$alihtangan_kegiatan = $this->mAlihtanganKegiatan->where($wherenyaa)->get(); $alihtangan_kegiatan = $this->mAlihtanganKegiatan->where($wherenyaa)->whereHas('siswa')->get();
$data = [ $data = [
'title' => $this->title, 'title' => $this->title,
...@@ -92,7 +92,7 @@ public function __construct() ...@@ -92,7 +92,7 @@ public function __construct()
if(!isset($kepsek)){ if(!isset($kepsek)){
return redirect("$this->url")->with('gagal', 'Kepsek belum di set'); return redirect("$this->url")->with('gagal', 'Kepsek belum di set');
}; };
$siswa = $this->mSiswa->where('id', $request->idSiswa)->first(); $siswa = $this->mSiswa->where('id', $request->idSiswa)->first();
$kelas = $this->mKelasKode->where('id', $siswa['idPKKode']); $kelas = $this->mKelasKode->where('id', $siswa['idPKKode']);
if(!isset($kelas)){ if(!isset($kelas)){
...@@ -107,7 +107,7 @@ public function __construct() ...@@ -107,7 +107,7 @@ public function __construct()
return redirect("$this->url")->with('gagal', 'Guru Konseling belum di set atau tidak aktif'); return redirect("$this->url")->with('gagal', 'Guru Konseling belum di set atau tidak aktif');
}; };
$suratWaktu = $request->surat_waktu; $suratWaktu = $request->surat_waktu;
$suratWaktunew = date("d-m-Y", strtotime($suratWaktu)); $suratWaktunew = date("d-m-Y", strtotime($suratWaktu));
$dataAlihKegiatan = [ $dataAlihKegiatan = [
...@@ -149,7 +149,7 @@ public function __construct() ...@@ -149,7 +149,7 @@ public function __construct()
// Get Data // Get Data
$alihtangan_kegiatan = $this->mAlihtanganKegiatan->where('kode_unik', $id)->first(); $alihtangan_kegiatan = $this->mAlihtanganKegiatan->where('kode_unik', $id)->first();
$alihtangan_rpl = $this->mAlihtanganRpl->where('idLAKegiatan', $alihtangan_kegiatan['id'])->first(); $alihtangan_rpl = $this->mAlihtanganRpl->where('idLAKegiatan', $alihtangan_kegiatan['id'])->first();
$data = [ $data = [
'title' => $this->title, 'title' => $this->title,
'url' => $this->url, 'url' => $this->url,
......
...@@ -42,9 +42,9 @@ public function __construct() ...@@ -42,9 +42,9 @@ public function __construct()
public function index() public function index()
{ {
$ijinKeluar = $this->mIjinKeluar->where('idPSekolah', session()->get('idPSekolah'))->get(); $ijinKeluar = $this->mIjinKeluar->where('idPSekolah', session()->get('idPSekolah'))->whereHas('siswa')->get();
$data = [ $data = [
'title' => $this->title, 'title' => $this->title,
'url' => $this->url, 'url' => $this->url,
...@@ -64,7 +64,7 @@ public function __construct() ...@@ -64,7 +64,7 @@ public function __construct()
'idPSekolah' => session()->get('idPSekolah'), 'idPSekolah' => session()->get('idPSekolah'),
]; ];
$piket = $this->mPiket->where($where)->get(); $piket = $this->mPiket->where($where)->get();
$data = [ $data = [
'title' => $this->title, 'title' => $this->title,
'url' => $this->url, 'url' => $this->url,
...@@ -78,9 +78,9 @@ public function __construct() ...@@ -78,9 +78,9 @@ public function __construct()
public function store(Request $request) public function store(Request $request)
{ {
$suratWaktu = $request->surat_waktu; $suratWaktu = $request->surat_waktu;
$suratWaktunew = date("d-m-Y", strtotime($suratWaktu)); $suratWaktunew = date("d-m-Y", strtotime($suratWaktu));
$siswa = $this->mSiswa->where('id', $request->idSiswa)->first(); $siswa = $this->mSiswa->where('id', $request->idSiswa)->first();
$whereKons = [ $whereKons = [
'id' => $siswa['idSKonselor'], 'id' => $siswa['idSKonselor'],
...@@ -91,7 +91,7 @@ public function __construct() ...@@ -91,7 +91,7 @@ public function __construct()
return redirect("$this->url")->with('gagal', 'Guru Konseling belum di set atau tidak aktif'); return redirect("$this->url")->with('gagal', 'Guru Konseling belum di set atau tidak aktif');
}; };
$dataIjinKeluar = [ $dataIjinKeluar = [
'idPSekolah' => session()->get('idPSekolah'), 'idPSekolah' => session()->get('idPSekolah'),
'idPKKode' => $request->idPKKode, 'idPKKode' => $request->idPKKode,
...@@ -110,7 +110,7 @@ public function __construct() ...@@ -110,7 +110,7 @@ public function __construct()
$this->mIjinKeluar->create($dataIjinKeluar); $this->mIjinKeluar->create($dataIjinKeluar);
$ijinKeluar = $this->mIjinKeluar->where('kode_unik', $dataIjinKeluar['kode_unik'])->first(); $ijinKeluar = $this->mIjinKeluar->where('kode_unik', $dataIjinKeluar['kode_unik'])->first();
$data = [ $data = [
'title' => $this->title, 'title' => $this->title,
'url' => $this->url, 'url' => $this->url,
...@@ -123,7 +123,7 @@ public function __construct() ...@@ -123,7 +123,7 @@ public function __construct()
public function show($id) public function show($id)
{ {
$ijinKeluar = $this->mIjinKeluar->where('kode_unik', $id)->first(); $ijinKeluar = $this->mIjinKeluar->where('kode_unik', $id)->first();
$data = [ $data = [
'title' => $this->title, 'title' => $this->title,
'url' => $this->url, 'url' => $this->url,
...@@ -160,29 +160,29 @@ public function __construct() ...@@ -160,29 +160,29 @@ public function __construct()
$templateProcessor = new TemplateProcessor('word-template/form_ijin/form_ijin_keluar.docx'); // load template word $templateProcessor = new TemplateProcessor('word-template/form_ijin/form_ijin_keluar.docx'); // load template word
$templateProcessor->setImageValue('KopSurat', array('path' => "upload/logo_sekolah/".$dataIjinKeluar['KopSurat'], 'width' => 500, 'height' => 200, 'ratio' => true)); $templateProcessor->setImageValue('KopSurat', array('path' => "upload/logo_sekolah/".$dataIjinKeluar['KopSurat'], 'width' => 500, 'height' => 200, 'ratio' => true));
$templateProcessor->setValue('noSurat', $dataIjinKeluar['nomor']); $templateProcessor->setValue('noSurat', $dataIjinKeluar['nomor']);
$templateProcessor->setValue('kelasSiswa', $dataIjinKeluar['idPKKode']); $templateProcessor->setValue('kelasSiswa', $dataIjinKeluar['idPKKode']);
$templateProcessor->setValue('namaSiswa', $dataIjinKeluar['idSiswa']); $templateProcessor->setValue('namaSiswa', $dataIjinKeluar['idSiswa']);
$templateProcessor->setValue('nisSiswa', $dataIjinKeluar['nisSiswa']); $templateProcessor->setValue('nisSiswa', $dataIjinKeluar['nisSiswa']);
$templateProcessor->setValue('namaKonselor', $dataIjinKeluar['idSKonselor']); $templateProcessor->setValue('namaKonselor', $dataIjinKeluar['idSKonselor']);
$templateProcessor->setValue('nipKonselor', $dataIjinKeluar['nipKonselor']); $templateProcessor->setValue('nipKonselor', $dataIjinKeluar['nipKonselor']);
$templateProcessor->setValue('namaPiket', $dataIjinKeluar['idSPiket']); $templateProcessor->setValue('namaPiket', $dataIjinKeluar['idSPiket']);
$templateProcessor->setValue('nipPiket', $dataIjinKeluar['nipPiket']); $templateProcessor->setValue('nipPiket', $dataIjinKeluar['nipPiket']);
$templateProcessor->setValue('surat_tempat', $dataIjinKeluar['surat_tempat']); $templateProcessor->setValue('surat_tempat', $dataIjinKeluar['surat_tempat']);
$templateProcessor->setValue('tanggalSurat', $dataIjinKeluar['surat_waktu']); $templateProcessor->setValue('tanggalSurat', $dataIjinKeluar['surat_waktu']);
$templateProcessor->setValue('isian_yth', $dataIjinKeluar['isian_yth']); $templateProcessor->setValue('isian_yth', $dataIjinKeluar['isian_yth']);
$templateProcessor->setValue('pukul', $dataIjinKeluar['isian_pukul']); $templateProcessor->setValue('pukul', $dataIjinKeluar['isian_pukul']);
$templateProcessor->setValue('ket', $dataIjinKeluar['isian_keterangan']); $templateProcessor->setValue('ket', $dataIjinKeluar['isian_keterangan']);
$fileName = 'form_ijin_keluar'; // nama filenya $fileName = 'form_ijin_keluar'; // nama filenya
// biar bisa dunlud // biar bisa dunlud
$templateProcessor->saveAs('tempor/' . $fileName . '.docx'); $templateProcessor->saveAs('tempor/' . $fileName . '.docx');
return response()->download('tempor/' . $fileName . '.docx')->deleteFileAfterSend(true); return response()->download('tempor/' . $fileName . '.docx')->deleteFileAfterSend(true);
// dd($dataIjinKeluar); // dd($dataIjinKeluar);
} }
public function edit($id){ public function edit($id){
$ijinKeluar = $this->mIjinKeluar->where('kode_unik', $id)->first(); $ijinKeluar = $this->mIjinKeluar->where('kode_unik', $id)->first();
$data = [ $data = [
'title' => $this->title, 'title' => $this->title,
'url' => $this->url, 'url' => $this->url,
...@@ -202,7 +202,7 @@ public function __construct() ...@@ -202,7 +202,7 @@ public function __construct()
$suratWaktu = $request->surat_waktu; $suratWaktu = $request->surat_waktu;
$suratWaktunew = date("d-m-Y", strtotime($suratWaktu)); $suratWaktunew = date("d-m-Y", strtotime($suratWaktu));
} else { } else {
$suratWaktunew = $dataUbah->surat_waktu; $suratWaktunew = $dataUbah->surat_waktu;
} }
$dataIjinKeluar = [ $dataIjinKeluar = [
......
...@@ -40,8 +40,8 @@ public function __construct() ...@@ -40,8 +40,8 @@ public function __construct()
public function index() public function index()
{ {
$ijinKeluarMasal = $this->mIjinKeluarMasal->where('idPSekolah', session()->get('idPSekolah'))->get(); $ijinKeluarMasal = $this->mIjinKeluarMasal->where('idPSekolah', session()->get('idPSekolah'))->whereHas('siswa')->get();
$data = [ $data = [
'title' => $this->title, 'title' => $this->title,
'url' => $this->url, 'url' => $this->url,
...@@ -75,11 +75,11 @@ public function __construct() ...@@ -75,11 +75,11 @@ public function __construct()
public function store(Request $request) public function store(Request $request)
{ {
$suratWaktu = $request->surat_waktu; $suratWaktu = $request->surat_waktu;
$suratWaktunew = date("d-m-Y", strtotime($suratWaktu)); $suratWaktunew = date("d-m-Y", strtotime($suratWaktu));
$isianTanggal = $request->isian_tanggal; $isianTanggal = $request->isian_tanggal;
$isianTanggalNew = date("d-m-Y", strtotime($isianTanggal)); $isianTanggalNew = date("d-m-Y", strtotime($isianTanggal));
$dataIjinKeluarMasal = [ $dataIjinKeluarMasal = [
'idPSekolah' => session()->get('idPSekolah'), 'idPSekolah' => session()->get('idPSekolah'),
...@@ -100,7 +100,7 @@ public function __construct() ...@@ -100,7 +100,7 @@ public function __construct()
$this->mIjinKeluarMasal->create($dataIjinKeluarMasal); $this->mIjinKeluarMasal->create($dataIjinKeluarMasal);
$ijinKeluarMasal = $this->mIjinKeluarMasal->where('kode_unik', $dataIjinKeluarMasal['kode_unik'])->first(); $ijinKeluarMasal = $this->mIjinKeluarMasal->where('kode_unik', $dataIjinKeluarMasal['kode_unik'])->first();
$data = [ $data = [
'title' => $this->title, 'title' => $this->title,
'url' => $this->url, 'url' => $this->url,
...@@ -113,7 +113,7 @@ public function __construct() ...@@ -113,7 +113,7 @@ public function __construct()
public function show($id) public function show($id)
{ {
$ijinKeluarMasal = $this->mIjinKeluarMasal->where('kode_unik', $id)->first(); $ijinKeluarMasal = $this->mIjinKeluarMasal->where('kode_unik', $id)->first();
$data = [ $data = [
'title' => $this->title, 'title' => $this->title,
'url' => $this->url, 'url' => $this->url,
...@@ -127,7 +127,7 @@ public function __construct() ...@@ -127,7 +127,7 @@ public function __construct()
{ {
$sekolah = $this->mPerpusSekolah->where('id', session()->get('idPSekolah'))->first(); $sekolah = $this->mPerpusSekolah->where('id', session()->get('idPSekolah'))->first();
$ijinKeluarMasal = $this->mIjinKeluarMasal->where('kode_unik', $id)->first(); $ijinKeluarMasal = $this->mIjinKeluarMasal->where('kode_unik', $id)->first();
$dataIjinKeluarMasal = [ $dataIjinKeluarMasal = [
'KopSurat' => $sekolah->logo, 'KopSurat' => $sekolah->logo,
'idPKKode' => $ijinKeluarMasal->kelaskode->kelas->nama.' '.$ijinKeluarMasal->kelaskode->kelas->jurusan->nama.' '.$ijinKeluarMasal->kelaskode->nama, 'idPKKode' => $ijinKeluarMasal->kelaskode->kelas->nama.' '.$ijinKeluarMasal->kelaskode->kelas->jurusan->nama.' '.$ijinKeluarMasal->kelaskode->nama,
...@@ -148,23 +148,23 @@ public function __construct() ...@@ -148,23 +148,23 @@ public function __construct()
// pakai dari sini. sambil buka word coba.docx // pakai dari sini. sambil buka word coba.docx
$templateProcessor = new TemplateProcessor('word-template/form_ijin/form_ijin_keluarmasal.docx'); // load template word $templateProcessor = new TemplateProcessor('word-template/form_ijin/form_ijin_keluarmasal.docx'); // load template word
$templateProcessor->setImageValue('KopSurat', array('path' => "upload/logo_sekolah/".$dataIjinKeluarMasal['KopSurat'], 'width' => 600, 'height' => 200, 'ratio' => true)); $templateProcessor->setImageValue('KopSurat', array('path' => "upload/logo_sekolah/".$dataIjinKeluarMasal['KopSurat'], 'width' => 600, 'height' => 200, 'ratio' => true));
$templateProcessor->setValue('kelasSiswa', $dataIjinKeluarMasal['idPKKode']); $templateProcessor->setValue('kelasSiswa', $dataIjinKeluarMasal['idPKKode']);
$templateProcessor->setValue('namaSiswa', $dataIjinKeluarMasal['arrayIdSiswa']); $templateProcessor->setValue('namaSiswa', $dataIjinKeluarMasal['arrayIdSiswa']);
$templateProcessor->setValue('hari', $dataIjinKeluarMasal['isian_hari']); $templateProcessor->setValue('hari', $dataIjinKeluarMasal['isian_hari']);
$templateProcessor->setValue('tanggalijin', $dataIjinKeluarMasal['isian_tanggal']); $templateProcessor->setValue('tanggalijin', $dataIjinKeluarMasal['isian_tanggal']);
$templateProcessor->setValue('pelajaran1', $dataIjinKeluarMasal['isian_pelajaran']); $templateProcessor->setValue('pelajaran1', $dataIjinKeluarMasal['isian_pelajaran']);
$templateProcessor->setValue('pelajaran2', $dataIjinKeluarMasal['isian_pelajaran']); $templateProcessor->setValue('pelajaran2', $dataIjinKeluarMasal['isian_pelajaran']);
$templateProcessor->setValue('ket', $dataIjinKeluarMasal['isian_keterangan']); $templateProcessor->setValue('ket', $dataIjinKeluarMasal['isian_keterangan']);
$templateProcessor->setValue('surat_tempat', $dataIjinKeluarMasal['surat_tempat']); $templateProcessor->setValue('surat_tempat', $dataIjinKeluarMasal['surat_tempat']);
$templateProcessor->setValue('tanggalSurat', $dataIjinKeluarMasal['surat_waktu']); $templateProcessor->setValue('tanggalSurat', $dataIjinKeluarMasal['surat_waktu']);
$templateProcessor->setValue('namaKonselor', $dataIjinKeluarMasal['idSKonselor']); $templateProcessor->setValue('namaKonselor', $dataIjinKeluarMasal['idSKonselor']);
$templateProcessor->setValue('nipKonselor', $dataIjinKeluarMasal['nipKonselor']); $templateProcessor->setValue('nipKonselor', $dataIjinKeluarMasal['nipKonselor']);
$templateProcessor->setValue('namaPiket', $dataIjinKeluarMasal['idSPiket']); $templateProcessor->setValue('namaPiket', $dataIjinKeluarMasal['idSPiket']);
$templateProcessor->setValue('nipPiket', $dataIjinKeluarMasal['nipPiket']); $templateProcessor->setValue('nipPiket', $dataIjinKeluarMasal['nipPiket']);
$templateProcessor->setValue('namaWakaKurikulum', $dataIjinKeluarMasal['idSKurikulum']); $templateProcessor->setValue('namaWakaKurikulum', $dataIjinKeluarMasal['idSKurikulum']);
$templateProcessor->setValue('nipWakaKurikulum', $dataIjinKeluarMasal['nipKurikulum']); $templateProcessor->setValue('nipWakaKurikulum', $dataIjinKeluarMasal['nipKurikulum']);
$fileName = 'form_ijin_keluar_masal'; // nama filenya $fileName = 'form_ijin_keluar_masal'; // nama filenya
// biar bisa dunlud // biar bisa dunlud
$templateProcessor->saveAs('tempor/' . $fileName . '.docx'); $templateProcessor->saveAs('tempor/' . $fileName . '.docx');
return response()->download('tempor/' . $fileName . '.docx')->deleteFileAfterSend(true); return response()->download('tempor/' . $fileName . '.docx')->deleteFileAfterSend(true);
...@@ -172,7 +172,7 @@ public function __construct() ...@@ -172,7 +172,7 @@ public function __construct()
public function update(Request $request, $id) public function update(Request $request, $id)
{ {
// //
} }
public function destroy($id) public function destroy($id)
......
...@@ -38,7 +38,7 @@ public function __construct() ...@@ -38,7 +38,7 @@ public function __construct()
public function index() public function index()
{ {
$ijinMasuk = $this->mIjinMasuk->where('idPSekolah', session()->get('idPSekolah'))->get(); $ijinMasuk = $this->mIjinMasuk->where('idPSekolah', session()->get('idPSekolah'))->whereHas('siswa')->get();
$data = [ $data = [
'title' => $this->title, 'title' => $this->title,
...@@ -58,7 +58,7 @@ public function __construct() ...@@ -58,7 +58,7 @@ public function __construct()
'idPSekolah' => session()->get('idPSekolah'), 'idPSekolah' => session()->get('idPSekolah'),
]; ];
$piket = $this->mPiket->where($where)->get(); $piket = $this->mPiket->where($where)->get();
$data = [ $data = [
'title' => $this->title, 'title' => $this->title,
'url' => $this->url, 'url' => $this->url,
...@@ -82,9 +82,9 @@ public function __construct() ...@@ -82,9 +82,9 @@ public function __construct()
return redirect("$this->url")->with('gagal', 'Guru Konseling belum di set atau tidak aktif'); return redirect("$this->url")->with('gagal', 'Guru Konseling belum di set atau tidak aktif');
}; };
$suratWaktu = $request->surat_waktu; $suratWaktu = $request->surat_waktu;
$suratWaktunew = date("d-m-Y", strtotime($suratWaktu)); $suratWaktunew = date("d-m-Y", strtotime($suratWaktu));
$dataIjinMasuk = [ $dataIjinMasuk = [
'idPSekolah' => session()->get('idPSekolah'), 'idPSekolah' => session()->get('idPSekolah'),
'idPKKode' => $request->idPKKode, 'idPKKode' => $request->idPKKode,
...@@ -99,9 +99,9 @@ public function __construct() ...@@ -99,9 +99,9 @@ public function __construct()
'isian_keterangan' => $request->isian_keterangan, 'isian_keterangan' => $request->isian_keterangan,
]; ];
$this->mIjinMasuk->create($dataIjinMasuk); $this->mIjinMasuk->create($dataIjinMasuk);
$ijinMasuk = $this->mIjinMasuk->where('kode_unik', $dataIjinMasuk['kode_unik'])->first(); $ijinMasuk = $this->mIjinMasuk->where('kode_unik', $dataIjinMasuk['kode_unik'])->first();
$data = [ $data = [
'title' => $this->title, 'title' => $this->title,
'url' => $this->url, 'url' => $this->url,
...@@ -114,7 +114,7 @@ public function __construct() ...@@ -114,7 +114,7 @@ public function __construct()
public function show($id) public function show($id)
{ {
$ijinMasuk = $this->mIjinMasuk->where('kode_unik', $id)->first(); $ijinMasuk = $this->mIjinMasuk->where('kode_unik', $id)->first();
$data = [ $data = [
'title' => $this->title, 'title' => $this->title,
'url' => $this->url, 'url' => $this->url,
...@@ -150,29 +150,29 @@ public function __construct() ...@@ -150,29 +150,29 @@ public function __construct()
// pakai dari sini. sambil buka word coba.docx // pakai dari sini. sambil buka word coba.docx
$templateProcessor = new TemplateProcessor('word-template/form_ijin/form_ijin_masukkelas.docx'); // load template word $templateProcessor = new TemplateProcessor('word-template/form_ijin/form_ijin_masukkelas.docx'); // load template word
$templateProcessor->setImageValue('KopSurat', array('path' => "upload/logo_sekolah/".$dataijinMasuk['KopSurat'], 'width' => 500, 'height' => 200, 'ratio' => true)); $templateProcessor->setImageValue('KopSurat', array('path' => "upload/logo_sekolah/".$dataijinMasuk['KopSurat'], 'width' => 500, 'height' => 200, 'ratio' => true));
$templateProcessor->setValue('kelasSiswa', $dataijinMasuk['idPKKode']); $templateProcessor->setValue('kelasSiswa', $dataijinMasuk['idPKKode']);
$templateProcessor->setValue('namaSiswa', $dataijinMasuk['idSiswa']); $templateProcessor->setValue('namaSiswa', $dataijinMasuk['idSiswa']);
$templateProcessor->setValue('nisSiswa', $dataijinMasuk['nisSiswa']); $templateProcessor->setValue('nisSiswa', $dataijinMasuk['nisSiswa']);
$templateProcessor->setValue('namaKonselor', $dataijinMasuk['idSKonselor']); $templateProcessor->setValue('namaKonselor', $dataijinMasuk['idSKonselor']);
$templateProcessor->setValue('nipKonselor', $dataijinMasuk['nipKonselor']); $templateProcessor->setValue('nipKonselor', $dataijinMasuk['nipKonselor']);
$templateProcessor->setValue('namaPiket', $dataijinMasuk['idSPiket']); $templateProcessor->setValue('namaPiket', $dataijinMasuk['idSPiket']);
$templateProcessor->setValue('nipPiket', $dataijinMasuk['nipPiket']); $templateProcessor->setValue('nipPiket', $dataijinMasuk['nipPiket']);
$templateProcessor->setValue('surat_tempat', $dataijinMasuk['surat_tempat']); $templateProcessor->setValue('surat_tempat', $dataijinMasuk['surat_tempat']);
$templateProcessor->setValue('tanggalSurat', $dataijinMasuk['surat_waktu']); $templateProcessor->setValue('tanggalSurat', $dataijinMasuk['surat_waktu']);
$templateProcessor->setValue('pelajaranKe', $dataijinMasuk['isian_pelajaran']); $templateProcessor->setValue('pelajaranKe', $dataijinMasuk['isian_pelajaran']);
$templateProcessor->setValue('ket', $dataijinMasuk['isian_keterangan']); $templateProcessor->setValue('ket', $dataijinMasuk['isian_keterangan']);
$fileName = 'form_ijin_masukkelas'; // nama filenya $fileName = 'form_ijin_masukkelas'; // nama filenya
// biar bisa dunlud // biar bisa dunlud
$templateProcessor->saveAs('tempor/' . $fileName . '.docx'); $templateProcessor->saveAs('tempor/' . $fileName . '.docx');
return response()->download('tempor/' . $fileName . '.docx')->deleteFileAfterSend(true); return response()->download('tempor/' . $fileName . '.docx')->deleteFileAfterSend(true);
// dd($dataijinMasuk); // dd($dataijinMasuk);
} }
public function edit($id){ public function edit($id){
$ijinMasuk = $this->mIjinMasuk->where('kode_unik', $id)->first(); $ijinMasuk = $this->mIjinMasuk->where('kode_unik', $id)->first();
$data = [ $data = [
'title' => $this->title, 'title' => $this->title,
'url' => $this->url, 'url' => $this->url,
...@@ -192,7 +192,7 @@ public function __construct() ...@@ -192,7 +192,7 @@ public function __construct()
$suratWaktu = $request->surat_waktu; $suratWaktu = $request->surat_waktu;
$suratWaktunew = date("d-m-Y", strtotime($suratWaktu)); $suratWaktunew = date("d-m-Y", strtotime($suratWaktu));
} else { } else {
$suratWaktunew = $dataUbah->surat_waktu; $suratWaktunew = $dataUbah->surat_waktu;
} }
$dataIjinMasuk = [ $dataIjinMasuk = [
......
...@@ -57,7 +57,7 @@ public function __construct() ...@@ -57,7 +57,7 @@ public function __construct()
'idPSekolah' => session()->get('idPSekolah'), 'idPSekolah' => session()->get('idPSekolah'),
'idSKonselor' => session()->get('idSKonselor'), 'idSKonselor' => session()->get('idSKonselor'),
]; ];
$konkegiatan = $this->mKonKegiatan->where($wherenyaa)->get(); $konkegiatan = $this->mKonKegiatan->where($wherenyaa)->whereHas('siswa')->get();
$data = [ $data = [
'title' => $this->title, 'title' => $this->title,
...@@ -94,7 +94,7 @@ public function __construct() ...@@ -94,7 +94,7 @@ public function __construct()
// Get Data // Get Data
$konKegiatan = $this->mKonKegiatan->where('kode_unik', $id)->first(); $konKegiatan = $this->mKonKegiatan->where('kode_unik', $id)->first();
$konrpl = $this->mKonRPL->where('idLKKegiatan', $konKegiatan['id'])->first(); $konrpl = $this->mKonRPL->where('idLKKegiatan', $konKegiatan['id'])->first();
$data = [ $data = [
'title' => $this->title, 'title' => $this->title,
'url' => $this->url, 'url' => $this->url,
...@@ -106,7 +106,7 @@ public function __construct() ...@@ -106,7 +106,7 @@ public function __construct()
'konkegiatan' => $konKegiatan, 'konkegiatan' => $konKegiatan,
]; ];
if ($konKegiatan['status'] == 2){ if ($konKegiatan['status'] == 2){
// PANGGIL MODEL BERITA ACARA // PANGGIL MODEL BERITA ACARA
$konberitaacara = $this->mKonBeritaAcara->where('idLKKegiatan', $konKegiatan['id'])->first(); $konberitaacara = $this->mKonBeritaAcara->where('idLKKegiatan', $konKegiatan['id'])->first();
$data['konberitaacara'] = $konberitaacara; $data['konberitaacara'] = $konberitaacara;
} }
...@@ -136,12 +136,12 @@ public function __construct() ...@@ -136,12 +136,12 @@ public function __construct()
return redirect("$this->url")->with('gagal', 'Kepsek belum di set'); return redirect("$this->url")->with('gagal', 'Kepsek belum di set');
}; };
$suratWaktu = $request->surat_waktu; $suratWaktu = $request->surat_waktu;
$suratWaktunew = date("d-m-Y", strtotime($suratWaktu)); $suratWaktunew = date("d-m-Y", strtotime($suratWaktu));
$isianWaktu = $request->isian_waktu; $isianWaktu = $request->isian_waktu;
$isianWaktunew = date("d-m-Y", strtotime($isianWaktu)); $isianWaktunew = date("d-m-Y", strtotime($isianWaktu));
$dataKonKegiatan = [ $dataKonKegiatan = [
'idPSekolah' => session()->get('idPSekolah'), 'idPSekolah' => session()->get('idPSekolah'),
'idSKonselor' => session()->get('idSKonselor'), 'idSKonselor' => session()->get('idSKonselor'),
......
...@@ -33,7 +33,7 @@ public function __construct() ...@@ -33,7 +33,7 @@ public function __construct()
{ {
createLogActivity(); createLogActivity();
$this->mPeriode = New PeriodeModel(); $this->mPeriode = New PeriodeModel();
$this->mPerpusSekolah = New SekolahModel(); $this->mPerpusSekolah = New SekolahModel();
$this->mPerpusJurusan = New JurusanModel(); $this->mPerpusJurusan = New JurusanModel();
$this->mPerpusKelas = New KelasModel(); $this->mPerpusKelas = New KelasModel();
...@@ -55,7 +55,7 @@ public function __construct() ...@@ -55,7 +55,7 @@ public function __construct()
'idPSekolah' => session()->get('idPSekolah'), 'idPSekolah' => session()->get('idPSekolah'),
'idSKonselor' => session()->get('idSKonselor'), 'idSKonselor' => session()->get('idSKonselor'),
]; ];
$dipulangkan = $this->mDipulangkan->where($wherenyaa)->get(); $dipulangkan = $this->mDipulangkan->where($wherenyaa)->whereHas('siswa')->get();
$data = [ $data = [
'title' => $this->title, 'title' => $this->title,
...@@ -96,8 +96,8 @@ public function __construct() ...@@ -96,8 +96,8 @@ public function __construct()
return redirect("$this->url")->with('gagal', 'Guru Konseling belum di set atau tidak aktif'); return redirect("$this->url")->with('gagal', 'Guru Konseling belum di set atau tidak aktif');
}; };
$suratWaktu = $request->surat_waktu; $suratWaktu = $request->surat_waktu;
$suratWaktunew = date("d-m-Y", strtotime($suratWaktu)); $suratWaktunew = date("d-m-Y", strtotime($suratWaktu));
$dataDipulangkan = [ $dataDipulangkan = [
'idPSekolah' => session()->get('idPSekolah'), 'idPSekolah' => session()->get('idPSekolah'),
'idSKonselor' => session()->get('idSKonselor'), 'idSKonselor' => session()->get('idSKonselor'),
...@@ -113,7 +113,7 @@ public function __construct() ...@@ -113,7 +113,7 @@ public function __construct()
]; ];
$this->mDipulangkan->create($dataDipulangkan); $this->mDipulangkan->create($dataDipulangkan);
$dipulangkan = $this->mDipulangkan->where('kode_unik', $dataDipulangkan['kode_unik'])->first(); $dipulangkan = $this->mDipulangkan->where('kode_unik', $dataDipulangkan['kode_unik'])->first();
$data = [ $data = [
'title' => $this->title, 'title' => $this->title,
'url' => $this->url, 'url' => $this->url,
...@@ -126,7 +126,7 @@ public function __construct() ...@@ -126,7 +126,7 @@ public function __construct()
public function show($id) public function show($id)
{ {
$dipulangkan = $this->mDipulangkan->where('kode_unik', $id)->first(); $dipulangkan = $this->mDipulangkan->where('kode_unik', $id)->first();
$data = [ $data = [
'title' => $this->title, 'title' => $this->title,
'url' => $this->url, 'url' => $this->url,
...@@ -158,26 +158,26 @@ public function __construct() ...@@ -158,26 +158,26 @@ public function __construct()
// pakai dari sini. sambil buka word coba.docx // pakai dari sini. sambil buka word coba.docx
$templateProcessor = new TemplateProcessor('word-template/surat/surat_keterangan_dipulangkan.docx'); // load template word $templateProcessor = new TemplateProcessor('word-template/surat/surat_keterangan_dipulangkan.docx'); // load template word
$templateProcessor->setImageValue('KopSurat', array('path' => "upload/logo_sekolah/".$datadipulangkan['KopSurat'], 'width' => 500, 'height' => 200, 'ratio' => true)); $templateProcessor->setImageValue('KopSurat', array('path' => "upload/logo_sekolah/".$datadipulangkan['KopSurat'], 'width' => 500, 'height' => 200, 'ratio' => true));
$templateProcessor->setValue('namaSiswa', $datadipulangkan['idSiswa']); $templateProcessor->setValue('namaSiswa', $datadipulangkan['idSiswa']);
$templateProcessor->setValue('kelasSiswa', $datadipulangkan['idPKKode']); $templateProcessor->setValue('kelasSiswa', $datadipulangkan['idPKKode']);
$templateProcessor->setValue('alasan', $datadipulangkan['isian_alasan']); $templateProcessor->setValue('alasan', $datadipulangkan['isian_alasan']);
$templateProcessor->setValue('surat_tempat', $datadipulangkan['surat_tempat']); $templateProcessor->setValue('surat_tempat', $datadipulangkan['surat_tempat']);
$templateProcessor->setValue('tanggalSurat', $datadipulangkan['surat_waktu']); $templateProcessor->setValue('tanggalSurat', $datadipulangkan['surat_waktu']);
$templateProcessor->setValue('namaOrtu', $datadipulangkan['idOrtu']); $templateProcessor->setValue('namaOrtu', $datadipulangkan['idOrtu']);
$templateProcessor->setValue('namaKonselor', $datadipulangkan['idSKonselor']); $templateProcessor->setValue('namaKonselor', $datadipulangkan['idSKonselor']);
$templateProcessor->setValue('nipKonselor', $datadipulangkan['nipKonselor']); $templateProcessor->setValue('nipKonselor', $datadipulangkan['nipKonselor']);
$fileName = 'Surat Siswa Dipulangkan'; // nama filenya $fileName = 'Surat Siswa Dipulangkan'; // nama filenya
// biar bisa dunlud // biar bisa dunlud
$templateProcessor->saveAs('tempor/' . $fileName . '.docx'); $templateProcessor->saveAs('tempor/' . $fileName . '.docx');
return response()->download('tempor/' . $fileName . '.docx')->deleteFileAfterSend(true); return response()->download('tempor/' . $fileName . '.docx')->deleteFileAfterSend(true);
// dd($datadipulangkan); // dd($datadipulangkan);
} }
public function edit($id){ public function edit($id){
$dipulangkan = $this->mDipulangkan->where('kode_unik', $id)->first(); $dipulangkan = $this->mDipulangkan->where('kode_unik', $id)->first();
$data = [ $data = [
'title' => $this->title, 'title' => $this->title,
'url' => $this->url, 'url' => $this->url,
...@@ -197,7 +197,7 @@ public function __construct() ...@@ -197,7 +197,7 @@ public function __construct()
$suratWaktu = $request->surat_waktu; $suratWaktu = $request->surat_waktu;
$suratWaktunew = date("d-m-Y", strtotime($suratWaktu)); $suratWaktunew = date("d-m-Y", strtotime($suratWaktu));
} else { } else {
$suratWaktunew = $dataUbah->surat_waktu; $suratWaktunew = $dataUbah->surat_waktu;
} }
$dataDipulangkan = [ $dataDipulangkan = [
...@@ -213,7 +213,7 @@ public function __construct() ...@@ -213,7 +213,7 @@ public function __construct()
'surat_waktu' => $suratWaktunew, 'surat_waktu' => $suratWaktunew,
'isian_alasan' => $request->isian_alasan, 'isian_alasan' => $request->isian_alasan,
]; ];
$this->mDipulangkan->where('kode_unik', $id)->update($dataDipulangkan); $this->mDipulangkan->where('kode_unik', $id)->update($dataDipulangkan);
return redirect("$this->url")->with('sukses', 'Data Surat Keterangan Dipulangkan untuk '.$dataUbah->siswa->nama.' berhasil di edit'); return redirect("$this->url")->with('sukses', 'Data Surat Keterangan Dipulangkan untuk '.$dataUbah->siswa->nama.' berhasil di edit');
......
...@@ -34,7 +34,7 @@ public function __construct() ...@@ -34,7 +34,7 @@ public function __construct()
{ {
createLogActivity(); createLogActivity();
$this->mPeriode = New PeriodeModel(); $this->mPeriode = New PeriodeModel();
$this->mPerpusSekolah = New SekolahModel(); $this->mPerpusSekolah = New SekolahModel();
$this->mPerpusJurusan = New JurusanModel(); $this->mPerpusJurusan = New JurusanModel();
$this->mPerpusKelas = New KelasModel(); $this->mPerpusKelas = New KelasModel();
...@@ -57,7 +57,7 @@ public function __construct() ...@@ -57,7 +57,7 @@ public function __construct()
'idPSekolah' => session()->get('idPSekolah'), 'idPSekolah' => session()->get('idPSekolah'),
'idSKonselor' => session()->get('idSKonselor'), 'idSKonselor' => session()->get('idSKonselor'),
]; ];
$daftar_pt = $this->mDaftarPT->where($wherenyaa)->get(); $daftar_pt = $this->mDaftarPT->where($wherenyaa)->whereHas('siswa')->get();
$data = [ $data = [
'title' => $this->title, 'title' => $this->title,
...@@ -92,8 +92,8 @@ public function __construct() ...@@ -92,8 +92,8 @@ public function __construct()
return redirect("$this->url")->with('gagal', 'Kepala Sekolah belum di set'); return redirect("$this->url")->with('gagal', 'Kepala Sekolah belum di set');
}; };
$suratWaktu = $request->surat_waktu; $suratWaktu = $request->surat_waktu;
$suratWaktunew = date("d-m-Y", strtotime($suratWaktu)); $suratWaktunew = date("d-m-Y", strtotime($suratWaktu));
$dataDaftarPT = [ $dataDaftarPT = [
...@@ -127,7 +127,7 @@ public function __construct() ...@@ -127,7 +127,7 @@ public function __construct()
{ {
// Get Data // Get Data
$daftar_pt = $this->mDaftarPT->where('kode_unik', $id)->first(); $daftar_pt = $this->mDaftarPT->where('kode_unik', $id)->first();
$data = [ $data = [
'title' => $this->title, 'title' => $this->title,
'url' => $this->url, 'url' => $this->url,
...@@ -145,7 +145,7 @@ public function __construct() ...@@ -145,7 +145,7 @@ public function __construct()
$sekolah = $this->mPerpusSekolah->where('id', session()->get('idPSekolah'))->first(); $sekolah = $this->mPerpusSekolah->where('id', session()->get('idPSekolah'))->first();
$daftar_pt = $this->mDaftarPT->where('kode_unik', $id)->first(); $daftar_pt = $this->mDaftarPT->where('kode_unik', $id)->first();
// dd($mundur); // dd($mundur);
$dataDaftarPT = [ $dataDaftarPT = [
'namaSekolah' => $sekolah->nama, 'namaSekolah' => $sekolah->nama,
'KopSurat' => $sekolah->logo, 'KopSurat' => $sekolah->logo,
...@@ -165,19 +165,19 @@ public function __construct() ...@@ -165,19 +165,19 @@ public function __construct()
// pakai dari sini. sambil buka word coba.docx // pakai dari sini. sambil buka word coba.docx
$templateProcessor = new TemplateProcessor('word-template/surat/surat_keterangan_daftarpt2.docx'); // load template word $templateProcessor = new TemplateProcessor('word-template/surat/surat_keterangan_daftarpt2.docx'); // load template word
$templateProcessor->setImageValue('KopSurat', array('path' => "upload/logo_sekolah/".$dataDaftarPT['KopSurat'], 'width' => 500, 'height' => 200, 'ratio' => true)); $templateProcessor->setImageValue('KopSurat', array('path' => "upload/logo_sekolah/".$dataDaftarPT['KopSurat'], 'width' => 500, 'height' => 200, 'ratio' => true));
$templateProcessor->setValue('namaSekolah', $dataDaftarPT['namaSekolah']); $templateProcessor->setValue('namaSekolah', $dataDaftarPT['namaSekolah']);
$templateProcessor->setValue('namaSiswa', $dataDaftarPT['idSiswa']); $templateProcessor->setValue('namaSiswa', $dataDaftarPT['idSiswa']);
$templateProcessor->setValue('kelasSiswa', $dataDaftarPT['idPKKode']); $templateProcessor->setValue('kelasSiswa', $dataDaftarPT['idPKKode']);
$templateProcessor->setValue('jurusanSekolah', $dataDaftarPT['idPJurusan']); $templateProcessor->setValue('jurusanSekolah', $dataDaftarPT['idPJurusan']);
$templateProcessor->setValue('noIndukSiswa', $dataDaftarPT['nisn']); $templateProcessor->setValue('noIndukSiswa', $dataDaftarPT['nisn']);
$templateProcessor->setValue('suratTempat', $dataDaftarPT['surat_tempat']); $templateProcessor->setValue('suratTempat', $dataDaftarPT['surat_tempat']);
$templateProcessor->setValue('tanggalSurat', $dataDaftarPT['surat_waktu']); $templateProcessor->setValue('tanggalSurat', $dataDaftarPT['surat_waktu']);
$templateProcessor->setValue('noSurat', $dataDaftarPT['nomor']); $templateProcessor->setValue('noSurat', $dataDaftarPT['nomor']);
$templateProcessor->setValue('namaKepsek', $dataDaftarPT['idSKepsek']); $templateProcessor->setValue('namaKepsek', $dataDaftarPT['idSKepsek']);
$templateProcessor->setValue('nipKepsek', $dataDaftarPT['nipKepsek']); $templateProcessor->setValue('nipKepsek', $dataDaftarPT['nipKepsek']);
$templateProcessor->setValue('isian_keterangan', $dataDaftarPT['isian_keterangan']); $templateProcessor->setValue('isian_keterangan', $dataDaftarPT['isian_keterangan']);
$fileName = 'Surat Keterangan Daftar Perguruan Tinggi'; // nama filenya $fileName = 'Surat Keterangan Daftar Perguruan Tinggi'; // nama filenya
// biar bisa dunlud // biar bisa dunlud
$templateProcessor->saveAs('tempor/' . $fileName . '.docx'); $templateProcessor->saveAs('tempor/' . $fileName . '.docx');
...@@ -187,7 +187,7 @@ public function __construct() ...@@ -187,7 +187,7 @@ public function __construct()
public function edit($id){ public function edit($id){
$daftar_pt = $this->mDaftarPT->where('kode_unik', $id)->first(); $daftar_pt = $this->mDaftarPT->where('kode_unik', $id)->first();
$data = [ $data = [
'title' => $this->title, 'title' => $this->title,
'url' => $this->url, 'url' => $this->url,
...@@ -207,7 +207,7 @@ public function __construct() ...@@ -207,7 +207,7 @@ public function __construct()
$suratWaktu = $request->surat_waktu; $suratWaktu = $request->surat_waktu;
$suratWaktunew = date("d-m-Y", strtotime($suratWaktu)); $suratWaktunew = date("d-m-Y", strtotime($suratWaktu));
} else { } else {
$suratWaktunew = $dataUbah->surat_waktu; $suratWaktunew = $dataUbah->surat_waktu;
} }
$dataDaftarPT = [ $dataDaftarPT = [
...@@ -223,7 +223,7 @@ public function __construct() ...@@ -223,7 +223,7 @@ public function __construct()
'surat_waktu' => $suratWaktunew, 'surat_waktu' => $suratWaktunew,
'isian_keterangan' => $request->isian_keterangan, 'isian_keterangan' => $request->isian_keterangan,
]; ];
$this->mDaftarPT->where('kode_unik', $id)->update($dataDaftarPT); $this->mDaftarPT->where('kode_unik', $id)->update($dataDaftarPT);
return redirect("$this->url")->with('sukses', 'Data Surat Keterangan Daftar Perguruan Tinggi untuk '.$dataUbah->siswa->nama.' berhasil di edit'); return redirect("$this->url")->with('sukses', 'Data Surat Keterangan Daftar Perguruan Tinggi untuk '.$dataUbah->siswa->nama.' berhasil di edit');
......
...@@ -40,7 +40,7 @@ public function __construct() ...@@ -40,7 +40,7 @@ public function __construct()
$this->mPerpusKelas = new KelasModel(); $this->mPerpusKelas = new KelasModel();
$this->mKelasKode = new KelasKodeModel(); $this->mKelasKode = new KelasKodeModel();
$this->mPerpusSekolah = new SekolahModel(); $this->mPerpusSekolah = new SekolahModel();
$this->mKepsek = New KepsekModel(); $this->mKepsek = New KepsekModel();
$this->mSekolahWali = new SekolahWaliModel(); $this->mSekolahWali = new SekolahWaliModel();
$this->mKonselor = New KonselorModel(); $this->mKonselor = New KonselorModel();
...@@ -58,7 +58,7 @@ public function __construct() ...@@ -58,7 +58,7 @@ public function __construct()
'idPSekolah' => session()->get('idPSekolah'), 'idPSekolah' => session()->get('idPSekolah'),
'idSKonselor' => session()->get('idSKonselor'), 'idSKonselor' => session()->get('idSKonselor'),
]; ];
$tartib = $this->mTartib->where($wherenyaa)->get(); $tartib = $this->mTartib->where($wherenyaa)->whereHas('siswa')->get();
$data = [ $data = [
'title' => $this->title, 'title' => $this->title,
...@@ -83,7 +83,7 @@ public function __construct() ...@@ -83,7 +83,7 @@ public function __construct()
public function store(Request $request) public function store(Request $request)
{ {
// masuk sini hasil form create // masuk sini hasil form create
$suratWaktu = $request->surat_waktu; $suratWaktu = $request->surat_waktu;
$suratWaktunew = date("d-m-Y", strtotime($suratWaktu)); $suratWaktunew = date("d-m-Y", strtotime($suratWaktu));
$siswa = $this->mSiswa->where('id', $request->idSiswa)->first(); $siswa = $this->mSiswa->where('id', $request->idSiswa)->first();
...@@ -106,7 +106,7 @@ public function __construct() ...@@ -106,7 +106,7 @@ public function __construct()
if(!isset($wali)){ if(!isset($wali)){
return redirect("$this->url")->with('gagal', 'Wali Kelas belum di set'); return redirect("$this->url")->with('gagal', 'Wali Kelas belum di set');
}; };
$whereKep = [ $whereKep = [
'idPSekolah' => session()->get('idPSekolah'), 'idPSekolah' => session()->get('idPSekolah'),
'status' => 1 'status' => 1
...@@ -152,7 +152,7 @@ public function __construct() ...@@ -152,7 +152,7 @@ public function __construct()
{ {
// Get Data // Get Data
$tartib = $this->mTartib->where('kode_unik', $id)->first(); $tartib = $this->mTartib->where('kode_unik', $id)->first();
$data = [ $data = [
'title' => $this->title, 'title' => $this->title,
'url' => $this->url, 'url' => $this->url,
...@@ -170,7 +170,7 @@ public function __construct() ...@@ -170,7 +170,7 @@ public function __construct()
$sekolah = $this->mPerpusSekolah->where('id', session()->get('idPSekolah'))->first(); $sekolah = $this->mPerpusSekolah->where('id', session()->get('idPSekolah'))->first();
$tartib = $this->mTartib->where('kode_unik', $id)->first(); $tartib = $this->mTartib->where('kode_unik', $id)->first();
// dd($mundur); // dd($mundur);
$dataTartib = [ $dataTartib = [
'namaSekolah' => $sekolah->namaSekolah, 'namaSekolah' => $sekolah->namaSekolah,
'KopSurat' => $sekolah->logo, 'KopSurat' => $sekolah->logo,
...@@ -196,27 +196,27 @@ public function __construct() ...@@ -196,27 +196,27 @@ public function __construct()
// pakai dari sini. sambil buka word coba.docx // pakai dari sini. sambil buka word coba.docx
$templateProcessor = new TemplateProcessor('word-template/surat/surat_pernyataan_tatatertib.docx'); // load template word $templateProcessor = new TemplateProcessor('word-template/surat/surat_pernyataan_tatatertib.docx'); // load template word
$templateProcessor->setImageValue('KopSurat', array('path' => "upload/logo_sekolah/".$dataTartib['KopSurat'], 'width' => 500, 'height' => 200, 'ratio' => true)); $templateProcessor->setImageValue('KopSurat', array('path' => "upload/logo_sekolah/".$dataTartib['KopSurat'], 'width' => 500, 'height' => 200, 'ratio' => true));
$templateProcessor->setValue('namaSekolah', $dataTartib['namaSekolah']); $templateProcessor->setValue('namaSekolah', $dataTartib['namaSekolah']);
$templateProcessor->setValue('namaSiswa', $dataTartib['idSiswa']); $templateProcessor->setValue('namaSiswa', $dataTartib['idSiswa']);
$templateProcessor->setValue('alamatSiswa', $dataTartib['alamatOrtu']); $templateProcessor->setValue('alamatSiswa', $dataTartib['alamatOrtu']);
$templateProcessor->setValue('kelasSiswa', $dataTartib['idPKKode']); $templateProcessor->setValue('kelasSiswa', $dataTartib['idPKKode']);
$templateProcessor->setValue('noIndukSiswa', $dataTartib['nisn']); $templateProcessor->setValue('noIndukSiswa', $dataTartib['nisn']);
$templateProcessor->setValue('namaOrtu', $dataTartib['idOrtu']); $templateProcessor->setValue('namaOrtu', $dataTartib['idOrtu']);
$templateProcessor->setValue('alamatOrtu', $dataTartib['alamatOrtu']); $templateProcessor->setValue('alamatOrtu', $dataTartib['alamatOrtu']);
$templateProcessor->setValue('menghadapKe', $dataTartib['isian_menghadap']); $templateProcessor->setValue('menghadapKe', $dataTartib['isian_menghadap']);
$templateProcessor->setValue('jenisMasalah', $dataTartib['isian_jenisMasalah']); $templateProcessor->setValue('jenisMasalah', $dataTartib['isian_jenisMasalah']);
$templateProcessor->setValue('penyelesaian', $dataTartib['isian_penyelesaian']); $templateProcessor->setValue('penyelesaian', $dataTartib['isian_penyelesaian']);
$templateProcessor->setValue('suratTempat', $dataTartib['surat_tempat']); $templateProcessor->setValue('suratTempat', $dataTartib['surat_tempat']);
$templateProcessor->setValue('tanggalSurat', $dataTartib['surat_waktu']); $templateProcessor->setValue('tanggalSurat', $dataTartib['surat_waktu']);
$templateProcessor->setValue('namaWaliKelas', $dataTartib['idSWali']); $templateProcessor->setValue('namaWaliKelas', $dataTartib['idSWali']);
$templateProcessor->setValue('nipWaliKelas', $dataTartib['nipWali']); $templateProcessor->setValue('nipWaliKelas', $dataTartib['nipWali']);
$templateProcessor->setValue('namaKonselor', $dataTartib['idSKonselor']); $templateProcessor->setValue('namaKonselor', $dataTartib['idSKonselor']);
$templateProcessor->setValue('nipKonselor', $dataTartib['nipKonselor']); $templateProcessor->setValue('nipKonselor', $dataTartib['nipKonselor']);
$templateProcessor->setValue('namaKepsek', $dataTartib['idSKepsek']); $templateProcessor->setValue('namaKepsek', $dataTartib['idSKepsek']);
$templateProcessor->setValue('nipKepsek', $dataTartib['nipKepsek']); $templateProcessor->setValue('nipKepsek', $dataTartib['nipKepsek']);
$templateProcessor->setValue('sangsi', $dataTartib['isian_penyelesaian']); $templateProcessor->setValue('sangsi', $dataTartib['isian_penyelesaian']);
$fileName = 'Surat Pernyataan Tata Tertib'; // nama filenya $fileName = 'Surat Pernyataan Tata Tertib'; // nama filenya
// biar bisa dunlud // biar bisa dunlud
$templateProcessor->saveAs('tempor/' . $fileName . '.docx'); $templateProcessor->saveAs('tempor/' . $fileName . '.docx');
...@@ -226,7 +226,7 @@ public function __construct() ...@@ -226,7 +226,7 @@ public function __construct()
public function edit($id){ public function edit($id){
$tartib = $this->mTartib->where('kode_unik', $id)->first(); $tartib = $this->mTartib->where('kode_unik', $id)->first();
$data = [ $data = [
'title' => $this->title, 'title' => $this->title,
'url' => $this->url, 'url' => $this->url,
...@@ -247,7 +247,7 @@ public function __construct() ...@@ -247,7 +247,7 @@ public function __construct()
$suratWaktu = $request->surat_waktu; $suratWaktu = $request->surat_waktu;
$suratWaktunew = date("d-m-Y", strtotime($suratWaktu)); $suratWaktunew = date("d-m-Y", strtotime($suratWaktu));
} else { } else {
$suratWaktunew = $dataUbah->surat_waktu; $suratWaktunew = $dataUbah->surat_waktu;
} }
$dataTartib = [ $dataTartib = [
...@@ -267,7 +267,7 @@ public function __construct() ...@@ -267,7 +267,7 @@ public function __construct()
'isian_jenisMasalah' => $request->isian_jenisMasalah, 'isian_jenisMasalah' => $request->isian_jenisMasalah,
'isian_penyelesaian' => $request->isian_penyelesaian, 'isian_penyelesaian' => $request->isian_penyelesaian,
]; ];
$this->mTartib->where('kode_unik', $id)->update($dataTartib); $this->mTartib->where('kode_unik', $id)->update($dataTartib);
return redirect("$this->url")->with('sukses', 'Data Surat Keterangan Tata Tertib untuk '.$dataUbah->siswa->nama.' berhasil di edit'); return redirect("$this->url")->with('sukses', 'Data Surat Keterangan Tata Tertib untuk '.$dataUbah->siswa->nama.' berhasil di edit');
......
...@@ -32,7 +32,7 @@ public function __construct() ...@@ -32,7 +32,7 @@ public function __construct()
createLogActivity(); createLogActivity();
// Di isi Construct // Di isi Construct
$this->mPeriode = New PeriodeModel(); $this->mPeriode = New PeriodeModel();
$this->mPerpusJurusan = new JurusanModel(); $this->mPerpusJurusan = new JurusanModel();
$this->mPerpusKelas = new KelasModel(); $this->mPerpusKelas = new KelasModel();
$this->mKelasKode = new KelasKodeModel(); $this->mKelasKode = new KelasKodeModel();
...@@ -52,8 +52,8 @@ public function __construct() ...@@ -52,8 +52,8 @@ public function __construct()
'idPSekolah' => session()->get('idPSekolah'), 'idPSekolah' => session()->get('idPSekolah'),
'idSKonselor' => session()->get('idSKonselor'), 'idSKonselor' => session()->get('idSKonselor'),
]; ];
$undangOrtu = $this->mUndangOrtu->where($wherenyaa)->get(); $undangOrtu = $this->mUndangOrtu->where($wherenyaa)->whereHas('siswa')->get();
$data = [ $data = [
'title' => $this->title, 'title' => $this->title,
'url' => $this->url, 'url' => $this->url,
...@@ -91,11 +91,11 @@ public function __construct() ...@@ -91,11 +91,11 @@ public function __construct()
return redirect("$this->url")->with('gagal', 'Data Ortu tidak ditemukan'); return redirect("$this->url")->with('gagal', 'Data Ortu tidak ditemukan');
}; };
$suratWaktu = $request->surat_waktu; $suratWaktu = $request->surat_waktu;
$suratWaktunew = date("d-m-Y", strtotime($suratWaktu)); $suratWaktunew = date("d-m-Y", strtotime($suratWaktu));
$isian_tanggal = $request->isian_tanggal; $isian_tanggal = $request->isian_tanggal;
$isiantanggalnew = date("d-m-Y", strtotime($isian_tanggal)); $isiantanggalnew = date("d-m-Y", strtotime($isian_tanggal));
$dataUndangOrtu = [ $dataUndangOrtu = [
'idPSekolah' => session()->get('idPSekolah'), 'idPSekolah' => session()->get('idPSekolah'),
'idSiswa' => $request->idSiswa, 'idSiswa' => $request->idSiswa,
...@@ -119,7 +119,7 @@ public function __construct() ...@@ -119,7 +119,7 @@ public function __construct()
// return redirect("$this->url")->with('sukses', 'Permintaan Surat berhasil di tambah'); // return redirect("$this->url")->with('sukses', 'Permintaan Surat berhasil di tambah');
// echo json_encode($kepsek); die; // echo json_encode($kepsek); die;
$undangOrtu = $this->mUndangOrtu->where('kode_unik', $dataUndangOrtu['kode_unik'])->first(); $undangOrtu = $this->mUndangOrtu->where('kode_unik', $dataUndangOrtu['kode_unik'])->first();
$data = [ $data = [
'title' => $this->title, 'title' => $this->title,
'url' => $this->url, 'url' => $this->url,
...@@ -133,7 +133,7 @@ public function __construct() ...@@ -133,7 +133,7 @@ public function __construct()
{ {
// Get Data // Get Data
$undangOrtu = $this->mUndangOrtu->where('kode_unik', $id)->first(); $undangOrtu = $this->mUndangOrtu->where('kode_unik', $id)->first();
$data = [ $data = [
'title' => $this->title, 'title' => $this->title,
'url' => $this->url, 'url' => $this->url,
...@@ -176,29 +176,29 @@ public function __construct() ...@@ -176,29 +176,29 @@ public function __construct()
$templateProcessor->setValue('namaSekolah', $dataUndangOrtu['namaSekolah']); $templateProcessor->setValue('namaSekolah', $dataUndangOrtu['namaSekolah']);
$templateProcessor->setValue('tanggalSurat', $dataUndangOrtu['surat_waktu']); $templateProcessor->setValue('tanggalSurat', $dataUndangOrtu['surat_waktu']);
$templateProcessor->setValue('nomorSurat', $dataUndangOrtu['nomor']); $templateProcessor->setValue('nomorSurat', $dataUndangOrtu['nomor']);
$templateProcessor->setValue('namaOrtu', $dataUndangOrtu['idOrtu']); $templateProcessor->setValue('namaOrtu', $dataUndangOrtu['idOrtu']);
$templateProcessor->setValue('namaSiswa', $dataUndangOrtu['idSiswa']); $templateProcessor->setValue('namaSiswa', $dataUndangOrtu['idSiswa']);
$templateProcessor->setValue('kelasSiswa', $dataUndangOrtu['idPKKode']); $templateProcessor->setValue('kelasSiswa', $dataUndangOrtu['idPKKode']);
$templateProcessor->setValue('hariPanggil', $dataUndangOrtu['isian_hari']); $templateProcessor->setValue('hariPanggil', $dataUndangOrtu['isian_hari']);
$templateProcessor->setValue('tanggalPanggil', $dataUndangOrtu['isian_tanggal']); $templateProcessor->setValue('tanggalPanggil', $dataUndangOrtu['isian_tanggal']);
$templateProcessor->setValue('pukul', $dataUndangOrtu['isian_pukul']); $templateProcessor->setValue('pukul', $dataUndangOrtu['isian_pukul']);
$templateProcessor->setValue('keperluan', $dataUndangOrtu['isian_keperluan']); $templateProcessor->setValue('keperluan', $dataUndangOrtu['isian_keperluan']);
$templateProcessor->setValue('namaKepsek', $dataUndangOrtu['idSKepsek']); $templateProcessor->setValue('namaKepsek', $dataUndangOrtu['idSKepsek']);
$templateProcessor->setValue('nipKepsek', $dataUndangOrtu['nipKepsek']); $templateProcessor->setValue('nipKepsek', $dataUndangOrtu['nipKepsek']);
$templateProcessor->setValue('isian_bertemu', $dataUndangOrtu['isian_bertemu']); $templateProcessor->setValue('isian_bertemu', $dataUndangOrtu['isian_bertemu']);
$templateProcessor->setValue('surat_tempat', $dataUndangOrtu['surat_tempat']); $templateProcessor->setValue('surat_tempat', $dataUndangOrtu['surat_tempat']);
$fileName = 'UNDANGAN ORANG TUA'; // nama filenya $fileName = 'UNDANGAN ORANG TUA'; // nama filenya
// biar bisa dunlud // biar bisa dunlud
$templateProcessor->saveAs('tempor/' . $fileName . '.docx'); $templateProcessor->saveAs('tempor/' . $fileName . '.docx');
return response()->download('tempor/' . $fileName . '.docx')->deleteFileAfterSend(true); return response()->download('tempor/' . $fileName . '.docx')->deleteFileAfterSend(true);
// dd($dataUndangOrtu); // dd($dataUndangOrtu);
} }
public function edit($id){ public function edit($id){
$undangOrtu = $this->mUndangOrtu->where('kode_unik', $id)->first(); $undangOrtu = $this->mUndangOrtu->where('kode_unik', $id)->first();
$data = [ $data = [
'title' => $this->title, 'title' => $this->title,
'url' => $this->url, 'url' => $this->url,
...@@ -219,16 +219,16 @@ public function __construct() ...@@ -219,16 +219,16 @@ public function __construct()
$suratWaktu = $request->surat_waktu; $suratWaktu = $request->surat_waktu;
$suratWaktunew = date("d-m-Y", strtotime($suratWaktu)); $suratWaktunew = date("d-m-Y", strtotime($suratWaktu));
} else { } else {
$suratWaktunew = $dataUbah->surat_waktu; $suratWaktunew = $dataUbah->surat_waktu;
} }
if (isset($request->isian_tanggal)) { if (isset($request->isian_tanggal)) {
$isian_tanggal = $request->isian_tanggal; $isian_tanggal = $request->isian_tanggal;
$isiantanggalnew = date("d-m-Y", strtotime($isian_tanggal)); $isiantanggalnew = date("d-m-Y", strtotime($isian_tanggal));
} else { } else {
$isiantanggalnew = $dataUbah->isian_tanggal; $isiantanggalnew = $dataUbah->isian_tanggal;
} }
$dataUndangOrtu = [ $dataUndangOrtu = [
// 'idPSekolah' => session()->get('idPSekolah'), // 'idPSekolah' => session()->get('idPSekolah'),
// 'idSiswa' => $request->idSiswa, // 'idSiswa' => $request->idSiswa,
...@@ -248,7 +248,7 @@ public function __construct() ...@@ -248,7 +248,7 @@ public function __construct()
'isian_bertemu' => $request->isian_bertemu, 'isian_bertemu' => $request->isian_bertemu,
'idSKonselor' => session()->get('idSKonselor'), 'idSKonselor' => session()->get('idSKonselor'),
]; ];
$this->mUndangOrtu->where('kode_unik', $id)->update($dataUndangOrtu); $this->mUndangOrtu->where('kode_unik', $id)->update($dataUndangOrtu);
return redirect("$this->url")->with('sukses', 'Data Surat Undang Orang Tua untuk '.$dataUbah->siswa->nama.' berhasil di edit'); return redirect("$this->url")->with('sukses', 'Data Surat Undang Orang Tua untuk '.$dataUbah->siswa->nama.' berhasil di edit');
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<li class="breadcrumb-item active">Data</li> <li class="breadcrumb-item active">Data</li>
@endcomponent @endcomponent
<div class="container-fluid pt-4"> <div class="container-fluid pt-4">
<div class="row justify-content-center"> <div class="row justify-content-center">
<div class="col-lg-10 col-sm-12"> <div class="col-lg-10 col-sm-12">
<div class="card border-top border-0 border-4 border-info"> <div class="card border-top border-0 border-4 border-info">
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<h5 class="card-title">{{ $page }}</h5> <h5 class="card-title">{{ $page }}</h5>
</div> </div>
<div class="col-lg-6"> <div class="col-lg-6">
<a href="{{ url('konselor/surat/sp_mundur') }}" class="btn btn-sm btn-primary float-end">kembali</a> <a href="{{ url($url) }}" class="btn btn-sm btn-primary float-end">kembali</a>
</div> </div>
</div> </div>
</div> </div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment