Struktur ulang: memindahkan sistem ke folder public untuk Nginx
This commit is contained in:
@@ -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 */
|
||||
Reference in New Issue
Block a user