48 lines
1.2 KiB
PHP
48 lines
1.2 KiB
PHP
<?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);
|
|
}
|
|
|
|
}
|
|
|