Struktur ulang: memindahkan sistem ke folder public untuk Nginx
This commit is contained in:
@@ -0,0 +1,142 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Akun extends CI_Controller {
|
||||
|
||||
|
||||
// load data
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
//$this->log_user->add_log();
|
||||
$this->load->model('user_model');
|
||||
//$this->load->model('staff_model');
|
||||
|
||||
// Ambil check login dari simple_login
|
||||
$this->simple_login->check_login();
|
||||
}
|
||||
|
||||
// Main page akun
|
||||
public function index()
|
||||
{
|
||||
$id = $this->session->userdata('id');
|
||||
$user = $this->user_model->detail($id);
|
||||
|
||||
// Validasi
|
||||
$valid = $this->form_validation;
|
||||
|
||||
$valid->set_rules('nama','Nama Pengguna','required',
|
||||
array( 'required' => '%s harus diisi'));
|
||||
|
||||
$valid->set_rules('email','Email Pengguna','required|valid_email',
|
||||
array( 'required' => '%s harus diisi',
|
||||
'valid_email' => '%s tidak valid. Masukkan email yang benar.'));
|
||||
|
||||
if($valid->run()) {
|
||||
if(!empty($_FILES['gambar']['name'])) {
|
||||
$config['upload_path'] = './assets/upload/user/';
|
||||
$config['allowed_types'] = 'gif|jpg|png|jpeg';
|
||||
$config['max_size'] = '2400'; // KB
|
||||
$config['max_width'] = '3000'; // Pixel
|
||||
$config['max_height'] = '3000'; //Pixel
|
||||
$this->load->library('upload', $config);
|
||||
if ( ! $this->upload->do_upload('gambar')){
|
||||
// End validasi
|
||||
|
||||
$data = array( 'title' => 'Aplikasi PPDB MTD - Profil Akun Anda: '.$this->session->userdata('nama'),
|
||||
'user' => $user,
|
||||
'error' => $this->upload->display_errors(),
|
||||
'content' => 'akun/list'
|
||||
);
|
||||
$this->load->view('layout/wrapper', $data, FALSE);
|
||||
|
||||
// Masuk database
|
||||
}else{
|
||||
$upload_data = array('uploads' =>$this->upload->data());
|
||||
// Image Editor
|
||||
$config['image_library'] = 'gd2';
|
||||
$config['source_image'] = './assets/upload/user/'.$upload_data['uploads']['file_name'];
|
||||
$config['new_image'] = './assets/upload/user/thumbs/';
|
||||
$config['create_thumb'] = TRUE;
|
||||
$config['quality'] = "100%";
|
||||
$config['maintain_ratio'] = TRUE;
|
||||
$config['width'] = 360; // Pixel
|
||||
$config['height'] = 360; // Pixel
|
||||
$config['x_axis'] = 0;
|
||||
$config['y_axis'] = 0;
|
||||
$config['thumb_marker'] = '';
|
||||
$this->load->library('image_lib', $config);
|
||||
$this->image_lib->resize();
|
||||
|
||||
$i = $this->input;
|
||||
$this->session->set_userdata('nama',$i->post('nama'));
|
||||
$data = array( 'id' => $id,
|
||||
'nama' => $i->post('nama'),
|
||||
'email' => $i->post('email'),
|
||||
'gambar' => $upload_data['uploads']['file_name'],
|
||||
);
|
||||
$this->user_model->edit($data);
|
||||
$this->session->set_flashdata('sukses', 'Data '.$user->nama.' telah diupdate');
|
||||
redirect(base_url('akun'),'refresh');
|
||||
}}else{
|
||||
$i = $this->input;
|
||||
$this->session->set_userdata('nama',$i->post('nama'));
|
||||
$data = array( 'id' => $id,
|
||||
'nama' => $i->post('nama'),
|
||||
'email' => $i->post('email'),
|
||||
);
|
||||
$this->user_model->edit($data);
|
||||
$this->session->set_flashdata('sukses', 'Data '.$user->nama.' telah diupdate');
|
||||
redirect(base_url('akun'),'refresh');
|
||||
}}
|
||||
// End masuk database
|
||||
$data = array( 'title' => 'Aplikasi PPDB MTD - Profil Akun Anda: '.$this->session->userdata('nama'),
|
||||
'user' => $user,
|
||||
'content' => 'akun/list'
|
||||
);
|
||||
$this->load->view('layout/wrapper', $data, FALSE);
|
||||
}
|
||||
|
||||
// Main page akun
|
||||
public function password()
|
||||
{
|
||||
$id = $this->session->userdata('id');
|
||||
$user = $this->user_model->detail($id);
|
||||
|
||||
// Validasi
|
||||
$valid = $this->form_validation;
|
||||
|
||||
$valid->set_rules('password','Password','required|trim|min_length[6]|max_length[32]',
|
||||
array( 'required' => '%s harus diisi',
|
||||
'min_length' => '%s minimal 6 karakter',
|
||||
'max_length' => '%s maksimal 32 karakter'));
|
||||
|
||||
$valid->set_rules('passconf', 'Konfirmasi password', 'required|matches[password]',
|
||||
array( 'required' => '%s harus diisi',
|
||||
'matches' => '%s tidak cocok. Pastikan password Anda sama'));
|
||||
|
||||
if($valid->run()===FALSE) {
|
||||
// End validasi
|
||||
|
||||
$data = array( 'title' => 'Profil Akun Anda: '.$this->session->userdata('nama'),
|
||||
'user' => $user,
|
||||
'content' => 'akun/password'
|
||||
);
|
||||
$this->load->view('layout/wrapper', $data, FALSE);
|
||||
// Masuk database
|
||||
}else{
|
||||
|
||||
$i = $this->input;
|
||||
$this->session->set_userdata('nama',$i->post('nama'));
|
||||
$data = array( 'id' => $id,
|
||||
'password' => MD5($i->post('password'))
|
||||
);
|
||||
$this->user_model->edit($data);
|
||||
$this->session->set_flashdata('sukses', 'Data '.$user->nama.' telah diupdate');
|
||||
redirect(base_url('akun'),'refresh');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* End of file Akun.php */
|
||||
/* Location: ./application/controllers/admin/Akun.php */
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Animasi extends CI_Controller {
|
||||
|
||||
//load model
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('animasi_model');
|
||||
$this->simple_login->check_login();
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$animasi = $this->animasi_model->animasi();
|
||||
$total = $this->animasi_model->total();
|
||||
|
||||
$data = array( 'title' => 'Data Pendaftar ANIMASI [ '.$total->total.' ]',
|
||||
'animasi' => $animasi,
|
||||
'content' => 'animasi/index'
|
||||
);
|
||||
$this->load->view('layout/wrapper', $data, FALSE);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Belumlulustes extends CI_Controller {
|
||||
|
||||
//load model
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('belumlulustes_model');
|
||||
$this->simple_login->check_login();
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$belumlulustes = $this->belumlulustes_model->belumlulus();
|
||||
$total = $this->belumlulustes_model->total();
|
||||
|
||||
$data = array( 'title' => 'Data Pendaftar BELUM LULUS TES [ '.$total->total.' ]',
|
||||
'belumlulustes' => $belumlulustes,
|
||||
'content' => 'belumlulustes/index'
|
||||
);
|
||||
$this->load->view('layout/wrapper', $data, FALSE);
|
||||
}
|
||||
|
||||
//Edit pengumuman
|
||||
public function edit($no_pendaftaran)
|
||||
{
|
||||
//panggil data user yang akan diedit
|
||||
$belumlulustes = $this->belumlulustes_model->detail($no_pendaftaran);
|
||||
|
||||
|
||||
//validasi input
|
||||
$valid = $this->form_validation;
|
||||
//check nama
|
||||
$valid->set_rules('status','Data Pengumuman Kelulusan','required',
|
||||
array( 'required' => '%s Harus Diisi'));
|
||||
|
||||
//jika sudah dicek dan error
|
||||
if($valid->run()===FALSE) {
|
||||
//end validasi
|
||||
|
||||
$data= array( 'title' => 'Edit Data Hasil Tes No. Pend : '.$belumlulustes->no_pendaftaran,
|
||||
'belumlulustes' => $belumlulustes,
|
||||
'content' => 'belumlulustes/edit'
|
||||
);
|
||||
$this->load->view('layout/wrapper', $data, FALSE);
|
||||
//jika validasi oke, masuk database
|
||||
}else{
|
||||
$inp = $this->input;
|
||||
$data = array( 'no_pendaftaran' => $no_pendaftaran,
|
||||
'status' => $inp->post('status'),
|
||||
'tanggal_pengumuman' => date('Y-m-d H:i:s')
|
||||
);
|
||||
//proses oleh model
|
||||
$this->belumlulustes_model->edit($data);
|
||||
//notifikasi dan redirect
|
||||
$this->session->set_flashdata('sukses', 'Data Pengumuman Kelulusan No. Pend : '.$belumlulustes->no_pendaftaran.' Telah Diedit.');
|
||||
redirect(base_url('belumlulustes'),'refresh');
|
||||
}
|
||||
//end masuk database
|
||||
}
|
||||
|
||||
//Delete pengumuman
|
||||
public function delete($no_pendaftaran)
|
||||
{
|
||||
$data = array('no_pendaftaran' => $no_pendaftaran);
|
||||
$data2 = array('userid' => $no_pendaftaran);
|
||||
//proses hapus
|
||||
$this->belumlulustes_model->delete($data);
|
||||
$this->belumlulustes_model->delete2($data2);
|
||||
//notifikasi
|
||||
$this->session->set_flashdata('sukses', 'Satu Data Pengumuman Telah Dihapus..!');
|
||||
redirect(base_url('belumlulustes'),'refresh');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Berkas extends CI_Controller {
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('biodata_model');
|
||||
//proteksi halaman
|
||||
$this->simple_login->check_login();
|
||||
|
||||
}
|
||||
|
||||
//Main page biodata
|
||||
public function index()
|
||||
{
|
||||
|
||||
$data = array( 'title' => 'Aplikasi PPDB MTD - Berkas Calon Peserta Didik',
|
||||
'content' => 'berkas/index'
|
||||
);
|
||||
$this->load->view('layout/wrapper', $data, FALSE);
|
||||
}
|
||||
|
||||
public function cetakberkas($no_pendaftaran)
|
||||
{
|
||||
$data['data'] = $this->db->get_where('v_rpt_trans_berkas',['no_pendaftaran'=>$no_pendaftaran])->row();
|
||||
$this->load->view('formulir/cetak_berkas',$data);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/* End of file biodata.php */
|
||||
/* Location: ./application/controllers/biodata.php */
|
||||
@@ -0,0 +1,401 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Biayaformulir extends CI_Controller {
|
||||
|
||||
//load model
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('formulir_model');
|
||||
$this->load->model('biayaformulir_model');
|
||||
$this->simple_login->check_login();
|
||||
//proteksi admin dan peserta
|
||||
if($this->session->userdata('level') !='Administrator')
|
||||
{
|
||||
if($this->session->userdata('level') !='Operator')
|
||||
{
|
||||
//kalau bukan adamin, lempar ke login
|
||||
$this->session->set_flashdata('warning', 'Hak akses anda tidak diijinkan mengakses menu penyerahan berkas');
|
||||
redirect(base_url('login'),'refresh');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function search(){
|
||||
// Ambil data pendaftar yang dikirim via ajax post
|
||||
$no_pendaftaran = $this->input->post('no_pendaftaran');
|
||||
$siswa = $this->biayaformulir_model->viewByNo($no_pendaftaran);
|
||||
|
||||
if( ! empty($siswa)){ // Jika data siswa ada/ditemukan
|
||||
// Buat sebuah array
|
||||
$callback = array(
|
||||
'status' => 'success', // Set array status dengan success
|
||||
'nama_lengkap' => $siswa->nama_lengkap, // Set array nama
|
||||
'sekolah_asal' => $siswa->sekolah_asal, // Set array sekolah
|
||||
'kompetensi' => $siswa->kompetensi, // Set array kompetensi
|
||||
'gelombang' => $siswa->gelombang, // Set array kompetensi
|
||||
);
|
||||
}else{
|
||||
$callback = array('status' => 'failed'); // set array status dengan failed
|
||||
}
|
||||
echo json_encode($callback); // konversi varibael $callback menjadi JSON
|
||||
}
|
||||
|
||||
|
||||
public function index()
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from('tr_formulir');
|
||||
$this->db->join('data_siswa', 'tr_formulir.no_pendaftaran = data_siswa.no_pendaftaran');
|
||||
$this->db->order_by('tr_formulir.no_trans', 'DESC');
|
||||
$query = $this->db->get();
|
||||
$result = $query->result();
|
||||
|
||||
$formulir = $result;
|
||||
|
||||
|
||||
$total = $this->biayaformulir_model->total();
|
||||
$setting = $this->setting_model->setting();
|
||||
$setting = array('tgl_sosialisasi' => $setting);
|
||||
$biaya = $this->db->get("setting")->row()->biaya_for;
|
||||
$diskon = $this->db->get("setting")->row()->diskon;
|
||||
|
||||
// Ambil tanggal saat ini dalam format 'Ymd'
|
||||
$tanggal_sekarang = date('Ymd');
|
||||
|
||||
// Lakukan query untuk mendapatkan nomor urutan terakhir
|
||||
$query = $this->db->query("SELECT MAX(CAST(RIGHT(no_trans, 5) AS UNSIGNED)) AS max_urutan FROM tr_formulir");
|
||||
$row = $query->row();
|
||||
$max_urutan = ($row->max_urutan != null) ? $row->max_urutan : 0;
|
||||
|
||||
// Tambahkan 1 ke nomor urutan terakhir
|
||||
$no_urut = sprintf("%05s", $max_urutan + 1);
|
||||
|
||||
// Gabungkan semua elemen menjadi nomor transaksi
|
||||
$nomor_transaksi = 'FR-' . $tanggal_sekarang . $no_urut;
|
||||
|
||||
// Sekarang Anda bisa menggunakan $nomor_transaksi ini untuk menyimpan ke dalam basis data
|
||||
|
||||
|
||||
//validasi input
|
||||
$valid = $this->form_validation;
|
||||
//check nama
|
||||
$this->form_validation->set_rules('nama_lengkap', 'Data tidak dapat disimpan, nama peserta harus terisi ', 'required',
|
||||
array( 'required' => '%s dengan menekan tombol cari terlebih dahulu'));
|
||||
|
||||
$valid->set_rules('no_pendaftaran','Berkas tidak dapat disimpan, ','required|is_unique[tr_data.no_pendaftaran]',
|
||||
array( 'required' => '%s harus diisi',
|
||||
'is_unique' => '%s nomor pendaftaran yang diinput sudah menyerahkan data jika ingin menambahkan silahkan di menu edit'));
|
||||
|
||||
//jika sudah dicek dan error
|
||||
if($valid->run()===FALSE) {
|
||||
$formulir = array( 'title' => 'Data Transaksi Biaya Tes [ '.$total->total.' ]',
|
||||
'formulir' => $formulir,
|
||||
'biaya' => $biaya,
|
||||
'diskon' => $diskon,
|
||||
'notr' => $nomor_transaksi,
|
||||
'content' => 'biayaformulir/index'
|
||||
);
|
||||
$this->load->view('layout/wrapper', $formulir, FALSE);
|
||||
//jika validasi oke, masuk database
|
||||
}else{
|
||||
|
||||
$inp = $this->input;
|
||||
$data = array( 'no_pendaftaran' => $inp->post('no_pendaftaran'),
|
||||
'tgl_sosialisasi' => date('Y-m-d H:i:s',($inp->post('tgl_sosialisasi'))),
|
||||
'shun' => $inp->post('shun'),
|
||||
'akte' => $inp->post('akte'),
|
||||
'kk' => $inp->post('kk'),
|
||||
'ktp' => $inp->post('ktp'),
|
||||
'nisn' => $inp->post('nisn'),
|
||||
'baik_narkoba' => $inp->post('baik_narkoba'),
|
||||
'ket_yatim' => $inp->post('ket_yatim'),
|
||||
'kip' => $inp->post('kip'),
|
||||
'slip_btn' => $inp->post('slip_btn'),
|
||||
'skl' => $inp->post('skl'),
|
||||
'ijazah' => $inp->post('ijazah'),
|
||||
'tgl_update' => date('Y-m-d H:i:s'),
|
||||
'petugas' => $this->session->userdata('nama')
|
||||
);
|
||||
//proses oleh model
|
||||
$this->formulir_model->tambah($data);
|
||||
//notifikasi dan redirect
|
||||
$this->session->set_flashdata('sukses', 'Data Formulir telah ditambah..!');
|
||||
redirect(base_url('biayaformulir/cetakberkas/'.$inp->post('no_pendaftaran')),'refresh');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function tambah(){
|
||||
|
||||
$inp = $this->input;
|
||||
$data = array( 'no_pendaftaran' => $inp->post('no_pendaftaran'),
|
||||
'tgl_trans' => date('Y-m-d'),
|
||||
'no_trans' => $inp->post('no_faktur'),
|
||||
'biaya' => $inp->post('biaya_tes'),
|
||||
'diskon' => $inp->post('diskon'),
|
||||
'bayar' => $inp->post('total'),
|
||||
'cash' => str_replace('.', '', $this->input->post('bayar')),
|
||||
'kembali' => $inp->post('kembalian'),
|
||||
'operator' => $this->session->userdata('nama')
|
||||
);
|
||||
$tambah= $this->db->insert("tr_formulir", $data);
|
||||
$this->session->set_flashdata('sukses', 'Data Calon Siswa Berhasil Ditambahkan..!');
|
||||
redirect(base_url('biayaformulir'),'refresh');
|
||||
// redirect(base_url('biayaformulir/cetakberkas/'.$inp->post('no_pendaftaran')),'refresh');
|
||||
|
||||
|
||||
}
|
||||
//Edit user
|
||||
public function edit($no_pendaftaran)
|
||||
{
|
||||
//panggil data user yang akan diedit
|
||||
$formulir = $this->formulir_model->detail($no_pendaftaran);
|
||||
|
||||
|
||||
//validasi input
|
||||
$valid = $this->form_validation;
|
||||
//check nama
|
||||
$valid->set_rules('akte','Data penyerahan berkas','required',
|
||||
array( 'required' => '%s harus diisi'));
|
||||
|
||||
//jika sudah dicek dan error
|
||||
if($valid->run()===FALSE) {
|
||||
//end validasi
|
||||
|
||||
$data= array( 'title' => 'Edit Data Berkas Pendaftar : '.$formulir->no_pendaftaran.' -- '.$formulir->nama_lengkap,
|
||||
'formulir' => $formulir,
|
||||
'content' => 'formulir/edit'
|
||||
);
|
||||
$this->load->view('layout/wrapper', $data, FALSE);
|
||||
//jika validasi oke, masuk database
|
||||
}else{
|
||||
$inp = $this->input;
|
||||
$data = array( 'no_pendaftaran' => $no_pendaftaran,
|
||||
'shun' => $inp->post('shun'),
|
||||
'akte' => $inp->post('akte'),
|
||||
'kk' => $inp->post('kk'),
|
||||
'ktp' => $inp->post('ktp'),
|
||||
'nisn' => $inp->post('nisn'),
|
||||
'baik_narkoba' => $inp->post('baik_narkoba'),
|
||||
'ket_yatim' => $inp->post('ket_yatim'),
|
||||
'kip' => $inp->post('kip'),
|
||||
'slip_btn' => $inp->post('slip_btn'),
|
||||
'skl' => $inp->post('skl'),
|
||||
'ijazah' => $inp->post('ijazah'),
|
||||
'tgl_update' => date('Y-m-d H:i:s'),
|
||||
'petugas' => $this->session->userdata('nama')
|
||||
);
|
||||
//proses oleh model
|
||||
$this->formulir_model->edit($data);
|
||||
//notifikasi dan redirect
|
||||
$this->session->set_flashdata('sukses', 'Data berkas '.$formulir->nama_lengkap.' telah diedit.');
|
||||
redirect(base_url('formulir'),'refresh');
|
||||
}
|
||||
//end masuk database
|
||||
}
|
||||
|
||||
//Delete formulir
|
||||
public function delete($no_pendaftaran)
|
||||
{
|
||||
$data = array('no_pendaftaran' => $no_pendaftaran);
|
||||
//proses hapus
|
||||
$this->biayaformulir_model->delete($data);
|
||||
//notifikasi
|
||||
$this->session->set_flashdata('sukses', 'Data formulir telah dihapus..!');
|
||||
redirect(base_url('biayaformulir'),'refresh');
|
||||
}
|
||||
|
||||
|
||||
|
||||
//EXPORT NILAI KE EXCEL
|
||||
public function export(){
|
||||
// Load plugin PHPExcel nya
|
||||
include APPPATH.'third_party/PHPExcel/PHPExcel.php';
|
||||
|
||||
// Panggil class PHPExcel nya
|
||||
$excel = new PHPExcel();
|
||||
// Settingan awal fil excel
|
||||
$excel->getProperties()->setCreator('By : 415 DIL')
|
||||
->setLastModifiedBy('By : 415 DIL')
|
||||
->setTitle("Data Transaksi Pembelian Formulir")
|
||||
->setSubject("Transaksi Pembelian Formulir")
|
||||
->setDescription("Laporan Data Transaksi Pembelian Formulir")
|
||||
->setKeywords("Data Transaksi Pembelian Formulir");
|
||||
// Buat sebuah variabel untuk menampung pengaturan style dari header tabel
|
||||
$style_col = array(
|
||||
'font' => array('bold' => true), // Set font nya jadi bold
|
||||
'alignment' => array(
|
||||
'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, // Set text jadi ditengah secara horizontal (center)
|
||||
'vertical' => PHPExcel_Style_Alignment::VERTICAL_CENTER // Set text jadi di tengah secara vertical (middle)
|
||||
),
|
||||
'borders' => array(
|
||||
'top' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border top dengan garis tipis
|
||||
'right' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border right dengan garis tipis
|
||||
'bottom' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border bottom dengan garis tipis
|
||||
'left' => array('style' => PHPExcel_Style_Border::BORDER_THIN) // Set border left dengan garis tipis
|
||||
)
|
||||
);
|
||||
// Buat sebuah variabel untuk menampung pengaturan style dari isi tabel
|
||||
$style_row = array(
|
||||
'alignment' => array(
|
||||
'vertical' => PHPExcel_Style_Alignment::VERTICAL_CENTER // Set text jadi di tengah secara vertical (middle)
|
||||
),
|
||||
'borders' => array(
|
||||
'top' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border top dengan garis tipis
|
||||
'right' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border right dengan garis tipis
|
||||
'bottom' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border bottom dengan garis tipis
|
||||
'left' => array('style' => PHPExcel_Style_Border::BORDER_THIN) // Set border left dengan garis tipis
|
||||
)
|
||||
);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('A1', "LAPORAN REKAP TRANSAKSI PEMBELIAN FORMULIR PPDB SMK AL-MUHTADIN DEPOK"); // Set kolom A1 dengan tulisan "DATA SISWA"
|
||||
$excel->getActiveSheet()->mergeCells('A1:P1'); // Set Merge Cell pada kolom A1 sampai E1
|
||||
$excel->getActiveSheet()->getStyle('A1')->getFont()->setBold(TRUE); // Set bold kolom A1
|
||||
$excel->getActiveSheet()->getStyle('A1')->getFont()->setSize(15); // Set font size 15 untuk kolom A1
|
||||
$excel->getActiveSheet()->getStyle('A1')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER); // Set text center untuk kolom A1
|
||||
// Buat header tabel nya pada baris ke 3
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('A3', "NO."); // Set kolom A3 dengan tulisan "NO"
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('B3', "NO. PEND"); // Set kolom B3 dengan tulisan "NO.PEND"
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('C3', "NO. TRANSAKSI"); // Set kolom C3 dengan tulisan "NAMA"
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('D3', "NAMA LENGKAP"); // Set kolom D3 dengan tulisan "JENIS KELAMIN"
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('E3', "JENIS KELAMIN"); // Set kolom E3 dengan tulisan "SEKOLAH"
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('F3', "SEKOLAH ASAL");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('G3', "KOMPETENSI");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('H3', "BIAYA");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('I3', "DISKON");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('J3', "TOTAL");
|
||||
|
||||
|
||||
|
||||
// Apply style header yang telah kita buat tadi ke masing-masing kolom header
|
||||
$excel->getActiveSheet()->getStyle('A3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('B3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('C3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('D3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('E3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('F3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('G3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('H3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('I3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('J3')->applyFromArray($style_col);
|
||||
|
||||
|
||||
// Panggil function view yang ada di formulir_model untuk menampilkan semua data formulirnya
|
||||
$formulir = $this->biayaformulir_model->ViewUrut();
|
||||
$no = 1; // Untuk penomoran tabel, di awal set dengan 1
|
||||
$numrow = 4; // Set baris pertama untuk isi tabel adalah baris ke 4
|
||||
foreach($formulir as $data){ // Lakukan looping pada variabel formulir
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('A'.$numrow, $no);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('B'.$numrow, $data->no_pendaftaran);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('C'.$numrow, $data->no_trans);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('D'.$numrow, $data->nama_lengkap);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('E'.$numrow, $data->jkelamin);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('F'.$numrow, $data->sekolah_asal);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('G'.$numrow, $data->kompetensi);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('H'.$numrow, $data->biaya);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('I'.$numrow, $data->diskon);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('J'.$numrow, $data->bayar);
|
||||
|
||||
|
||||
|
||||
// Apply style row yang telah kita buat tadi ke masing-masing baris (isi tabel)
|
||||
$excel->getActiveSheet()->getStyle('A'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('B'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('C'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('D'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('E'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('F'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('G'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('H'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('I'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('J'.$numrow)->applyFromArray($style_row);
|
||||
|
||||
|
||||
|
||||
$no++; // Tambah 1 setiap kali looping
|
||||
$numrow++; // Tambah 1 setiap kali looping
|
||||
}
|
||||
// Set width kolom
|
||||
$excel->getActiveSheet()->getColumnDimension('A')->setWidth(5); // Set width kolom A
|
||||
$excel->getActiveSheet()->getColumnDimension('B')->setWidth(12); // Set width kolom B
|
||||
$excel->getActiveSheet()->getColumnDimension('C')->setWidth(35); // Set width kolom C
|
||||
$excel->getActiveSheet()->getColumnDimension('D')->setWidth(15); // Set width kolom D
|
||||
$excel->getActiveSheet()->getColumnDimension('E')->setWidth(35); // Set width kolom E
|
||||
$excel->getActiveSheet()->getColumnDimension('F')->setWidth(13);
|
||||
$excel->getActiveSheet()->getColumnDimension('G')->setWidth(13);
|
||||
$excel->getActiveSheet()->getColumnDimension('H')->setWidth(12);
|
||||
$excel->getActiveSheet()->getColumnDimension('I')->setWidth(12);
|
||||
$excel->getActiveSheet()->getColumnDimension('J')->setWidth(12);
|
||||
$excel->getActiveSheet()->getColumnDimension('K')->setWidth(12);
|
||||
$excel->getActiveSheet()->getColumnDimension('L')->setWidth(12);
|
||||
$excel->getActiveSheet()->getColumnDimension('M')->setWidth(16);
|
||||
$excel->getActiveSheet()->getColumnDimension('N')->setWidth(12);
|
||||
$excel->getActiveSheet()->getColumnDimension('O')->setWidth(12);
|
||||
$excel->getActiveSheet()->getColumnDimension('P')->setWidth(12);
|
||||
$excel->getActiveSheet()->getColumnDimension('Q')->setWidth(12);
|
||||
$excel->getActiveSheet()->getColumnDimension('R')->setWidth(12);
|
||||
$excel->getActiveSheet()->getColumnDimension('S')->setWidth(18);
|
||||
$excel->getActiveSheet()->getColumnDimension('T')->setWidth(15);
|
||||
|
||||
// Set height semua kolom menjadi auto (mengikuti height isi dari kolommnya, jadi otomatis)
|
||||
$excel->getActiveSheet()->getDefaultRowDimension()->setRowHeight(-1);
|
||||
// Set orientasi kertas jadi LANDSCAPE
|
||||
$excel->getActiveSheet()->getPageSetup()->setOrientation(PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE);
|
||||
// Set judul file excel nya
|
||||
$excel->getActiveSheet(0)->setTitle("Rekap Pembelian Formulir PPDB");
|
||||
$excel->setActiveSheetIndex(0);
|
||||
// Proses file excel
|
||||
header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
|
||||
header('Content-Disposition: attachment; filename="Rekap Transaksi Pembelian Formulir PPDB.xlsx"'); // Set nama file excel nya
|
||||
header('Cache-Control: max-age=0');
|
||||
$write = PHPExcel_IOFactory::createWriter($excel, 'Excel2007');
|
||||
$write->save('php://output');
|
||||
}
|
||||
|
||||
public function cetak(){
|
||||
$pdf = new FPDF('p','mm','A4');
|
||||
// membuat halaman baru
|
||||
$pdf->AddPage();
|
||||
// setting jenis font yang akan digunakan
|
||||
$pdf->SetFont('Arial','B',16);
|
||||
// mencetak string
|
||||
$pdf->Cell(190,7,'LAPORAN REKAP DATA BERKAS PPDB',0,1,'C');
|
||||
$pdf->SetFont('Arial','B',12);
|
||||
$pdf->Cell(190,7,'SMK AL-MUHTADIN DEPOK',0,1,'C');
|
||||
// Memberikan space kebawah agar tidak terlalu rapat
|
||||
$pdf->Cell(10,7,'',0,1);
|
||||
$pdf->SetFont('Arial','B',10);
|
||||
$pdf->Cell(10,6,'NO.',1,0);
|
||||
$pdf->Cell(20,6,'NO. PEND',1,0);
|
||||
$pdf->Cell(85,6,'NAMA SISWA',1,0);
|
||||
$pdf->Cell(30,6,'TEMPAT LAHIR',1,0);
|
||||
$pdf->Cell(33,6,'TANGGAL LAHIR',1,1);
|
||||
$pdf->SetFont('Arial','',10);
|
||||
$siswa = $this->db->get('data_siswa')->result();
|
||||
$no = 1;
|
||||
foreach ($siswa as $row){
|
||||
$pdf->Cell(10,6,$no++,1,0);
|
||||
$pdf->Cell(20,6,$row->no_pendaftaran,1,0);
|
||||
$pdf->Cell(85,6,$row->nama_lengkap,1,0);
|
||||
$pdf->Cell(30,6,$row->tempat_lahir,1,0);
|
||||
$pdf->Cell(33,6,$row->tgl_lahir,1,1);
|
||||
}
|
||||
$pdf->Output();
|
||||
}
|
||||
|
||||
public function cetakberkas($no_pendaftaran)
|
||||
{
|
||||
$data['data'] = $this->db->get_where('v_rpt_trans_formulir',['no_pendaftaran'=>$no_pendaftaran])->row();
|
||||
$this->load->view('biayaformulir/cetak_berkas',$data);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/* End of file formulir.php */
|
||||
/* Location: ./application/controllers/formulir.php */
|
||||
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Biayappdb extends CI_Controller {
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('setting_model');
|
||||
//proteksi halaman
|
||||
$this->simple_login->check_login();
|
||||
|
||||
}
|
||||
|
||||
//Main page biodata
|
||||
public function index()
|
||||
{
|
||||
$biayappdb = $this->setting_model->biayappdb();
|
||||
|
||||
$data = array( 'title' => 'Aplikasi PPDB MTD - Pengaturan Biaya PPDB',
|
||||
'biayappdb' => $biayappdb,
|
||||
'content' => 'biayappdb/edit'
|
||||
);
|
||||
$this->load->view('layout/wrapper', $data, FALSE);
|
||||
}
|
||||
|
||||
//Edit Pengaturan
|
||||
public function edit()
|
||||
{
|
||||
|
||||
//validasi input
|
||||
$valid = $this->form_validation;
|
||||
//check nama
|
||||
$valid->set_rules('biaya_otkp','Pilih Tombol','required',
|
||||
array( 'required' => '%s Edit Tempat'));
|
||||
|
||||
//jika sudah dicek dan error
|
||||
if($valid->run()===FALSE) {
|
||||
//end validasi
|
||||
|
||||
$data= array( 'title' => 'Edit Data Biaya PPDB',
|
||||
'content' => 'biayappdb/edit'
|
||||
);
|
||||
$this->load->view('layout/wrapper', $data, FALSE);
|
||||
//jika validasi oke, masuk database
|
||||
}else{
|
||||
$inp = $this->input;
|
||||
$data = array(
|
||||
'biaya_otkp' => str_replace('.', '', $inp->post('biaya_otkp')),
|
||||
'biaya_tkj' => str_replace('.', '', $inp->post('biaya_tkj')),
|
||||
'biaya_animasi' => str_replace('.', '', $inp->post('biaya_animasi')),
|
||||
'biaya_kuliner' => str_replace('.', '', $inp->post('biaya_kuliner')),
|
||||
'pot_gel' => str_replace('.', '', $inp->post('pot_gel')),
|
||||
'pot_dp' => str_replace('.', '', $inp->post('pot_dp')),
|
||||
'pot_yatim' => str_replace('.', '', $inp->post('pot_yatim')),
|
||||
'pot_spp' => str_replace('.', '', $inp->post('pot_spp')),
|
||||
'pot_spp_tkj' => str_replace('.', '', $inp->post('pot_spp_tkj')),
|
||||
'pot_spp_animasi' => str_replace('.', '', $inp->post('pot_spp_animasi')),
|
||||
'pot_spp_kuliner' => str_replace('.', '', $inp->post('pot_spp_kuliner')),
|
||||
'pot_kembar' => str_replace('.', '', $inp->post('pot_kembar'))
|
||||
);
|
||||
//proses oleh model
|
||||
$this->setting_model->edit7($data);
|
||||
|
||||
//notifikasi dan redirect
|
||||
$this->session->set_flashdata('sukses', 'Pengaturan Biaya PPDB Berhasil di Update.');
|
||||
redirect(base_url('biayappdb'),'refresh');
|
||||
}
|
||||
//end masuk database
|
||||
}
|
||||
}
|
||||
|
||||
/* End of file biodata.php */
|
||||
/* Location: ./application/controllers/biodata.php */
|
||||
@@ -0,0 +1,178 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Biodata extends CI_Controller {
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('biodata_model');
|
||||
//proteksi halaman
|
||||
$this->simple_login->check_login();
|
||||
|
||||
}
|
||||
|
||||
//Main page biodata
|
||||
public function index()
|
||||
{
|
||||
|
||||
$data = array( 'title' => 'Aplikasi PPDB MTD - Biodata',
|
||||
'content' => 'biodata/index'
|
||||
);
|
||||
$this->load->view('layout/wrapper', $data, FALSE);
|
||||
}
|
||||
|
||||
public function cetakpeserta($userid)
|
||||
{
|
||||
$data['data'] = $this->db->get_where('user2',['userid'=>$userid])->row();
|
||||
$this->load->view('biodata/cetak_peserta',$data);
|
||||
}
|
||||
|
||||
//Edit peserta
|
||||
public function edit($no_pendaftaran)
|
||||
{
|
||||
//panggil data user yang akan diedit
|
||||
|
||||
$id = $_SESSION['userid'];
|
||||
$peserta = $this->biodata_model->user2($id);
|
||||
|
||||
|
||||
//validasi input
|
||||
$valid = $this->form_validation;
|
||||
//check nama
|
||||
$valid->set_rules('nama_lengkap','Nama Peserta','required',
|
||||
array( 'required' => '%s harus diisi'));
|
||||
|
||||
//jika sudah dicek dan error
|
||||
if($valid->run()===FALSE) {
|
||||
//end validasi
|
||||
|
||||
$data= array( 'title' => 'Edit Data Peserta, No. Pendaftaran : '.$peserta->no_pendaftaran,
|
||||
'peserta' => $peserta,
|
||||
'content' => 'biodata/edit'
|
||||
);
|
||||
$this->load->view('layout/wrapper', $data, FALSE);
|
||||
//jika validasi oke, masuk database
|
||||
}else{
|
||||
$inp = $this->input;
|
||||
$data = array( 'no_pendaftaran' => $no_pendaftaran,
|
||||
'nama_lengkap' => $inp->post('nama_lengkap'),
|
||||
'nama_panggilan' => $inp->post('nama_panggilan'),
|
||||
'jkelamin' => $inp->post('jkelamin'),
|
||||
'nik' => $inp->post('nik'),
|
||||
'nisn' => $inp->post('nisn'),
|
||||
'tempat_lahir' => $inp->post('tempat_lahir'),
|
||||
'tgl_lahir' => date('Y-m-d',strtotime($inp->post('tgl_lahir'))),
|
||||
'agama' => $inp->post('agama'),
|
||||
'kewarganegaraan' => $inp->post('kewarganegaraan'),
|
||||
'anak_ke' => $inp->post('anak_ke'),
|
||||
'jml_saudara' => $inp->post('jml_saudara'),
|
||||
'kandung' => $inp->post('kandung'),
|
||||
'tiri' => $inp->post('tiri'),
|
||||
'angkat' => $inp->post('angkat'),
|
||||
'status_keluarga' => $inp->post('status_keluarga'),
|
||||
'bhs_dirumah' => $inp->post('bhs_dirumah'),
|
||||
'kemeja' => $inp->post('kemeja'),
|
||||
'celana' => $inp->post('celana'),
|
||||
'alamat_siswa' => $inp->post('alamat_siswa'),
|
||||
'no_rmh' => $inp->post('no_rmh'),
|
||||
'rt' => $inp->post('rt'),
|
||||
'rw' => $inp->post('rw'),
|
||||
'kelurahan' => $inp->post('kelurahan'),
|
||||
'kecamatan' => $inp->post('kecamatan'),
|
||||
'kota' => $inp->post('kota'),
|
||||
'provinsi' => $inp->post('provinsi'),
|
||||
'kode_pos' => $inp->post('kode_pos'),
|
||||
'no_tlp_rmh' => $inp->post('no_tlp_rmh'),
|
||||
'no_hp' => $inp->post('no_hp'),
|
||||
'email' => $inp->post('email'),
|
||||
'tinggal_dengan' => $inp->post('tinggal_dengan'),
|
||||
'sekolah_dengan' => $inp->post('sekolah_dengan'),
|
||||
'jarak_rmh_kesekolah' => $inp->post('jarak_rmh_kesekolah'),
|
||||
'berat_badan' => $inp->post('berat_badan'),
|
||||
'tinggi_badan' => $inp->post('tinggi_badan'),
|
||||
'gol_darah' => $inp->post('gol_darah'),
|
||||
'penyakit' => $inp->post('penyakit'),
|
||||
'kelainan_jasmani' => $inp->post('kelainan_jasmani'),
|
||||
'usia_tahun' => $inp->post('usia_tahun'),
|
||||
'usia_bulan' => $inp->post('usia_bulan'),
|
||||
'sekolah_asal' => $inp->post('sekolah_asal'),
|
||||
'npsn2' => $inp->post('npsn2'),
|
||||
'nisn2' => $inp->post('nisn2'),
|
||||
'sekolah_jln' => $inp->post('sekolah_jln'),
|
||||
'sekolah_kel' => $inp->post('sekolah_kel'),
|
||||
'sekolah_kec' => $inp->post('sekolah_kec'),
|
||||
'sekolah_kota' => $inp->post('sekolah_kota'),
|
||||
'sekolah_prov' => $inp->post('sekolah_prov'),
|
||||
'Ijazah_tgl' => date('Y-m-d',strtotime($inp->post('Ijazah_tgl'))),
|
||||
'Ijazah_no' => $inp->post('Ijazah_no'),
|
||||
'nama_ayah' => $inp->post('nama_ayah'),
|
||||
'tmpt_lahir_ayah' => $inp->post('tmpt_lahir_ayah'),
|
||||
'tgl_lahir_ayah' => date('Y-m-d',strtotime($inp->post('tgl_lahir_ayah'))),
|
||||
'agama_ayah' => $inp->post('agama_ayah'),
|
||||
'kewarganegaraan_ayah' => $inp->post('kewarganegaraan_ayah'),
|
||||
'pendidikan_ayah' => $inp->post('pendidikan_ayah'),
|
||||
'pekerjaan_ayah' => $inp->post('pekerjaan_ayah'),
|
||||
'penghasilan_ayah' => $inp->post('penghasilan_ayah'),
|
||||
'alamat_ayah' => $inp->post('alamat_ayah'),
|
||||
'tlp_ayah' => $inp->post('tlp_ayah'),
|
||||
'nama_ibu' => $inp->post('nama_ibu'),
|
||||
'tmpt_lahir_ibu' => $inp->post('tmpt_lahir_ibu'),
|
||||
'tgl_lahir_ibu' => date('Y-m-d',strtotime($inp->post('tgl_lahir_ibu'))),
|
||||
'agama_ibu' => $inp->post('agama_ibu'),
|
||||
'kewarganegaraan_ibu' => $inp->post('kewarganegaraan_ibu'),
|
||||
'pendidikan_ibu' => $inp->post('pendidikan_ibu'),
|
||||
'pekerjaan_ibu' => $inp->post('pekerjaan_ibu'),
|
||||
'penghasilan_ibu' => $inp->post('penghasilan_ibu'),
|
||||
'alamat_ibu' => $inp->post('alamat_ibu'),
|
||||
'tlp_ibu' => $inp->post('tlp_ibu'),
|
||||
'nama_wali' => $inp->post('nama_wali'),
|
||||
'tmpt_lahir_wali' => $inp->post('tmpt_lahir_wali'),
|
||||
'tgl_lahir_wali' => date('Y-m-d',strtotime($inp->post('tgl_lahir_wali'))),
|
||||
'agama_wali' => $inp->post('agama_wali'),
|
||||
'kewarganegaraan_wali' => $inp->post('kewarganegaraan_wali'),
|
||||
'pendidikan_wali' => $inp->post('pendidikan_wali'),
|
||||
'pekerjaan_wali' => $inp->post('pekerjaan_wali'),
|
||||
'penghasilan_wali' => $inp->post('penghasilan_wali'),
|
||||
'alamat_wali' => $inp->post('alamat_wali'),
|
||||
'tlp_wali' => $inp->post('tlp_wali'),
|
||||
'iq' => $inp->post('iq'),
|
||||
'tgl_tes_iq' => date('Y-m-d',strtotime($inp->post('tgl_tes_iq'))),
|
||||
'disiplin' => $inp->post('disiplin'),
|
||||
'prakarsa' => $inp->post('prakarsa'),
|
||||
'tanggung_jwb' => $inp->post('tanggung_jwb'),
|
||||
'penyesuaian_diri' => $inp->post('penyesuaian_diri'),
|
||||
'kemantapan_emosi' => $inp->post('kemantapan_emosi'),
|
||||
'kerjasama' => $inp->post('kerjasama'),
|
||||
'iptek' => $inp->post('iptek'),
|
||||
'iptek_tingkat' => $inp->post('iptek_tingkat'),
|
||||
'olahraga' => $inp->post('olahraga'),
|
||||
'olahraga_tingkat' => $inp->post('olahraga_tingkat'),
|
||||
'kesenian' => $inp->post('kesenian'),
|
||||
'kesenian_tingkat' => $inp->post('kesenian_tingkat'),
|
||||
'keagamaan' => $inp->post('keagamaan'),
|
||||
'keagamaan_tingkat' => $inp->post('keagamaan_tingkat'),
|
||||
'keterampilan' => $inp->post('keterampilan'),
|
||||
'keterampilan_tingkat' => $inp->post('keterampilan_tingkat'),
|
||||
'lainnya' => $inp->post('lainnya'),
|
||||
'lainnya_tingkat' => $inp->post('lainnya_tingkat'),
|
||||
'beasiswa1_thn' => $inp->post('beasiswa1_thn'),
|
||||
'beasiswa1_dari' => $inp->post('beasiswa1_dari'),
|
||||
'beasiswa2_thn' => $inp->post('beasiswa2_thn'),
|
||||
'beasiswa2_dari' => $inp->post('beasiswa2_dari')
|
||||
|
||||
/*'' => $inp->post(''),*/
|
||||
);
|
||||
//proses oleh model
|
||||
$this->biodata_model->edit($data);
|
||||
//notifikasi dan redirect
|
||||
$this->session->set_flashdata('sukses', 'Data Peserta Nomor Pendaftar : <b>'.$peserta->no_pendaftaran.'</b> Telah Diupdate !');
|
||||
redirect(base_url('biodata'),'refresh');
|
||||
}
|
||||
//end masuk database
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* End of file biodata.php */
|
||||
/* Location: ./application/controllers/biodata.php */
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Dashboard extends CI_Controller {
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('dashboard_model');
|
||||
//proteksi halaman
|
||||
$this->simple_login->check_login();
|
||||
|
||||
}
|
||||
|
||||
//Main page dashboard
|
||||
public function index()
|
||||
{
|
||||
|
||||
$data = array( 'title' => 'Aplikasi PPDB MTD - Dashboard',
|
||||
'content' => 'dashboard/index'
|
||||
);
|
||||
$this->load->view('layout/wrapper', $data, FALSE);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/* End of file Dashboard.php */
|
||||
/* Location: ./application/controllers/Dashboard.php */
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Download extends CI_Controller {
|
||||
|
||||
function __construct(){
|
||||
parent::__construct();
|
||||
$this->load->model('biodata_model');
|
||||
$this->load->helper(array('url','download'));
|
||||
$this->simple_login->check_login();
|
||||
}
|
||||
|
||||
public function index(){
|
||||
$data = array( 'title' => 'Aplikasi PPDB MTD - Pengumuman Hasil Tes Akademik dan BTQ',
|
||||
'content' => 'download/index'
|
||||
);
|
||||
$this->load->view('layout/wrapper', $data, FALSE);
|
||||
}
|
||||
|
||||
public function lakukan_download(){
|
||||
force_download('gambar/foto.jpg', NULL);
|
||||
}
|
||||
|
||||
public function lakukan_download55(){
|
||||
if(!empty($no_pendaftaran)){
|
||||
|
||||
|
||||
//get file info from database
|
||||
$fileInfo = $this->file->getRows(array('no_pendaftaran' => $no_pendaftaran));
|
||||
|
||||
//file path
|
||||
$file = 'uploads/'.$fileInfo['no_pendaftaran'];
|
||||
|
||||
//download file from directory
|
||||
force_download($file, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function lakukan_download223($no_pendaftaran)
|
||||
{
|
||||
$data = $this->db->get_where('data_siswa',['no_pendaftaran'=>$no_pendaftaran])->row();
|
||||
force_download('uploads/102223001',NULL);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,164 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class Form extends CI_Controller {
|
||||
|
||||
public function __construct(){
|
||||
parent::__construct();
|
||||
//panggil model
|
||||
$this->load->model('siswamodel');
|
||||
//proteksi halaman
|
||||
$this->simple_login->check_login();
|
||||
}
|
||||
|
||||
public function search(){
|
||||
// Ambil data pendaftar yang dikirim via ajax post
|
||||
$no_pendaftaran = $this->input->post('no_pendaftaran');
|
||||
$siswa = $this->siswamodel->viewByNo($no_pendaftaran);
|
||||
|
||||
if( ! empty($siswa)){ // Jika data siswa ada/ditemukan
|
||||
// Buat sebuah array
|
||||
$callback = array(
|
||||
'status' => 'success', // Set array status dengan success
|
||||
'nama_lengkap' => $siswa->nama_lengkap, // Set array nama
|
||||
'sekolah_asal' => $siswa->sekolah_asal, // Set array sekolah
|
||||
'kompetensi' => $siswa->kompetensi, // Set array kompetensi
|
||||
'no_hp' => $siswa->no_hp, // Set array no.hp
|
||||
'nama_ayah' => $siswa->nama_ayah, // Set array nama ayah
|
||||
'tlp_ayah' => $siswa->tlp_ayah, // tlp
|
||||
'nama_ibu' => $siswa->nama_ibu, // Set array nama ibu
|
||||
'tlp_ibu' => $siswa->tlp_ibu, // tlp
|
||||
);
|
||||
}else{
|
||||
$callback = array('status' => 'failed'); // set array status dengan failed
|
||||
}
|
||||
echo json_encode($callback); // konversi varibael $callback menjadi JSON
|
||||
}
|
||||
|
||||
public function index(){
|
||||
// $form = $this->siswamodel->listing();
|
||||
$total = $this->siswamodel->total();
|
||||
|
||||
//validasi input
|
||||
$valid = $this->form_validation;
|
||||
|
||||
//check nama
|
||||
$this->form_validation->set_rules('nama_lengkap', 'Nama Peserta Harus Terisi ', 'required',
|
||||
array( 'required' => '%s Dengan Menekan Tombol Cari'));
|
||||
|
||||
$valid->set_rules('no_pendaftaran','Nilai tidak dapat disimpan, ','required|is_unique[nilai_tes.no_pendaftaran]',
|
||||
array( 'required' => '%s harus diisi',
|
||||
'is_unique' => '%s nomor pendaftaran yang diinput sudah mengikuti tes'));
|
||||
|
||||
$valid->set_rules('btq_membaca','Membaca','required',
|
||||
array( 'required' => '%s harus diisi'));
|
||||
|
||||
$valid->set_rules('btq_makhrojul','Makhrojul','required',
|
||||
array( 'required' => '%s harus diisi'));
|
||||
|
||||
$valid->set_rules('btq_tajwid','Tajwid','required',
|
||||
array( 'required' => '%s harus diisi'));
|
||||
|
||||
$valid->set_rules('btq_huruftunggal','Huruf tunggal','required',
|
||||
array( 'required' => '%s harus diisi'));
|
||||
|
||||
$valid->set_rules('btq_merangkaihuruf','Membaca','required',
|
||||
array( 'required' => '%s harus diisi'));
|
||||
|
||||
$valid->set_rules('btq_kerapihan','Kerapihan','required',
|
||||
array( 'required' => '%s harus diisi'));
|
||||
|
||||
$valid->set_rules('btq_akhlak','Akhlak','required',
|
||||
array( 'required' => '%s harus diisi'));
|
||||
|
||||
$valid->set_rules('w2n_alasan','Alasan','required',
|
||||
array( 'required' => '%s harus diisi'));
|
||||
|
||||
$valid->set_rules('w2n_kepercayaan','Kepercayaan','required',
|
||||
array( 'required' => '%s harus diisi'));
|
||||
|
||||
$valid->set_rules('w2n_penanganan','Penanganan','required',
|
||||
array( 'required' => '%s harus diisi'));
|
||||
|
||||
$valid->set_rules('w2n_kebiasaan','Kebiasaan','required',
|
||||
array( 'required' => '%s harus diisi'));
|
||||
|
||||
$valid->set_rules('w2n_psikologi','Psikologi','required',
|
||||
array( 'required' => '%s harus diisi'));
|
||||
|
||||
$valid->set_rules('w2n_sholat','Sholat','required',
|
||||
array( 'required' => '%s harus diisi'));
|
||||
|
||||
$valid->set_rules('w2n_keikutsertaan','Keikutsertaan','required',
|
||||
array( 'required' => '%s harus diisi'));
|
||||
|
||||
$valid->set_rules('w2n_kesediaan','Kesediaan','required',
|
||||
array( 'required' => '%s harus diisi'));
|
||||
|
||||
//jika sudah dicek dan error
|
||||
if($valid->run()===FALSE) {
|
||||
|
||||
$data = array( 'title' => 'Jumlah Pendaftar Yang Sudah Tes BTQ & Wawancara [ '.$total->total.' ]',
|
||||
//'form ' => $form,
|
||||
'content' => 'form/index'
|
||||
);
|
||||
$this->load->view('layout/wrapper', $data, FALSE);
|
||||
//jika validasi oke, masuk database
|
||||
}else{
|
||||
$inp = $this->input;
|
||||
$data = array( 'no_pendaftaran' => $inp->post('no_pendaftaran'),
|
||||
'btq_membaca' => $inp->post('btq_membaca'),
|
||||
'btq_makhrojul' => $inp->post('btq_makhrojul'),
|
||||
'btq_tajwid' => $inp->post('btq_tajwid'),
|
||||
'btq_huruftunggal' => $inp->post('btq_huruftunggal'),
|
||||
'btq_merangkaihuruf' => $inp->post('btq_merangkaihuruf'),
|
||||
'btq_kerapihan' => $inp->post('btq_kerapihan'),
|
||||
'btq_akhlak' => $inp->post('btq_akhlak'),
|
||||
'w2n_alasan' => $inp->post('w2n_alasan'),
|
||||
'w2n_kepercayaan' => $inp->post('w2n_kepercayaan'),
|
||||
'w2n_penanganan' => $inp->post('w2n_penanganan'),
|
||||
'w2n_kebiasaan' => $inp->post('w2n_kebiasaan'),
|
||||
'w2n_psikologi' => $inp->post('w2n_psikologi'),
|
||||
'w2n_sholat' => $inp->post('w2n_sholat'),
|
||||
'w2n_keikutsertaan' => $inp->post('w2n_keikutsertaan'),
|
||||
'w2n_kesediaan' => $inp->post('w2n_kesediaan'),
|
||||
'catatan' => $inp->post('catatan'),
|
||||
'penguji' => $this->session->userdata('nama'),
|
||||
'tanggal' => date('Y-m-d H:i:s')
|
||||
|
||||
);
|
||||
//proses oleh model
|
||||
$this->siswamodel->tambah($data);
|
||||
|
||||
//edit status siswa
|
||||
$inp2 = $this->input;
|
||||
$data2 = array( 'no_pendaftaran' => $inp->post('no_pendaftaran'),
|
||||
'status' => 'Sudah Tes' );
|
||||
$this->siswamodel->edit($data2);
|
||||
|
||||
//notifikasi dan redirect
|
||||
$this->session->set_flashdata('sukses', 'Data nilai telah ditambah');
|
||||
redirect(base_url('nilai'),'refresh');
|
||||
}
|
||||
//end masuk database
|
||||
}
|
||||
|
||||
public function edit($no_pendaftaran)
|
||||
{
|
||||
$inp = $this->input;
|
||||
$data = array( 'no_pendaftaran' => $no_pendaftaran,
|
||||
'status' => $inp->post('status'));
|
||||
$this->siswamodel->edit($data);
|
||||
}
|
||||
|
||||
|
||||
//Delete user
|
||||
public function delete($no_pendaftaran)
|
||||
{
|
||||
$data = array('no_pendaftaran' => $no_pendaftaran);
|
||||
//proses hapus
|
||||
$this->siswamodel->delete($data);
|
||||
//notifikasi
|
||||
$this->session->set_flashdata('sukses', 'Data nilai telah dihapus');
|
||||
redirect(base_url('nilai'),'refresh');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,169 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class Formdaftar extends CI_Controller {
|
||||
|
||||
public function __construct(){
|
||||
parent::__construct();
|
||||
//panggil model
|
||||
$this->load->model('siswamodel');
|
||||
$this->load->model('peserta_model');
|
||||
$this->load->model('pendaftar_model');
|
||||
|
||||
//proteksi halaman
|
||||
$this->simple_login->check_login();
|
||||
}
|
||||
|
||||
|
||||
public function index()
|
||||
{
|
||||
$peserta = $this->peserta_model->listing();
|
||||
$total = $this->peserta_model->total();
|
||||
$query = $this->db->get('setting'); // Mengambil data dari tabel 'setting'
|
||||
$result = $query->row(); // Mengambil baris pertama sebagai objek
|
||||
$tahun_pelajaran = $result->kelas_tahun;
|
||||
$tp = $result->tp;
|
||||
|
||||
// Ambil nomor pendaftaran terakhir dari tabel data_siswa
|
||||
$this->db->select_max('no_pendaftaran');
|
||||
$this->db->where('tahun_pelajaran', $tp);
|
||||
$query_last_number = $this->db->get('data_siswa');
|
||||
$result_last_number = $query_last_number->row();
|
||||
$last_registration_number = $result_last_number->no_pendaftaran;
|
||||
|
||||
// Mengambil nomor urut terakhir dalam format angka
|
||||
if ($last_registration_number) {
|
||||
// Mengambil nomor urut terakhir dari nomor pendaftaran terakhir
|
||||
$last_registration_number_urut = substr($last_registration_number, -3);
|
||||
$last_registration_number_urut_numeric = (int)$last_registration_number_urut;
|
||||
} else {
|
||||
$last_registration_number_urut_numeric = 0; // Jika tidak ada pendaftar sebelumnya, nomor urut dimulai dari 0
|
||||
}
|
||||
|
||||
// Menghitung nomor urut pendaftaran berikutnya
|
||||
$next_registration_number_urut = $last_registration_number_urut_numeric + 1;
|
||||
|
||||
// Format nomor pendaftaran berikutnya
|
||||
$nomor_pendaftaran = $tahun_pelajaran . sprintf("%03d", $next_registration_number_urut);
|
||||
|
||||
|
||||
|
||||
$data = array( 'title' => 'Form Pendaftaran - Data Keseluruhan Pendaftar [ '.$total->total.' ]',
|
||||
'peserta' => $peserta,
|
||||
'nodaftar' => $nomor_pendaftaran,
|
||||
'content' => 'formdaftar/index'
|
||||
);
|
||||
$this->load->view('layout/wrapper', $data, FALSE);
|
||||
}
|
||||
|
||||
|
||||
public function edit($no_pendaftaran)
|
||||
{
|
||||
$inp = $this->input;
|
||||
$data = array( 'no_pendaftaran' => $no_pendaftaran,
|
||||
'status' => $inp->post('status'));
|
||||
$this->siswamodel->edit($data);
|
||||
}
|
||||
|
||||
public function tambah() {
|
||||
$query = $this->db->get('setting'); // Mengambil data dari tabel 'setting'
|
||||
$result = $query->row(); // Mengambil baris pertama sebagai objek
|
||||
// Ambil data yang dikirimkan dari form
|
||||
$nisn = $this->input->post('nisn');
|
||||
$sepatu = $this->input->post('sepatu');
|
||||
$no_pendaftaran = $this->input->post('no_pendaftaran');
|
||||
$nama_lengkap = $this->input->post('nama_lengkap');
|
||||
$jkelamin = $this->input->post('jkelamin');
|
||||
$agama = $this->input->post('agama');
|
||||
$kemeja = $this->input->post('kemeja');
|
||||
$celana = $this->input->post('celana');
|
||||
$tempat_lahir = $this->input->post('tempat_lahir');
|
||||
$tgl_lahir = $this->input->post('tgl_lahir');
|
||||
$no_hp = $this->input->post('no_hp');
|
||||
$sekolah_asal = $this->input->post('sekolah_asal');
|
||||
$nama_ayah = $this->input->post('nama_ayah');
|
||||
$tlp_ayah = $this->input->post('tlp_ayah');
|
||||
$nama_ibu = $this->input->post('nama_ibu');
|
||||
$tlp_ibu = $this->input->post('tlp_ibu');
|
||||
$alamat_ayah = $this->input->post('alamat_ayah');
|
||||
$kd_kompetensi = $this->input->post('kd_kompetensi');
|
||||
$sekolah_lain = $this->input->post('sekolah_lain');
|
||||
$jurusan = "";
|
||||
if ($kd_kompetensi == "TJKT") {
|
||||
$jurusan= "Teknik Jaringan Komputer & Telekomunikasi";
|
||||
} elseif ($kd_kompetensi == "MPLB") {
|
||||
$jurusan= "Manajemen Perkantoran & Layanan Bisnis";
|
||||
} elseif ($kd_kompetensi == "ANIMASI") {
|
||||
$jurusan= "Animasi";
|
||||
} else {
|
||||
$jurusan = "Kuliner";
|
||||
}
|
||||
|
||||
$sekolah = !empty($sekolah_asal) ? $sekolah_asal : $sekolah_lain;
|
||||
|
||||
// Lakukan validasi data jika diperlukan
|
||||
// Siapkan data untuk dimasukkan ke dalam basis data
|
||||
$data = array(
|
||||
'no_pendaftaran' => $no_pendaftaran,
|
||||
'nisn' => $nisn,
|
||||
'sepatu' => $sepatu,
|
||||
'kompetensi' => $jurusan,
|
||||
'nama_lengkap' => $nama_lengkap,
|
||||
'jkelamin' => $jkelamin,
|
||||
'agama' => $agama,
|
||||
'kemeja' => $kemeja,
|
||||
'celana' => $celana,
|
||||
'tempat_lahir' => $tempat_lahir,
|
||||
'tgl_lahir' => $tgl_lahir,
|
||||
'no_hp' => $no_hp,
|
||||
'sekolah_asal' => $sekolah,
|
||||
'nama_ayah' => $nama_ayah,
|
||||
'tlp_ayah' => $tlp_ayah,
|
||||
'nama_ibu' => $nama_ibu,
|
||||
'tlp_ibu' => $tlp_ibu,
|
||||
'alamat_siswa' => $alamat_ayah,
|
||||
'kd_kompetensi' => $kd_kompetensi,
|
||||
'tahun_pelajaran' => $result->tp,
|
||||
'gelombang' => $result->gelombang,
|
||||
'status' => 'Belum Tes',
|
||||
);
|
||||
|
||||
// Simpan data ke dalam basis data
|
||||
$this->db->insert('data_siswa', $data);
|
||||
if (!empty($sekolah_lain)) {
|
||||
$datas = array(
|
||||
'nm_sekolah' => $sekolah_lain,
|
||||
);
|
||||
$this->db->insert('sekolah', $datas);
|
||||
|
||||
}
|
||||
|
||||
// Tambahkan logika untuk menangani jika data berhasil disimpan atau tidak
|
||||
if ($this->db->affected_rows() > 0) {
|
||||
// Data berhasil disimpan
|
||||
$this->session->set_flashdata('sukses', 'Data Calon Siswa Telah Ditambahkan, Silahkan lakukan Transaki Biaya Tes..!');
|
||||
redirect(base_url('biayaformulir'),'refresh');
|
||||
} else {
|
||||
// Data gagal disimpan
|
||||
echo "Gagal menyimpan data calon siswa. Silakan coba lagi.";
|
||||
}
|
||||
}
|
||||
|
||||
// Fungsi untuk menghasilkan nomor pendaftaran baru
|
||||
private function generate_nomor_pendaftaran() {
|
||||
// Tambahkan logika untuk menghasilkan nomor pendaftaran baru sesuai dengan kebutuhan Anda
|
||||
// ...
|
||||
return $nomor_pendaftaran;
|
||||
}
|
||||
|
||||
|
||||
//Delete user
|
||||
public function delete($no_pendaftaran)
|
||||
{
|
||||
$data = array('no_pendaftaran' => $no_pendaftaran);
|
||||
//proses hapus
|
||||
$this->siswamodel->delete($data);
|
||||
//notifikasi
|
||||
$this->session->set_flashdata('sukses', 'Data nilai telah dihapus');
|
||||
redirect(base_url('nilai'),'refresh');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,382 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Formulir extends CI_Controller {
|
||||
|
||||
//load model
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('formulir_model');
|
||||
$this->simple_login->check_login();
|
||||
//proteksi admin dan peserta
|
||||
if($this->session->userdata('level') !='Administrator')
|
||||
{
|
||||
if($this->session->userdata('level') !='Operator')
|
||||
{
|
||||
if($this->session->userdata('level') !='CS')
|
||||
{
|
||||
//kalau bukan adamin, lempar ke login
|
||||
$this->session->set_flashdata('warning', 'Hak akses anda tidak diijinkan mengakses menu penyerahan berkas');
|
||||
redirect(base_url('login'),'refresh');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function search(){
|
||||
// Ambil data pendaftar yang dikirim via ajax post
|
||||
$no_pendaftaran = $this->input->post('no_pendaftaran');
|
||||
$siswa = $this->formulir_model->viewByNo($no_pendaftaran);
|
||||
|
||||
if( ! empty($siswa)){ // Jika data siswa ada/ditemukan
|
||||
// Buat sebuah array
|
||||
$callback = array(
|
||||
'status' => 'success', // Set array status dengan success
|
||||
'nama_lengkap' => $siswa->nama_lengkap, // Set array nama
|
||||
'sekolah_asal' => $siswa->sekolah_asal, // Set array sekolah
|
||||
'kompetensi' => $siswa->kompetensi, // Set array kompetensi
|
||||
);
|
||||
}else{
|
||||
$callback = array('status' => 'failed'); // set array status dengan failed
|
||||
}
|
||||
echo json_encode($callback); // konversi varibael $callback menjadi JSON
|
||||
}
|
||||
|
||||
|
||||
public function index()
|
||||
{
|
||||
$formulir = $this->formulir_model->listing();
|
||||
$total = $this->formulir_model->total();
|
||||
$setting = $this->setting_model->setting();
|
||||
$setting = array('tgl_sosialisasi' => $setting);
|
||||
|
||||
//validasi input
|
||||
$valid = $this->form_validation;
|
||||
//check nama
|
||||
$this->form_validation->set_rules('nama_lengkap', 'Data tidak dapat disimpan, nama peserta harus terisi ', 'required',
|
||||
array( 'required' => '%s dengan menekan tombol cari terlebih dahulu'));
|
||||
|
||||
$valid->set_rules('no_pendaftaran','Berkas tidak dapat disimpan, ','required|is_unique[tr_data.no_pendaftaran]',
|
||||
array( 'required' => '%s harus diisi',
|
||||
'is_unique' => '%s nomor pendaftaran yang diinput sudah menyerahkan data jika ingin menambahkan silahkan di menu edit'));
|
||||
|
||||
//jika sudah dicek dan error
|
||||
if($valid->run()===FALSE) {
|
||||
$formulir = array( 'title' => 'Data Penyerahan Berkas [ '.$total->total.' ]',
|
||||
'formulir' => $formulir,
|
||||
'content' => 'formulir/index'
|
||||
);
|
||||
$this->load->view('layout/wrapper', $formulir, FALSE);
|
||||
//jika validasi oke, masuk database
|
||||
}else{
|
||||
|
||||
$inp = $this->input;
|
||||
$data = array( 'no_pendaftaran' => $inp->post('no_pendaftaran'),
|
||||
'tgl_sosialisasi' => date('Y-m-d H:i:s',($inp->post('tgl_sosialisasi'))),
|
||||
'shun' => $inp->post('shun'),
|
||||
'akte' => $inp->post('akte'),
|
||||
'kk' => $inp->post('kk'),
|
||||
'ktp' => $inp->post('ktp'),
|
||||
'nisn' => $inp->post('nisn'),
|
||||
'baik_narkoba' => $inp->post('baik_narkoba'),
|
||||
'ket_yatim' => $inp->post('ket_yatim'),
|
||||
'kip' => $inp->post('kip'),
|
||||
'slip_btn' => $inp->post('slip_btn'),
|
||||
'skl' => $inp->post('skl'),
|
||||
'ijazah' => $inp->post('ijazah'),
|
||||
'tgl_update' => date('Y-m-d H:i:s'),
|
||||
'petugas' => $this->session->userdata('nama')
|
||||
);
|
||||
//proses oleh model
|
||||
$this->formulir_model->tambah($data);
|
||||
//notifikasi dan redirect
|
||||
$this->session->set_flashdata('sukses', 'Data berkas telah ditambah..!');
|
||||
redirect(base_url('formulir'),'refresh');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//Edit user
|
||||
public function edit($no_pendaftaran)
|
||||
{
|
||||
//panggil data user yang akan diedit
|
||||
$formulir = $this->formulir_model->detail($no_pendaftaran);
|
||||
|
||||
|
||||
//validasi input
|
||||
$valid = $this->form_validation;
|
||||
//check nama
|
||||
$valid->set_rules('akte','Data penyerahan berkas','required',
|
||||
array( 'required' => '%s harus diisi'));
|
||||
|
||||
//jika sudah dicek dan error
|
||||
if($valid->run()===FALSE) {
|
||||
//end validasi
|
||||
|
||||
$data= array( 'title' => 'Edit Data Berkas Pendaftar : '.$formulir->no_pendaftaran.' -- '.$formulir->nama_lengkap,
|
||||
'formulir' => $formulir,
|
||||
'content' => 'formulir/edit'
|
||||
);
|
||||
$this->load->view('layout/wrapper', $data, FALSE);
|
||||
//jika validasi oke, masuk database
|
||||
}else{
|
||||
$inp = $this->input;
|
||||
$data = array( 'no_pendaftaran' => $no_pendaftaran,
|
||||
'shun' => $inp->post('shun'),
|
||||
'akte' => $inp->post('akte'),
|
||||
'kk' => $inp->post('kk'),
|
||||
'ktp' => $inp->post('ktp'),
|
||||
'nisn' => $inp->post('nisn'),
|
||||
'baik_narkoba' => $inp->post('baik_narkoba'),
|
||||
'ket_yatim' => $inp->post('ket_yatim'),
|
||||
'kip' => $inp->post('kip'),
|
||||
'slip_btn' => $inp->post('slip_btn'),
|
||||
'skl' => $inp->post('skl'),
|
||||
'ijazah' => $inp->post('ijazah'),
|
||||
'tgl_update' => date('Y-m-d H:i:s'),
|
||||
'petugas' => $this->session->userdata('nama')
|
||||
);
|
||||
//proses oleh model
|
||||
$this->formulir_model->edit($data);
|
||||
//notifikasi dan redirect
|
||||
$this->session->set_flashdata('sukses', 'Data berkas '.$formulir->nama_lengkap.' telah diedit.');
|
||||
redirect(base_url('formulir'),'refresh');
|
||||
}
|
||||
//end masuk database
|
||||
}
|
||||
|
||||
//Delete formulir
|
||||
public function delete($no_pendaftaran)
|
||||
{
|
||||
$data = array('no_pendaftaran' => $no_pendaftaran);
|
||||
//proses hapus
|
||||
$this->formulir_model->delete($data);
|
||||
//notifikasi
|
||||
$this->session->set_flashdata('sukses', 'Data berkas telah dihapus..!');
|
||||
redirect(base_url('formulir'),'refresh');
|
||||
}
|
||||
|
||||
|
||||
|
||||
//EXPORT NILAI KE EXCEL
|
||||
public function export(){
|
||||
// Load plugin PHPExcel nya
|
||||
include APPPATH.'third_party/PHPExcel/PHPExcel.php';
|
||||
|
||||
// Panggil class PHPExcel nya
|
||||
$excel = new PHPExcel();
|
||||
// Settingan awal fil excel
|
||||
$excel->getProperties()->setCreator('By : 415 DIL')
|
||||
->setLastModifiedBy('By : 415 DIL')
|
||||
->setTitle("Data Berkas")
|
||||
->setSubject("Berkas")
|
||||
->setDescription("Laporan Data Berkas")
|
||||
->setKeywords("Data Berkas");
|
||||
// Buat sebuah variabel untuk menampung pengaturan style dari header tabel
|
||||
$style_col = array(
|
||||
'font' => array('bold' => true), // Set font nya jadi bold
|
||||
'alignment' => array(
|
||||
'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, // Set text jadi ditengah secara horizontal (center)
|
||||
'vertical' => PHPExcel_Style_Alignment::VERTICAL_CENTER // Set text jadi di tengah secara vertical (middle)
|
||||
),
|
||||
'borders' => array(
|
||||
'top' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border top dengan garis tipis
|
||||
'right' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border right dengan garis tipis
|
||||
'bottom' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border bottom dengan garis tipis
|
||||
'left' => array('style' => PHPExcel_Style_Border::BORDER_THIN) // Set border left dengan garis tipis
|
||||
)
|
||||
);
|
||||
// Buat sebuah variabel untuk menampung pengaturan style dari isi tabel
|
||||
$style_row = array(
|
||||
'alignment' => array(
|
||||
'vertical' => PHPExcel_Style_Alignment::VERTICAL_CENTER // Set text jadi di tengah secara vertical (middle)
|
||||
),
|
||||
'borders' => array(
|
||||
'top' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border top dengan garis tipis
|
||||
'right' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border right dengan garis tipis
|
||||
'bottom' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border bottom dengan garis tipis
|
||||
'left' => array('style' => PHPExcel_Style_Border::BORDER_THIN) // Set border left dengan garis tipis
|
||||
)
|
||||
);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('A1', "LAPORAN REKAP PENYERAHAN BERKAS PPDB SMK AL-MUHTADIN DEPOK"); // Set kolom A1 dengan tulisan "DATA SISWA"
|
||||
$excel->getActiveSheet()->mergeCells('A1:P1'); // Set Merge Cell pada kolom A1 sampai E1
|
||||
$excel->getActiveSheet()->getStyle('A1')->getFont()->setBold(TRUE); // Set bold kolom A1
|
||||
$excel->getActiveSheet()->getStyle('A1')->getFont()->setSize(15); // Set font size 15 untuk kolom A1
|
||||
$excel->getActiveSheet()->getStyle('A1')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER); // Set text center untuk kolom A1
|
||||
// Buat header tabel nya pada baris ke 3
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('A3', "NO."); // Set kolom A3 dengan tulisan "NO"
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('B3', "NO. PEND"); // Set kolom B3 dengan tulisan "NO.PEND"
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('C3', "NAMA LENGKAP"); // Set kolom C3 dengan tulisan "NAMA"
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('D3', "JENIS KELAMIN"); // Set kolom D3 dengan tulisan "JENIS KELAMIN"
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('E3', "SEKOLAH ASAL"); // Set kolom E3 dengan tulisan "SEKOLAH"
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('F3', "KOMPETENSI");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('G3', "GELOMBANG");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('H3', "FORMULIR");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('I3', "AKTE");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('J3', "KK");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('K3', "KTP ORTU");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('L3', "NISN");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('M3', "BAIK & NARKOBA");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('N3', "KET. YATIM");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('O3', "KIP");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('P3', "SALIN SLIP");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('Q3', "SKL");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('R3', "IJAZAH");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('S3', "TGL. UPDATE");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('T3', "PETUGAS");
|
||||
|
||||
|
||||
// Apply style header yang telah kita buat tadi ke masing-masing kolom header
|
||||
$excel->getActiveSheet()->getStyle('A3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('B3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('C3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('D3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('E3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('F3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('G3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('H3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('I3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('J3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('K3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('L3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('M3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('N3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('O3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('P3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('Q3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('R3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('S3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('T3')->applyFromArray($style_col);
|
||||
|
||||
// Panggil function view yang ada di formulir_model untuk menampilkan semua data formulirnya
|
||||
$formulir = $this->formulir_model->ViewUrut();
|
||||
$no = 1; // Untuk penomoran tabel, di awal set dengan 1
|
||||
$numrow = 4; // Set baris pertama untuk isi tabel adalah baris ke 4
|
||||
foreach($formulir as $data){ // Lakukan looping pada variabel formulir
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('A'.$numrow, $no);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('B'.$numrow, $data->no_pendaftaran);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('C'.$numrow, $data->nama_lengkap);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('D'.$numrow, $data->jkelamin);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('E'.$numrow, $data->sekolah_asal);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('F'.$numrow, $data->kd_kompetensi);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('G'.$numrow, $data->gelombang);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('H'.$numrow, $data->shun);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('I'.$numrow, $data->akte);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('J'.$numrow, $data->kk);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('K'.$numrow, $data->ktp);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('L'.$numrow, $data->nisn);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('M'.$numrow, $data->baik_narkoba);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('N'.$numrow, $data->ket_yatim);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('O'.$numrow, $data->kip);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('P'.$numrow, $data->slip_btn);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('Q'.$numrow, $data->skl);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('R'.$numrow, $data->ijazah);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('S'.$numrow, $data->tgl_update);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('T'.$numrow, $data->petugas);
|
||||
|
||||
|
||||
// Apply style row yang telah kita buat tadi ke masing-masing baris (isi tabel)
|
||||
$excel->getActiveSheet()->getStyle('A'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('B'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('C'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('D'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('E'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('F'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('G'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('H'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('I'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('J'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('K'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('L'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('M'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('N'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('O'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('P'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('Q'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('R'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('S'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('T'.$numrow)->applyFromArray($style_row);
|
||||
|
||||
|
||||
$no++; // Tambah 1 setiap kali looping
|
||||
$numrow++; // Tambah 1 setiap kali looping
|
||||
}
|
||||
// Set width kolom
|
||||
$excel->getActiveSheet()->getColumnDimension('A')->setWidth(5); // Set width kolom A
|
||||
$excel->getActiveSheet()->getColumnDimension('B')->setWidth(12); // Set width kolom B
|
||||
$excel->getActiveSheet()->getColumnDimension('C')->setWidth(35); // Set width kolom C
|
||||
$excel->getActiveSheet()->getColumnDimension('D')->setWidth(15); // Set width kolom D
|
||||
$excel->getActiveSheet()->getColumnDimension('E')->setWidth(35); // Set width kolom E
|
||||
$excel->getActiveSheet()->getColumnDimension('F')->setWidth(13);
|
||||
$excel->getActiveSheet()->getColumnDimension('G')->setWidth(13);
|
||||
$excel->getActiveSheet()->getColumnDimension('H')->setWidth(12);
|
||||
$excel->getActiveSheet()->getColumnDimension('I')->setWidth(12);
|
||||
$excel->getActiveSheet()->getColumnDimension('J')->setWidth(12);
|
||||
$excel->getActiveSheet()->getColumnDimension('K')->setWidth(12);
|
||||
$excel->getActiveSheet()->getColumnDimension('L')->setWidth(12);
|
||||
$excel->getActiveSheet()->getColumnDimension('M')->setWidth(16);
|
||||
$excel->getActiveSheet()->getColumnDimension('N')->setWidth(12);
|
||||
$excel->getActiveSheet()->getColumnDimension('O')->setWidth(12);
|
||||
$excel->getActiveSheet()->getColumnDimension('P')->setWidth(12);
|
||||
$excel->getActiveSheet()->getColumnDimension('Q')->setWidth(12);
|
||||
$excel->getActiveSheet()->getColumnDimension('R')->setWidth(12);
|
||||
$excel->getActiveSheet()->getColumnDimension('S')->setWidth(18);
|
||||
$excel->getActiveSheet()->getColumnDimension('T')->setWidth(15);
|
||||
|
||||
// Set height semua kolom menjadi auto (mengikuti height isi dari kolommnya, jadi otomatis)
|
||||
$excel->getActiveSheet()->getDefaultRowDimension()->setRowHeight(-1);
|
||||
// Set orientasi kertas jadi LANDSCAPE
|
||||
$excel->getActiveSheet()->getPageSetup()->setOrientation(PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE);
|
||||
// Set judul file excel nya
|
||||
$excel->getActiveSheet(0)->setTitle("Rekap Penyerahan Berkas PPDB");
|
||||
$excel->setActiveSheetIndex(0);
|
||||
// Proses file excel
|
||||
header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
|
||||
header('Content-Disposition: attachment; filename="Rekap Penyerahan Berkas PPDB.xlsx"'); // Set nama file excel nya
|
||||
header('Cache-Control: max-age=0');
|
||||
$write = PHPExcel_IOFactory::createWriter($excel, 'Excel2007');
|
||||
$write->save('php://output');
|
||||
}
|
||||
|
||||
public function cetak(){
|
||||
$pdf = new FPDF('p','mm','A4');
|
||||
// membuat halaman baru
|
||||
$pdf->AddPage();
|
||||
// setting jenis font yang akan digunakan
|
||||
$pdf->SetFont('Arial','B',16);
|
||||
// mencetak string
|
||||
$pdf->Cell(190,7,'LAPORAN REKAP DATA BERKAS PPDB',0,1,'C');
|
||||
$pdf->SetFont('Arial','B',12);
|
||||
$pdf->Cell(190,7,'SMK AL-MUHTADIN DEPOK',0,1,'C');
|
||||
// Memberikan space kebawah agar tidak terlalu rapat
|
||||
$pdf->Cell(10,7,'',0,1);
|
||||
$pdf->SetFont('Arial','B',10);
|
||||
$pdf->Cell(10,6,'NO.',1,0);
|
||||
$pdf->Cell(20,6,'NO. PEND',1,0);
|
||||
$pdf->Cell(85,6,'NAMA SISWA',1,0);
|
||||
$pdf->Cell(30,6,'TEMPAT LAHIR',1,0);
|
||||
$pdf->Cell(33,6,'TANGGAL LAHIR',1,1);
|
||||
$pdf->SetFont('Arial','',10);
|
||||
$siswa = $this->db->get('data_siswa')->result();
|
||||
$no = 1;
|
||||
foreach ($siswa as $row){
|
||||
$pdf->Cell(10,6,$no++,1,0);
|
||||
$pdf->Cell(20,6,$row->no_pendaftaran,1,0);
|
||||
$pdf->Cell(85,6,$row->nama_lengkap,1,0);
|
||||
$pdf->Cell(30,6,$row->tempat_lahir,1,0);
|
||||
$pdf->Cell(33,6,$row->tgl_lahir,1,1);
|
||||
}
|
||||
$pdf->Output();
|
||||
}
|
||||
|
||||
public function cetakberkas($no_pendaftaran)
|
||||
{
|
||||
$data['data'] = $this->db->get_where('v_rpt_trans_berkas',['no_pendaftaran'=>$no_pendaftaran])->row();
|
||||
$this->load->view('formulir/cetak_berkas',$data);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* End of file formulir.php */
|
||||
/* Location: ./application/controllers/formulir.php */
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Gambar extends CI_Controller {
|
||||
|
||||
public function __construct(){
|
||||
parent::__construct();
|
||||
|
||||
$this->load->model('GambarModel');
|
||||
}
|
||||
|
||||
public function index(){
|
||||
$data['gambar'] = $this->GambarModel->view();
|
||||
$this->load->view('gambar/index', $data);
|
||||
}
|
||||
|
||||
public function upload(){
|
||||
// lakukan upload file dengan memanggil function upload yang ada di GambarModel.php
|
||||
$upload = $this->GambarModel->upload();
|
||||
|
||||
if($upload['result'] == "success"){ // Jika proses upload sukses
|
||||
// Panggil function save yang ada di GambarModel.php untuk menyimpan data ke database
|
||||
$this->GambarModel->save($upload);
|
||||
|
||||
// Echo hasil dari proses dengan tanda pemisah <|>
|
||||
echo "SUCCESS<|>Gambar berhasil diupload<|>";
|
||||
echo $this->load->view('gambar/view', array('gambar'=>$this->GambarModel->view()), true); // Load view.php
|
||||
}else{ // Jika proses upload gagal
|
||||
// Echo hasil dari proses dengan tanda pemisah <|>
|
||||
echo "FAILED<|>".$upload['error']; // Ambil pesan error uploadnya untuk dikirim ke file form dan ditampilkan
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,160 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Gel1 extends CI_Controller {
|
||||
|
||||
//load model
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('gelombang_model');
|
||||
$this->simple_login->check_login();
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$gel1 = $this->gelombang_model->gel1();
|
||||
$total = $this->gelombang_model->total();
|
||||
|
||||
$data = array( 'title' => 'Data Pendaftar Gelombang 1 [ '.$total->total.' ]',
|
||||
'gel1' => $gel1,
|
||||
'content' => 'gelombang/gelombang1/index'
|
||||
|
||||
);
|
||||
$this->load->view('layout/wrapper', $data, FALSE);
|
||||
}
|
||||
|
||||
//EXPORT GEL2 KE EXCEL
|
||||
public function export(){
|
||||
// Load plugin PHPExcel nya
|
||||
include APPPATH.'third_party/PHPExcel/PHPExcel.php';
|
||||
|
||||
// Panggil class PHPExcel nya
|
||||
$excel = new PHPExcel();
|
||||
// Settingan awal fil excel
|
||||
$excel->getProperties()->setCreator('By : 415 DIL')
|
||||
->setLastModifiedBy('By : 415 DIL')
|
||||
->setTitle("Data Berkas")
|
||||
->setSubject("Berkas")
|
||||
->setDescription("Laporan Data Berkas")
|
||||
->setKeywords("Data Berkas");
|
||||
// Buat sebuah variabel untuk menampung pengaturan style dari header tabel
|
||||
$style_col = array(
|
||||
'font' => array('bold' => true), // Set font nya jadi bold
|
||||
'alignment' => array(
|
||||
'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, // Set text jadi ditengah secara horizontal (center)
|
||||
'vertical' => PHPExcel_Style_Alignment::VERTICAL_CENTER // Set text jadi di tengah secara vertical (middle)
|
||||
),
|
||||
'borders' => array(
|
||||
'top' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border top dengan garis tipis
|
||||
'right' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border right dengan garis tipis
|
||||
'bottom' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border bottom dengan garis tipis
|
||||
'left' => array('style' => PHPExcel_Style_Border::BORDER_THIN) // Set border left dengan garis tipis
|
||||
)
|
||||
);
|
||||
// Buat sebuah variabel untuk menampung pengaturan style dari isi tabel
|
||||
$style_row = array(
|
||||
'alignment' => array(
|
||||
'vertical' => PHPExcel_Style_Alignment::VERTICAL_CENTER // Set text jadi di tengah secara vertical (middle)
|
||||
),
|
||||
'borders' => array(
|
||||
'top' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border top dengan garis tipis
|
||||
'right' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border right dengan garis tipis
|
||||
'bottom' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border bottom dengan garis tipis
|
||||
'left' => array('style' => PHPExcel_Style_Border::BORDER_THIN) // Set border left dengan garis tipis
|
||||
)
|
||||
);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('A1', "LAPORAN REKAP DATA GELOMBANG 1 PPDB SMK AL-MUHTADIN DEPOK"); // Set kolom A1 dengan tulisan "DATA SISWA"
|
||||
$excel->getActiveSheet()->mergeCells('A1:K1'); // Set Merge Cell pada kolom A1 sampai E1
|
||||
$excel->getActiveSheet()->getStyle('A1')->getFont()->setBold(TRUE); // Set bold kolom A1
|
||||
$excel->getActiveSheet()->getStyle('A1')->getFont()->setSize(15); // Set font size 15 untuk kolom A1
|
||||
$excel->getActiveSheet()->getStyle('A1')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER); // Set text center untuk kolom A1
|
||||
// Buat header tabel nya pada baris ke 3
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('A3', "NO."); // Set kolom A3 dengan tulisan "NO"
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('B3', "NO. PEND"); // Set kolom B3 dengan tulisan "NO.PEND"
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('C3', "NAMA LENGKAP"); // Set kolom C3 dengan tulisan "NAMA"
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('D3', "JENIS KELAMIN"); // Set kolom D3 dengan tulisan "JENIS KELAMIN"
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('E3', "TEMPAT LAHIR"); // Set kolom E3 dengan tulisan "TEMPAT LAHIR"
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('F3', "TGL. LAHIR");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('G3', "SEKOLAH ASAL");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('H3', "KOMPETENSI");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('I3', "GELOMBANG");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('J3', "NO. HANDPHONE");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('K3', "TGL. DAFTAR");
|
||||
|
||||
// Apply style header yang telah kita buat tadi ke masing-masing kolom header
|
||||
$excel->getActiveSheet()->getStyle('A3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('B3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('C3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('D3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('E3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('F3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('G3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('H3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('I3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('J3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('K3')->applyFromArray($style_col);
|
||||
|
||||
// Panggil function view yang ada di formulir_model untuk menampilkan semua data formulirnya
|
||||
$gel2 = $this->gelombang_model->ViewUrut1();
|
||||
$no = 1; // Untuk penomoran tabel, di awal set dengan 1
|
||||
$numrow = 4; // Set baris pertama untuk isi tabel adalah baris ke 4
|
||||
foreach($gel2 as $data){ // Lakukan looping pada variabel formulir
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('A'.$numrow, $no);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('B'.$numrow, $data->no_pendaftaran);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('C'.$numrow, $data->nama_lengkap);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('D'.$numrow, $data->jkelamin);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('E'.$numrow, $data->tempat_lahir);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('F'.$numrow, $data->tgl_lahir);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('G'.$numrow, $data->sekolah_asal);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('H'.$numrow, $data->kd_kompetensi);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('I'.$numrow, $data->gelombang);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('J'.$numrow, $data->no_hp);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('K'.$numrow, $data->tgl_trans);
|
||||
|
||||
|
||||
// Apply style row yang telah kita buat tadi ke masing-masing baris (isi tabel)
|
||||
$excel->getActiveSheet()->getStyle('A'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('B'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('C'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('D'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('E'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('F'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('G'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('H'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('I'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('J'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('K'.$numrow)->applyFromArray($style_row);
|
||||
|
||||
|
||||
$no++; // Tambah 1 setiap kali looping
|
||||
$numrow++; // Tambah 1 setiap kali looping
|
||||
}
|
||||
// Set width kolom
|
||||
$excel->getActiveSheet()->getColumnDimension('A')->setWidth(5); // Set width kolom A
|
||||
$excel->getActiveSheet()->getColumnDimension('B')->setWidth(12); // Set width kolom B
|
||||
$excel->getActiveSheet()->getColumnDimension('C')->setWidth(35); // Set width kolom C
|
||||
$excel->getActiveSheet()->getColumnDimension('D')->setWidth(15); // Set width kolom D
|
||||
$excel->getActiveSheet()->getColumnDimension('E')->setWidth(20); // Set width kolom E
|
||||
$excel->getActiveSheet()->getColumnDimension('F')->setWidth(14);
|
||||
$excel->getActiveSheet()->getColumnDimension('G')->setWidth(35);
|
||||
$excel->getActiveSheet()->getColumnDimension('H')->setWidth(14);
|
||||
$excel->getActiveSheet()->getColumnDimension('I')->setWidth(14);
|
||||
$excel->getActiveSheet()->getColumnDimension('J')->setWidth(18);
|
||||
$excel->getActiveSheet()->getColumnDimension('K')->setWidth(14);
|
||||
|
||||
// Set height semua kolom menjadi auto (mengikuti height isi dari kolommnya, jadi otomatis)
|
||||
$excel->getActiveSheet()->getDefaultRowDimension()->setRowHeight(-1);
|
||||
// Set orientasi kertas jadi LANDSCAPE
|
||||
$excel->getActiveSheet()->getPageSetup()->setOrientation(PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE);
|
||||
// Set judul file excel nya
|
||||
$excel->getActiveSheet(0)->setTitle("Rekap Data Gelombang 1 PPDB");
|
||||
$excel->setActiveSheetIndex(0);
|
||||
// Proses file excel
|
||||
header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
|
||||
header('Content-Disposition: attachment; filename="Rekap Data Gelombang 1 PPDB.xlsx"'); // Set nama file excel nya
|
||||
header('Cache-Control: max-age=0');
|
||||
$write = PHPExcel_IOFactory::createWriter($excel, 'Excel2007');
|
||||
$write->save('php://output');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,161 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Gel2 extends CI_Controller {
|
||||
|
||||
//load model
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('gelombang_model');
|
||||
$this->simple_login->check_login();
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$gel2 = $this->gelombang_model->gel2();
|
||||
$total = $this->gelombang_model->total2();
|
||||
|
||||
$data = array( 'title' => 'Data Pendaftar Gelombang 2 [ '.$total->total.' ]',
|
||||
'gel2' => $gel2,
|
||||
'content' => 'gelombang/gelombang2/index'
|
||||
|
||||
);
|
||||
$this->load->view('layout/wrapper', $data, FALSE);
|
||||
}
|
||||
|
||||
//EXPORT GEL2 KE EXCEL
|
||||
public function export(){
|
||||
// Load plugin PHPExcel nya
|
||||
include APPPATH.'third_party/PHPExcel/PHPExcel.php';
|
||||
|
||||
// Panggil class PHPExcel nya
|
||||
$excel = new PHPExcel();
|
||||
// Settingan awal fil excel
|
||||
$excel->getProperties()->setCreator('By : 415 DIL')
|
||||
->setLastModifiedBy('By : 415 DIL')
|
||||
->setTitle("Data Berkas")
|
||||
->setSubject("Berkas")
|
||||
->setDescription("Laporan Data Berkas")
|
||||
->setKeywords("Data Berkas");
|
||||
// Buat sebuah variabel untuk menampung pengaturan style dari header tabel
|
||||
$style_col = array(
|
||||
'font' => array('bold' => true), // Set font nya jadi bold
|
||||
'alignment' => array(
|
||||
'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, // Set text jadi ditengah secara horizontal (center)
|
||||
'vertical' => PHPExcel_Style_Alignment::VERTICAL_CENTER // Set text jadi di tengah secara vertical (middle)
|
||||
),
|
||||
'borders' => array(
|
||||
'top' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border top dengan garis tipis
|
||||
'right' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border right dengan garis tipis
|
||||
'bottom' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border bottom dengan garis tipis
|
||||
'left' => array('style' => PHPExcel_Style_Border::BORDER_THIN) // Set border left dengan garis tipis
|
||||
)
|
||||
);
|
||||
// Buat sebuah variabel untuk menampung pengaturan style dari isi tabel
|
||||
$style_row = array(
|
||||
'alignment' => array(
|
||||
'vertical' => PHPExcel_Style_Alignment::VERTICAL_CENTER // Set text jadi di tengah secara vertical (middle)
|
||||
),
|
||||
'borders' => array(
|
||||
'top' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border top dengan garis tipis
|
||||
'right' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border right dengan garis tipis
|
||||
'bottom' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border bottom dengan garis tipis
|
||||
'left' => array('style' => PHPExcel_Style_Border::BORDER_THIN) // Set border left dengan garis tipis
|
||||
)
|
||||
);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('A1', "LAPORAN REKAP DATA GELOMBANG 2 PPDB SMK AL-MUHTADIN DEPOK"); // Set kolom A1 dengan tulisan "DATA SISWA"
|
||||
$excel->getActiveSheet()->mergeCells('A1:K1'); // Set Merge Cell pada kolom A1 sampai E1
|
||||
$excel->getActiveSheet()->getStyle('A1')->getFont()->setBold(TRUE); // Set bold kolom A1
|
||||
$excel->getActiveSheet()->getStyle('A1')->getFont()->setSize(15); // Set font size 15 untuk kolom A1
|
||||
$excel->getActiveSheet()->getStyle('A1')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER); // Set text center untuk kolom A1
|
||||
// Buat header tabel nya pada baris ke 3
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('A3', "NO."); // Set kolom A3 dengan tulisan "NO"
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('B3', "NO. PEND"); // Set kolom B3 dengan tulisan "NO.PEND"
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('C3', "NAMA LENGKAP"); // Set kolom C3 dengan tulisan "NAMA"
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('D3', "JENIS KELAMIN"); // Set kolom D3 dengan tulisan "JENIS KELAMIN"
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('E3', "TEMPAT LAHIR"); // Set kolom E3 dengan tulisan "TEMPAT LAHIR"
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('F3', "TGL. LAHIR");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('G3', "SEKOLAH ASAL");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('H3', "KOMPETENSI");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('I3', "GELOMBANG");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('J3', "NO. HANDPHONE");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('K3', "TGL. DAFTAR");
|
||||
|
||||
// Apply style header yang telah kita buat tadi ke masing-masing kolom header
|
||||
$excel->getActiveSheet()->getStyle('A3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('B3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('C3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('D3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('E3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('F3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('G3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('H3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('I3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('J3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('K3')->applyFromArray($style_col);
|
||||
|
||||
// Panggil function view yang ada di formulir_model untuk menampilkan semua data formulirnya
|
||||
$gel2 = $this->gelombang_model->ViewUrut2();
|
||||
$no = 1; // Untuk penomoran tabel, di awal set dengan 1
|
||||
$numrow = 4; // Set baris pertama untuk isi tabel adalah baris ke 4
|
||||
foreach($gel2 as $data){ // Lakukan looping pada variabel formulir
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('A'.$numrow, $no);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('B'.$numrow, $data->no_pendaftaran);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('C'.$numrow, $data->nama_lengkap);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('D'.$numrow, $data->jkelamin);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('E'.$numrow, $data->tempat_lahir);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('F'.$numrow, $data->tgl_lahir);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('G'.$numrow, $data->sekolah_asal);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('H'.$numrow, $data->kd_kompetensi);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('I'.$numrow, $data->gelombang);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('J'.$numrow, $data->no_hp);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('K'.$numrow, $data->tgl_trans);
|
||||
|
||||
|
||||
// Apply style row yang telah kita buat tadi ke masing-masing baris (isi tabel)
|
||||
$excel->getActiveSheet()->getStyle('A'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('B'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('C'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('D'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('E'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('F'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('G'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('H'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('I'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('J'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('K'.$numrow)->applyFromArray($style_row);
|
||||
|
||||
|
||||
$no++; // Tambah 1 setiap kali looping
|
||||
$numrow++; // Tambah 1 setiap kali looping
|
||||
}
|
||||
// Set width kolom
|
||||
$excel->getActiveSheet()->getColumnDimension('A')->setWidth(5); // Set width kolom A
|
||||
$excel->getActiveSheet()->getColumnDimension('B')->setWidth(12); // Set width kolom B
|
||||
$excel->getActiveSheet()->getColumnDimension('C')->setWidth(35); // Set width kolom C
|
||||
$excel->getActiveSheet()->getColumnDimension('D')->setWidth(15); // Set width kolom D
|
||||
$excel->getActiveSheet()->getColumnDimension('E')->setWidth(20); // Set width kolom E
|
||||
$excel->getActiveSheet()->getColumnDimension('F')->setWidth(14);
|
||||
$excel->getActiveSheet()->getColumnDimension('G')->setWidth(35);
|
||||
$excel->getActiveSheet()->getColumnDimension('H')->setWidth(14);
|
||||
$excel->getActiveSheet()->getColumnDimension('I')->setWidth(14);
|
||||
$excel->getActiveSheet()->getColumnDimension('J')->setWidth(18);
|
||||
$excel->getActiveSheet()->getColumnDimension('K')->setWidth(14);
|
||||
|
||||
// Set height semua kolom menjadi auto (mengikuti height isi dari kolommnya, jadi otomatis)
|
||||
$excel->getActiveSheet()->getDefaultRowDimension()->setRowHeight(-1);
|
||||
// Set orientasi kertas jadi LANDSCAPE
|
||||
$excel->getActiveSheet()->getPageSetup()->setOrientation(PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE);
|
||||
// Set judul file excel nya
|
||||
$excel->getActiveSheet(0)->setTitle("Rekap Data Gelombang 2 PPDB");
|
||||
$excel->setActiveSheetIndex(0);
|
||||
// Proses file excel
|
||||
header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
|
||||
header('Content-Disposition: attachment; filename="Rekap Data Gelombang 2 PPDB.xlsx"'); // Set nama file excel nya
|
||||
header('Cache-Control: max-age=0');
|
||||
$write = PHPExcel_IOFactory::createWriter($excel, 'Excel2007');
|
||||
$write->save('php://output');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,669 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Invoice extends CI_Controller {
|
||||
|
||||
//load model
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('invoice_model');
|
||||
$this->load->model('biayaformulir_model');
|
||||
|
||||
$this->simple_login->check_login();
|
||||
}
|
||||
|
||||
public function search(){
|
||||
// Ambil data pendaftar yang dikirim via ajax post
|
||||
$no_pendaftaran = $this->input->post('no_pendaftaran');
|
||||
$siswa = $this->biayaformulir_model->viewByNoInvoice($no_pendaftaran);
|
||||
|
||||
if( ! empty($siswa)){ // Jika data siswa ada/ditemukan
|
||||
// Buat sebuah array
|
||||
|
||||
// cari dulu ditabel pengumuman
|
||||
$cari1= $this->db->get_where("pengumuman", ["no_pendaftaran" =>$siswa->no_pendaftaran ]);
|
||||
|
||||
if ($cari1->num_rows() > 0) {
|
||||
$datapengumuman= $cari1->row();
|
||||
if ($datapengumuman->status == "BELUM LULUS" || $datapengumuman->status == "TIDAK LULUS") {
|
||||
$callback = array('status' => 'belum');
|
||||
} else {
|
||||
$setppdb = $this->db->get("biaya_ppdb")->row();
|
||||
$biaya_pendaftaran_formatted = number_format($siswa->biaya_pendaftaran, 0, ',', '.');
|
||||
$potgel=0;
|
||||
$potkembar=0;
|
||||
$potsekolah=0;
|
||||
$potyatim=0;
|
||||
$potspp=0;
|
||||
|
||||
if ($siswa->gelombang == "Gelombang 1") {
|
||||
// potongangelombang
|
||||
$potgel= $setppdb->pot_gel;
|
||||
// potongansekolah_dp
|
||||
if ($siswa->sekolah_asal=="SMP Dharma Pertiwi") {
|
||||
$potsekolah = $setppdb->pot_dp;
|
||||
}
|
||||
// // potonganyatim
|
||||
// if ($siswa->ket=="Yatim") {
|
||||
// $potsekolah = $setppdb->pot_yatim;
|
||||
// // potongan SPP
|
||||
// if ($siswa->kd_pompetensi =="TJKT") {
|
||||
// $potspp = $setppdb->pot_spp_tkj;
|
||||
// }
|
||||
// else{
|
||||
// $potspp = $setppdb->pot_spp;
|
||||
// }
|
||||
// }
|
||||
} else {
|
||||
|
||||
// if ($siswa->sekolah_asal=="SMP Dharma Pertiwi") {
|
||||
// $potsekolah = $setppdb->pot_dp;
|
||||
// }
|
||||
// potonganyatim
|
||||
// if ($siswa->ket=="Yatim") {
|
||||
// $potsekolah = $setppdb->pot_yatim;
|
||||
// // potongan SPP
|
||||
// if ($siswa->kd_pompetensi =="TJKT") {
|
||||
// $potspp = $setppdb->pot_spp_tkj;
|
||||
// }
|
||||
// else{
|
||||
// $potspp = $setppdb->pot_spp;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
$totalpotongan = $potgel+$potsekolah+$potspp+$potyatim;
|
||||
$totalketentuan = $siswa->biaya_pendaftaran-$totalpotongan;
|
||||
|
||||
|
||||
|
||||
$callback = array(
|
||||
'status' => 'success', // Set array status dengan success
|
||||
'nama_lengkap' => $siswa->nama_lengkap, // Set array nama
|
||||
'sekolah_asal' => $siswa->sekolah_asal, // Set array sekolah
|
||||
'kompetensi' => $siswa->kompetensi, // Set array kompetensi
|
||||
'gelombang' => $siswa->gelombang, // Set array kompetensi
|
||||
'biaya_pendaftaran' => $siswa->biaya_pendaftaran, // Set array kompetensi
|
||||
'biaya' => $biaya_pendaftaran_formatted, // Set array kompetensi
|
||||
'potgel' => $potgel, // Set array kompetensi
|
||||
'potsekolah' => $potsekolah, // Set array kompetensi
|
||||
'potspp' => $potspp, // Set array kompetensi
|
||||
'potyatim' => $potyatim, // Set array kompetensi
|
||||
'ketentuan' => $totalketentuan, // Set array kompetensi
|
||||
);
|
||||
}
|
||||
}
|
||||
else{
|
||||
$callback = array('status' => 'belum');
|
||||
}
|
||||
}else{
|
||||
$callback = array('status' => 'failed'); // set array status dengan failed
|
||||
}
|
||||
echo json_encode($callback); // konversi varibael $callback menjadi JSON
|
||||
}
|
||||
|
||||
|
||||
public function caripotongan() {
|
||||
// Ambil data dari AJAX request
|
||||
$potongan = $this->input->post('potongan');
|
||||
$nopendaftaran = $this->input->post('nopendaftaran');
|
||||
$siswa = $this->db->get_where("data_siswa", ["no_pendaftaran" => $nopendaftaran])->row();
|
||||
|
||||
if( ! empty($siswa)){ // Jika data siswa ada/ditemukan
|
||||
// Buat sebuah array
|
||||
$setppdb = $this->db->get("biaya_ppdb")->row();
|
||||
// $biaya_pendaftaran_formatted = number_format($siswa->biaya_pendaftaran, 0, ',', '.');
|
||||
$potgel=0;
|
||||
$potkembar=0;
|
||||
$potsekolah=0;
|
||||
$potyatim=0;
|
||||
$potspp=0;
|
||||
$potyayasan=0;
|
||||
|
||||
|
||||
|
||||
// potonganyatim
|
||||
if ($potongan=="Yatim") {
|
||||
$potyatim = $setppdb->pot_yatim;
|
||||
// potongan SPP
|
||||
if ($siswa->kd_kompetensi =="TJKT") {
|
||||
$potspp = $setppdb->pot_spp_tkj;
|
||||
}
|
||||
elseif ($siswa->kd_kompetensi =="MPLB") {
|
||||
$potspp = $setppdb->pot_spp;
|
||||
}
|
||||
elseif ($siswa->kd_kompetensi =="ANIMASI") {
|
||||
$potspp = $setppdb->pot_spp_animasi;
|
||||
}
|
||||
else{
|
||||
$potspp = $setppdb->pot_spp_kuliner;
|
||||
}
|
||||
}
|
||||
elseif ($potongan=="Kembar") {
|
||||
$potkembar = $setppdb->pot_kembar;
|
||||
}
|
||||
elseif ($potongan=="Yatim & Kembar") {
|
||||
$potkembar = $setppdb->pot_kembar;
|
||||
$potyatim = $setppdb->pot_yatim;
|
||||
// potongan SPP
|
||||
if ($siswa->kd_kompetensi =="TJKT") {
|
||||
$potspp = $setppdb->pot_spp_tkj;
|
||||
}
|
||||
elseif ($siswa->kd_kompetensi =="MPLB") {
|
||||
$potspp = $setppdb->pot_spp;
|
||||
}
|
||||
elseif ($siswa->kd_kompetensi =="ANIMASI") {
|
||||
$potspp = $setppdb->pot_spp_animasi;
|
||||
}
|
||||
else{
|
||||
$potspp = $setppdb->pot_spp_kuliner;
|
||||
}
|
||||
}
|
||||
elseif ($potongan=="Yayasan") {
|
||||
}
|
||||
elseif ($potongan=="SKTM") {
|
||||
# code...
|
||||
}
|
||||
|
||||
|
||||
|
||||
// $totalpotongan = $potgel+$potsekolah+$potspp+$potyatim;
|
||||
// $totalketentuan = $siswa->biaya_pendaftaran-$totalpotongan;
|
||||
|
||||
|
||||
|
||||
$callback = array(
|
||||
'status' => 'success', // Set array status dengan success
|
||||
// 'nama_lengkap' => $siswa->nama_lengkap, // Set array nama
|
||||
// 'sekolah_asal' => $siswa->sekolah_asal, // Set array sekolah
|
||||
// 'kompetensi' => $siswa->kompetensi, // Set array kompetensi
|
||||
// // 'biaya_pendaftaran' => $siswa->biaya_pendaftaran, // Set array kompetensi
|
||||
// 'biaya' => $biaya_pendaftaran_formatted, // Set array kompetensi
|
||||
'potgel' => $potgel, // Set array kompetensi
|
||||
'potsekolah' => $potsekolah, // Set array kompetensi
|
||||
'potspp' => $potspp, // Set array kompetensi
|
||||
'potyatim' => $potyatim, // Set array kompetensi
|
||||
'potkembar' => $potkembar, // Set array kompetensi
|
||||
// 'ketentuan' => $totalketentuan, // Set array kompetensi
|
||||
);
|
||||
}else{
|
||||
$callback = array('status' => 'failed'); // set array status dengan failed
|
||||
}
|
||||
echo json_encode($callback); // konversi varibael $callback menjadi JSON
|
||||
}
|
||||
|
||||
public function caripotongandp() {
|
||||
// Ambil data dari AJAX request
|
||||
$potongan = $this->input->post('potongan');
|
||||
$nopendaftaran = $this->input->post('nopendaftaran');
|
||||
$siswa = $this->db->get_where("data_siswa", ["no_pendaftaran" => $nopendaftaran])->row();
|
||||
|
||||
|
||||
if( ! empty($siswa)){ // Jika data siswa ada/ditemukan
|
||||
// Buat sebuah array
|
||||
$setppdb = $this->db->get("biaya_ppdb")->row();
|
||||
// $biaya_pendaftaran_formatted = number_format($siswa->biaya_pendaftaran, 0, ',', '.');
|
||||
$potgel=0;
|
||||
$potkembar=0;
|
||||
$potsekolah=0;
|
||||
$potyatim=0;
|
||||
$potspp=0;
|
||||
$potyayasan=0;
|
||||
|
||||
|
||||
|
||||
// potonganyatim
|
||||
if ($potongan=="YA") {
|
||||
$potsekolah = $setppdb->pot_dp;
|
||||
}
|
||||
else{
|
||||
}
|
||||
$callback = array(
|
||||
'status' => 'success', // Set array status dengan success
|
||||
'potdp' => $potsekolah, // Set array nama
|
||||
|
||||
);
|
||||
}else{
|
||||
$callback = array('status' => 'failed'); // set array status dengan failed
|
||||
}
|
||||
echo json_encode($callback); // konversi varibael $callback menjadi JSON
|
||||
}
|
||||
|
||||
|
||||
public function index()
|
||||
{
|
||||
$invoice = $this->invoice_model->listing();
|
||||
$total = $this->invoice_model->total();
|
||||
$biaya = $this->db->get("setting")->row()->biaya_for;
|
||||
$diskon = $this->db->get("setting")->row()->diskon;
|
||||
|
||||
// no invoice otomatis
|
||||
// Ambil tanggal saat ini dalam format 'Ymd'
|
||||
$tanggal_sekarang = date('dmy');
|
||||
|
||||
// Lakukan query untuk mendapatkan nomor urutan terakhir
|
||||
$query = $this->db->query("SELECT MAX(CAST(RIGHT(no_invoice, 4) AS UNSIGNED)) AS max_urutan FROM invoice");
|
||||
$row = $query->row();
|
||||
$max_urutan = ($row->max_urutan != null) ? $row->max_urutan : 0;
|
||||
|
||||
// Tambahkan 1 ke nomor urutan terakhir
|
||||
$no_urut = sprintf("%04s", $max_urutan + 1);
|
||||
|
||||
// Gabungkan semua elemen menjadi nomor transaksi
|
||||
$nomor_transaksi = 'IN-' . $tanggal_sekarang . $no_urut;
|
||||
|
||||
$data = array( 'title' => 'Invoice Biaya PPDB [ '.$total->total.' ]',
|
||||
'invoice' => $invoice,
|
||||
'notr' => $nomor_transaksi,
|
||||
'content' => 'invoice/index'
|
||||
);
|
||||
$this->load->view('layout/wrapper', $data, FALSE);
|
||||
}
|
||||
|
||||
public function tambah()
|
||||
{
|
||||
|
||||
// Ambil data dari input form
|
||||
$data = array(
|
||||
'no_invoice' => $this->input->post('noinvoice'),
|
||||
'tgl_invoice' => date('Y-m-d'),
|
||||
'no_pendaftaran' => $this->input->post('no_pendaftaran'),
|
||||
'biaya' => $this->input->post('realbiaya'),
|
||||
'pot_gel' => $this->input->post('potongan_gel_1'),
|
||||
'pot_dp' => $this->input->post('potongan_dp'),
|
||||
'pot_yatim' => $this->input->post('potongan_yatim'),
|
||||
'pot_spp' => $this->input->post('potongan_spp'),
|
||||
'pot_kembar' => $this->input->post('potongan_kembar'),
|
||||
'pot_yayasan' => str_replace('.', '', $this->input->post('potongan_yayasan')),
|
||||
'pot_sktm' => str_replace('.', '', $this->input->post('potongan_sktm')),
|
||||
'pot_lain' => str_replace('.', '', $this->input->post('potongan_lainnya')),
|
||||
'ketentuan' => $this->input->post('total'),
|
||||
'operator' => $this->session->userdata('nama')
|
||||
|
||||
);
|
||||
|
||||
// Simpan data ke dalam tabel invoice
|
||||
$this->db->insert('invoice', $data);
|
||||
|
||||
// Redirect ke halaman setelah berhasil menyimpan
|
||||
$this->session->set_flashdata('sukses', 'Data Invoice telah ditambah..!');
|
||||
|
||||
redirect('invoice');
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
//Edit user
|
||||
public function edit($no_pendaftaran)
|
||||
{
|
||||
//panggil data user yang akan diedit
|
||||
$invoice = $this->invoice_model->detail($no_pendaftaran);
|
||||
|
||||
|
||||
|
||||
|
||||
$data= array( 'title' => 'Edit Data Invoice Pendaftar : '.$invoice->no_pendaftaran.' -- '.$invoice->nama_lengkap.' -- '.$invoice->gelombang,
|
||||
'invoice' => $invoice,
|
||||
'content' => 'invoice/edit'
|
||||
);
|
||||
$this->load->view('layout/wrapper', $data, FALSE);
|
||||
//jika validasi oke, masuk database
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function transaksi($no_pendaftaran)
|
||||
{
|
||||
//panggil data user yang akan diedit
|
||||
$invoice = $this->invoice_model->detail($no_pendaftaran);
|
||||
$datatrx = $this->db->get_where("tr_invoice", ["no_pendaftaran" => $no_pendaftaran])->result();
|
||||
// Inisialisasi variabel untuk menyimpan total pembayaran
|
||||
$total_pembayaran = 0;
|
||||
|
||||
// Iterasi setiap baris hasil query dan tambahkan nilai kolom 'bayar' ke variabel $total_pembayaran
|
||||
foreach ($datatrx as $trx) {
|
||||
$total_pembayaran += $trx->bayar;
|
||||
}
|
||||
|
||||
$tanggal_sekarang = date('dmy');
|
||||
|
||||
// Lakukan query untuk mendapatkan nomor urutan terakhir
|
||||
$query = $this->db->query("SELECT MAX(CAST(RIGHT(no_trans, 4) AS UNSIGNED)) AS max_urutan FROM tr_invoice");
|
||||
$row = $query->row();
|
||||
$max_urutan = ($row->max_urutan != null) ? $row->max_urutan : 0;
|
||||
|
||||
// Tambahkan 1 ke nomor urutan terakhir
|
||||
$no_urut = sprintf("%04s", $max_urutan + 1);
|
||||
|
||||
// Gabungkan semua elemen menjadi nomor transaksi
|
||||
$nomor_transaksi = 'TI-' . $tanggal_sekarang . $no_urut;
|
||||
|
||||
|
||||
$data= array( 'title' => 'Transaksi Invoice : '.$invoice->no_pendaftaran.' -- '.$invoice->nama_lengkap.' -- '.$invoice->gelombang,
|
||||
'invoice' => $invoice,
|
||||
'transaksi' => $datatrx,
|
||||
'sudahbayar' => $total_pembayaran,
|
||||
'notr' => $nomor_transaksi,
|
||||
'content' => 'invoice/transaksi'
|
||||
);
|
||||
$this->load->view('layout/wrapper', $data, FALSE);
|
||||
//jika validasi oke, masuk database
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function simpanedit($no_pendaftaran)
|
||||
{
|
||||
//panggil data user yang akan diedit
|
||||
$data = array(
|
||||
'pot_gel' => $this->input->post('potongan_gel_1'),
|
||||
'pot_dp' => $this->input->post('potongan_dp'),
|
||||
'pot_yatim' => $this->input->post('potongan_yatim'),
|
||||
'pot_spp' => $this->input->post('potongan_spp'),
|
||||
'pot_kembar' => $this->input->post('potongan_kembar'),
|
||||
'pot_yayasan' => str_replace('.', '', $this->input->post('potongan_yayasan')),
|
||||
'pot_sktm' => str_replace('.', '', $this->input->post('potongan_sktm')),
|
||||
'pot_lain' => str_replace('.', '', $this->input->post('potongan_lainnya')),
|
||||
'ketentuan' => $this->input->post('total'),
|
||||
'operator' => $this->session->userdata('nama')
|
||||
|
||||
);
|
||||
|
||||
$this->db->where('no_pendaftaran', $no_pendaftaran);
|
||||
$this->db->update('invoice', $data);
|
||||
|
||||
$this->session->set_flashdata('sukses', 'Data invoice '.$no_pendaftaran.' telah diedit.');
|
||||
redirect(base_url('invoice'),'refresh');
|
||||
|
||||
//jika validasi oke, masuk database
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function delete($no_pendaftaran)
|
||||
{
|
||||
$data = array('no_pendaftaran' => $no_pendaftaran);
|
||||
//proses hapus
|
||||
$this->invoice_model->delete($data);
|
||||
$this->db->where('no_pendaftaran', $data['no_pendaftaran']);
|
||||
$this->db->delete('tr_invoice', $data);
|
||||
//notifikasi
|
||||
$this->session->set_flashdata('sukses', 'Data invoice telah dihapus..!');
|
||||
redirect(base_url('invoice'),'refresh');
|
||||
}
|
||||
|
||||
|
||||
// transaksi invoice
|
||||
|
||||
public function fungsi_edit_invoice()
|
||||
{
|
||||
// Ambil data yang dikirim melalui AJAX
|
||||
$noTrans = $this->input->post('no_trans');
|
||||
|
||||
// Query ke tabel tr_invoice berdasarkan nomor transaksi
|
||||
$data = $this->db->get_where('tr_invoice', array('no_trans' => $noTrans))->row();
|
||||
|
||||
// Kirim data dalam format JSON
|
||||
echo json_encode($data);
|
||||
}
|
||||
|
||||
public function cetaktransaksi($no_pendaftaran)
|
||||
{
|
||||
$data['invoice'] = $this->invoice_model->detail($no_pendaftaran);
|
||||
$data['data'] = $this->db->get_where('v_rpt_trans_invoice',['no_pendaftaran'=>$no_pendaftaran])->row();
|
||||
$data['datatrx'] = $this->db->get_where('v_rpt_trans_invoice',['no_pendaftaran'=>$no_pendaftaran])->result();
|
||||
$datatrx = $this->db->get_where("tr_invoice", ["no_pendaftaran" => $no_pendaftaran])->result();
|
||||
// Inisialisasi variabel untuk menyimpan total pembayaran
|
||||
$total_pembayaran = 0;
|
||||
|
||||
// Iterasi setiap baris hasil query dan tambahkan nilai kolom 'bayar' ke variabel $total_pembayaran
|
||||
foreach ($datatrx as $trx) {
|
||||
$total_pembayaran += $trx->bayar;
|
||||
}
|
||||
$data["total"] = $total_pembayaran;
|
||||
$this->load->view('invoice/cetak',$data);
|
||||
}
|
||||
|
||||
public function simpantransaksi(){
|
||||
$editkah = $this->input->post("editkah");
|
||||
$nopen = $this->input->post("nopen");
|
||||
$noin = $this->input->post("noin");
|
||||
$notr = $this->input->post("notr");
|
||||
$keterangan_cicilan = $this->input->post("keterangan_cicilan");
|
||||
$besarcicilan = str_replace('.', '',$this->input->post("besarcicilan"));
|
||||
if ($editkah == "editkah") {
|
||||
$data = [
|
||||
"angsuran" => $keterangan_cicilan,
|
||||
"bayar" => $besarcicilan,
|
||||
"tgl_bayar" => date('Y-m-d'),
|
||||
'operator' => $this->session->userdata('nama')
|
||||
|
||||
];
|
||||
|
||||
$this->db->where('no_trans', $notr);
|
||||
$this->db->update('tr_invoice', $data);
|
||||
|
||||
$this->session->set_flashdata('sukses', 'Data Transaksi invoice '.$notr.' telah diedit.');
|
||||
redirect(base_url('invoice/transaksi/'.$nopen),'refresh');
|
||||
|
||||
|
||||
} else {
|
||||
$data = [
|
||||
"angsuran" => $keterangan_cicilan,
|
||||
"bayar" => $besarcicilan,
|
||||
"tgl_bayar" => date('Y-m-d'),
|
||||
"no_trans" => $notr,
|
||||
"no_pendaftaran" => $nopen,
|
||||
"no_invoice" => $noin,
|
||||
"no_invoice" => $noin,
|
||||
'operator' => $this->session->userdata('nama')
|
||||
];
|
||||
|
||||
$this->db->insert('tr_invoice', $data);
|
||||
|
||||
$this->session->set_flashdata('sukses', 'Data Transaksi invoice '.$notr.' telah ditambahkan.');
|
||||
redirect(base_url('invoice/transaksi/'.$nopen),'refresh');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function deletetransaksi($no_trans)
|
||||
{
|
||||
$no_pendaftaran = $this->input->get('no_pendaftaran');
|
||||
$data = array('no_trans' => $no_trans);
|
||||
//proses hapus
|
||||
$this->invoice_model->deletetransaksi($data);
|
||||
//notifikasi
|
||||
$this->session->set_flashdata('sukses', 'Data Transaksi invoice '.$no_trans.' telah dihapus.');
|
||||
redirect(base_url('invoice/transaksi/'.$no_pendaftaran),'refresh');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//EXPORT NILAI KE EXCEL
|
||||
public function export(){
|
||||
// Load plugin PHPExcel nya
|
||||
include APPPATH.'third_party/PHPExcel/PHPExcel.php';
|
||||
|
||||
// Panggil class PHPExcel nya
|
||||
$excel = new PHPExcel();
|
||||
// Settingan awal fil excel
|
||||
$excel->getProperties()->setCreator('By : 415 DIL')
|
||||
->setLastModifiedBy('By : 415 DIL')
|
||||
->setTitle("Data Invoice")
|
||||
->setSubject("Invoice")
|
||||
->setDescription("Laporan Data Invoice")
|
||||
->setKeywords("Data Invoice");
|
||||
// Buat sebuah variabel untuk menampung pengaturan style dari header tabel
|
||||
$style_col = array(
|
||||
'font' => array('bold' => true), // Set font nya jadi bold
|
||||
'alignment' => array(
|
||||
'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, // Set text jadi ditengah secara horizontal (center)
|
||||
'vertical' => PHPExcel_Style_Alignment::VERTICAL_CENTER // Set text jadi di tengah secara vertical (middle)
|
||||
),
|
||||
'borders' => array(
|
||||
'top' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border top dengan garis tipis
|
||||
'right' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border right dengan garis tipis
|
||||
'bottom' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border bottom dengan garis tipis
|
||||
'left' => array('style' => PHPExcel_Style_Border::BORDER_THIN) // Set border left dengan garis tipis
|
||||
)
|
||||
);
|
||||
// Buat sebuah variabel untuk menampung pengaturan style dari isi tabel
|
||||
$style_row = array(
|
||||
'alignment' => array(
|
||||
'vertical' => PHPExcel_Style_Alignment::VERTICAL_CENTER // Set text jadi di tengah secara vertical (middle)
|
||||
),
|
||||
'borders' => array(
|
||||
'top' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border top dengan garis tipis
|
||||
'right' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border right dengan garis tipis
|
||||
'bottom' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border bottom dengan garis tipis
|
||||
'left' => array('style' => PHPExcel_Style_Border::BORDER_THIN) // Set border left dengan garis tipis
|
||||
)
|
||||
);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('A1', "DATA REKAP INVOICE PPDB SMK AL-MUHTADIN DEPOK"); // Set kolom A1 dengan tulisan "DATA SISWA"
|
||||
$excel->getActiveSheet()->mergeCells('A1:S1'); // Set Merge Cell pada kolom A1 sampai E1
|
||||
$excel->getActiveSheet()->getStyle('A1')->getFont()->setBold(TRUE); // Set bold kolom A1
|
||||
$excel->getActiveSheet()->getStyle('A1')->getFont()->setSize(15); // Set font size 15 untuk kolom A1
|
||||
$excel->getActiveSheet()->getStyle('A1')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER); // Set text center untuk kolom A1
|
||||
// Buat header tabel nya pada baris ke 3
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('A3', "NO."); // Set kolom A3 dengan tulisan "NO"
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('B3', "NO. PEND"); // Set kolom B3 dengan tulisan "NO.PEND"
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('C3', "NAMA LENGKAP"); // Set kolom C3 dengan tulisan "NAMA"
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('D3', "SEKOLAH ASAL"); // Set kolom E3 dengan tulisan "SEKOLAH"
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('E3', "KOMPETENSI");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('F3', "GELOMBANG");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('G3', "TGL. INVOICE");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('H3', "NO. INVOICE");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('I3', "BIAYA PPDB");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('J3', "POT. GEL");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('K3', "POT. DP");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('L3', "POT. YATIM");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('M3', "POT. SPP");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('N3', "POT. KEMBAR");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('O3', "POT. YAYASAN");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('P3', "POT. SKTM");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('Q3', "POT. LAINNYA");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('R3', "BIAYA KETENTUAN");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('S3', "PETUGAS INVOICE");
|
||||
|
||||
|
||||
// Apply style header yang telah kita buat tadi ke masing-masing kolom header
|
||||
$excel->getActiveSheet()->getStyle('A3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('B3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('C3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('D3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('E3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('F3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('G3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('H3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('I3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('J3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('K3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('L3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('M3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('N3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('O3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('P3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('Q3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('R3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('S3')->applyFromArray($style_col);
|
||||
|
||||
// Panggil function view yang ada di invoice_model untuk menampilkan semua data invoicenya
|
||||
$invoice = $this->invoice_model->ViewUrut();
|
||||
$no = 1; // Untuk penomoran tabel, di awal set dengan 1
|
||||
$numrow = 4; // Set baris pertama untuk isi tabel adalah baris ke 4
|
||||
foreach($invoice as $data){ // Lakukan looping pada variabel invoice
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('A'.$numrow, $no);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('B'.$numrow, $data->no_pendaftaran);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('C'.$numrow, $data->nama_lengkap);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('D'.$numrow, $data->sekolah_asal);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('E'.$numrow, $data->kd_kompetensi);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('F'.$numrow, $data->gelombang);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('G'.$numrow, $data->tgl_invoice);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('H'.$numrow, $data->no_invoice);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('I'.$numrow, $data->biaya);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('J'.$numrow, $data->pot_gel);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('K'.$numrow, $data->pot_dp);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('L'.$numrow, $data->pot_yatim);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('M'.$numrow, $data->pot_spp);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('N'.$numrow, $data->pot_kembar);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('O'.$numrow, $data->pot_yayasan);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('P'.$numrow, $data->pot_sktm);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('Q'.$numrow, $data->pot_lain);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('R'.$numrow, $data->ketentuan);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('S'.$numrow, $data->operator);
|
||||
|
||||
|
||||
// Apply style row yang telah kita buat tadi ke masing-masing baris (isi tabel)
|
||||
$excel->getActiveSheet()->getStyle('A'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('B'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('C'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('D'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('E'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('F'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('G'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('H'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('I'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('J'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('K'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('L'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('M'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('N'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('O'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('P'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('Q'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('R'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('S'.$numrow)->applyFromArray($style_row);
|
||||
|
||||
|
||||
$no++; // Tambah 1 setiap kali looping
|
||||
$numrow++; // Tambah 1 setiap kali looping
|
||||
}
|
||||
// Set width kolom
|
||||
$excel->getActiveSheet()->getColumnDimension('A')->setWidth(5); // Set width kolom A
|
||||
$excel->getActiveSheet()->getColumnDimension('B')->setWidth(12); // Set width kolom B
|
||||
$excel->getActiveSheet()->getColumnDimension('C')->setWidth(35); // Set width kolom C
|
||||
$excel->getActiveSheet()->getColumnDimension('D')->setWidth(35); // Set width kolom D
|
||||
$excel->getActiveSheet()->getColumnDimension('E')->setWidth(13); // Set width kolom E
|
||||
$excel->getActiveSheet()->getColumnDimension('F')->setWidth(15);
|
||||
$excel->getActiveSheet()->getColumnDimension('G')->setWidth(13);
|
||||
$excel->getActiveSheet()->getColumnDimension('H')->setWidth(15);
|
||||
$excel->getActiveSheet()->getColumnDimension('I')->setWidth(12);
|
||||
$excel->getActiveSheet()->getColumnDimension('J')->setWidth(12);
|
||||
$excel->getActiveSheet()->getColumnDimension('K')->setWidth(12);
|
||||
$excel->getActiveSheet()->getColumnDimension('L')->setWidth(12);
|
||||
$excel->getActiveSheet()->getColumnDimension('M')->setWidth(12);
|
||||
$excel->getActiveSheet()->getColumnDimension('N')->setWidth(15);
|
||||
$excel->getActiveSheet()->getColumnDimension('O')->setWidth(15);
|
||||
$excel->getActiveSheet()->getColumnDimension('P')->setWidth(12);
|
||||
$excel->getActiveSheet()->getColumnDimension('Q')->setWidth(15);
|
||||
$excel->getActiveSheet()->getColumnDimension('R')->setWidth(18);
|
||||
$excel->getActiveSheet()->getColumnDimension('S')->setWidth(18);
|
||||
|
||||
|
||||
// Set height semua kolom menjadi auto (mengikuti height isi dari kolommnya, jadi otomatis)
|
||||
$excel->getActiveSheet()->getDefaultRowDimension()->setRowHeight(-1);
|
||||
// Set orientasi kertas jadi LANDSCAPE
|
||||
$excel->getActiveSheet()->getPageSetup()->setOrientation(PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE);
|
||||
// Set judul file excel nya
|
||||
$excel->getActiveSheet(0)->setTitle("Data Rekap Invoice PPDB");
|
||||
$excel->setActiveSheetIndex(0);
|
||||
// Proses file excel
|
||||
header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
|
||||
header('Content-Disposition: attachment; filename="Data Rekap Invoice PPDB.xlsx"'); // Set nama file excel nya
|
||||
header('Cache-Control: max-age=0');
|
||||
$write = PHPExcel_IOFactory::createWriter($excel, 'Excel2007');
|
||||
$write->save('php://output');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* End of file Pendaftar.php */
|
||||
/* Location: ./application/controllers/Pendaftar.php */
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Kuliner extends CI_Controller {
|
||||
|
||||
//load model
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('kuliner_model');
|
||||
$this->simple_login->check_login();
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$kuliner = $this->kuliner_model->kuliner();
|
||||
$total = $this->kuliner_model->total();
|
||||
|
||||
$data = array( 'title' => 'Data Pendaftar KULINER [ '.$total->total.' ]',
|
||||
'kuliner' => $kuliner,
|
||||
'content' => 'kuliner/index'
|
||||
);
|
||||
$this->load->view('layout/wrapper', $data, FALSE);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Lap_registrasi extends CI_Controller {
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('registrasi_model');
|
||||
//proteksi halaman
|
||||
$this->simple_login->check_login();
|
||||
|
||||
}
|
||||
|
||||
//Main page biodata
|
||||
public function index()
|
||||
{
|
||||
|
||||
$data = array( 'title' => 'Aplikasi PPDB MTD - Laporan Registrasi PPDB',
|
||||
'content' => 'lap_registrasi/index'
|
||||
);
|
||||
|
||||
$data['sum'] = $this->registrasi_model->get_sum();
|
||||
$this->load->view('layout/wrapper', $data, FALSE);
|
||||
}
|
||||
|
||||
public function cetakregistrasi($no_pendaftaran)
|
||||
{
|
||||
$data['data'] = $this->db->get_where('v_rpt_trans_berkas',['no_pendaftaran'=>$no_pendaftaran])->row();
|
||||
$this->load->view('formulir/cetak_berkas',$data);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/* End of file biodata.php */
|
||||
/* Location: ./application/controllers/biodata.php */
|
||||
@@ -0,0 +1,127 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Laporanbiayaformulir extends CI_Controller {
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('formulir_model');
|
||||
$this->load->model('biayaformulir_model');
|
||||
$this->simple_login->check_login();
|
||||
//proteksi admin dan peserta
|
||||
if($this->session->userdata('level') !='Administrator')
|
||||
{
|
||||
if($this->session->userdata('level') !='Operator')
|
||||
{
|
||||
//kalau bukan adamin, lempar ke login
|
||||
$this->session->set_flashdata('warning', 'Hak akses anda tidak diijinkan mengakses menu penyerahan berkas');
|
||||
redirect(base_url('login'),'refresh');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
|
||||
$dataku= $this->db->get("v_rpt_trans_formulir")->result();
|
||||
$data = array( 'title' => 'Laporan Transaksi Biaya Tes Per Periode',
|
||||
'formulir' => $dataku,
|
||||
'content' => 'laporanformulir/index'
|
||||
);
|
||||
$this->load->view('layout/wrapper', $data, FALSE);
|
||||
}
|
||||
|
||||
|
||||
public function get_data_transaksi() {
|
||||
// Ambil parameter filter dari request
|
||||
$tanggal_awal = $this->input->post('tanggal_awal');
|
||||
$tanggal_akhir = $this->input->post('tanggal_akhir');
|
||||
$operator = $this->input->post('operator');
|
||||
|
||||
// Query SQL untuk mendapatkan data transaksi
|
||||
$sql = "SELECT * FROM v_rpt_trans_formulir WHERE tgl_trans BETWEEN ? AND ? AND operator = ?";
|
||||
$query = $this->db->query($sql, array($tanggal_awal, $tanggal_akhir, $operator));
|
||||
$data = $query->result_array();
|
||||
|
||||
// Kirim data sebagai JSON ke view
|
||||
echo json_encode($data);
|
||||
}
|
||||
|
||||
|
||||
public function getdata()
|
||||
{
|
||||
$draw = intval($this->input->get("draw"));
|
||||
$start = intval($this->input->get("start"));
|
||||
$length = intval($this->input->get("length"));
|
||||
|
||||
$tanggal_awal = $this->input->get("tanggal_awal");
|
||||
$tanggal_akhir = $this->input->get("tanggal_akhir");
|
||||
$operator = $this->input->get("operator");
|
||||
|
||||
$this->db->select('*');
|
||||
$this->db->from('v_rpt_trans_formulir');
|
||||
if (!empty($tanggal_awal) && !empty($tanggal_akhir)) {
|
||||
$this->db->where('tgl_trans >=', $tanggal_awal);
|
||||
$this->db->where('tgl_trans <=', $tanggal_akhir);
|
||||
}
|
||||
if (!empty($operator)) {
|
||||
$this->db->where('operator', $operator);
|
||||
}
|
||||
$this->db->order_by('no_trans', 'DESC');
|
||||
$query = $this->db->get();
|
||||
|
||||
$data = [];
|
||||
$no = 0;
|
||||
foreach ($query->result() as $key => $lists) {
|
||||
$no++;
|
||||
$data[$key][] = $no;
|
||||
$data[$key][] = date('d-M-Y', strtotime($lists->tgl_trans));
|
||||
$data[$key][] = $lists->no_trans;
|
||||
$data[$key][] = $lists->no_pendaftaran;
|
||||
$data[$key][] = $lists->nama_lengkap;
|
||||
$data[$key][] = "Rp. ".number_format($lists->biaya);
|
||||
$data[$key][] = "Rp. ".number_format($lists->diskon);
|
||||
$data[$key][] = "Rp. ".number_format($lists->bayar);
|
||||
$data[$key][] = "Rp. ".number_format($lists->cash);
|
||||
$data[$key][] = "Rp. ".number_format($lists->kembali);
|
||||
}
|
||||
|
||||
$result = array(
|
||||
"draw" => $draw,
|
||||
"recordsTotal" => $query->num_rows(),
|
||||
"recordsFiltered" => $query->num_rows(),
|
||||
"data" => $data
|
||||
);
|
||||
|
||||
echo json_encode($result);
|
||||
exit();
|
||||
}
|
||||
|
||||
public function print_pdf($start = null, $end = null) {
|
||||
// Mengambil data dari model berdasarkan rentang tanggal dan metode yang diberikan
|
||||
|
||||
$tanggal_awal = $this->input->get("start_date");
|
||||
$tanggal_akhir = $this->input->get("end_date");
|
||||
$operator = $this->input->get("operator");
|
||||
|
||||
$this->db->select('*');
|
||||
$this->db->from('v_rpt_trans_formulir');
|
||||
if (!empty($tanggal_awal) && !empty($tanggal_akhir)) {
|
||||
$this->db->where('tgl_trans >=', $tanggal_awal);
|
||||
$this->db->where('tgl_trans <=', $tanggal_akhir);
|
||||
}
|
||||
if (!empty($operator)) {
|
||||
$this->db->where('operator', $operator);
|
||||
}
|
||||
$this->db->order_by('no_trans', 'DESC');
|
||||
$query = $this->db->get();
|
||||
$data["tp"] = $this->db->get("setting")->row()->tp;
|
||||
$data["data"] = $query;
|
||||
|
||||
|
||||
$this->load->view('laporanformulir/printpdf', $data);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Laporantransaksiregistrasi extends CI_Controller {
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('formulir_model');
|
||||
$this->load->model('biayaformulir_model');
|
||||
$this->simple_login->check_login();
|
||||
//proteksi admin dan peserta
|
||||
if($this->session->userdata('level') !='Administrator')
|
||||
{
|
||||
if($this->session->userdata('level') !='Operator')
|
||||
{
|
||||
//kalau bukan adamin, lempar ke login
|
||||
$this->session->set_flashdata('warning', 'Hak akses anda tidak diijinkan mengakses menu penyerahan berkas');
|
||||
redirect(base_url('login'),'refresh');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
|
||||
$dataku= $this->db->get("v_rpt_trans_invoice")->result();
|
||||
$data = array( 'title' => 'Laporan Transaksi Biaya Registrasi',
|
||||
'formulir' => $dataku,
|
||||
'content' => 'lapregis/index'
|
||||
);
|
||||
$this->load->view('layout/wrapper', $data, FALSE);
|
||||
}
|
||||
|
||||
|
||||
public function get_data_transaksi() {
|
||||
// Ambil parameter filter dari request
|
||||
$tanggal_awal = $this->input->post('tanggal_awal');
|
||||
$tanggal_akhir = $this->input->post('tanggal_akhir');
|
||||
$operator = $this->input->post('operator');
|
||||
|
||||
// Query SQL untuk mendapatkan data transaksi
|
||||
$sql = "SELECT * FROM v_rpt_trans_invoice WHERE tgl_bayar BETWEEN ? AND ? AND operator = ?";
|
||||
$query = $this->db->query($sql, array($tanggal_awal, $tanggal_akhir, $operator));
|
||||
$data = $query->result_array();
|
||||
|
||||
// Kirim data sebagai JSON ke view
|
||||
echo json_encode($data);
|
||||
}
|
||||
|
||||
|
||||
public function getdata()
|
||||
{
|
||||
$draw = intval($this->input->get("draw"));
|
||||
$start = intval($this->input->get("start"));
|
||||
$length = intval($this->input->get("length"));
|
||||
|
||||
$tanggal_awal = $this->input->get("tanggal_awal");
|
||||
$tanggal_akhir = $this->input->get("tanggal_akhir");
|
||||
$operator = $this->input->get("operator");
|
||||
|
||||
$this->db->select('*');
|
||||
$this->db->from('v_rpt_trans_invoice');
|
||||
if (!empty($tanggal_awal) && !empty($tanggal_akhir)) {
|
||||
$this->db->where('tgl_bayar >=', $tanggal_awal);
|
||||
$this->db->where('tgl_bayar <=', $tanggal_akhir);
|
||||
}
|
||||
if (!empty($operator)) {
|
||||
$this->db->where('operator', $operator);
|
||||
}
|
||||
$this->db->order_by('tgl_bayar', 'DESC');
|
||||
$query = $this->db->get();
|
||||
|
||||
$data = [];
|
||||
$no = 0;
|
||||
foreach ($query->result() as $key => $lists) {
|
||||
$no++;
|
||||
$data[$key][] = $no;
|
||||
$data[$key][] = date('d-M-Y', strtotime($lists->tgl_bayar));
|
||||
$data[$key][] = $lists->no_trans;
|
||||
$data[$key][] = $lists->no_pendaftaran;
|
||||
$data[$key][] = $lists->nama_lengkap;
|
||||
$data[$key][] = "Rp. ".number_format($lists->biaya);
|
||||
$data[$key][] = "Rp. ".number_format($lists->pot_gel + $lists->pot_dp + $lists->pot_yatim + $lists->pot_spp + $lists->pot_yayasan + $lists->pot_sktm + $lists->pot_lain);
|
||||
$data[$key][] = "Rp. ".number_format($lists->ketentuan);
|
||||
$data[$key][] = $lists->angsuran;
|
||||
$data[$key][] = "Rp. ".number_format($lists->bayar);
|
||||
}
|
||||
|
||||
$result = array(
|
||||
"draw" => $draw,
|
||||
"recordsTotal" => $query->num_rows(),
|
||||
"recordsFiltered" => $query->num_rows(),
|
||||
"data" => $data
|
||||
);
|
||||
|
||||
echo json_encode($result);
|
||||
exit();
|
||||
}
|
||||
|
||||
public function print_pdf($start = null, $end = null) {
|
||||
// Mengambil data dari model berdasarkan rentang tanggal dan metode yang diberikan
|
||||
|
||||
$tanggal_awal = $this->input->get("start_date");
|
||||
$tanggal_akhir = $this->input->get("end_date");
|
||||
$operator = $this->input->get("operator");
|
||||
|
||||
$this->db->select('*');
|
||||
$this->db->from('v_rpt_trans_invoice');
|
||||
if (!empty($tanggal_awal) && !empty($tanggal_akhir)) {
|
||||
$this->db->where('tgl_bayar >=', $tanggal_awal);
|
||||
$this->db->where('tgl_bayar <=', $tanggal_akhir);
|
||||
}
|
||||
if (!empty($operator)) {
|
||||
$this->db->where('operator', $operator);
|
||||
}
|
||||
$this->db->order_by('no_trans', 'DESC');
|
||||
$query = $this->db->get();
|
||||
$data["tp"] = $this->db->get("setting")->row()->tp;
|
||||
$data["data"] = $query;
|
||||
|
||||
|
||||
$this->load->view('lapregis/printpdf', $data);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Login extends CI_Controller {
|
||||
|
||||
//load model
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('dashboard_model');
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
//validasi input
|
||||
$userid = $this->input->post('userid');
|
||||
$password = $this->input->post('password');
|
||||
//check input
|
||||
$this->form_validation->set_rules('userid', 'Userid', 'required',
|
||||
array( 'required' => '%s harus diisi'));
|
||||
|
||||
$this->form_validation->set_rules('password', 'Password', 'required',
|
||||
array( 'required' => '%s harus diisi'));
|
||||
|
||||
if($this->form_validation->run())
|
||||
{
|
||||
//proses ke simple login
|
||||
$this->simple_login->login($userid,$password);
|
||||
}
|
||||
|
||||
//end validasi
|
||||
$data =array ('title'=> 'Aplikasi PPDB MTD - Login');
|
||||
$this->load->view('login/list', $data, FALSE);
|
||||
}
|
||||
|
||||
//fungsi logout
|
||||
public function logout()
|
||||
{
|
||||
//ambil fungsi logout dari simple login
|
||||
$this->simple_login->logout();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* End of file Login.php */
|
||||
/* Location: ./application/controllers/Login.php */
|
||||
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Lulustes extends CI_Controller {
|
||||
|
||||
//load model
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('lulustes_model');
|
||||
$this->simple_login->check_login();
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$lulustes = $this->lulustes_model->lulus();
|
||||
$total = $this->lulustes_model->total();
|
||||
|
||||
$data = array( 'title' => 'Data Pendaftar LULUS TES [ '.$total->total.' ]',
|
||||
'lulustes' => $lulustes,
|
||||
'content' => 'lulustes/index'
|
||||
);
|
||||
$this->load->view('layout/wrapper', $data, FALSE);
|
||||
}
|
||||
|
||||
//Edit pengumuman
|
||||
public function edit($no_pendaftaran)
|
||||
{
|
||||
//panggil data user yang akan diedit
|
||||
$lulustes = $this->lulustes_model->detail($no_pendaftaran);
|
||||
|
||||
|
||||
//validasi input
|
||||
$valid = $this->form_validation;
|
||||
//check nama
|
||||
$valid->set_rules('status','Data Pengumuman Kelulusan','required',
|
||||
array( 'required' => '%s Harus Diisi'));
|
||||
|
||||
//jika sudah dicek dan error
|
||||
if($valid->run()===FALSE) {
|
||||
//end validasi
|
||||
|
||||
$data= array( 'title' => 'Edit Data Hasil Tes No. Pend : '.$lulustes->no_pendaftaran,
|
||||
'lulustes' => $lulustes,
|
||||
'content' => 'lulustes/edit'
|
||||
);
|
||||
$this->load->view('layout/wrapper', $data, FALSE);
|
||||
//jika validasi oke, masuk database
|
||||
}else{
|
||||
$inp = $this->input;
|
||||
$data = array( 'no_pendaftaran' => $no_pendaftaran,
|
||||
'status' => $inp->post('status'),
|
||||
'tanggal_pengumuman' => date('Y-m-d H:i:s')
|
||||
);
|
||||
//proses oleh model
|
||||
$this->lulustes_model->edit($data);
|
||||
//notifikasi dan redirect
|
||||
$this->session->set_flashdata('sukses', 'Data Pengumuman Kelulusan No. Pend : '.$lulustes->no_pendaftaran.' Telah Diedit.');
|
||||
redirect(base_url('lulustes'),'refresh');
|
||||
}
|
||||
//end masuk database
|
||||
}
|
||||
|
||||
//Delete pengumuman
|
||||
public function delete($no_pendaftaran)
|
||||
{
|
||||
$data = array('no_pendaftaran' => $no_pendaftaran);
|
||||
$data2 = array('userid' => $no_pendaftaran);
|
||||
//proses hapus
|
||||
$this->lulustes_model->delete($data);
|
||||
$this->lulustes_model->delete2($data2);
|
||||
//notifikasi
|
||||
$this->session->set_flashdata('sukses', 'Satu Data Pengumuman Telah Dihapus..!');
|
||||
redirect(base_url('lulustes'),'refresh');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,354 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Nilai extends CI_Controller {
|
||||
|
||||
//load model
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('nilai_model');
|
||||
//proteksi halaman
|
||||
$this->simple_login->check_login();
|
||||
//proteksi admin dan penguji
|
||||
if($this->session->userdata('level') !='Administrator')
|
||||
{
|
||||
if($this->session->userdata('level') !='Penguji')
|
||||
{
|
||||
//kalau bukan adamin, lempar ke login
|
||||
$this->session->set_flashdata('warning', 'Hak akses anda tidak diijinkan mengakses menu BTQ & Wawancara');
|
||||
redirect(base_url('login'),'refresh');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Data nilai
|
||||
public function index()
|
||||
{
|
||||
$nilai = $this->nilai_model->listing();
|
||||
$total = $this->nilai_model->total();
|
||||
|
||||
//validasi input
|
||||
$valid = $this->form_validation;
|
||||
//check nama
|
||||
$valid->set_rules('nama','Nama Lengkap','required',
|
||||
array( 'required' => '%s harus diisi'));
|
||||
//check email
|
||||
$valid->set_rules('email','Email','required|valid_email',
|
||||
array( 'required' => '%s harus diisi',
|
||||
'valid_email' => '%s tidak valid. Masukan email yang benar'));
|
||||
//check nilainame
|
||||
$valid->set_rules('nilaiid','Nilaiid','required|is_unique[nilai2.nilaiid]',
|
||||
array( 'required' => '%s harus diisi',
|
||||
'is_unique' => '%s sudah ada. Buat nilaiid baru'));
|
||||
//check password
|
||||
$valid->set_rules('password','Password','required|min_length[6]|max_length[32]',
|
||||
array( 'required' => '%s harus diisi',
|
||||
'min_length' => '%s minimal 6 karakter',
|
||||
'max_length' => '%s maksimal 32 karakter'));
|
||||
//jika sudah dicek dan error
|
||||
if($valid->run()===FALSE) {
|
||||
//end validasi
|
||||
|
||||
$data = array( 'title' => 'Jumlah Pendaftar Yang Sudah Tes BTQ & Wawancara [ '.$total->total.' ]',
|
||||
'nilai' => $nilai,
|
||||
'content' => 'nilai/index'
|
||||
);
|
||||
$this->load->view('layout/wrapper', $data, FALSE);
|
||||
//jika validasi oke, masuk database
|
||||
}else{
|
||||
$inp = $this->input;
|
||||
$data = array( 'nama' => $inp->post('nama'),
|
||||
'email' => $inp->post('email'),
|
||||
'nilaiid' => $inp->post('nilaiid'),
|
||||
'password' => MD5($inp->post('password')),
|
||||
'level' => $inp->post('level'),
|
||||
'gambar' => $inp->post('gambar'),
|
||||
);
|
||||
//proses oleh model
|
||||
$this->nilai_model->tambah($data);
|
||||
//notifikasi dan redirect
|
||||
$this->session->set_flashdata('sukses', 'Data nilai telah ditambah');
|
||||
redirect(base_url('nilai'),'refresh');
|
||||
}
|
||||
//end masuk database
|
||||
}
|
||||
|
||||
//Edit nilai
|
||||
public function edit($no_pendaftaran)
|
||||
{
|
||||
//panggil data nilai yang akan diedit
|
||||
$nilai = $this->nilai_model->detail($no_pendaftaran);
|
||||
|
||||
//validasi input
|
||||
$valid = $this->form_validation;
|
||||
//check nama
|
||||
$valid->set_rules('btq_membaca','Nilai membaca','required',
|
||||
array( 'required' => '%s harus diisi'));
|
||||
|
||||
//jika sudah dicek dan error
|
||||
if($valid->run()===FALSE) {
|
||||
//end validasi
|
||||
//end validasi
|
||||
$data = array( 'title' => 'Edit Data Nilai : '.$nilai->no_pendaftaran.' -- '.$nilai->nama_lengkap.' -- '.$nilai->sekolah_asal.' -- '.$nilai->kd_kompetensi,
|
||||
'nilai' => $nilai,
|
||||
'content' => 'nilai/edit'
|
||||
);
|
||||
$this->load->view('layout/wrapper', $data, FALSE);
|
||||
|
||||
//jika validasi oke, masuk database
|
||||
//jika validasi oke, masuk database
|
||||
}else{
|
||||
|
||||
$inp = $this->input;
|
||||
$data = array(
|
||||
'no_pendaftaran' => $no_pendaftaran,
|
||||
'btq_membaca' => $inp->post('btq_membaca'),
|
||||
'btq_makhrojul' => $inp->post('btq_makhrojul'),
|
||||
'btq_tajwid' => $inp->post('btq_tajwid'),
|
||||
'btq_huruftunggal' => $inp->post('btq_huruftunggal'),
|
||||
'btq_merangkaihuruf'=> $inp->post('btq_merangkaihuruf'),
|
||||
'btq_kerapihan' => $inp->post('btq_kerapihan'),
|
||||
'btq_akhlak ' => $inp->post('btq_akhlak'),
|
||||
'w2n_alasan' => $inp->post('w2n_alasan'),
|
||||
'w2n_kepercayaan' => $inp->post('w2n_kepercayaan'),
|
||||
'w2n_penanganan' => $inp->post('w2n_penanganan'),
|
||||
'w2n_kebiasaan' => $inp->post('w2n_kebiasaan'),
|
||||
'w2n_psikologi' => $inp->post('w2n_psikologi'),
|
||||
'w2n_sholat' => $inp->post('w2n_sholat'),
|
||||
'w2n_keikutsertaan' => $inp->post('w2n_keikutsertaan'),
|
||||
'w2n_kesediaan' => $inp->post('w2n_kesediaan'),
|
||||
'catatan' => $inp->post('catatan'),
|
||||
'penguji' => $this->session->userdata('nama'),
|
||||
'tanggal' => date('Y-m-d H:i:s')
|
||||
|
||||
);
|
||||
|
||||
|
||||
//proses oleh model
|
||||
$this->nilai_model->edit($data);
|
||||
//notifikasi dan redirect
|
||||
$this->session->set_flashdata('sukses', 'Data nilai '.$nilai->nama_lengkap.' telah diedit');
|
||||
redirect(base_url('nilai'),'refresh');
|
||||
}
|
||||
//end masuk database
|
||||
}
|
||||
|
||||
//Delete nilai
|
||||
public function delete($no_pendaftaran)
|
||||
{
|
||||
$data = array('no_pendaftaran' => $no_pendaftaran);
|
||||
//proses hapus
|
||||
$this->nilai_model->delete($data);
|
||||
//notifikasi
|
||||
$this->session->set_flashdata('sukses', 'Data nilai telah dihapus');
|
||||
redirect(base_url('nilai'),'refresh');
|
||||
}
|
||||
|
||||
|
||||
|
||||
//EXPORT NILAI KE EXCEL
|
||||
public function export(){
|
||||
// Load plugin PHPExcel nya
|
||||
include APPPATH.'third_party/PHPExcel/PHPExcel.php';
|
||||
|
||||
// Panggil class PHPExcel nya
|
||||
$excel = new PHPExcel();
|
||||
// Settingan awal fil excel
|
||||
$excel->getProperties()->setCreator('By : 415 DIL')
|
||||
->setLastModifiedBy('By : 415 DIL')
|
||||
->setTitle("Data Nilai")
|
||||
->setSubject("Nilai")
|
||||
->setDescription("Laporan Data Nilai BTQ & Wawancara")
|
||||
->setKeywords("Data Nilai");
|
||||
// Buat sebuah variabel untuk menampung pengaturan style dari header tabel
|
||||
$style_col = array(
|
||||
'font' => array('bold' => true), // Set font nya jadi bold
|
||||
'alignment' => array(
|
||||
'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, // Set text jadi ditengah secara horizontal (center)
|
||||
'vertical' => PHPExcel_Style_Alignment::VERTICAL_CENTER // Set text jadi di tengah secara vertical (middle)
|
||||
),
|
||||
'borders' => array(
|
||||
'top' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border top dengan garis tipis
|
||||
'right' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border right dengan garis tipis
|
||||
'bottom' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border bottom dengan garis tipis
|
||||
'left' => array('style' => PHPExcel_Style_Border::BORDER_THIN) // Set border left dengan garis tipis
|
||||
)
|
||||
);
|
||||
// Buat sebuah variabel untuk menampung pengaturan style dari isi tabel
|
||||
$style_row = array(
|
||||
'alignment' => array(
|
||||
'vertical' => PHPExcel_Style_Alignment::VERTICAL_CENTER // Set text jadi di tengah secara vertical (middle)
|
||||
),
|
||||
'borders' => array(
|
||||
'top' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border top dengan garis tipis
|
||||
'right' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border right dengan garis tipis
|
||||
'bottom' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border bottom dengan garis tipis
|
||||
'left' => array('style' => PHPExcel_Style_Border::BORDER_THIN) // Set border left dengan garis tipis
|
||||
)
|
||||
);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('A1', "DATA NILAI BTQ & WAWANCARA PPDB SMK AL-MUHTADIN DEPOK"); // Set kolom A1 dengan tulisan "DATA SISWA"
|
||||
$excel->getActiveSheet()->mergeCells('A1:Y1'); // Set Merge Cell pada kolom A1 sampai E1
|
||||
$excel->getActiveSheet()->getStyle('A1')->getFont()->setBold(TRUE); // Set bold kolom A1
|
||||
$excel->getActiveSheet()->getStyle('A1')->getFont()->setSize(15); // Set font size 15 untuk kolom A1
|
||||
$excel->getActiveSheet()->getStyle('A1')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER); // Set text center untuk kolom A1
|
||||
// Buat header tabel nya pada baris ke 3
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('A3', "NO."); // Set kolom A3 dengan tulisan "NO"
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('B3', "NO. PEND"); // Set kolom B3 dengan tulisan "NO.PEND"
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('C3', "NAMA LENGKAP"); // Set kolom C3 dengan tulisan "NAMA"
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('D3', "JENIS KELAMIN"); // Set kolom D3 dengan tulisan "JENIS KELAMIN"
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('E3', "SEKOLAH ASAL"); // Set kolom E3 dengan tulisan "SEKOLAH"
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('F3', "KOMPETENSI");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('G3', "GELOMBANG");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('H3', "1B-MEMBACA");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('I3', "2B-MAKHROJUL");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('J3', "3B-TAJWID");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('K3', "4B-HURUF TUNGGAL");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('L3', "5B-MERANGKAI HURUF");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('M3', "6B-KERAPIHAN");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('N3', "7B-AKHLAK");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('O3', "1W-ALASAN");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('P3', "2W-KEPERCAYAAN");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('Q3', "3W-PENANGANAN");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('R3', "4W-KEBIASAAN");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('S3', "5W-PSIKOLOGI");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('T3', "6W-SHOLAT");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('U3', "7W-KEIKUTSERTAAN");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('V3', "8W-KESEDIAAN");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('W3', "CATATAN");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('X3', "PENGUJI");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('Y3', "TANGGAL TES");
|
||||
|
||||
// Apply style header yang telah kita buat tadi ke masing-masing kolom header
|
||||
$excel->getActiveSheet()->getStyle('A3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('B3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('C3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('D3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('E3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('F3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('G3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('H3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('I3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('J3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('K3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('L3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('M3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('N3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('O3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('P3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('Q3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('R3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('S3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('T3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('U3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('V3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('W3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('X3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('Y3')->applyFromArray($style_col);
|
||||
// Panggil function view yang ada di nilai_model untuk menampilkan semua data nilainya
|
||||
$nilai = $this->nilai_model->ViewUrut();
|
||||
$no = 1; // Untuk penomoran tabel, di awal set dengan 1
|
||||
$numrow = 4; // Set baris pertama untuk isi tabel adalah baris ke 4
|
||||
foreach($nilai as $data){ // Lakukan looping pada variabel nilai
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('A'.$numrow, $no);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('B'.$numrow, $data->no_pendaftaran);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('C'.$numrow, $data->nama_lengkap);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('D'.$numrow, $data->jkelamin);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('E'.$numrow, $data->sekolah_asal);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('F'.$numrow, $data->kd_kompetensi);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('G'.$numrow, $data->gelombang);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('H'.$numrow, $data->btq_membaca);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('I'.$numrow, $data->btq_makhrojul);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('J'.$numrow, $data->btq_tajwid);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('K'.$numrow, $data->btq_huruftunggal);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('L'.$numrow, $data->btq_merangkaihuruf);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('M'.$numrow, $data->btq_kerapihan);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('N'.$numrow, $data->btq_akhlak);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('O'.$numrow, $data->w2n_alasan);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('P'.$numrow, $data->w2n_kepercayaan);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('Q'.$numrow, $data->w2n_penanganan);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('R'.$numrow, $data->w2n_kebiasaan);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('S'.$numrow, $data->w2n_psikologi);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('T'.$numrow, $data->w2n_sholat);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('U'.$numrow, $data->w2n_keikutsertaan);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('V'.$numrow, $data->w2n_kesediaan);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('W'.$numrow, $data->catatan);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('X'.$numrow, $data->penguji);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('Y'.$numrow, $data->tanggal);
|
||||
|
||||
// Apply style row yang telah kita buat tadi ke masing-masing baris (isi tabel)
|
||||
$excel->getActiveSheet()->getStyle('A'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('B'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('C'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('D'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('E'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('F'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('G'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('H'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('I'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('J'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('K'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('L'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('M'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('N'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('O'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('P'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('Q'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('R'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('S'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('T'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('U'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('V'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('W'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('X'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('Y'.$numrow)->applyFromArray($style_row);
|
||||
|
||||
$no++; // Tambah 1 setiap kali looping
|
||||
$numrow++; // Tambah 1 setiap kali looping
|
||||
}
|
||||
// Set width kolom
|
||||
$excel->getActiveSheet()->getColumnDimension('A')->setWidth(5); // Set width kolom A
|
||||
$excel->getActiveSheet()->getColumnDimension('B')->setWidth(12); // Set width kolom B
|
||||
$excel->getActiveSheet()->getColumnDimension('C')->setWidth(35); // Set width kolom C
|
||||
$excel->getActiveSheet()->getColumnDimension('D')->setWidth(15); // Set width kolom D
|
||||
$excel->getActiveSheet()->getColumnDimension('E')->setWidth(35); // Set width kolom E
|
||||
$excel->getActiveSheet()->getColumnDimension('F')->setWidth(13);
|
||||
$excel->getActiveSheet()->getColumnDimension('G')->setWidth(13);
|
||||
$excel->getActiveSheet()->getColumnDimension('H')->setWidth(15);
|
||||
$excel->getActiveSheet()->getColumnDimension('I')->setWidth(15);
|
||||
$excel->getActiveSheet()->getColumnDimension('J')->setWidth(12);
|
||||
$excel->getActiveSheet()->getColumnDimension('K')->setWidth(19);
|
||||
$excel->getActiveSheet()->getColumnDimension('L')->setWidth(21);
|
||||
$excel->getActiveSheet()->getColumnDimension('M')->setWidth(15);
|
||||
$excel->getActiveSheet()->getColumnDimension('N')->setWidth(12);
|
||||
$excel->getActiveSheet()->getColumnDimension('O')->setWidth(12);
|
||||
$excel->getActiveSheet()->getColumnDimension('P')->setWidth(18);
|
||||
$excel->getActiveSheet()->getColumnDimension('Q')->setWidth(18);
|
||||
$excel->getActiveSheet()->getColumnDimension('R')->setWidth(15);
|
||||
$excel->getActiveSheet()->getColumnDimension('S')->setWidth(15);
|
||||
$excel->getActiveSheet()->getColumnDimension('T')->setWidth(12);
|
||||
$excel->getActiveSheet()->getColumnDimension('U')->setWidth(19);
|
||||
$excel->getActiveSheet()->getColumnDimension('V')->setWidth(15);
|
||||
$excel->getActiveSheet()->getColumnDimension('W')->setWidth(30);
|
||||
$excel->getActiveSheet()->getColumnDimension('X')->setWidth(25);
|
||||
$excel->getActiveSheet()->getColumnDimension('Y')->setWidth(20);
|
||||
|
||||
// Set height semua kolom menjadi auto (mengikuti height isi dari kolommnya, jadi otomatis)
|
||||
$excel->getActiveSheet()->getDefaultRowDimension()->setRowHeight(-1);
|
||||
// Set orientasi kertas jadi LANDSCAPE
|
||||
$excel->getActiveSheet()->getPageSetup()->setOrientation(PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE);
|
||||
// Set judul file excel nya
|
||||
$excel->getActiveSheet(0)->setTitle("Data Nilai BTQ & Wawancara");
|
||||
$excel->setActiveSheetIndex(0);
|
||||
// Proses file excel
|
||||
header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
|
||||
header('Content-Disposition: attachment; filename="Data Nilai BTQ & Wawancara.xlsx"'); // Set nama file excel nya
|
||||
header('Cache-Control: max-age=0');
|
||||
$write = PHPExcel_IOFactory::createWriter($excel, 'Excel2007');
|
||||
$write->save('php://output');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* End of file Nilai.php */
|
||||
/* Location: ./application/controllers/Nilai.php */
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Otkp extends CI_Controller {
|
||||
|
||||
//load model
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('otkp_model');
|
||||
$this->simple_login->check_login();
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$otkp = $this->otkp_model->otkp();
|
||||
$total = $this->otkp_model->total();
|
||||
|
||||
$data = array( 'title' => 'Data Pendaftar MPLB [ '.$total->total.' ]',
|
||||
'otkp' => $otkp,
|
||||
'content' => 'otkp/index'
|
||||
|
||||
);
|
||||
$this->load->view('layout/wrapper', $data, FALSE);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Panduan extends CI_Controller {
|
||||
|
||||
public function index()
|
||||
{
|
||||
$data = array( 'title' => 'Panduan Pengunaan Sistem Informasi',
|
||||
'content' => 'panduan/index'
|
||||
);
|
||||
$this->load->view('layout/wrapper', $data, FALSE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* End of file Panduan.php */
|
||||
/* Location: ./application/controllers/Panduan.php */
|
||||
@@ -0,0 +1,220 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Pembayaran extends CI_Controller {
|
||||
|
||||
//load model
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('pembayaran_model');
|
||||
$this->simple_login->check_login();
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$pembayaran = $this->pembayaran_model->listing();
|
||||
$total = $this->pembayaran_model->total();
|
||||
$hitung = $this->pembayaran_model->get_sum();
|
||||
|
||||
$pembayaran = array( 'title' => 'Pembayaran Tes [ '.$total->total.' ] Casis, Total Dibayarkan : Rp. '.number_format($hitung).',- ',
|
||||
'pembayaran' => $pembayaran,
|
||||
'content' => 'pembayaran/index'
|
||||
);
|
||||
$this->load->view('layout/wrapper', $pembayaran, FALSE);
|
||||
}
|
||||
|
||||
//Edit user
|
||||
public function edit($no_trans)
|
||||
{
|
||||
//panggil data user yang akan diedit
|
||||
$pembayaran = $this->pembayaran_model->detail($no_trans);
|
||||
|
||||
|
||||
//validasi input
|
||||
$valid = $this->form_validation;
|
||||
//check nama
|
||||
$valid->set_rules('bayar','Pembayaran','required',
|
||||
array( 'required' => '%s harus diisi'));
|
||||
|
||||
//jika sudah dicek dan error
|
||||
if($valid->run()===FALSE) {
|
||||
//end validasi
|
||||
|
||||
$data= array( 'title' => 'Edit Data Pembayaran, No. Transaksi : '.$pembayaran->no_trans,
|
||||
'pembayaran' => $pembayaran,
|
||||
'content' => 'pembayaran/edit'
|
||||
);
|
||||
$this->load->view('layout/wrapper', $data, FALSE);
|
||||
//jika validasi oke, masuk database
|
||||
}else{
|
||||
$inp = $this->input;
|
||||
$data = array( 'no_trans' => $no_trans,
|
||||
'bayar' => $inp->post('bayar')
|
||||
);
|
||||
//proses oleh model
|
||||
$this->pembayaran_model->edit($data);
|
||||
//notifikasi dan redirect
|
||||
$this->session->set_flashdata('sukses', 'Data Pembayaran Tes '.$pembayaran->no_trans.' atas nama '.$registrasi->nama_lengkap.' Telah Diedit');
|
||||
redirect(base_url('pembayaran'),'refresh');
|
||||
}
|
||||
//end masuk database
|
||||
}
|
||||
|
||||
//Delete regis
|
||||
public function delete($no_trans)
|
||||
{
|
||||
$data = array('no_trans' => $no_trans);
|
||||
//proses hapus
|
||||
$this->pembayaran_model->delete($data);
|
||||
//notifikasi
|
||||
$this->session->set_flashdata('sukses', 'Data pembayaran telah dihapus');
|
||||
redirect(base_url('pembayaran'),'refresh');
|
||||
}
|
||||
|
||||
//EXPORT NILAI KE EXCEL
|
||||
public function export(){
|
||||
// Load plugin PHPExcel nya
|
||||
include APPPATH.'third_party/PHPExcel/PHPExcel.php';
|
||||
|
||||
// Panggil class PHPExcel nya
|
||||
$excel = new PHPExcel();
|
||||
// Settingan awal fil excel
|
||||
$excel->getProperties()->setCreator('By : 415 DIL')
|
||||
->setLastModifiedBy('By : 415 DIL')
|
||||
->setTitle("Data Pembayaran")
|
||||
->setSubject("Pembayaran")
|
||||
->setDescription("Laporan Data Pembayaran")
|
||||
->setKeywords("Data Pembayaran");
|
||||
// Buat sebuah variabel untuk menampung pengaturan style dari header tabel
|
||||
$style_col = array(
|
||||
'font' => array('bold' => true), // Set font nya jadi bold
|
||||
'alignment' => array(
|
||||
'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, // Set text jadi ditengah secara horizontal (center)
|
||||
'vertical' => PHPExcel_Style_Alignment::VERTICAL_CENTER // Set text jadi di tengah secara vertical (middle)
|
||||
),
|
||||
'borders' => array(
|
||||
'top' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border top dengan garis tipis
|
||||
'right' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border right dengan garis tipis
|
||||
'bottom' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border bottom dengan garis tipis
|
||||
'left' => array('style' => PHPExcel_Style_Border::BORDER_THIN) // Set border left dengan garis tipis
|
||||
)
|
||||
);
|
||||
// Buat sebuah variabel untuk menampung pengaturan style dari isi tabel
|
||||
$style_row = array(
|
||||
'alignment' => array(
|
||||
'vertical' => PHPExcel_Style_Alignment::VERTICAL_CENTER // Set text jadi di tengah secara vertical (middle)
|
||||
),
|
||||
'borders' => array(
|
||||
'top' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border top dengan garis tipis
|
||||
'right' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border right dengan garis tipis
|
||||
'bottom' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border bottom dengan garis tipis
|
||||
'left' => array('style' => PHPExcel_Style_Border::BORDER_THIN) // Set border left dengan garis tipis
|
||||
)
|
||||
);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('A1', "DATA REKAP PEMBAYARAN TES PPDB SMK AL-MUHTADIN DEPOK"); // Set kolom A1 dengan tulisan "DATA SISWA"
|
||||
$excel->getActiveSheet()->mergeCells('A1:L1'); // Set Merge Cell pada kolom A1 sampai E1
|
||||
$excel->getActiveSheet()->getStyle('A1')->getFont()->setBold(TRUE); // Set bold kolom A1
|
||||
$excel->getActiveSheet()->getStyle('A1')->getFont()->setSize(15); // Set font size 15 untuk kolom A1
|
||||
$excel->getActiveSheet()->getStyle('A1')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER); // Set text center untuk kolom A1
|
||||
// Buat header tabel nya pada baris ke 3
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('A3', "NO."); // Set kolom A3 dengan tulisan "NO"
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('B3', "NO. PEND"); // Set kolom B3 dengan tulisan "NO.PEND"
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('C3', "NAMA LENGKAP"); // Set kolom C3 dengan tulisan "NAMA"
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('D3', "SEKOLAH ASAL"); // Set kolom E3 dengan tulisan "SEKOLAH"
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('E3', "KOMPETENSI");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('F3', "GELOMBANG");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('G3', "TGL. TRANSAKSI");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('H3', "NO. TRANSAKSI");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('I3', "BIAYA TES");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('J3', "DISKON");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('K3', "DIBAYARKAN");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('L3', "PETUGAS");
|
||||
|
||||
|
||||
// Apply style header yang telah kita buat tadi ke masing-masing kolom header
|
||||
$excel->getActiveSheet()->getStyle('A3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('B3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('C3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('D3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('E3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('F3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('G3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('H3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('I3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('J3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('K3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('L3')->applyFromArray($style_col);
|
||||
|
||||
|
||||
// Panggil function view yang ada di registrasi_model untuk menampilkan semua data registrasinya
|
||||
$pembayaran = $this->pembayaran_model->ViewUrut();
|
||||
$no = 1; // Untuk penomoran tabel, di awal set dengan 1
|
||||
$numrow = 4; // Set baris pertama untuk isi tabel adalah baris ke 4
|
||||
foreach($pembayaran as $data){ // Lakukan looping pada variabel registrasi
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('A'.$numrow, $no);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('B'.$numrow, $data->no_pendaftaran);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('C'.$numrow, $data->nama_lengkap);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('D'.$numrow, $data->sekolah_asal);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('E'.$numrow, $data->kd_kompetensi);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('F'.$numrow, $data->gelombang);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('G'.$numrow, $data->tgl_trans);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('H'.$numrow, $data->no_trans);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('I'.$numrow, $data->biaya);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('J'.$numrow, $data->diskon);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('K'.$numrow, $data->bayar);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('L'.$numrow, $data->operator);
|
||||
|
||||
|
||||
// Apply style row yang telah kita buat tadi ke masing-masing baris (isi tabel)
|
||||
$excel->getActiveSheet()->getStyle('A'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('B'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('C'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('D'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('E'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('F'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('G'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('H'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('I'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('J'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('K'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('L'.$numrow)->applyFromArray($style_row);
|
||||
|
||||
|
||||
$no++; // Tambah 1 setiap kali looping
|
||||
$numrow++; // Tambah 1 setiap kali looping
|
||||
}
|
||||
// Set width kolom
|
||||
$excel->getActiveSheet()->getColumnDimension('A')->setWidth(5); // Set width kolom A
|
||||
$excel->getActiveSheet()->getColumnDimension('B')->setWidth(12); // Set width kolom B
|
||||
$excel->getActiveSheet()->getColumnDimension('C')->setWidth(35); // Set width kolom C
|
||||
$excel->getActiveSheet()->getColumnDimension('D')->setWidth(35); // Set width kolom D
|
||||
$excel->getActiveSheet()->getColumnDimension('E')->setWidth(13); // Set width kolom E
|
||||
$excel->getActiveSheet()->getColumnDimension('F')->setWidth(15);
|
||||
$excel->getActiveSheet()->getColumnDimension('G')->setWidth(13);
|
||||
$excel->getActiveSheet()->getColumnDimension('H')->setWidth(15);
|
||||
$excel->getActiveSheet()->getColumnDimension('I')->setWidth(18);
|
||||
$excel->getActiveSheet()->getColumnDimension('J')->setWidth(16);
|
||||
$excel->getActiveSheet()->getColumnDimension('K')->setWidth(19);
|
||||
$excel->getActiveSheet()->getColumnDimension('L')->setWidth(15);
|
||||
|
||||
|
||||
// Set height semua kolom menjadi auto (mengikuti height isi dari kolommnya, jadi otomatis)
|
||||
$excel->getActiveSheet()->getDefaultRowDimension()->setRowHeight(-1);
|
||||
// Set orientasi kertas jadi LANDSCAPE
|
||||
$excel->getActiveSheet()->getPageSetup()->setOrientation(PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE);
|
||||
// Set judul file excel nya
|
||||
$excel->getActiveSheet(0)->setTitle("Data Rekap Pembayaran Tes PPDB");
|
||||
$excel->setActiveSheetIndex(0);
|
||||
// Proses file excel
|
||||
header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
|
||||
header('Content-Disposition: attachment; filename="Data Rekap Pembayaran PPDB.xlsx"'); // Set nama file excel nya
|
||||
header('Cache-Control: max-age=0');
|
||||
$write = PHPExcel_IOFactory::createWriter($excel, 'Excel2007');
|
||||
$write->save('php://output');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* End of file registrasi.php */
|
||||
/* Location: ./application/controllers/registrasi.php */
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Pendaftar extends CI_Controller {
|
||||
|
||||
//load model
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('pendaftar_model');
|
||||
$this->simple_login->check_login();
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$pendaftar = $this->pendaftar_model->listing();
|
||||
$total = $this->pendaftar_model->total();
|
||||
$gel = $this->pendaftar_model->gelombang();
|
||||
|
||||
$data = array( 'title' => 'Data Pendaftar',
|
||||
'pendaftar' => $pendaftar,
|
||||
'content' => 'pendaftar/index'
|
||||
);
|
||||
$this->load->view('layout/wrapper', $data, FALSE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* End of file Pendaftar.php */
|
||||
/* Location: ./application/controllers/Pendaftar.php */
|
||||
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Pengaturan extends CI_Controller {
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('setting_model');
|
||||
//proteksi halaman
|
||||
$this->simple_login->check_login();
|
||||
|
||||
}
|
||||
|
||||
//Main page biodata
|
||||
public function index()
|
||||
{
|
||||
|
||||
$data = array( 'title' => 'Aplikasi PPDB MTD - Pengaturan Ketentuan di Peserta',
|
||||
'content' => 'pengaturan/edit'
|
||||
);
|
||||
$this->load->view('layout/wrapper', $data, FALSE);
|
||||
}
|
||||
|
||||
//Edit Pengaturan
|
||||
public function edit()
|
||||
{
|
||||
|
||||
//validasi input
|
||||
$valid = $this->form_validation;
|
||||
//check nama
|
||||
$valid->set_rules('biodata','Pilih Tombol','required',
|
||||
array( 'required' => '%s Edit Biodata'));
|
||||
|
||||
//jika sudah dicek dan error
|
||||
if($valid->run()===FALSE) {
|
||||
//end validasi
|
||||
|
||||
$data= array( 'title' => 'Edit Data Tombol Pengaturan',
|
||||
'content' => 'pengaturan/edit'
|
||||
);
|
||||
$this->load->view('layout/wrapper', $data, FALSE);
|
||||
//jika validasi oke, masuk database
|
||||
}else{
|
||||
$inp = $this->input;
|
||||
$data = array(
|
||||
'pengaturan_value' => $inp->post('biodata')
|
||||
);
|
||||
//proses oleh model
|
||||
$this->setting_model->edit($data);
|
||||
|
||||
$inp2 = $this->input;
|
||||
$data2 = array(
|
||||
'pengaturan_value' => $inp2->post('password')
|
||||
);
|
||||
$this->setting_model->edit2($data2);
|
||||
|
||||
$inp3 = $this->input;
|
||||
$data3 = array(
|
||||
'pengaturan_value' => $inp3->post('tampil_tanggal')
|
||||
);
|
||||
$this->setting_model->edit3($data3);
|
||||
|
||||
$inp4 = $this->input;
|
||||
$data4 = array(
|
||||
'pengaturan_value' => $inp4->post('tampil_pengumuman')
|
||||
);
|
||||
$this->setting_model->edit4($data4);
|
||||
|
||||
//notifikasi dan redirect
|
||||
$this->session->set_flashdata('sukses', 'Pengaturan Selesai di Update.');
|
||||
redirect(base_url('pengaturan'),'refresh');
|
||||
}
|
||||
//end masuk database
|
||||
}
|
||||
}
|
||||
|
||||
/* End of file biodata.php */
|
||||
/* Location: ./application/controllers/biodata.php */
|
||||
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Pengaturan2 extends CI_Controller {
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('setting_model');
|
||||
//proteksi halaman
|
||||
$this->simple_login->check_login();
|
||||
|
||||
}
|
||||
|
||||
//Main page biodata
|
||||
public function index()
|
||||
{
|
||||
$pengaturan2 = $this->setting_model->panitia();
|
||||
$data = array( 'title' => 'Aplikasi PPDB MTD - Pengaturan Sekolah, Panitia, Tahun Pelajaran & Biaya Tes',
|
||||
'pengaturan2' => $pengaturan2,
|
||||
'content' => 'pengaturan2/edit'
|
||||
);
|
||||
$this->load->view('layout/wrapper', $data, FALSE);
|
||||
}
|
||||
|
||||
//Edit Pengaturan
|
||||
public function edit()
|
||||
{
|
||||
|
||||
//validasi input
|
||||
$valid = $this->form_validation;
|
||||
//check nama
|
||||
$valid->set_rules('sekolah','Pilih Tombol','required',
|
||||
array( 'required' => '%s Edit Sekolah'));
|
||||
|
||||
//jika sudah dicek dan error
|
||||
if($valid->run()===FALSE) {
|
||||
//end validasi
|
||||
|
||||
$data= array( 'title' => 'Edit Data Pengaturan',
|
||||
'content' => 'pengaturan2/edit'
|
||||
);
|
||||
$this->load->view('layout/wrapper', $data, FALSE);
|
||||
|
||||
|
||||
|
||||
//jika validasi oke, masuk database
|
||||
}else{
|
||||
$inp = $this->input;
|
||||
$data = array(
|
||||
'sekolah' => $inp->post('sekolah'),
|
||||
'alamat' => $inp->post('alamat'),
|
||||
'website' => $inp->post('website'),
|
||||
'tlp' => $inp->post('tlp'),
|
||||
'ketua_yayasan' => $inp->post('ketua_yayasan'),
|
||||
'kepsek' => $inp->post('kepsek'),
|
||||
'ketua_ppdb' => $inp->post('ketua_ppdb'),
|
||||
'bendahara' => $inp->post('bendahara'),
|
||||
'tp' => $inp->post('tp'),
|
||||
'kelas_tahun' => $inp->post('kelas_tahun'),
|
||||
'gelombang' => $inp->post('gelombang'),
|
||||
'biaya_for' => $inp->post('biaya_for'),
|
||||
'diskon' => $inp->post('diskon')
|
||||
);
|
||||
//proses oleh model
|
||||
$this->setting_model->edit5($data);
|
||||
|
||||
$inp8 = $this->input;
|
||||
$data8 = array(
|
||||
'th_pelajaran' => $inp8->post('th_pelajaran')
|
||||
);
|
||||
$this->setting_model->edit8($data8);
|
||||
|
||||
//notifikasi dan redirect
|
||||
$this->session->set_flashdata('sukses', 'Pengaturan Sekolah, Panitia & Biaya Tes Selesai di Update.');
|
||||
redirect(base_url('pengaturan2'),'refresh');
|
||||
}
|
||||
//end masuk database
|
||||
}
|
||||
}
|
||||
|
||||
/* End of file biodata.php */
|
||||
/* Location: ./application/controllers/biodata.php */
|
||||
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Pengumuman extends CI_Controller {
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('biodata_model');
|
||||
$this->load->model('file');
|
||||
|
||||
//proteksi halaman
|
||||
$this->simple_login->check_login();
|
||||
$this->load->helper(array('url', 'download'));
|
||||
|
||||
$this->load->helper('url');
|
||||
//load our model
|
||||
$this->load->model('Pengumuman_model','pengumuman_model');
|
||||
}
|
||||
|
||||
//Main page biodata
|
||||
public function index()
|
||||
{
|
||||
|
||||
$data = array( 'title' => 'Aplikasi PPDB MTD - Pengumuman Hasil Tes Akademik dan BTQ',
|
||||
'content' => 'pengumuman/index'
|
||||
);
|
||||
$this->load->view('layout/wrapper', $data, FALSE);
|
||||
}
|
||||
|
||||
public function cetakberkas($no_pendaftaran)
|
||||
{
|
||||
$data['data'] = $this->db->get_where('v_rpt_trans_berkas',['no_pendaftaran'=>$no_pendaftaran])->row();
|
||||
$this->load->view('formulir/cetak_berkas',$data);
|
||||
}
|
||||
|
||||
//public function download($no_pendaftaran)
|
||||
//{
|
||||
//$data = $this->db->get_where('data_siswa',['no_pendaftaran'=>$id])->row();
|
||||
//force_download('uploads/'.$data['no_pendaftaran']);
|
||||
|
||||
//$akhir = ".pdf";
|
||||
//$data = $this->db->get_where('v_rpt_data_pengumuman', ['no_pendaftaran' => $no_pendaftaran])->row_array();
|
||||
//header("Content-Disposition: attachment; filename=" .$data['no_pendaftaran'].$akhir);
|
||||
//$fp = fopen("uploads/".$data['no_pendaftaran'].$akhir, 'r');
|
||||
//$content = fread($fp, filesize('uploads/'.$data['no_pendaftaran'].$akhir));
|
||||
//fclose($fp);
|
||||
//echo $content;
|
||||
//exit;
|
||||
|
||||
//$data = $this->db->get_where('v_rpt_data_pengumuman', ['no_pendaftaran' => $no_pendaftaran])->row_array();
|
||||
//header("Content-Disposition: attachment; filename=" . $data['file_upload']);
|
||||
//$fp = fopen("uploads/" . $data['file_upload'], 'r');
|
||||
//$content = fread($fp, filesize('uploads/' . $data['file_upload']));
|
||||
//fclose($fp);
|
||||
//echo $content;
|
||||
//exit;
|
||||
//}
|
||||
|
||||
public function download($no_pendaftaran){
|
||||
$this->load->helper('download');
|
||||
$fileinfo = $this->pengumuman_model->download($no_pendaftaran);
|
||||
$file = 'uploads/'.$fileinfo['file_upload'];
|
||||
force_download($file, NULL);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* End of file biodata.php */
|
||||
/* Location: ./application/controllers/biodata.php */
|
||||
@@ -0,0 +1,373 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Pengumuman_setting extends CI_Controller {
|
||||
|
||||
//load model
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('pengumuman_model');
|
||||
$this->load->model('biayaformulir_model');
|
||||
$this->simple_login->check_login();
|
||||
//proteksi admin dan peserta
|
||||
if($this->session->userdata('level') !='Administrator')
|
||||
{
|
||||
if($this->session->userdata('level') !='Operator')
|
||||
{
|
||||
//kalau bukan adamin, lempar ke login
|
||||
$this->session->set_flashdata('warning', 'Hak akses anda tidak diijinkan mengakses menu pengumuman');
|
||||
redirect(base_url('login'),'refresh');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function search(){
|
||||
// Ambil data pendaftar yang dikirim via ajax post
|
||||
$no_pendaftaran = $this->input->post('no_pendaftaran');
|
||||
$siswa = $this->pengumuman_model->viewByNo($no_pendaftaran);
|
||||
|
||||
if( ! empty($siswa)){ // Jika data siswa ada/ditemukan
|
||||
// Buat sebuah array
|
||||
$callback = array(
|
||||
'status' => 'success', // Set array status dengan success
|
||||
'nama_lengkap' => $siswa->nama_lengkap, // Set array nama
|
||||
'sekolah_asal' => $siswa->sekolah_asal, // Set array sekolah
|
||||
'kompetensi' => $siswa->kompetensi, // Set array kompetensi
|
||||
);
|
||||
}else{
|
||||
$callback = array('status' => 'failed'); // set array status dengan failed
|
||||
}
|
||||
echo json_encode($callback); // konversi varibael $callback menjadi JSON
|
||||
}
|
||||
|
||||
|
||||
public function index()
|
||||
{
|
||||
$pengumuman = $this->pengumuman_model->listing();
|
||||
$total = $this->pengumuman_model->total();
|
||||
|
||||
|
||||
//validasi input
|
||||
$valid = $this->form_validation;
|
||||
//check nama
|
||||
$this->form_validation->set_rules('nama_lengkap', 'Data tidak dapat disimpan, nama peserta harus terisi ', 'required',
|
||||
array( 'required' => '%s dengan menekan tombol cari terlebih dahulu'));
|
||||
|
||||
$valid->set_rules('no_pendaftaran','Data tidak dapat disimpan, ','required|is_unique[pengumuman.no_pendaftaran]',
|
||||
array( 'required' => '%s harus diisi',
|
||||
'is_unique' => '%s nomor pendaftaran yang diinput sudah terdata kelulusannya jika ingin merubah silahkan di menu edit.'));
|
||||
|
||||
//jika sudah dicek dan error
|
||||
if($valid->run()===FALSE) {
|
||||
$pengumuman = array( 'title' => 'Data Pengumuman Hasil Tes [ '.$total->total.' ]',
|
||||
'pengumuman' => $pengumuman,
|
||||
'content' => 'pengumuman_setting/index'
|
||||
);
|
||||
$this->load->view('layout/wrapper', $pengumuman, FALSE);
|
||||
//jika validasi oke, masuk database
|
||||
}else{
|
||||
$extensi = '.pdf';
|
||||
|
||||
$inp = $this->input;
|
||||
$data = array( 'no_pendaftaran' => $inp->post('no_pendaftaran'),
|
||||
'status' => $inp->post('status'),
|
||||
'tanggal_pengumuman' => date('Y-m-d H:i:s'),
|
||||
'file_upload' => $inp->post('no_pendaftaran') .$extensi
|
||||
);
|
||||
|
||||
$no_pendaftaran = $this->input->post('no_pendaftaran');
|
||||
$data2 = array( 'userid' => $no_pendaftaran,
|
||||
'password' => '5ada545f85f69b85e6d7c848274f4da4',
|
||||
'nama' => $no_pendaftaran,
|
||||
'email' => 'user@gmail.com',
|
||||
'gambar' => 'user1.jpg',
|
||||
'level' => 'Peserta'
|
||||
);
|
||||
|
||||
//proses oleh model
|
||||
$this->pengumuman_model->tambah($data);
|
||||
//proses oleh model
|
||||
$this->pengumuman_model->tambah2($data2);
|
||||
//notifikasi dan redirect
|
||||
$this->session->set_flashdata('sukses', 'Satu Data Pengumuman Kelulusan Telah Ditambah..!');
|
||||
redirect(base_url('pengumuman_setting'),'refresh');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//Edit user
|
||||
public function edit($no_pendaftaran)
|
||||
{
|
||||
//panggil data user yang akan diedit
|
||||
$pengumuman = $this->pengumuman_model->detail($no_pendaftaran);
|
||||
|
||||
|
||||
//validasi input
|
||||
$valid = $this->form_validation;
|
||||
//check nama
|
||||
$valid->set_rules('status','Data Pengumuman Kelulusan','required',
|
||||
array( 'required' => '%s Harus Diisi'));
|
||||
|
||||
//jika sudah dicek dan error
|
||||
if($valid->run()===FALSE) {
|
||||
//end validasi
|
||||
|
||||
$data= array( 'title' => 'Edit Data Hasil Tes No. Pend : '.$pengumuman->no_pendaftaran,
|
||||
'pengumuman' => $pengumuman,
|
||||
'content' => 'pengumuman_setting/edit'
|
||||
);
|
||||
$this->load->view('layout/wrapper', $data, FALSE);
|
||||
//jika validasi oke, masuk database
|
||||
}else{
|
||||
$inp = $this->input;
|
||||
$data = array( 'no_pendaftaran' => $no_pendaftaran,
|
||||
'status' => $inp->post('status'),
|
||||
'tanggal_pengumuman' => date('Y-m-d H:i:s')
|
||||
);
|
||||
//proses oleh model
|
||||
$this->pengumuman_model->edit($data);
|
||||
//notifikasi dan redirect
|
||||
$this->session->set_flashdata('sukses', 'Data Pengumuman Kelulusan No. Pend : '.$pengumuman->no_pendaftaran.' Telah Diedit.');
|
||||
redirect(base_url('pengumuman_setting'),'refresh');
|
||||
}
|
||||
//end masuk database
|
||||
}
|
||||
|
||||
//Delete pengumuman
|
||||
public function delete($no_pendaftaran)
|
||||
{
|
||||
$data = array('no_pendaftaran' => $no_pendaftaran);
|
||||
$data2 = array('userid' => $no_pendaftaran);
|
||||
//proses hapus
|
||||
$this->pengumuman_model->delete($data);
|
||||
$this->pengumuman_model->delete2($data2);
|
||||
//notifikasi
|
||||
$this->session->set_flashdata('sukses', 'Satu Data Pengumuman Telah Dihapus..!');
|
||||
redirect(base_url('pengumuman_setting'),'refresh');
|
||||
}
|
||||
|
||||
|
||||
|
||||
//EXPORT NILAI KE EXCEL
|
||||
public function export(){
|
||||
// Load plugin PHPExcel nya
|
||||
include APPPATH.'third_party/PHPExcel/PHPExcel.php';
|
||||
|
||||
// Panggil class PHPExcel nya
|
||||
$excel = new PHPExcel();
|
||||
// Settingan awal fil excel
|
||||
$excel->getProperties()->setCreator('By : 415 DIL')
|
||||
->setLastModifiedBy('By : 415 DIL')
|
||||
->setTitle("Data Berkas")
|
||||
->setSubject("Berkas")
|
||||
->setDescription("Laporan Data Berkas")
|
||||
->setKeywords("Data Berkas");
|
||||
// Buat sebuah variabel untuk menampung pengaturan style dari header tabel
|
||||
$style_col = array(
|
||||
'font' => array('bold' => true), // Set font nya jadi bold
|
||||
'alignment' => array(
|
||||
'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, // Set text jadi ditengah secara horizontal (center)
|
||||
'vertical' => PHPExcel_Style_Alignment::VERTICAL_CENTER // Set text jadi di tengah secara vertical (middle)
|
||||
),
|
||||
'borders' => array(
|
||||
'top' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border top dengan garis tipis
|
||||
'right' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border right dengan garis tipis
|
||||
'bottom' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border bottom dengan garis tipis
|
||||
'left' => array('style' => PHPExcel_Style_Border::BORDER_THIN) // Set border left dengan garis tipis
|
||||
)
|
||||
);
|
||||
// Buat sebuah variabel untuk menampung pengaturan style dari isi tabel
|
||||
$style_row = array(
|
||||
'alignment' => array(
|
||||
'vertical' => PHPExcel_Style_Alignment::VERTICAL_CENTER // Set text jadi di tengah secara vertical (middle)
|
||||
),
|
||||
'borders' => array(
|
||||
'top' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border top dengan garis tipis
|
||||
'right' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border right dengan garis tipis
|
||||
'bottom' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border bottom dengan garis tipis
|
||||
'left' => array('style' => PHPExcel_Style_Border::BORDER_THIN) // Set border left dengan garis tipis
|
||||
)
|
||||
);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('A1', "LAPORAN REKAP PENYERAHAN BERKAS PPDB SMK AL-MUHTADIN DEPOK"); // Set kolom A1 dengan tulisan "DATA SISWA"
|
||||
$excel->getActiveSheet()->mergeCells('A1:P1'); // Set Merge Cell pada kolom A1 sampai E1
|
||||
$excel->getActiveSheet()->getStyle('A1')->getFont()->setBold(TRUE); // Set bold kolom A1
|
||||
$excel->getActiveSheet()->getStyle('A1')->getFont()->setSize(15); // Set font size 15 untuk kolom A1
|
||||
$excel->getActiveSheet()->getStyle('A1')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER); // Set text center untuk kolom A1
|
||||
// Buat header tabel nya pada baris ke 3
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('A3', "NO."); // Set kolom A3 dengan tulisan "NO"
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('B3', "NO. PEND"); // Set kolom B3 dengan tulisan "NO.PEND"
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('C3', "NAMA LENGKAP"); // Set kolom C3 dengan tulisan "NAMA"
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('D3', "JENIS KELAMIN"); // Set kolom D3 dengan tulisan "JENIS KELAMIN"
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('E3', "SEKOLAH ASAL"); // Set kolom E3 dengan tulisan "SEKOLAH"
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('F3', "KOMPETENSI");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('G3', "GELOMBANG");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('H3', "FORMULIR");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('I3', "AKTE");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('J3', "KK");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('K3', "KTP ORTU");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('L3', "NISN");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('M3', "BAIK & NARKOBA");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('N3', "KET. YATIM");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('O3', "KIP");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('P3', "SALIN SLIP");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('Q3', "SKL");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('R3', "IJAZAH");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('S3', "TGL. UPDATE");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('T3', "PETUGAS");
|
||||
|
||||
|
||||
// Apply style header yang telah kita buat tadi ke masing-masing kolom header
|
||||
$excel->getActiveSheet()->getStyle('A3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('B3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('C3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('D3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('E3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('F3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('G3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('H3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('I3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('J3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('K3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('L3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('M3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('N3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('O3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('P3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('Q3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('R3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('S3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('T3')->applyFromArray($style_col);
|
||||
|
||||
// Panggil function view yang ada di formulir_model untuk menampilkan semua data formulirnya
|
||||
$pengumuman = $this->formulir_model->ViewUrut();
|
||||
$no = 1; // Untuk penomoran tabel, di awal set dengan 1
|
||||
$numrow = 4; // Set baris pertama untuk isi tabel adalah baris ke 4
|
||||
foreach($pengumuman as $data){ // Lakukan looping pada variabel pengumuman
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('A'.$numrow, $no);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('B'.$numrow, $data->no_pendaftaran);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('C'.$numrow, $data->nama_lengkap);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('D'.$numrow, $data->jkelamin);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('E'.$numrow, $data->sekolah_asal);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('F'.$numrow, $data->kd_kompetensi);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('G'.$numrow, $data->gelombang);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('H'.$numrow, $data->shun);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('I'.$numrow, $data->akte);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('J'.$numrow, $data->kk);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('K'.$numrow, $data->ktp);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('L'.$numrow, $data->nisn);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('M'.$numrow, $data->baik_narkoba);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('N'.$numrow, $data->ket_yatim);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('O'.$numrow, $data->kip);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('P'.$numrow, $data->slip_btn);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('Q'.$numrow, $data->skl);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('R'.$numrow, $data->ijazah);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('S'.$numrow, $data->tgl_update);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('T'.$numrow, $data->petugas);
|
||||
|
||||
|
||||
// Apply style row yang telah kita buat tadi ke masing-masing baris (isi tabel)
|
||||
$excel->getActiveSheet()->getStyle('A'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('B'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('C'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('D'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('E'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('F'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('G'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('H'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('I'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('J'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('K'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('L'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('M'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('N'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('O'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('P'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('Q'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('R'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('S'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('T'.$numrow)->applyFromArray($style_row);
|
||||
|
||||
|
||||
$no++; // Tambah 1 setiap kali looping
|
||||
$numrow++; // Tambah 1 setiap kali looping
|
||||
}
|
||||
// Set width kolom
|
||||
$excel->getActiveSheet()->getColumnDimension('A')->setWidth(5); // Set width kolom A
|
||||
$excel->getActiveSheet()->getColumnDimension('B')->setWidth(12); // Set width kolom B
|
||||
$excel->getActiveSheet()->getColumnDimension('C')->setWidth(35); // Set width kolom C
|
||||
$excel->getActiveSheet()->getColumnDimension('D')->setWidth(15); // Set width kolom D
|
||||
$excel->getActiveSheet()->getColumnDimension('E')->setWidth(35); // Set width kolom E
|
||||
$excel->getActiveSheet()->getColumnDimension('F')->setWidth(13);
|
||||
$excel->getActiveSheet()->getColumnDimension('G')->setWidth(13);
|
||||
$excel->getActiveSheet()->getColumnDimension('H')->setWidth(12);
|
||||
$excel->getActiveSheet()->getColumnDimension('I')->setWidth(12);
|
||||
$excel->getActiveSheet()->getColumnDimension('J')->setWidth(12);
|
||||
$excel->getActiveSheet()->getColumnDimension('K')->setWidth(12);
|
||||
$excel->getActiveSheet()->getColumnDimension('L')->setWidth(12);
|
||||
$excel->getActiveSheet()->getColumnDimension('M')->setWidth(16);
|
||||
$excel->getActiveSheet()->getColumnDimension('N')->setWidth(12);
|
||||
$excel->getActiveSheet()->getColumnDimension('O')->setWidth(12);
|
||||
$excel->getActiveSheet()->getColumnDimension('P')->setWidth(12);
|
||||
$excel->getActiveSheet()->getColumnDimension('Q')->setWidth(12);
|
||||
$excel->getActiveSheet()->getColumnDimension('R')->setWidth(12);
|
||||
$excel->getActiveSheet()->getColumnDimension('S')->setWidth(18);
|
||||
$excel->getActiveSheet()->getColumnDimension('T')->setWidth(15);
|
||||
|
||||
// Set height semua kolom menjadi auto (mengikuti height isi dari kolommnya, jadi otomatis)
|
||||
$excel->getActiveSheet()->getDefaultRowDimension()->setRowHeight(-1);
|
||||
// Set orientasi kertas jadi LANDSCAPE
|
||||
$excel->getActiveSheet()->getPageSetup()->setOrientation(PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE);
|
||||
// Set judul file excel nya
|
||||
$excel->getActiveSheet(0)->setTitle("Rekap Penyerahan Berkas PPDB");
|
||||
$excel->setActiveSheetIndex(0);
|
||||
// Proses file excel
|
||||
header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
|
||||
header('Content-Disposition: attachment; filename="Rekap Penyerahan Berkas PPDB.xlsx"'); // Set nama file excel nya
|
||||
header('Cache-Control: max-age=0');
|
||||
$write = PHPExcel_IOFactory::createWriter($excel, 'Excel2007');
|
||||
$write->save('php://output');
|
||||
}
|
||||
|
||||
public function cetak(){
|
||||
$pdf = new FPDF('p','mm','A4');
|
||||
// membuat halaman baru
|
||||
$pdf->AddPage();
|
||||
// setting jenis font yang akan digunakan
|
||||
$pdf->SetFont('Arial','B',16);
|
||||
// mencetak string
|
||||
$pdf->Cell(190,7,'LAPORAN REKAP DATA BERKAS PPDB',0,1,'C');
|
||||
$pdf->SetFont('Arial','B',12);
|
||||
$pdf->Cell(190,7,'SMK AL-MUHTADIN DEPOK',0,1,'C');
|
||||
// Memberikan space kebawah agar tidak terlalu rapat
|
||||
$pdf->Cell(10,7,'',0,1);
|
||||
$pdf->SetFont('Arial','B',10);
|
||||
$pdf->Cell(10,6,'NO.',1,0);
|
||||
$pdf->Cell(20,6,'NO. PEND',1,0);
|
||||
$pdf->Cell(85,6,'NAMA SISWA',1,0);
|
||||
$pdf->Cell(30,6,'TEMPAT LAHIR',1,0);
|
||||
$pdf->Cell(33,6,'TANGGAL LAHIR',1,1);
|
||||
$pdf->SetFont('Arial','',10);
|
||||
$siswa = $this->db->get('data_siswa')->result();
|
||||
$no = 1;
|
||||
foreach ($siswa as $row){
|
||||
$pdf->Cell(10,6,$no++,1,0);
|
||||
$pdf->Cell(20,6,$row->no_pendaftaran,1,0);
|
||||
$pdf->Cell(85,6,$row->nama_lengkap,1,0);
|
||||
$pdf->Cell(30,6,$row->tempat_lahir,1,0);
|
||||
$pdf->Cell(33,6,$row->tgl_lahir,1,1);
|
||||
}
|
||||
$pdf->Output();
|
||||
}
|
||||
|
||||
public function cetakpengumuman($no_pendaftaran)
|
||||
{
|
||||
$data['data'] = $this->db->get_where('v_rpt_trans_berkas',['no_pendaftaran'=>$no_pendaftaran])->row();
|
||||
$this->load->view('pengumuman/cetak_berkas',$data);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* End of file pengumuman.php */
|
||||
/* Location: ./application/controllers/pengumuman.php */
|
||||
@@ -0,0 +1,390 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Peserta extends CI_Controller {
|
||||
|
||||
//load model
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('peserta_model');
|
||||
$this->load->model('biodata_model');
|
||||
$this->simple_login->check_login();
|
||||
//proteksi admin dan peserta
|
||||
if($this->session->userdata('level') !='Administrator')
|
||||
{
|
||||
if($this->session->userdata('level') !='Operator')
|
||||
{
|
||||
if($this->session->userdata('level') !='CS')
|
||||
{
|
||||
//kalau bukan adamin, lempar ke login
|
||||
$this->session->set_flashdata('warning', 'Hak akses anda tidak diijinkan mengakses menu pendaftar');
|
||||
redirect(base_url('login'),'refresh');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$peserta = $this->peserta_model->listing();
|
||||
$total = $this->peserta_model->total();
|
||||
|
||||
$data = array( 'title' => 'Data Keseluruhan Pendaftar [ '.$total->total.' ]',
|
||||
'peserta' => $peserta,
|
||||
'content' => 'peserta/index'
|
||||
);
|
||||
$this->load->view('layout/wrapper', $data, FALSE);
|
||||
}
|
||||
|
||||
//detail pasien
|
||||
public function detail($no_pendaftaran)
|
||||
{
|
||||
$peserta = $this->peserta_model->detail($no_pendaftaran);
|
||||
|
||||
$data = array( 'title' => 'Biodata Pendaftar : '.$peserta->nama_lengkap.'',
|
||||
'peserta' => $peserta,
|
||||
'content' => 'peserta/detail'
|
||||
);
|
||||
$this->load->view('layout/wrapper', $data, FALSE);
|
||||
}
|
||||
|
||||
//Edit peserta
|
||||
public function edit($no_pendaftaran)
|
||||
{
|
||||
//panggil data user yang akan diedit
|
||||
$peserta = $this->peserta_model->detail($no_pendaftaran);
|
||||
|
||||
|
||||
//validasi input
|
||||
$valid = $this->form_validation;
|
||||
//check nama
|
||||
$valid->set_rules('nama_lengkap','Nama Peserta','required',
|
||||
array( 'required' => '%s harus diisi'));
|
||||
|
||||
//jika sudah dicek dan error
|
||||
if($valid->run()===FALSE) {
|
||||
//end validasi
|
||||
|
||||
$data= array( 'title' => 'Edit Data Peserta, No. Pendaftaran : '.$peserta->no_pendaftaran,
|
||||
'peserta' => $peserta,
|
||||
'content' => 'peserta/edit'
|
||||
);
|
||||
$this->load->view('layout/wrapper', $data, FALSE);
|
||||
//jika validasi oke, masuk database
|
||||
}else{
|
||||
$inp = $this->input;
|
||||
$data = array( 'no_pendaftaran' => $no_pendaftaran,
|
||||
'nama_lengkap' => $inp->post('nama_lengkap'),
|
||||
'nama_panggilan' => $inp->post('nama_panggilan'),
|
||||
'jkelamin' => $inp->post('jkelamin'),
|
||||
'nik' => $inp->post('nik'),
|
||||
'nisn' => $inp->post('nisn'),
|
||||
'tempat_lahir' => $inp->post('tempat_lahir'),
|
||||
'tgl_lahir' => date('Y-m-d',strtotime($inp->post('tgl_lahir'))),
|
||||
'agama' => $inp->post('agama'),
|
||||
'kewarganegaraan' => $inp->post('kewarganegaraan'),
|
||||
'anak_ke' => $inp->post('anak_ke'),
|
||||
'jml_saudara' => $inp->post('jml_saudara'),
|
||||
'kandung' => $inp->post('kandung'),
|
||||
'tiri' => $inp->post('tiri'),
|
||||
'angkat' => $inp->post('angkat'),
|
||||
'status_keluarga' => $inp->post('status_keluarga'),
|
||||
'bhs_dirumah' => $inp->post('bhs_dirumah'),
|
||||
'kemeja' => $inp->post('kemeja'),
|
||||
'celana' => $inp->post('celana'),
|
||||
'alamat_siswa' => $inp->post('alamat_siswa'),
|
||||
'no_rmh' => $inp->post('no_rmh'),
|
||||
'rt' => $inp->post('rt'),
|
||||
'rw' => $inp->post('rw'),
|
||||
'kelurahan' => $inp->post('kelurahan'),
|
||||
'kecamatan' => $inp->post('kecamatan'),
|
||||
'kota' => $inp->post('kota'),
|
||||
'provinsi' => $inp->post('provinsi'),
|
||||
'kode_pos' => $inp->post('kode_pos'),
|
||||
'no_tlp_rmh' => $inp->post('no_tlp_rmh'),
|
||||
'no_hp' => $inp->post('no_hp'),
|
||||
'email' => $inp->post('email'),
|
||||
'tinggal_dengan' => $inp->post('tinggal_dengan'),
|
||||
'sekolah_dengan' => $inp->post('sekolah_dengan'),
|
||||
'jarak_rmh_kesekolah' => $inp->post('jarak_rmh_kesekolah'),
|
||||
'berat_badan' => $inp->post('berat_badan'),
|
||||
'tinggi_badan' => $inp->post('tinggi_badan'),
|
||||
'gol_darah' => $inp->post('gol_darah'),
|
||||
'penyakit' => $inp->post('penyakit'),
|
||||
'kelainan_jasmani' => $inp->post('kelainan_jasmani'),
|
||||
'usia_tahun' => $inp->post('usia_tahun'),
|
||||
'usia_bulan' => $inp->post('usia_bulan'),
|
||||
'sekolah_asal' => $inp->post('sekolah_asal'),
|
||||
'npsn2' => $inp->post('npsn2'),
|
||||
'nisn2' => $inp->post('nisn2'),
|
||||
'sekolah_jln' => $inp->post('sekolah_jln'),
|
||||
'sekolah_kel' => $inp->post('sekolah_kel'),
|
||||
'sekolah_kec' => $inp->post('sekolah_kec'),
|
||||
'sekolah_kota' => $inp->post('sekolah_kota'),
|
||||
'sekolah_prov' => $inp->post('sekolah_prov'),
|
||||
'Ijazah_tgl' => date('Y-m-d',strtotime($inp->post('Ijazah_tgl'))),
|
||||
'Ijazah_no' => $inp->post('Ijazah_no'),
|
||||
'nama_ayah' => $inp->post('nama_ayah'),
|
||||
'tmpt_lahir_ayah' => $inp->post('tmpt_lahir_ayah'),
|
||||
'tgl_lahir_ayah' => date('Y-m-d',strtotime($inp->post('tgl_lahir_ayah'))),
|
||||
'agama_ayah' => $inp->post('agama_ayah'),
|
||||
'kewarganegaraan_ayah' => $inp->post('kewarganegaraan_ayah'),
|
||||
'pendidikan_ayah' => $inp->post('pendidikan_ayah'),
|
||||
'pekerjaan_ayah' => $inp->post('pekerjaan_ayah'),
|
||||
'penghasilan_ayah' => $inp->post('penghasilan_ayah'),
|
||||
'alamat_ayah' => $inp->post('alamat_ayah'),
|
||||
'tlp_ayah' => $inp->post('tlp_ayah'),
|
||||
'nama_ibu' => $inp->post('nama_ibu'),
|
||||
'tmpt_lahir_ibu' => $inp->post('tmpt_lahir_ibu'),
|
||||
'tgl_lahir_ibu' => date('Y-m-d',strtotime($inp->post('tgl_lahir_ibu'))),
|
||||
'agama_ibu' => $inp->post('agama_ibu'),
|
||||
'kewarganegaraan_ibu' => $inp->post('kewarganegaraan_ibu'),
|
||||
'pendidikan_ibu' => $inp->post('pendidikan_ibu'),
|
||||
'pekerjaan_ibu' => $inp->post('pekerjaan_ibu'),
|
||||
'penghasilan_ibu' => $inp->post('penghasilan_ibu'),
|
||||
'alamat_ibu' => $inp->post('alamat_ibu'),
|
||||
'tlp_ibu' => $inp->post('tlp_ibu'),
|
||||
'nama_wali' => $inp->post('nama_wali'),
|
||||
'tmpt_lahir_wali' => $inp->post('tmpt_lahir_wali'),
|
||||
'tgl_lahir_wali' => date('Y-m-d',strtotime($inp->post('tgl_lahir_wali'))),
|
||||
'agama_wali' => $inp->post('agama_wali'),
|
||||
'kewarganegaraan_wali' => $inp->post('kewarganegaraan_wali'),
|
||||
'pendidikan_wali' => $inp->post('pendidikan_wali'),
|
||||
'pekerjaan_wali' => $inp->post('pekerjaan_wali'),
|
||||
'penghasilan_wali' => $inp->post('penghasilan_wali'),
|
||||
'alamat_wali' => $inp->post('alamat_wali'),
|
||||
'tlp_wali' => $inp->post('tlp_wali'),
|
||||
'iq' => $inp->post('iq'),
|
||||
'tgl_tes_iq' => date('Y-m-d',strtotime($inp->post('tgl_tes_iq'))),
|
||||
'disiplin' => $inp->post('disiplin'),
|
||||
'prakarsa' => $inp->post('prakarsa'),
|
||||
'tanggung_jwb' => $inp->post('tanggung_jwb'),
|
||||
'penyesuaian_diri' => $inp->post('penyesuaian_diri'),
|
||||
'kemantapan_emosi' => $inp->post('kemantapan_emosi'),
|
||||
'kerjasama' => $inp->post('kerjasama'),
|
||||
'iptek' => $inp->post('iptek'),
|
||||
'iptek_tingkat' => $inp->post('iptek_tingkat'),
|
||||
'olahraga' => $inp->post('olahraga'),
|
||||
'olahraga_tingkat' => $inp->post('olahraga_tingkat'),
|
||||
'kesenian' => $inp->post('kesenian'),
|
||||
'kesenian_tingkat' => $inp->post('kesenian_tingkat'),
|
||||
'keagamaan' => $inp->post('keagamaan'),
|
||||
'keagamaan_tingkat' => $inp->post('keagamaan_tingkat'),
|
||||
'keterampilan' => $inp->post('keterampilan'),
|
||||
'keterampilan_tingkat' => $inp->post('keterampilan_tingkat'),
|
||||
'lainnya' => $inp->post('lainnya'),
|
||||
'lainnya_tingkat' => $inp->post('lainnya_tingkat'),
|
||||
'beasiswa1_thn' => $inp->post('beasiswa1_thn'),
|
||||
'beasiswa1_dari' => $inp->post('beasiswa1_dari'),
|
||||
'beasiswa2_thn' => $inp->post('beasiswa2_thn'),
|
||||
'beasiswa2_dari' => $inp->post('beasiswa2_dari')
|
||||
|
||||
/*'' => $inp->post(''),*/
|
||||
);
|
||||
//proses oleh model
|
||||
$this->peserta_model->edit($data);
|
||||
//notifikasi dan redirect
|
||||
$this->session->set_flashdata('sukses', 'Data Peserta Nomor Pendaftar : <b>'.$peserta->no_pendaftaran.'</b> Telah Diupdate !');
|
||||
redirect(base_url('peserta'),'refresh');
|
||||
}
|
||||
//end masuk database
|
||||
}
|
||||
|
||||
//Edit peserta
|
||||
public function editjur($no_pendaftaran)
|
||||
{
|
||||
//panggil data user yang akan diedit
|
||||
$peserta = $this->peserta_model->detail($no_pendaftaran);
|
||||
|
||||
|
||||
//validasi input
|
||||
$valid = $this->form_validation;
|
||||
//check nama
|
||||
$valid->set_rules('kd_kompetensi','Program keahlian peserta','required',
|
||||
array( 'required' => '%s harus diisi'));
|
||||
|
||||
//jika sudah dicek dan error
|
||||
if($valid->run()===FALSE) {
|
||||
//end validasi
|
||||
|
||||
$data= array( 'title' => 'Edit Data Peserta, No. Pendaftaran : '.$peserta->no_pendaftaran,
|
||||
'peserta' => $peserta,
|
||||
'content' => 'peserta/editjur'
|
||||
);
|
||||
$this->load->view('layout/wrapper', $data, FALSE);
|
||||
//jika validasi oke, masuk database
|
||||
}else{
|
||||
$inp = $this->input;
|
||||
$query = $this->db->get('data_siswa');
|
||||
$jurusan = $query->row(); // Mengambil baris pertama sebagai objek
|
||||
// Ambil data yang dikirimkan dari form
|
||||
$kd_kompetensi = $this->input->post('kd_kompetensi');
|
||||
$jurusan ="";
|
||||
if ($kd_kompetensi == "TJKT") {
|
||||
$jurusan= "Teknik Jaringan Komputer & Telekomunikasi";
|
||||
} elseif ($kd_kompetensi == "MPLB") {
|
||||
$jurusan= "Manajemen Perkantoran & Layanan Bisnis";
|
||||
} elseif ($kd_kompetensi == "ANIMASI") {
|
||||
$jurusan= "Animasi";
|
||||
} else {
|
||||
$jurusan = "Kuliner";
|
||||
}
|
||||
$data = array( 'no_pendaftaran' => $no_pendaftaran,
|
||||
'kd_kompetensi' => $inp->post('kd_kompetensi'),
|
||||
'kompetensi' => $jurusan
|
||||
|
||||
);
|
||||
//proses oleh model
|
||||
$this->peserta_model->editjur($data);
|
||||
//notifikasi dan redirect
|
||||
$this->session->set_flashdata('sukses', 'Data Peserta Nomor Pendaftar : <b>'.$peserta->no_pendaftaran.'</b> Telah Diupdate !');
|
||||
redirect(base_url('peserta'),'refresh');
|
||||
}
|
||||
//end masuk database
|
||||
}
|
||||
|
||||
//EXPORT GEL ALL KE EXCEL
|
||||
public function export(){
|
||||
// Load plugin PHPExcel nya
|
||||
include APPPATH.'third_party/PHPExcel/PHPExcel.php';
|
||||
|
||||
// Panggil class PHPExcel nya
|
||||
$excel = new PHPExcel();
|
||||
// Settingan awal fil excel
|
||||
$excel->getProperties()->setCreator('By : 415 DIL')
|
||||
->setLastModifiedBy('By : 415 DIL')
|
||||
->setTitle("Data Berkas")
|
||||
->setSubject("Berkas")
|
||||
->setDescription("Laporan Data Berkas")
|
||||
->setKeywords("Data Berkas");
|
||||
// Buat sebuah variabel untuk menampung pengaturan style dari header tabel
|
||||
$style_col = array(
|
||||
'font' => array('bold' => true), // Set font nya jadi bold
|
||||
'alignment' => array(
|
||||
'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, // Set text jadi ditengah secara horizontal (center)
|
||||
'vertical' => PHPExcel_Style_Alignment::VERTICAL_CENTER // Set text jadi di tengah secara vertical (middle)
|
||||
),
|
||||
'borders' => array(
|
||||
'top' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border top dengan garis tipis
|
||||
'right' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border right dengan garis tipis
|
||||
'bottom' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border bottom dengan garis tipis
|
||||
'left' => array('style' => PHPExcel_Style_Border::BORDER_THIN) // Set border left dengan garis tipis
|
||||
)
|
||||
);
|
||||
// Buat sebuah variabel untuk menampung pengaturan style dari isi tabel
|
||||
$style_row = array(
|
||||
'alignment' => array(
|
||||
'vertical' => PHPExcel_Style_Alignment::VERTICAL_CENTER // Set text jadi di tengah secara vertical (middle)
|
||||
),
|
||||
'borders' => array(
|
||||
'top' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border top dengan garis tipis
|
||||
'right' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border right dengan garis tipis
|
||||
'bottom' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border bottom dengan garis tipis
|
||||
'left' => array('style' => PHPExcel_Style_Border::BORDER_THIN) // Set border left dengan garis tipis
|
||||
)
|
||||
);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('A1', "DATA KESELURUHAN PENDAFTAR PPDB SMK AL-MUHTADIN DEPOK"); // Set kolom A1 dengan tulisan "DATA SISWA"
|
||||
$excel->getActiveSheet()->mergeCells('A1:K1'); // Set Merge Cell pada kolom A1 sampai E1
|
||||
$excel->getActiveSheet()->getStyle('A1')->getFont()->setBold(TRUE); // Set bold kolom A1
|
||||
$excel->getActiveSheet()->getStyle('A1')->getFont()->setSize(15); // Set font size 15 untuk kolom A1
|
||||
$excel->getActiveSheet()->getStyle('A1')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER); // Set text center untuk kolom A1
|
||||
// Buat header tabel nya pada baris ke 3
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('A3', "NO."); // Set kolom A3 dengan tulisan "NO"
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('B3', "NO. PEND"); // Set kolom B3 dengan tulisan "NO.PEND"
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('C3', "NAMA LENGKAP"); // Set kolom C3 dengan tulisan "NAMA"
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('D3', "JENIS KELAMIN"); // Set kolom D3 dengan tulisan "JENIS KELAMIN"
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('E3', "TEMPAT LAHIR"); // Set kolom E3 dengan tulisan "TEMPAT LAHIR"
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('F3', "TGL. LAHIR");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('G3', "SEKOLAH ASAL");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('H3', "KOMPETENSI");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('I3', "GELOMBANG");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('J3', "NO. HANDPHONE");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('K3', "TGL. DAFTAR");
|
||||
|
||||
// Apply style header yang telah kita buat tadi ke masing-masing kolom header
|
||||
$excel->getActiveSheet()->getStyle('A3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('B3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('C3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('D3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('E3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('F3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('G3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('H3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('I3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('J3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('K3')->applyFromArray($style_col);
|
||||
|
||||
// Panggil function view yang ada di formulir_model untuk menampilkan semua data formulirnya
|
||||
$peserta = $this->peserta_model->ViewUrutAll();
|
||||
$no = 1; // Untuk penomoran tabel, di awal set dengan 1
|
||||
$numrow = 4; // Set baris pertama untuk isi tabel adalah baris ke 4
|
||||
foreach($peserta as $data){ // Lakukan looping pada variabel formulir
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('A'.$numrow, $no);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('B'.$numrow, $data->no_pendaftaran);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('C'.$numrow, $data->nama_lengkap);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('D'.$numrow, $data->jkelamin);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('E'.$numrow, $data->tempat_lahir);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('F'.$numrow, $data->tgl_lahir);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('G'.$numrow, $data->sekolah_asal);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('H'.$numrow, $data->kd_kompetensi);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('I'.$numrow, $data->gelombang);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('J'.$numrow, $data->no_hp);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('K'.$numrow, $data->tgl_trans);
|
||||
|
||||
|
||||
// Apply style row yang telah kita buat tadi ke masing-masing baris (isi tabel)
|
||||
$excel->getActiveSheet()->getStyle('A'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('B'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('C'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('D'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('E'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('F'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('G'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('H'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('I'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('J'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('K'.$numrow)->applyFromArray($style_row);
|
||||
|
||||
|
||||
$no++; // Tambah 1 setiap kali looping
|
||||
$numrow++; // Tambah 1 setiap kali looping
|
||||
}
|
||||
// Set width kolom
|
||||
$excel->getActiveSheet()->getColumnDimension('A')->setWidth(5); // Set width kolom A
|
||||
$excel->getActiveSheet()->getColumnDimension('B')->setWidth(12); // Set width kolom B
|
||||
$excel->getActiveSheet()->getColumnDimension('C')->setWidth(35); // Set width kolom C
|
||||
$excel->getActiveSheet()->getColumnDimension('D')->setWidth(15); // Set width kolom D
|
||||
$excel->getActiveSheet()->getColumnDimension('E')->setWidth(20); // Set width kolom E
|
||||
$excel->getActiveSheet()->getColumnDimension('F')->setWidth(14);
|
||||
$excel->getActiveSheet()->getColumnDimension('G')->setWidth(35);
|
||||
$excel->getActiveSheet()->getColumnDimension('H')->setWidth(14);
|
||||
$excel->getActiveSheet()->getColumnDimension('I')->setWidth(14);
|
||||
$excel->getActiveSheet()->getColumnDimension('J')->setWidth(18);
|
||||
$excel->getActiveSheet()->getColumnDimension('K')->setWidth(14);
|
||||
|
||||
// Set height semua kolom menjadi auto (mengikuti height isi dari kolommnya, jadi otomatis)
|
||||
$excel->getActiveSheet()->getDefaultRowDimension()->setRowHeight(-1);
|
||||
// Set orientasi kertas jadi LANDSCAPE
|
||||
$excel->getActiveSheet()->getPageSetup()->setOrientation(PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE);
|
||||
// Set judul file excel nya
|
||||
$excel->getActiveSheet(0)->setTitle("Data Keseluruhan Pendaftar");
|
||||
$excel->setActiveSheetIndex(0);
|
||||
// Proses file excel
|
||||
header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
|
||||
header('Content-Disposition: attachment; filename="Data Pendaftar Keseluruhan PPDB.xlsx"'); // Set nama file excel nya
|
||||
header('Cache-Control: max-age=0');
|
||||
$write = PHPExcel_IOFactory::createWriter($excel, 'Excel2007');
|
||||
$write->save('php://output');
|
||||
}
|
||||
|
||||
public function cetakpeserta($no_pendaftaran)
|
||||
{
|
||||
$data['data'] = $this->db->get_where('v_rpt_trans_formulir_web',['no_pendaftaran'=>$no_pendaftaran])->row();
|
||||
$this->load->view('peserta/cetak_peserta',$data);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* End of file Peserta.php */
|
||||
/* Location: ./application/controllers/Peserta.php */
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Profil extends CI_Controller {
|
||||
|
||||
public function index()
|
||||
{
|
||||
$data = array( 'title' => 'Data Pengguna User',
|
||||
'content' => 'profil/index'
|
||||
);
|
||||
$this->load->view('layout/wrapper', $data, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
/* End of file Profil.php */
|
||||
/* Location: ./application/controllers/Profil.php */
|
||||
@@ -0,0 +1,219 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Registrasi extends CI_Controller {
|
||||
|
||||
//load model
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('registrasi_model');
|
||||
$this->simple_login->check_login();
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$registrasi = $this->registrasi_model->listing();
|
||||
$total = $this->registrasi_model->total();
|
||||
|
||||
$registrasi = array( 'title' => 'Registrasi PPDB/Salin Slip [ '.$total->total.' ]',
|
||||
'registrasi' => $registrasi,
|
||||
'content' => 'registrasi/index'
|
||||
);
|
||||
$this->load->view('layout/wrapper', $registrasi, FALSE);
|
||||
}
|
||||
|
||||
//Edit user
|
||||
public function edit($no_trans)
|
||||
{
|
||||
//panggil data user yang akan diedit
|
||||
$registrasi = $this->registrasi_model->detail($no_trans);
|
||||
|
||||
|
||||
//validasi input
|
||||
$valid = $this->form_validation;
|
||||
//check nama
|
||||
$valid->set_rules('bayar','Pembayaran','required',
|
||||
array( 'required' => '%s harus diisi'));
|
||||
|
||||
//jika sudah dicek dan error
|
||||
if($valid->run()===FALSE) {
|
||||
//end validasi
|
||||
|
||||
$data= array( 'title' => 'Edit Data Registrasi, No. Transaksi : '.$registrasi->no_trans,
|
||||
'registrasi' => $registrasi,
|
||||
'content' => 'registrasi/edit'
|
||||
);
|
||||
$this->load->view('layout/wrapper', $data, FALSE);
|
||||
//jika validasi oke, masuk database
|
||||
}else{
|
||||
$inp = $this->input;
|
||||
$data = array( 'no_trans' => $no_trans,
|
||||
'bayar' => $inp->post('bayar')
|
||||
);
|
||||
//proses oleh model
|
||||
$this->registrasi_model->edit($data);
|
||||
//notifikasi dan redirect
|
||||
$this->session->set_flashdata('sukses', 'Data Registrasi/Salin Slip '.$registrasi->no_trans.' - '.$registrasi->angsuran.' atas nama '.$registrasi->nama_lengkap.' Telah Diedit');
|
||||
redirect(base_url('registrasi'),'refresh');
|
||||
}
|
||||
//end masuk database
|
||||
}
|
||||
|
||||
//Delete regis
|
||||
public function delete($no_trans)
|
||||
{
|
||||
$data = array('no_trans' => $no_trans);
|
||||
//proses hapus
|
||||
$this->registrasi_model->delete($data);
|
||||
//notifikasi
|
||||
$this->session->set_flashdata('sukses', 'Data registrasi telah dihapus');
|
||||
redirect(base_url('registrasi'),'refresh');
|
||||
}
|
||||
|
||||
//EXPORT NILAI KE EXCEL
|
||||
public function export(){
|
||||
// Load plugin PHPExcel nya
|
||||
include APPPATH.'third_party/PHPExcel/PHPExcel.php';
|
||||
|
||||
// Panggil class PHPExcel nya
|
||||
$excel = new PHPExcel();
|
||||
// Settingan awal fil excel
|
||||
$excel->getProperties()->setCreator('By : 415 DIL')
|
||||
->setLastModifiedBy('By : 415 DIL')
|
||||
->setTitle("Data Registrasi")
|
||||
->setSubject("Registrasi")
|
||||
->setDescription("Laporan Data Registrasi")
|
||||
->setKeywords("Data Registrasi");
|
||||
// Buat sebuah variabel untuk menampung pengaturan style dari header tabel
|
||||
$style_col = array(
|
||||
'font' => array('bold' => true), // Set font nya jadi bold
|
||||
'alignment' => array(
|
||||
'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, // Set text jadi ditengah secara horizontal (center)
|
||||
'vertical' => PHPExcel_Style_Alignment::VERTICAL_CENTER // Set text jadi di tengah secara vertical (middle)
|
||||
),
|
||||
'borders' => array(
|
||||
'top' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border top dengan garis tipis
|
||||
'right' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border right dengan garis tipis
|
||||
'bottom' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border bottom dengan garis tipis
|
||||
'left' => array('style' => PHPExcel_Style_Border::BORDER_THIN) // Set border left dengan garis tipis
|
||||
)
|
||||
);
|
||||
// Buat sebuah variabel untuk menampung pengaturan style dari isi tabel
|
||||
$style_row = array(
|
||||
'alignment' => array(
|
||||
'vertical' => PHPExcel_Style_Alignment::VERTICAL_CENTER // Set text jadi di tengah secara vertical (middle)
|
||||
),
|
||||
'borders' => array(
|
||||
'top' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border top dengan garis tipis
|
||||
'right' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border right dengan garis tipis
|
||||
'bottom' => array('style' => PHPExcel_Style_Border::BORDER_THIN), // Set border bottom dengan garis tipis
|
||||
'left' => array('style' => PHPExcel_Style_Border::BORDER_THIN) // Set border left dengan garis tipis
|
||||
)
|
||||
);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('A1', "DATA REKAP REGISTRASI/SALIN SLIP PPDB SMK AL-MUHTADIN DEPOK"); // Set kolom A1 dengan tulisan "DATA SISWA"
|
||||
$excel->getActiveSheet()->mergeCells('A1:L1'); // Set Merge Cell pada kolom A1 sampai E1
|
||||
$excel->getActiveSheet()->getStyle('A1')->getFont()->setBold(TRUE); // Set bold kolom A1
|
||||
$excel->getActiveSheet()->getStyle('A1')->getFont()->setSize(15); // Set font size 15 untuk kolom A1
|
||||
$excel->getActiveSheet()->getStyle('A1')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER); // Set text center untuk kolom A1
|
||||
// Buat header tabel nya pada baris ke 3
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('A3', "NO."); // Set kolom A3 dengan tulisan "NO"
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('B3', "NO. PEND"); // Set kolom B3 dengan tulisan "NO.PEND"
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('C3', "NAMA LENGKAP"); // Set kolom C3 dengan tulisan "NAMA"
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('D3', "SEKOLAH ASAL"); // Set kolom E3 dengan tulisan "SEKOLAH"
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('E3', "KOMPETENSI");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('F3', "GELOMBANG");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('G3', "TGL. SALIN");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('H3', "NO. TRANSAKSI");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('I3', "KETENTUAN BIAYA");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('J3', "KET. ANGSURAN");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('K3', "SUDAH DIBAYARKAN");
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('L3', "PETUGAS");
|
||||
|
||||
|
||||
// Apply style header yang telah kita buat tadi ke masing-masing kolom header
|
||||
$excel->getActiveSheet()->getStyle('A3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('B3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('C3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('D3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('E3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('F3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('G3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('H3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('I3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('J3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('K3')->applyFromArray($style_col);
|
||||
$excel->getActiveSheet()->getStyle('L3')->applyFromArray($style_col);
|
||||
|
||||
|
||||
// Panggil function view yang ada di registrasi_model untuk menampilkan semua data registrasinya
|
||||
$registrasi = $this->registrasi_model->ViewUrut();
|
||||
$no = 1; // Untuk penomoran tabel, di awal set dengan 1
|
||||
$numrow = 4; // Set baris pertama untuk isi tabel adalah baris ke 4
|
||||
foreach($registrasi as $data){ // Lakukan looping pada variabel registrasi
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('A'.$numrow, $no);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('B'.$numrow, $data->no_pendaftaran);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('C'.$numrow, $data->nama_lengkap);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('D'.$numrow, $data->sekolah_asal);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('E'.$numrow, $data->kd_kompetensi);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('F'.$numrow, $data->gelombang);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('G'.$numrow, $data->tgl_bayar);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('H'.$numrow, $data->no_trans);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('I'.$numrow, $data->ketentuan);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('J'.$numrow, $data->angsuran);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('K'.$numrow, $data->bayar);
|
||||
$excel->setActiveSheetIndex(0)->setCellValue('L'.$numrow, $data->operator);
|
||||
|
||||
|
||||
// Apply style row yang telah kita buat tadi ke masing-masing baris (isi tabel)
|
||||
$excel->getActiveSheet()->getStyle('A'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('B'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('C'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('D'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('E'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('F'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('G'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('H'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('I'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('J'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('K'.$numrow)->applyFromArray($style_row);
|
||||
$excel->getActiveSheet()->getStyle('L'.$numrow)->applyFromArray($style_row);
|
||||
|
||||
|
||||
$no++; // Tambah 1 setiap kali looping
|
||||
$numrow++; // Tambah 1 setiap kali looping
|
||||
}
|
||||
// Set width kolom
|
||||
$excel->getActiveSheet()->getColumnDimension('A')->setWidth(5); // Set width kolom A
|
||||
$excel->getActiveSheet()->getColumnDimension('B')->setWidth(12); // Set width kolom B
|
||||
$excel->getActiveSheet()->getColumnDimension('C')->setWidth(35); // Set width kolom C
|
||||
$excel->getActiveSheet()->getColumnDimension('D')->setWidth(35); // Set width kolom D
|
||||
$excel->getActiveSheet()->getColumnDimension('E')->setWidth(13); // Set width kolom E
|
||||
$excel->getActiveSheet()->getColumnDimension('F')->setWidth(15);
|
||||
$excel->getActiveSheet()->getColumnDimension('G')->setWidth(13);
|
||||
$excel->getActiveSheet()->getColumnDimension('H')->setWidth(15);
|
||||
$excel->getActiveSheet()->getColumnDimension('I')->setWidth(18);
|
||||
$excel->getActiveSheet()->getColumnDimension('J')->setWidth(16);
|
||||
$excel->getActiveSheet()->getColumnDimension('K')->setWidth(19);
|
||||
$excel->getActiveSheet()->getColumnDimension('L')->setWidth(15);
|
||||
|
||||
|
||||
// Set height semua kolom menjadi auto (mengikuti height isi dari kolommnya, jadi otomatis)
|
||||
$excel->getActiveSheet()->getDefaultRowDimension()->setRowHeight(-1);
|
||||
// Set orientasi kertas jadi LANDSCAPE
|
||||
$excel->getActiveSheet()->getPageSetup()->setOrientation(PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE);
|
||||
// Set judul file excel nya
|
||||
$excel->getActiveSheet(0)->setTitle("Data Rekap Registrasi PPDB");
|
||||
$excel->setActiveSheetIndex(0);
|
||||
// Proses file excel
|
||||
header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
|
||||
header('Content-Disposition: attachment; filename="Data Rekap Registrasi PPDB.xlsx"'); // Set nama file excel nya
|
||||
header('Cache-Control: max-age=0');
|
||||
$write = PHPExcel_IOFactory::createWriter($excel, 'Excel2007');
|
||||
$write->save('php://output');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* End of file registrasi.php */
|
||||
/* Location: ./application/controllers/registrasi.php */
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Setting extends CI_Controller {
|
||||
|
||||
//load model
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('setting_model');
|
||||
$this->load->model('peserta_model');
|
||||
|
||||
$this->simple_login->check_login();
|
||||
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$setting = $this->setting_model->listing();
|
||||
$total = $this->peserta_model->total();
|
||||
|
||||
$data = array( 'title' => 'Data Pendaftar PPDB [ '.$total->total.' ]',
|
||||
'setting' => $setting ,
|
||||
'content' => 'formdaftar/index'
|
||||
|
||||
);
|
||||
$this->load->view('layout/wrapper', $data, FALSE);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/* End of file Peserta.php */
|
||||
/* Location: ./application/controllers/Peserta.php */
|
||||
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Sosialisasi extends CI_Controller {
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('setting_model');
|
||||
//proteksi halaman
|
||||
$this->simple_login->check_login();
|
||||
|
||||
}
|
||||
|
||||
//Main page biodata
|
||||
public function index()
|
||||
{
|
||||
$sosialisasi = $this->setting_model->sosialisasi();
|
||||
|
||||
$data = array( 'title' => 'Aplikasi PPDB MTD - Pengaturan Sosialisasi Tes Akademik & BTQ',
|
||||
'sosialisasi' => $sosialisasi,
|
||||
'content' => 'sosialisasi/edit'
|
||||
);
|
||||
$this->load->view('layout/wrapper', $data, FALSE);
|
||||
}
|
||||
|
||||
//Edit Pengaturan
|
||||
public function edit()
|
||||
{
|
||||
|
||||
//validasi input
|
||||
$valid = $this->form_validation;
|
||||
//check nama
|
||||
$valid->set_rules('tempat','Pilih Tombol','required',
|
||||
array( 'required' => '%s Edit Tempat'));
|
||||
|
||||
//jika sudah dicek dan error
|
||||
if($valid->run()===FALSE) {
|
||||
//end validasi
|
||||
|
||||
$data= array( 'title' => 'Edit Data Sosialisasi',
|
||||
'content' => 'sosialisasi/edit'
|
||||
);
|
||||
$this->load->view('layout/wrapper', $data, FALSE);
|
||||
//jika validasi oke, masuk database
|
||||
}else{
|
||||
$inp = $this->input;
|
||||
$data = array(
|
||||
'tanggal' => date('Y-m-d',strtotime($inp->post('tanggal'))),
|
||||
'waktu' => $inp->post('waktu'),
|
||||
'tempat' => $inp->post('tempat')
|
||||
);
|
||||
//proses oleh model
|
||||
$this->setting_model->edit6($data);
|
||||
|
||||
//notifikasi dan redirect
|
||||
$this->session->set_flashdata('sukses', 'Pengaturan Sosialisasi Tes Berhasil di Update.');
|
||||
redirect(base_url('sosialisasi'),'refresh');
|
||||
}
|
||||
//end masuk database
|
||||
}
|
||||
}
|
||||
|
||||
/* End of file biodata.php */
|
||||
/* Location: ./application/controllers/biodata.php */
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Tkj extends CI_Controller {
|
||||
|
||||
//load model
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('tkj_model');
|
||||
$this->simple_login->check_login();
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$tkj = $this->tkj_model->tkj();
|
||||
$total = $this->tkj_model->total();
|
||||
|
||||
$data = array( 'title' => 'Data Pendaftar TJKT [ '.$total->total.' ]',
|
||||
'tkj' => $tkj,
|
||||
'content' => 'tkj/index'
|
||||
);
|
||||
$this->load->view('layout/wrapper', $data, FALSE);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,149 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class User extends CI_Controller {
|
||||
|
||||
//load model
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('user_model');
|
||||
//proteksi halaman
|
||||
$this->simple_login->check_login();
|
||||
//ptoteksi admin
|
||||
if($this->session->userdata('level') !='Administrator')
|
||||
{
|
||||
//kalau bukan adamin, lempar ke login
|
||||
$this->session->set_flashdata('warning', 'Hak akses anda tidak diijinkan mengakses menu pengguna');
|
||||
redirect(base_url('login'),'refresh');
|
||||
}
|
||||
}
|
||||
//Data user
|
||||
public function index()
|
||||
{
|
||||
$user = $this->user_model->listing();
|
||||
$total = $this->user_model->total();
|
||||
|
||||
//validasi input
|
||||
$valid = $this->form_validation;
|
||||
//check nama
|
||||
$valid->set_rules('nama','Nama Lengkap','required',
|
||||
array( 'required' => '%s harus diisi...'));
|
||||
//check email
|
||||
$valid->set_rules('email','Email','required|valid_email',
|
||||
array( 'required' => '%s harus diisi',
|
||||
'valid_email' => '%s tidak valid. Masukan email yang benar'));
|
||||
//check username
|
||||
$valid->set_rules('userid','Userid','required|is_unique[user2.userid]',
|
||||
array( 'required' => '%s harus diisi',
|
||||
'is_unique' => '%s sudah ada. Buat userid baru'));
|
||||
//check password
|
||||
$valid->set_rules('password','Password','required|min_length[6]|max_length[32]',
|
||||
array( 'required' => '%s harus diisi',
|
||||
'min_length' => '%s minimal 6 karakter',
|
||||
'max_length' => '%s maksimal 32 karakter'));
|
||||
//jika sudah dicek dan error
|
||||
if($valid->run()===FALSE) {
|
||||
//end validasi
|
||||
|
||||
$data = array( 'title' => 'Data Pengguna User [ '.$total->total.' ]',
|
||||
'user' => $user,
|
||||
'content' => 'user/index'
|
||||
);
|
||||
$this->load->view('layout/wrapper', $data, FALSE);
|
||||
//jika validasi oke, masuk database
|
||||
}else{
|
||||
$inp = $this->input;
|
||||
$data = array( 'nama' => $inp->post('nama'),
|
||||
'email' => $inp->post('email'),
|
||||
'userid' => $inp->post('userid'),
|
||||
'password' => MD5($inp->post('password')),
|
||||
'level' => $inp->post('level'),
|
||||
'gambar' => $inp->post('gambar'),
|
||||
);
|
||||
//proses oleh model
|
||||
$this->user_model->tambah($data);
|
||||
//notifikasi dan redirect
|
||||
$this->session->set_flashdata('sukses', 'Data user telah ditambah');
|
||||
redirect(base_url('user'),'refresh');
|
||||
}
|
||||
//end masuk database
|
||||
}
|
||||
|
||||
//Edit user
|
||||
public function edit($id)
|
||||
{
|
||||
//panggil data user yang akan diedit
|
||||
$user = $this->user_model->detail($id);
|
||||
|
||||
|
||||
//validasi input
|
||||
$valid = $this->form_validation;
|
||||
//check nama
|
||||
$valid->set_rules('nama','Nama Lengkap','required',
|
||||
array( 'required' => '%s harus diisi'));
|
||||
//check email
|
||||
$valid->set_rules('email','Email','required|valid_email',
|
||||
array( 'required' => '%s harus diisi',
|
||||
'valid_email' => '%s tidak valid. Masukan email yang benar'));
|
||||
//check password
|
||||
$valid->set_rules('password','Password','required|min_length[6]|max_length[32]',
|
||||
array( 'required' => '%s harus diisi',
|
||||
'min_length' => '%s minimal 6 karakter',
|
||||
'max_length' => '%s maksimal 32 karakter'));
|
||||
|
||||
//jika sudah dicek dan error
|
||||
if($valid->run()===FALSE) {
|
||||
//end validasi
|
||||
|
||||
$data = array( 'title' => 'Edit Data User : '.$user->nama,
|
||||
'user' => $user,
|
||||
'content' => 'user/edit'
|
||||
);
|
||||
$this->load->view('layout/wrapper', $data, FALSE);
|
||||
//jika validasi oke, masuk database
|
||||
}else{
|
||||
$inp = $this->input;
|
||||
//check panjang password, jika lebih 6 karakter maka password diganti
|
||||
//jika password lebih dari 32 maka password tidak diganti
|
||||
if(strlen($inp->post('password')) >= 6 || strlen($inp->post('password')) <= 32) {
|
||||
//password diganti
|
||||
$data = array( 'id' => $id,
|
||||
'nama' => $inp->post('nama'),
|
||||
'email' => $inp->post('email'),
|
||||
'password' => MD5($inp->post('password')),
|
||||
'level' => $inp->post('level'),
|
||||
);
|
||||
}else{
|
||||
//jika kurang dari 6 atau lebih dari 32 maka tidak diganti
|
||||
$data = array( 'id' => $id,
|
||||
'nama' => $inp->post('nama'),
|
||||
'email' => $inp->post('email'),
|
||||
'level' => $inp->post('level'),
|
||||
);
|
||||
}
|
||||
//proses oleh model
|
||||
$this->user_model->edit($data);
|
||||
//notifikasi dan redirect
|
||||
$this->session->set_flashdata('sukses', 'Data user '.$user->nama.' telah diedit');
|
||||
redirect(base_url('user'),'refresh');
|
||||
}
|
||||
//end masuk database
|
||||
}
|
||||
|
||||
//Delete user
|
||||
public function delete($id)
|
||||
{
|
||||
$data = array('id' => $id);
|
||||
//proses hapus
|
||||
$this->user_model->delete($data);
|
||||
//notifikasi
|
||||
$this->session->set_flashdata('sukses', 'Data user telah dihapus');
|
||||
redirect(base_url('user'),'refresh');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/* End of file User.php */
|
||||
/* Location: ./application/controllers/User.php */
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Welcome extends CI_Controller {
|
||||
|
||||
/**
|
||||
* Index Page for this controller.
|
||||
*
|
||||
* Maps to the following URL
|
||||
* http://example.com/index.php/welcome
|
||||
* - or -
|
||||
* http://example.com/index.php/welcome/index
|
||||
* - or -
|
||||
* Since this controller is set as the default controller in
|
||||
* config/routes.php, it's displayed at http://example.com/
|
||||
*
|
||||
* So any other public methods not prefixed with an underscore will
|
||||
* map to /index.php/welcome/<method_name>
|
||||
* @see https://codeigniter.com/user_guide/general/urls.html
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$this->load->view('welcome_message');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>403 Forbidden</title>
|
||||
<link rel="shortcut icon" href="assets/file/Logo.png" />
|
||||
<!-- Main content -->
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<p>Directory access is forbidden.</p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
Class Laporanpdf extends CI_Controller{
|
||||
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
$this->load->library('pdf');
|
||||
}
|
||||
|
||||
function index(){
|
||||
$pdf = new FPDF('p','mm','A4');
|
||||
// membuat halaman baru
|
||||
$pdf->AddPage();
|
||||
// setting jenis font yang akan digunakan
|
||||
$pdf->SetFont('Arial','B',16);
|
||||
// mencetak string
|
||||
$pdf->Cell(190,7,'LAPORAN REKAP DATA BERKAS PPDB',0,1,'C');
|
||||
$pdf->SetFont('Arial','B',12);
|
||||
$pdf->Cell(190,7,'SMK AL-MUHTADIN DEPOK',0,1,'C');
|
||||
// Memberikan space kebawah agar tidak terlalu rapat
|
||||
$pdf->Cell(10,7,'',0,1);
|
||||
$pdf->SetFont('Arial','B',10);
|
||||
$pdf->Cell(20,6,'NO. PEND',1,0);
|
||||
$pdf->Cell(85,6,'NAMA SISWA',1,0);
|
||||
$pdf->Cell(30,6,'TEMPAT LAHIR',1,0);
|
||||
$pdf->Cell(33,6,'TANGGAL LAHIR',1,1);
|
||||
$pdf->SetFont('Arial','',10);
|
||||
$siswa = $this->db->get('data_siswa')->result();
|
||||
foreach ($siswa as $row){
|
||||
$pdf->Cell(20,6,$row->no_pendaftaran,1,0);
|
||||
$pdf->Cell(85,6,$row->nama_lengkap,1,0);
|
||||
$pdf->Cell(30,6,$row->tempat_lahir,1,0);
|
||||
$pdf->Cell(33,6,$row->tgl_lahir,1,1);
|
||||
}
|
||||
$pdf->Output();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
tes CI_Controller
|
||||
Reference in New Issue
Block a user