Struktur ulang: memindahkan sistem ke folder public untuk Nginx

This commit is contained in:
atuy
2026-06-26 17:48:01 +07:00
parent f6ff2d5d9d
commit f015774d4e
3283 changed files with 0 additions and 0 deletions
@@ -0,0 +1,49 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Animasi_model extends CI_Model {
public function __construct()
{
parent::__construct();
$this->load->database();
}
//ambil data nilai
public function listing()
{
$this->db->select('*');
$this->db->from('v_rpt_trans_formulir');
$this->db->order_by('no_pendaftaran','desc');
$query = $this->db->get();
return $query->result();
}
//hitung total siswa
public function total()
{
$this->db->select('COUNT(*) AS total');
$this->db->from('v_rpt_trans_formulir');
//where
$this->db->where('kd_kompetensi','ANIMASI');
$this->db->order_by('no_pendaftaran','desc');
$query = $this->db->get();
return $query->row();
}
// Total nilai animasi
public function animasi()
{
$this->db->select('*');
$this->db->from('v_rpt_trans_formulir');
//where
$this->db->where('kd_kompetensi','ANIMASI');
$this->db->order_by('no_pendaftaran','desc');
$query = $this->db->get();
return $query->result();
}
}
@@ -0,0 +1,102 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Belumlulustes_model extends CI_Model {
public function __construct()
{
parent::__construct();
$this->load->database();
$this->load->library('pdf');
}
//ambil data data
public function listing()
{
$this->db->select('*');
$this->db->from('v_rpt_data_pengumuman');
$this->db->order_by('tanggal_pengumuman','desc');
$query = $this->db->get();
return $query->result();
}
//ambil detail data data
public function detail($no_pendaftaran)
{
$this->db->select('*');
$this->db->from('v_rpt_data_pengumuman');
//where
$this->db->where('no_pendaftaran', $no_pendaftaran);
$this->db->order_by('no_pendaftaran','desc');
$query = $this->db->get();
return $query->row();
}
// Total nilai belum lulus
public function belumlulus()
{
$this->db->select('*');
$this->db->from('v_rpt_data_pengumuman');
//where
$this->db->where('status','BELUM LULUS');
$this->db->order_by('no_pendaftaran','desc');
$query = $this->db->get();
return $query->result();
}
//ambil detail data data
public function setting()
{
$this->db->select('*');
$this->db->from('setting');
$this->db->order_by('id','desc');
$query = $this->db->get();
return $query->result();
}
//hitung total data
public function total()
{
$this->db->select('COUNT(*) AS total');
$this->db->from('v_rpt_data_pengumuman');
//where
$this->db->where('status','BELUM LULUS');
$this->db->order_by('no_pendaftaran','desc');
$query = $this->db->get();
return $query->row();
}
//fungsi edit
public function edit($data)
{
$this->db->where('no_pendaftaran', $data['no_pendaftaran']);
$this->db->update('pengumuman', $data);
}
//fungsi delete
public function delete($data)
{
$this->db->where('no_pendaftaran', $data['no_pendaftaran']);
$this->db->delete('pengumuman', $data);
}
//fungsi delete
public function delete2($data2)
{
$this->db->where('userid', $data2['userid']);
$this->db->delete('user2', $data2);
}
//tambah user
public function tambah($data)
{
$this->db->insert('pengumuman', $data);
}
//tambah user
public function tambah2($data2)
{
$this->db->insert('user2', $data2);
}
}
@@ -0,0 +1,104 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Biayaformulir_model extends CI_Model {
public function __construct()
{
parent::__construct();
$this->load->database();
}
public function viewByNoInvoice($no_pendaftaran){
$cari = $this->db->get_where("invoice", ["no_pendaftaran" => $no_pendaftaran])->num_rows();
if ($cari < 1) {
$this->db->select('data_siswa.*,
(CASE
WHEN data_siswa.kd_kompetensi = "TJKT" THEN (SELECT biaya_tkj FROM biaya_ppdb LIMIT 1)
ELSE (SELECT biaya_otkp FROM biaya_ppdb LIMIT 1)
END) AS biaya_pendaftaran');
$this->db->from('data_siswa');
$this->db->where('data_siswa.no_pendaftaran', $no_pendaftaran);
$result = $this->db->get()->row(); // Tampilkan data
return $result;
}
else {
return null;
}
}
public function viewByNo($no_pendaftaran) {
$sql = "SELECT * FROM data_siswa
WHERE no_pendaftaran = ?
AND no_pendaftaran NOT IN (
SELECT no_pendaftaran FROM tr_formulir
)";
$query = $this->db->query($sql, array($no_pendaftaran));
$result = $query->row(); // Ambil hasil query
return $result;
}
public function ViewUrut()
{
$this->db->select('*');
$this->db->from('v_rpt_trans_formulir');
$this->db->order_by('no_trans','ASC');
$query = $this->db->get();
return $query->result();
}
public function viewByNo2($no_pendaftaran){
$this->db->where('no_pendaftaran', $no_pendaftaran);
$result = $this->db->get('v_rpt_data_pengumuman')->row(); // Tampilkan data
return $result;
}
//ambil data user
public function listing()
{
$this->db->select('*');
$this->db->from('nilai_tes');
$this->db->order_by('no_pendaftaran','desc');
$query = $this->db->get();
return $query->result();
}
//hitung total tes
public function total()
{
$this->db->select('COUNT(*) AS total');
$this->db->from('tr_formulir');
$this->db->order_by('no_pendaftaran','desc');
$query = $this->db->get();
return $query->row();
}
//tambah nilai
public function tambah($data)
{
$this->db->insert('nilai_tes', $data);
}
//fungsi delete
public function delete($data)
{
$this->db->where('no_pendaftaran', $data['no_pendaftaran']);
$this->db->delete('tr_formulir', $data);
}
//ubah status
public function edit($data2)
{
$this->db->where('no_pendaftaran', $data2['no_pendaftaran']);
$this->db->update('data_siswa', $data2);
}
}
@@ -0,0 +1,117 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Biayaformulir_model extends CI_Model {
public function __construct()
{
parent::__construct();
$this->load->database();
}
public function viewByNoInvoice($no_pendaftaran){
$cari = $this->db->get_where("invoice", ["no_pendaftaran" => $no_pendaftaran])->num_rows();
if ($cari < 1) {
$this->db->select('data_siswa.*,
(CASE
WHEN data_siswa.kd_kompetensi = "TJKT" THEN (SELECT biaya_tkj FROM biaya_ppdb LIMIT 1)
WHEN data_siswa.kd_kompetensi = "MPLB" THEN (SELECT biaya_otkp FROM biaya_ppdb LIMIT 1)
WHEN data_siswa.kd_kompetensi = "ANIMASI" THEN (SELECT biaya_animasi FROM biaya_ppdb LIMIT 1)
ELSE (SELECT biaya_kuliner FROM biaya_ppdb LIMIT 1)
END) AS biaya_pendaftaran');
$this->db->from('data_siswa');
$this->db->where('data_siswa.no_pendaftaran', $no_pendaftaran);
$result = $this->db->get()->row(); // Tampilkan data
return $result;
}
else {
return null;
}
}
public function viewByNo($no_pendaftaran) {
$sql = "SELECT * FROM data_siswa
WHERE no_pendaftaran = ?
AND no_pendaftaran NOT IN (
SELECT no_pendaftaran FROM tr_formulir
)";
$query = $this->db->query($sql, array($no_pendaftaran));
$result = $query->row(); // Ambil hasil query
return $result;
}
public function ViewUrut()
{
$this->db->select('*');
$this->db->from('v_rpt_trans_formulir');
$this->db->order_by('no_trans','ASC');
$query = $this->db->get();
return $query->result();
}
public function viewByNo2($no_pendaftaran){
$this->db->where('no_pendaftaran', $no_pendaftaran);
$result = $this->db->get('v_rpt_data_pengumuman')->row(); // Tampilkan data
return $result;
}
//ambil data user
public function listing()
{
$this->db->select('*');
$this->db->from('nilai_tes');
$this->db->order_by('no_pendaftaran','desc');
$query = $this->db->get();
return $query->result();
}
//hitung total tes
public function total()
{
$this->db->select('COUNT(*) AS total');
$this->db->from('tr_formulir');
$this->db->order_by('no_pendaftaran','desc');
$query = $this->db->get();
return $query->row();
}
//hitung get siswa
public function get_siswa()
{
$this->db->select('*');
$this->db->from('data_siswa');
$this->db->order_by('no_pendaftaran','desc');
$query = $this->db->get();
return $query->result();
}
//tambah nilai
public function tambah($data)
{
$this->db->insert('nilai_tes', $data);
}
//fungsi delete
public function delete($data)
{
$this->db->where('no_pendaftaran', $data['no_pendaftaran']);
$this->db->delete('tr_formulir', $data);
}
//ubah status
public function edit($data2)
{
$this->db->where('no_pendaftaran', $data2['no_pendaftaran']);
$this->db->update('data_siswa', $data2);
}
}
@@ -0,0 +1,86 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Biodata_model extends CI_Model {
public function __construct()
{
parent::__construct();
$this->load->database();
}
public function user2($no_pendaftaran)
{
$this->db->select('*');
$this->db->from('data_siswa');
$this->db->where('no_pendaftaran', $no_pendaftaran);
$this->db->order_by('no_pendaftaran','desc');
$query = $this->db->get();
return $query->row();
}
public function user3($no_pendaftaran)
{
$this->db->select('*');
$this->db->from('v_rpt_data_pengumuman');
$this->db->where('no_pendaftaran', $no_pendaftaran);
$this->db->order_by('no_pendaftaran','desc');
$query = $this->db->get();
return $query->row();
}
public function berkas($no_pendaftaran)
{
$this->db->select('*');
$this->db->from('v_rpt_trans_berkas');
$this->db->where('no_pendaftaran', $no_pendaftaran);
$this->db->order_by('no_pendaftaran','desc');
$query = $this->db->get();
return $query->row();
}
public function menu()
{
$this->db->select('*');
$this->db->from('pengaturan');
//where
$this->db->where('pengaturan_slug','menu_edit_ops');
$this->db->order_by('pengaturan_slug','desc');
$query = $this->db->get();
return $query->row();
}
public function menu2()
{
$this->db->select('*');
$this->db->from('pengaturan');
//where
$this->db->where('pengaturan_slug','menu_edit_tgllahir');
$this->db->order_by('pengaturan_slug','desc');
$query = $this->db->get();
return $query->row();
}
public function menu_psswd()
{
$this->db->select('*');
$this->db->from('pengaturan');
//where
$this->db->where('pengaturan_slug','menu_edit_psswd');
$this->db->order_by('pengaturan_slug','desc');
$query = $this->db->get();
return $query->row();
}
//ubah peserta
public function edit($data)
{
$this->db->where('no_pendaftaran', $data['no_pendaftaran']);
$this->db->update('data_siswa', $data);
}
}
/* End of file Dashboard_model.php */
/* Location: ./application/models/Dashboard_model.php */
@@ -0,0 +1,293 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Dashboard_model extends CI_Model {
public function __construct()
{
parent::__construct();
$this->load->database();
}
// Total user
public function user()
{
$this->db->select('COUNT(*) AS total');
$this->db->from('user2');
$query = $this->db->get();
return $query->row();
}
// Total pendaftar
public function pendaftar()
{
$this->db->select('COUNT(*) AS total');
$this->db->from('tr_formulir');
$query = $this->db->get();
return $query->row();
}
// Total formulir
public function formulir()
{
$this->db->select('COUNT(*) AS total');
$this->db->from('tr_data');
$query = $this->db->get();
return $query->row();
}
// Total nilai tes
public function nilai()
{
$this->db->select('COUNT(*) AS total');
$this->db->from('v_rpt_nilai_tes');
$query = $this->db->get();
return $query->row();
}
// Total otkp/mplb
public function otkp()
{
$this->db->select('COUNT(*) AS total');
$this->db->from('v_rpt_trans_formulir');
//where
$this->db->where('kd_kompetensi','MPLB');
$this->db->order_by('kd_kompetensi','desc');
$query = $this->db->get();
return $query->row();
}
// Total tkj/tjkt
public function tkj()
{
$this->db->select('COUNT(*) AS total');
$this->db->from('v_rpt_trans_formulir');
//where
$this->db->where('kd_kompetensi','TJKT');
$this->db->order_by('kd_kompetensi','desc');
$query = $this->db->get();
return $query->row();
}
// Total animasi
public function animasi()
{
$this->db->select('COUNT(*) AS total');
$this->db->from('v_rpt_trans_formulir');
//where
$this->db->where('kd_kompetensi','ANIMASI');
$this->db->order_by('kd_kompetensi','desc');
$query = $this->db->get();
return $query->row();
}
// Total kuliner
public function kuliner()
{
$this->db->select('COUNT(*) AS total');
$this->db->from('v_rpt_trans_formulir');
//where
$this->db->where('kd_kompetensi','KULINER');
$this->db->order_by('kd_kompetensi','desc');
$query = $this->db->get();
return $query->row();
}
// Total lulus
public function lulus()
{
$this->db->select('COUNT(*) AS total');
$this->db->from('v_rpt_data_pengumuman');
//where
$this->db->where('status','LULUS');
$this->db->order_by('status','desc');
$query = $this->db->get();
return $query->row();
}
// Total belum lulus
public function belumlulus()
{
$this->db->select('COUNT(*) AS total');
$this->db->from('v_rpt_data_pengumuman');
//where
$this->db->where('status','BELUM LULUS');
$this->db->order_by('status','desc');
$query = $this->db->get();
return $query->row();
}
// Total gel.1
public function gel1()
{
$this->db->select('COUNT(*) AS total');
$this->db->from('v_rpt_trans_formulir');
//where
$this->db->where('gelombang','Gelombang 1');
$this->db->order_by('gelombang','desc');
$query = $this->db->get();
return $query->row();
}
// Total gel.2
public function gel2()
{
$this->db->select('COUNT(*) AS total');
$this->db->from('v_rpt_trans_formulir');
//where
$this->db->where('gelombang','Gelombang 2');
$this->db->order_by('gelombang','desc');
$query = $this->db->get();
return $query->row();
}
// Total gel
public function gelombang()
{
$this->db->select('*');
$this->db->from('setting');
//where
$this->db->where('id','1');
$this->db->order_by('gelombang','desc');
$query = $this->db->get();
return $query->row();
}
// Total invoice
public function invoice()
{
$this->db->select('COUNT(*) AS total');
$this->db->from('v_rpt_data_invoice');
$query = $this->db->get();
return $query->row();
}
// Total registrasi
public function registrasi()
{
$this->db->select('COUNT(*) AS total');
$this->db->from('v_rpt_trans_invoice');
$query = $this->db->get();
return $query->row();
}
// Total kunjungan
public function pendaftaran()
{
$this->db->select('tgl_trans, COUNT(*) AS total');
$this->db->from('tr_formulir');
$this->db->group_by('tgl_trans');
$this->db->order_by('tgl_trans', 'desc');
$this->db->limit(14);
$query = $this->db->get();
return $query->result();
}
public function user2($no_pendaftaran)
{
$this->db->select('*');
$this->db->from('data_siswa');
$this->db->where('no_pendaftaran', $no_pendaftaran);
$this->db->order_by('no_pendaftaran','desc');
$query = $this->db->get();
return $query->row();
}
public function user_login($id)
{
$this->db->select('*');
$this->db->from('user2');
$this->db->where('id', $id);
$this->db->order_by('id','desc');
$query = $this->db->get();
return $query->row();
}
public function admin()
{
$this->db->select('*');
$this->db->from('informasi');
$this->db->where('id', '1');
$this->db->order_by('id','desc');
$query = $this->db->get();
return $query->row();
}
public function tp()
{
$this->db->select('*');
$this->db->from('setting');
$this->db->where('id','1');
$this->db->order_by('tp','desc');
$query = $this->db->get();
return $query->row();
}
public function penguji()
{
$this->db->select('*');
$this->db->from('informasi');
$this->db->where('id', '3');
$this->db->order_by('id','desc');
$query = $this->db->get();
return $query->row();
}
public function peserta()
{
$this->db->select('*');
$this->db->from('informasi');
$this->db->where('id', '3');
$this->db->order_by('id','desc');
$query = $this->db->get();
return $query->row();
}
public function menu()
{
$this->db->select('*');
$this->db->from('pengaturan');
//where
$this->db->where('pengaturan_slug','menu_edit_ops');
$this->db->order_by('pengaturan_slug','desc');
$query = $this->db->get();
return $query->row();
}
public function menu_psswd()
{
$this->db->select('*');
$this->db->from('pengaturan');
//where
$this->db->where('pengaturan_slug','menu_edit_psswd');
$this->db->order_by('pengaturan_slug','desc');
$query = $this->db->get();
return $query->row();
}
public function sekolah()
{
$this->db->select('*');
$this->db->from('pengaturan');
//where
$this->db->where('pengaturan_slug','sekolah');
$this->db->order_by('pengaturan_slug','desc');
$query = $this->db->get();
return $query->row();
}
//ubah peserta
public function edit($data)
{
$this->db->where('no_pendaftaran', $data['no_pendaftaran']);
$this->db->update('data_siswa', $data);
}
}
/* End of file Dashboard_model.php */
/* Location: ./application/models/Dashboard_model.php */
+31
View File
@@ -0,0 +1,31 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class File extends CI_Model{
/*
* get rows from the files table
*/
function getRows($params = array()){
$this->db->select('*');
$this->db->from('data_siswa');
$this->db->where('no_pendaftaran','102223001');
$this->db->order_by('no_pendaftaran','desc');
if(array_key_exists('no_pendaftaran',$params) && !empty($params['no_pendaftaran'])){
$this->db->where('no_pendaftaran',$params['no_pendaftaran']);
//get records
$query = $this->db->get();
$result = ($query->num_rows() > 0)?$query->row_array():FALSE;
}else{
//set start and limit
if(array_key_exists("start",$params) && array_key_exists("limit",$params)){
$this->db->limit($params['limit'],$params['start']);
}elseif(!array_key_exists("start",$params) && array_key_exists("limit",$params)){
$this->db->limit($params['limit']);
}
//get records
$query = $this->db->get();
$result = ($query->num_rows() > 0)?$query->result_array():FALSE;
}
//return fetched data
return $result;
}
}
@@ -0,0 +1,118 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Formulir_model extends CI_Model {
public function __construct()
{
parent::__construct();
$this->load->database();
$this->load->library('pdf');
}
//ambil data data
public function listing()
{
$this->db->select('*');
$this->db->from('v_rpt_trans_berkas');
$this->db->order_by('tgl_update','desc');
$query = $this->db->get();
return $query->result();
}
//ambil detail data data
public function detail($no_pendaftaran)
{
$this->db->select('*');
$this->db->from('v_rpt_trans_berkas');
//where
$this->db->where('no_pendaftaran', $no_pendaftaran);
$this->db->order_by('no_pendaftaran','desc');
$query = $this->db->get();
return $query->row();
}
//ambil detail data data
public function setting()
{
$this->db->select('*');
$this->db->from('setting');
$this->db->order_by('id','desc');
$query = $this->db->get();
return $query->result();
}
//hitung get siswa
public function get_siswa()
{
$this->db->select('*');
$this->db->from('data_siswa');
$this->db->order_by('no_pendaftaran','desc');
$query = $this->db->get();
return $query->result();
}
public function viewByNo($no_pendaftaran) {
$sql = "SELECT * FROM data_siswa
WHERE no_pendaftaran = ?
AND no_pendaftaran NOT IN (
SELECT no_pendaftaran FROM tr_data
)";
$query = $this->db->query($sql, array($no_pendaftaran));
$result = $query->row(); // Ambil hasil query
return $result;
}
//hitung total data
public function total()
{
$this->db->select('COUNT(*) AS total');
$this->db->from('v_rpt_trans_berkas');
$this->db->order_by('no_pendaftaran','desc');
$query = $this->db->get();
return $query->row();
}
//fungsi edit
public function edit($data)
{
$this->db->where('no_pendaftaran', $data['no_pendaftaran']);
$this->db->update('tr_data', $data);
}
//fungsi delete
public function delete($data)
{
$this->db->where('no_pendaftaran', $data['no_pendaftaran']);
$this->db->delete('tr_data', $data);
}
//tambah user
public function tambah($data)
{
$this->db->insert('tr_data', $data);
}
//ambil data ViewUrut
public function ViewUrut()
{
$this->db->select('*');
$this->db->from('v_rpt_trans_berkas');
$this->db->order_by('no_pendaftaran','ASC');
$query = $this->db->get();
return $query->result();
}
}
/* End of file Pendaftar_model.php */
/* Location: ./application/models/Pendaftar_model.php */
+39
View File
@@ -0,0 +1,39 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class GambarModel extends CI_Model {
// Fungsi untuk menampilkan semua data gambar
public function view(){
return $this->db->get('gambar')->result();
}
// Fungsi untuk melakukan proses upload file
public function upload(){
$config['upload_path'] = './images/';
$config['allowed_types'] = 'jpg|png|jpeg';
$config['max_size'] = '2048';
$config['remove_space'] = TRUE;
$this->load->library('upload', $config); // Load konfigurasi uploadnya
if($this->upload->do_upload('input_gambar')){ // Lakukan upload dan Cek jika proses upload berhasil
// Jika berhasil :
$return = array('result' => 'success', 'file' => $this->upload->data(), 'error' => '');
return $return;
}else{
// Jika gagal :
$return = array('result' => 'failed', 'file' => '', 'error' => $this->upload->display_errors());
return $return;
}
}
// Fungsi untuk menyimpan data ke database
public function save($upload){
$data = array(
'deskripsi'=>$this->input->post('input_deskripsi'),
'nama_file' => $upload['file']['file_name'],
'ukuran_file' => $upload['file']['file_size'],
'tipe_file' => $upload['file']['file_type']
);
$this->db->insert('gambar', $data);
}
}
@@ -0,0 +1,99 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Gelombang_model extends CI_Model {
public function __construct()
{
parent::__construct();
$this->load->database();
}
//ambil data nilai
public function listing()
{
$this->db->select('*');
$this->db->from('v_rpt_trans_formulir');
$this->db->order_by('no_pendaftaran','desc');
$query = $this->db->get();
return $query->result();
}
//hitung total siswa
public function total()
{
$this->db->select('COUNT(*) AS total');
$this->db->from('v_rpt_trans_formulir');
//where
$this->db->where('gelombang','Gelombang 1');
$this->db->order_by('no_pendaftaran','desc');
$query = $this->db->get();
return $query->row();
}
// Total
public function gel1()
{
$this->db->select('*');
$this->db->from('v_rpt_trans_formulir');
//where
$this->db->where('gelombang','Gelombang 1');
$this->db->order_by('no_pendaftaran','desc');
$query = $this->db->get();
return $query->result();
}
//hitung total siswa
public function total2()
{
$this->db->select('COUNT(*) AS total');
$this->db->from('v_rpt_trans_formulir');
//where
$this->db->where('gelombang','Gelombang 2');
$this->db->order_by('no_pendaftaran','desc');
$query = $this->db->get();
return $query->row();
}
// Total
public function gel2()
{
$this->db->select('*');
$this->db->from('v_rpt_trans_formulir');
//where
$this->db->where('gelombang','Gelombang 2');
$this->db->order_by('no_pendaftaran','desc');
$query = $this->db->get();
return $query->result();
}
//ambil data ViewUrut gel. 1
public function ViewUrut1()
{
$this->db->select('*');
$this->db->from('v_rpt_trans_formulir');
//where
$this->db->where('gelombang','Gelombang 1');
$this->db->order_by('no_pendaftaran','ASC');
$query = $this->db->get();
return $query->result();
}
//ambil data ViewUrut gel. 2
public function ViewUrut2()
{
$this->db->select('*');
$this->db->from('v_rpt_trans_formulir');
//where
$this->db->where('gelombang','Gelombang 2');
$this->db->order_by('no_pendaftaran','ASC');
$query = $this->db->get();
return $query->result();
}
}
@@ -0,0 +1,76 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Invoice_model extends CI_Model {
public function __construct()
{
parent::__construct();
$this->load->database();
}
//ambil data data
public function listing()
{
$this->db->select('*');
$this->db->from('v_rpt_data_invoice');
$this->db->order_by('tgl_invoice','desc');
$query = $this->db->get();
return $query->result();
}
public function delete($data)
{
$this->db->where('no_pendaftaran', $data['no_pendaftaran']);
$this->db->delete('invoice', $data);
}
public function deletetransaksi($data)
{
$this->db->where('no_trans', $data['no_trans']);
$this->db->delete('tr_invoice', $data);
}
//ambil detail data data
public function detail($no_pendaftaran)
{
$this->db->select('*');
$this->db->from('v_rpt_data_invoice');
//where
$this->db->where('no_pendaftaran', $no_pendaftaran);
$this->db->order_by('no_pendaftaran','desc');
$query = $this->db->get();
return $query->row();
}
//hitung total data
public function total()
{
$this->db->select('COUNT(*) AS total');
$this->db->from('v_rpt_data_invoice');
$this->db->order_by('no_pendaftaran','desc');
$query = $this->db->get();
return $query->row();
}
//ambil data ViewUrut
public function ViewUrut()
{
$this->db->select('*');
$this->db->from('v_rpt_data_invoice');
$this->db->order_by('no_pendaftaran','ASC');
$query = $this->db->get();
return $query->result();
}
}
/* End of file Pendaftar_model.php */
/* Location: ./application/models/Pendaftar_model.php */
@@ -0,0 +1,49 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Kuliner_model extends CI_Model {
public function __construct()
{
parent::__construct();
$this->load->database();
}
//ambil data nilai
public function listing()
{
$this->db->select('*');
$this->db->from('v_rpt_trans_formulir');
$this->db->order_by('no_pendaftaran','desc');
$query = $this->db->get();
return $query->result();
}
//hitung total siswa
public function total()
{
$this->db->select('COUNT(*) AS total');
$this->db->from('v_rpt_trans_formulir');
//where
$this->db->where('kd_kompetensi','KULINER');
$this->db->order_by('no_pendaftaran','desc');
$query = $this->db->get();
return $query->row();
}
// Total nilai kuliner
public function kuliner()
{
$this->db->select('*');
$this->db->from('v_rpt_trans_formulir');
//where
$this->db->where('kd_kompetensi','KULINER');
$this->db->order_by('no_pendaftaran','desc');
$query = $this->db->get();
return $query->result();
}
}
@@ -0,0 +1,102 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Lulustes_model extends CI_Model {
public function __construct()
{
parent::__construct();
$this->load->database();
$this->load->library('pdf');
}
//ambil data data
public function listing()
{
$this->db->select('*');
$this->db->from('v_rpt_data_pengumuman');
$this->db->order_by('tanggal_pengumuman','desc');
$query = $this->db->get();
return $query->result();
}
//ambil detail data data
public function detail($no_pendaftaran)
{
$this->db->select('*');
$this->db->from('v_rpt_data_pengumuman');
//where
$this->db->where('no_pendaftaran', $no_pendaftaran);
$this->db->order_by('no_pendaftaran','desc');
$query = $this->db->get();
return $query->row();
}
// Total nilai lulus
public function lulus()
{
$this->db->select('*');
$this->db->from('v_rpt_data_pengumuman');
//where
$this->db->where('status','LULUS');
$this->db->order_by('no_pendaftaran','desc');
$query = $this->db->get();
return $query->result();
}
//ambil detail data data
public function setting()
{
$this->db->select('*');
$this->db->from('setting');
$this->db->order_by('id','desc');
$query = $this->db->get();
return $query->result();
}
//hitung total data
public function total()
{
$this->db->select('COUNT(*) AS total');
$this->db->from('v_rpt_data_pengumuman');
//where
$this->db->where('status','LULUS');
$this->db->order_by('no_pendaftaran','desc');
$query = $this->db->get();
return $query->row();
}
//fungsi edit
public function edit($data)
{
$this->db->where('no_pendaftaran', $data['no_pendaftaran']);
$this->db->update('pengumuman', $data);
}
//fungsi delete
public function delete($data)
{
$this->db->where('no_pendaftaran', $data['no_pendaftaran']);
$this->db->delete('pengumuman', $data);
}
//fungsi delete
public function delete2($data2)
{
$this->db->where('userid', $data2['userid']);
$this->db->delete('user2', $data2);
}
//tambah user
public function tambah($data)
{
$this->db->insert('pengumuman', $data);
}
//tambah user
public function tambah2($data2)
{
$this->db->insert('user2', $data2);
}
}
+82
View File
@@ -0,0 +1,82 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Nilai_model extends CI_Model {
public function __construct()
{
parent::__construct();
$this->load->database();
}
//ambil data nilai
public function listing()
{
$this->db->select('*');
$this->db->from('v_rpt_nilai_tes');
$this->db->order_by('tanggal','desc');
$query = $this->db->get();
return $query->result();
}
//ambil detail data nilai
public function detail($no_pendaftaran)
{
$this->db->select('*');
$this->db->from('v_rpt_nilai_tes');
//where
$this->db->where('no_pendaftaran', $no_pendaftaran);
$this->db->order_by('no_pendaftaran','desc');
$query = $this->db->get();
return $query->row();
}
//hitung total nilai
public function total()
{
$this->db->select('COUNT(*) AS total');
$this->db->from('nilai_tes');
$this->db->order_by('no_pendaftaran','desc');
$query = $this->db->get();
return $query->row();
}
//fungsi delete
public function delete($data)
{
$this->db->where('no_pendaftaran', $data['no_pendaftaran']);
$this->db->delete('nilai_tes', $data);
}
//fungsi edit
public function edit($data)
{
$this->db->where('no_pendaftaran', $data['no_pendaftaran']);
$this->db->update('nilai_tes', $data);
}
//tambah nilai
public function tambah($data)
{
$this->db->insert('nilai_tes', $data);
}
//ambil data ViewUrut
public function ViewUrut()
{
$this->db->select('*');
$this->db->from('v_rpt_nilai_tes');
$this->db->order_by('no_pendaftaran','ASC');
$query = $this->db->get();
return $query->result();
}
}
/* End of file User_model.php */
/* Location: ./application/models/User_model.php */
+49
View File
@@ -0,0 +1,49 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Otkp_model extends CI_Model {
public function __construct()
{
parent::__construct();
$this->load->database();
}
//ambil data nilai
public function listing()
{
$this->db->select('*');
$this->db->from('v_rpt_trans_formulir');
$this->db->order_by('no_pendaftaran','desc');
$query = $this->db->get();
return $query->result();
}
//hitung total siswa
public function total()
{
$this->db->select('COUNT(*) AS total');
$this->db->from('v_rpt_trans_formulir');
//where
$this->db->where('kd_kompetensi','MPLB');
$this->db->order_by('no_pendaftaran','desc');
$query = $this->db->get();
return $query->row();
}
// Total nilai otkp
public function otkp()
{
$this->db->select('*');
$this->db->from('v_rpt_trans_formulir');
//where
$this->db->where('kd_kompetensi','MPLB');
$this->db->order_by('no_pendaftaran','desc');
$query = $this->db->get();
return $query->result();
}
}
@@ -0,0 +1,113 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Pembayaran_model extends CI_Model {
public function __construct()
{
parent::__construct();
$this->load->database();
}
//ambil data data
public function listing()
{
$this->db->select('*');
$this->db->from('v_rpt_trans_formulir');
$this->db->order_by('tgl_trans','desc');
$query = $this->db->get();
return $query->result();
}
//ambil detail data data
public function detail($no_trans)
{
$this->db->select('*');
$this->db->from('v_rpt_trans_formulir');
//where
$this->db->where('no_trans', $no_trans);
$this->db->order_by('no_trans','desc');
$query = $this->db->get();
return $query->row();
}
//hitung total data
public function total()
{
$this->db->select('COUNT(*) AS total');
$this->db->from('v_rpt_trans_formulir');
$this->db->order_by('no_pendaftaran','desc');
$query = $this->db->get();
return $query->row();
}
//fungsi edit
public function edit($data)
{
$this->db->where('no_trans', $data['no_trans']);
$this->db->update('tr_formulir', $data);
}
//fungsi delete
public function delete($data)
{
$this->db->where('no_trans', $data['no_trans']);
$this->db->delete('tr_formulir', $data);
}
//ambil data ViewUrut
public function ViewUrut()
{
$this->db->select('*');
$this->db->from('v_rpt_trans_formulir');
$this->db->order_by('no_pendaftaran','ASC');
$query = $this->db->get();
return $query->result();
}
public function regis($no_pendaftaran)
{
$this->db->select('*');
$this->db->from('v_rpt_data_formulir');
$this->db->where('no_pendaftaran', $no_pendaftaran);
$this->db->order_by('no_pendaftaran','desc');
$query = $this->db->get();
return $query->row();
}
public function regis2($no_pendaftaran)
{
$this->db->select('*');
$this->db->from('v_rpt_trans_formulir');
$this->db->where('no_pendaftaran', $no_pendaftaran);
$this->db->order_by('angsuran','Asc');
$query = $this->db->get();
return $query->result();
}
// Total formulir
public function regis3($no_pendaftaran)
{
$this->db->select('SUM(bayar) AS bayar');
$this->db->from('v_rpt_trans_formulir');
$this->db->where('no_pendaftaran', $no_pendaftaran);
$query = $this->db->get();
return $query->row();
}
public function get_sum()
{
$sql = "SELECT sum(bayar) as bayar FROM v_rpt_trans_formulir";
$result = $this->db->query($sql);
return $result->row()->bayar;
}
}
/* End of file Pendaftar_model.php */
/* Location: ./application/models/Pendaftar_model.php */
@@ -0,0 +1,63 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Pendaftar_model extends CI_Model {
public function __construct()
{
parent::__construct();
$this->load->database();
}
//ambil data siswa
public function listing()
{
$this->db->select('*');
$this->db->from('tr_formulir');
$this->db->order_by('no_pendaftaran','desc');
$query = $this->db->get();
return $query->result();
}
//ambil detail data user
public function detail($no_pendaftaran)
{
$this->db->select('*');
$this->db->from('tr_formulir');
//where
$this->db->where('no_pendaftaran', $no_pendaftaran);
$this->db->order_by('no_pendaftaran','desc');
$query = $this->db->get();
return $query->row();
}
//hitung total siswa
public function total()
{
$this->db->select('COUNT(*) AS total');
$this->db->from('tr_formulir');
$this->db->order_by('no_pendaftaran','desc');
$query = $this->db->get();
return $query->row();
}
// Total gel
public function gelombang()
{
$this->db->select('*');
$this->db->from('setting');
//where
$this->db->where('id','1');
$this->db->order_by('gelombang','desc');
$query = $this->db->get();
return $query->row();
}
}
/* End of file Pendaftar_model.php */
/* Location: ./application/models/Pendaftar_model.php */
@@ -0,0 +1,126 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Pengumuman_model extends CI_Model {
public function __construct()
{
parent::__construct();
$this->load->database();
$this->load->library('pdf');
}
//ambil data data
public function listing()
{
$this->db->select('*');
$this->db->from('v_rpt_data_pengumuman');
$this->db->order_by('tanggal_pengumuman','desc');
$query = $this->db->get();
return $query->result();
}
//ambil detail data data
public function detail($no_pendaftaran)
{
$this->db->select('*');
$this->db->from('v_rpt_data_pengumuman');
//where
$this->db->where('no_pendaftaran', $no_pendaftaran);
$this->db->order_by('no_pendaftaran','desc');
$query = $this->db->get();
return $query->row();
}
//ambil detail data data
public function setting()
{
$this->db->select('*');
$this->db->from('setting');
$this->db->order_by('id','desc');
$query = $this->db->get();
return $query->result();
}
//hitung total data
public function total()
{
$this->db->select('COUNT(*) AS total');
$this->db->from('v_rpt_data_pengumuman');
$this->db->order_by('no_pendaftaran','desc');
$query = $this->db->get();
return $query->row();
}
//hitung get siswa
public function get_siswa()
{
$this->db->select('*');
$this->db->from('data_siswa');
$this->db->order_by('no_pendaftaran','desc');
$query = $this->db->get();
return $query->result();
}
public function viewByNo($no_pendaftaran) {
$sql = "SELECT * FROM data_siswa
WHERE no_pendaftaran = ?
AND no_pendaftaran NOT IN (
SELECT no_pendaftaran FROM pengumuman
)";
$query = $this->db->query($sql, array($no_pendaftaran));
$result = $query->row(); // Ambil hasil query
return $result;
}
//fungsi edit
public function edit($data)
{
$this->db->where('no_pendaftaran', $data['no_pendaftaran']);
$this->db->update('pengumuman', $data);
}
//fungsi delete
public function delete($data)
{
$this->db->where('no_pendaftaran', $data['no_pendaftaran']);
$this->db->delete('pengumuman', $data);
}
//fungsi delete
public function delete2($data2)
{
$this->db->where('userid', $data2['userid']);
$this->db->delete('user2', $data2);
}
//tambah user
public function tambah($data)
{
$this->db->insert('pengumuman', $data);
}
//tambah user
public function tambah2($data2)
{
$this->db->insert('user2', $data2);
}
//ambil data ViewUrut
public function ViewUrut()
{
$this->db->select('*');
$this->db->from('v_rpt_data_pengumuman');
$this->db->order_by('no_pendaftaran','ASC');
$query = $this->db->get();
return $query->result();
}
public function download($no_pendaftaran){
$query = $this->db->get_where('v_rpt_data_pengumuman',array('no_pendaftaran'=>$no_pendaftaran));
return $query->row_array();
}
}
@@ -0,0 +1,96 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Peserta_model extends CI_Model {
public function __construct()
{
parent::__construct();
$this->load->database();
}
public function user2($no_pendaftaran)
{
$this->db->select('*');
$this->db->from('data_siswa');
$this->db->where('no_pendaftaran', $no_pendaftaran);
$this->db->order_by('no_pendaftaran','desc');
$query = $this->db->get();
return $query->row();
}
//ambil data peserta
public function listing()
{
$this->db->select('*');
$this->db->from('v_rpt_trans_formulir_web');
$this->db->order_by('no_pendaftaran','desc');
$query = $this->db->get();
return $query->result();
}
//hitung total peserta
public function total()
{
$this->db->select('COUNT(*) AS total');
$this->db->from('v_rpt_trans_formulir_web');
$this->db->order_by('no_pendaftaran','desc');
$query = $this->db->get();
return $query->row();
}
public function detail($no_pendaftaran)
{
$this->db->select('*');
$this->db->from('v_rpt_trans_formulir_web');
$this->db->where('no_pendaftaran', $no_pendaftaran);
$this->db->order_by('no_pendaftaran','desc');
$query = $this->db->get();
return $query->row();
}
public function cari($no_pendaftaran)
{
$this->db->select('*');
$this->db->from('data_siswa');
$this->db->where('no_pendaftaran', $no_pendaftaran);
$this->db->order_by('no_pendaftaran','desc');
$query = $this->db->get();
return $query->row();
}
//ubah peserta
public function edit($data)
{
$this->db->where('no_pendaftaran', $data['no_pendaftaran']);
$this->db->update('data_siswa', $data);
}
//ubah peserta
public function editjur($data)
{
$this->db->where('no_pendaftaran', $data['no_pendaftaran']);
$this->db->update('data_siswa', $data);
}
//ambil data ViewUrut all
public function ViewUrutAll()
{
$this->db->select('*');
$this->db->from('v_rpt_trans_formulir_web');
$this->db->order_by('no_pendaftaran','ASC');
$query = $this->db->get();
return $query->result();
}
}
/* End of file Peserta_model.php */
/* Location: ./application/models/Peserta_model.php */
@@ -0,0 +1,113 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Registrasi_model extends CI_Model {
public function __construct()
{
parent::__construct();
$this->load->database();
}
//ambil data data
public function listing()
{
$this->db->select('*');
$this->db->from('v_rpt_trans_invoice');
$this->db->order_by('tgl_bayar','desc');
$query = $this->db->get();
return $query->result();
}
//ambil detail data data
public function detail($no_trans)
{
$this->db->select('*');
$this->db->from('v_rpt_trans_invoice');
//where
$this->db->where('no_trans', $no_trans);
$this->db->order_by('no_trans','desc');
$query = $this->db->get();
return $query->row();
}
//hitung total data
public function total()
{
$this->db->select('COUNT(*) AS total');
$this->db->from('v_rpt_trans_invoice');
$this->db->order_by('no_pendaftaran','desc');
$query = $this->db->get();
return $query->row();
}
//fungsi edit
public function edit($data)
{
$this->db->where('no_trans', $data['no_trans']);
$this->db->update('tr_invoice', $data);
}
//fungsi delete
public function delete($data)
{
$this->db->where('no_trans', $data['no_trans']);
$this->db->delete('tr_invoice', $data);
}
//ambil data ViewUrut
public function ViewUrut()
{
$this->db->select('*');
$this->db->from('v_rpt_trans_invoice');
$this->db->order_by('no_pendaftaran','ASC');
$query = $this->db->get();
return $query->result();
}
public function regis($no_pendaftaran)
{
$this->db->select('*');
$this->db->from('v_rpt_data_invoice');
$this->db->where('no_pendaftaran', $no_pendaftaran);
$this->db->order_by('no_pendaftaran','desc');
$query = $this->db->get();
return $query->row();
}
public function regis2($no_pendaftaran)
{
$this->db->select('*');
$this->db->from('v_rpt_trans_invoice');
$this->db->where('no_pendaftaran', $no_pendaftaran);
$this->db->order_by('angsuran','Asc');
$query = $this->db->get();
return $query->result();
}
// Total formulir
public function regis3($no_pendaftaran)
{
$this->db->select('SUM(bayar) AS bayar');
$this->db->from('v_rpt_trans_invoice');
$this->db->where('no_pendaftaran', $no_pendaftaran);
$query = $this->db->get();
return $query->row();
}
public function get_sum()
{
$sql = "SELECT sum(bayar) as bayar FROM v_rpt_trans_invoice";
$result = $this->db->query($sql);
return $result->row()->bayar;
}
}
/* End of file Pendaftar_model.php */
/* Location: ./application/models/Pendaftar_model.php */
+190
View File
@@ -0,0 +1,190 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Setting_model extends CI_Model {
public function __construct()
{
parent::__construct();
$this->load->database();
}
//ambil data user
public function listing()
{
$this->db->select('*');
$this->db->from('setting');
$this->db->order_by('id','desc');
$query = $this->db->get();
return $query->result();
}
//ambil detail data user
public function setting()
{
$this->db->select('*');
$this->db->from('setting');
//where
$this->db->where('tgl_sosialisasi');
$this->db->order_by('id','desc');
$query = $this->db->get();
return $query->row();
}
//ambil detail panitia
public function panitia()
{
$this->db->select('*');
$this->db->from('setting');
//where
$this->db->where('id','1');
$this->db->order_by('id','desc');
$query = $this->db->get();
return $query->row();
}
//ambil tp2
public function tp2()
{
$this->db->select('*');
$this->db->from('tahun_pelajaran');
//where
$this->db->where('id_th','1');
$this->db->order_by('id_th','desc');
$query = $this->db->get();
return $query->row();
}
//ambil detail sosialisasi
public function sosialisasi()
{
$this->db->select('*');
$this->db->from('jadwal_sosialisasi');
//where
$this->db->where('id','0');
$this->db->order_by('id','desc');
$query = $this->db->get();
return $query->row();
}
//ambil detail biayappdb
public function biayappdb()
{
$this->db->select('*');
$this->db->from('biaya_ppdb');
//where
$this->db->where('id_k','0');
$this->db->order_by('id_k','desc');
$query = $this->db->get();
return $query->row();
}
public function pengaturan()
{
$this->db->select('*');
$this->db->from('pengaturan');
//where
$this->db->where('pengaturan_slug','menu_edit_ops');
$this->db->order_by('pengaturan_slug','desc');
$query = $this->db->get();
return $query->row();
}
public function pengaturan2()
{
$this->db->select('*');
$this->db->from('pengaturan');
//where
$this->db->where('pengaturan_slug','menu_edit_psswd');
$this->db->order_by('pengaturan_slug','desc');
$query = $this->db->get();
return $query->row();
}
public function pengaturan3()
{
$this->db->select('*');
$this->db->from('pengaturan');
//where
$this->db->where('pengaturan_slug','menu_edit_tgllahir');
$this->db->order_by('pengaturan_slug','desc');
$query = $this->db->get();
return $query->row();
}
public function pengaturan4()
{
$this->db->select('*');
$this->db->from('pengaturan');
//where
$this->db->where('pengaturan_slug','menu_pengumuman');
$this->db->order_by('pengaturan_slug','desc');
$query = $this->db->get();
return $query->row();
}
//ubah biodata
public function edit($data)
{
$this->db->where('pengaturan_slug','menu_edit_ops', $data['pengaturan_value']);
$this->db->update('pengaturan', $data);
}
//ubah password
public function edit2($data2)
{
$this->db->where('pengaturan_slug','menu_edit_psswd', $data2['pengaturan_value']);
$this->db->update('pengaturan', $data2);
}
//ubah tanggal
public function edit3($data3)
{
$this->db->where('pengaturan_slug','menu_edit_tgllahir', $data3['pengaturan_value']);
$this->db->update('pengaturan', $data3);
}
//ubah tanggal
public function edit4($data4)
{
$this->db->where('pengaturan_slug','menu_pengumuman', $data4['pengaturan_value']);
$this->db->update('pengaturan', $data4);
}
//ubah setting
public function edit5($data)
{
$this->db->where('id', '1');
$this->db->update('setting', $data);
}
//ubah sosialisasi
public function edit6($data)
{
$this->db->where('id', '0');
$this->db->update('jadwal_sosialisasi', $data);
}
//ubah sosialisasi
public function edit7($data)
{
$this->db->where('id_k', '0');
$this->db->update('biaya_ppdb', $data);
}
//ubah setting
public function edit8($data8)
{
$this->db->where('id_th', '1');
$this->db->update('tahun_pelajaran', $data8);
}
}
/* End of file User_model.php */
/* Location: ./application/models/User_model.php */
+86
View File
@@ -0,0 +1,86 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class SiswaModel extends CI_Model {
public function __construct()
{
parent::__construct();
$this->load->database();
}
// public function viewByNo($no_pendaftaran){
// $this->db->where('no_pendaftaran', $no_pendaftaran);
// $result = $this->db->get('v_rpt_trans_formulir')->row(); // Tampilkan data
// return $result;
// }
public function viewByNo($no_pendaftaran) {
$sql = "SELECT * FROM data_siswa
WHERE no_pendaftaran = ?
AND no_pendaftaran NOT IN (
SELECT no_pendaftaran FROM v_rpt_nilai_tes
)";
$query = $this->db->query($sql, array($no_pendaftaran));
$result = $query->row(); // Ambil hasil query
return $result;
}
public function viewByNo2($no_pendaftaran){
$this->db->where('no_pendaftaran', $no_pendaftaran);
$result = $this->db->get('v_rpt_data_pengumuman')->row(); // Tampilkan data
return $result;
}
//ambil data user
public function listing()
{
$this->db->select('*');
$this->db->from('nilai_tes');
$this->db->order_by('no_pendaftaran','desc');
$query = $this->db->get();
return $query->result();
}
//hitung get siswa
public function get_siswa()
{
$this->db->select('*');
$this->db->from('data_siswa');
$this->db->order_by('no_pendaftaran','desc');
$query = $this->db->get();
return $query->result();
}
//hitung total tes
public function total()
{
$this->db->select('COUNT(*) AS total');
$this->db->from('nilai_tes');
$this->db->order_by('no_pendaftaran','desc');
$query = $this->db->get();
return $query->row();
}
//tambah nilai
public function tambah($data)
{
$this->db->insert('nilai_tes', $data);
}
//fungsi delete
public function delete($data)
{
$this->db->where('no_pendaftaran', $data['no_pendaftaran']);
$this->db->delete('nilai_tes', $data);
}
//ubah status
public function edit($data)
{
$this->db->where('no_pendaftaran', $data['no_pendaftaran']);
$this->db->update('data_siswa', $data);
}
}
+137
View File
@@ -0,0 +1,137 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Staff_model extends CI_Model {
public function __construct() {
$this->load->database();
}
// Listing
public function listing($id_anggota=FALSE) {
$this->db->select('staff.*, kategori_staff.nama_kategori_staff, kategori_staff.slug_kategori_staff');
$this->db->from('staff');
$this->db->join('kategori_staff','kategori_staff.id_kategori_staff = staff.id_kategori_staff','LEFT');
if($id_anggota) {
$this->db->where('staff.id_anggota', $id_anggota);
}
$this->db->order_by('urutan','ASC');
$query = $this->db->get();
return $query->result();
}
// total
public function total($id_anggota=FALSE)
{
$this->db->select('COUNT(*) AS total');
$this->db->from('staff');
if($id_anggota) {
$this->db->where('staff.id_anggota', $id_anggota);
}
$query = $this->db->get();
return $query->row();
}
// Semua
public function semua() {
$this->db->select('staff.*, kategori_staff.nama_kategori_staff, kategori_staff.slug_kategori_staff');
$this->db->from('staff');
$this->db->join('kategori_staff','kategori_staff.id_kategori_staff = staff.id_kategori_staff','LEFT');
$this->db->where(array( 'status_staff' =>'Yes'));
$this->db->order_by('urutan','ASC');
$query = $this->db->get();
return $query->result();
}
// Semua
public function home() {
$this->db->select('staff.*, kategori_staff.nama_kategori_staff, kategori_staff.slug_kategori_staff');
$this->db->from('staff');
$this->db->join('kategori_staff','kategori_staff.id_kategori_staff = staff.id_kategori_staff','LEFT');
$this->db->where(array( 'status_staff' =>'Yes'));
$this->db->order_by('urutan','ASC');
$this->db->limit(12);
$query = $this->db->get();
return $query->result();
}
// Semua
public function kategori($id_kategori_staff) {
$this->db->select('*');
$this->db->from('staff');
$this->db->where(array( 'status_staff' =>'Yes',
'id_kategori_staff' => $id_kategori_staff));
$this->db->order_by('urutan','ASC');
$query = $this->db->get();
return $query->result();
}
// Semua
public function semua_staff($limit, $start) {
$this->db->select('*');
$this->db->from('staff');
$this->db->where(array('status_staff'=>'Yes'));
$this->db->limit($limit, $start);
$this->db->order_by('urutan','ASC');
$query = $this->db->get();
return $query->result();
}
// Semua
public function total_staff() {
$this->db->select('*');
$this->db->from('staff');
$this->db->where(array('status_staff'=>'Yes'));
$this->db->order_by('urutan','ASC');
$query = $this->db->get();
return $query->num_rows();
}
// Listing Besar
public function listing_besar() {
$this->db->select('*');
$this->db->from('staff');
$this->db->where(array('status_staff'=>'Ya','ukuran' => 'Besar'));
$this->db->order_by('id_staff','DESC');
$query = $this->db->get();
return $query->result();
}
// Besar
public function total_besar() {
$this->db->select('*');
$this->db->from('staff');
$this->db->where(array('status_staff'=>'Ya','ukuran' => 'Besar'));
$this->db->order_by('id_staff','DESC');
$query = $this->db->get();
return $query->num_rows();
}
// Detail
public function detail($id_staff) {
$this->db->select('*');
$this->db->from('staff');
$this->db->where('id_staff',$id_staff);
$this->db->order_by('urutan','DESC');
$query = $this->db->get();
return $query->row();
}
// Tambah
public function tambah($data) {
$this->db->insert('staff',$data);
}
// Edit
public function edit($data) {
$this->db->where('id_staff',$data['id_staff']);
$this->db->update('staff',$data);
}
// Delete
public function delete($data) {
$this->db->where('id_staff',$data['id_staff']);
$this->db->delete('staff',$data);
}
}
+49
View File
@@ -0,0 +1,49 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Tkj_model extends CI_Model {
public function __construct()
{
parent::__construct();
$this->load->database();
}
//ambil data nilai
public function listing()
{
$this->db->select('*');
$this->db->from('v_rpt_trans_formulir');
$this->db->order_by('no_pendaftaran','desc');
$query = $this->db->get();
return $query->result();
}
//hitung total siswa
public function total()
{
$this->db->select('COUNT(*) AS total');
$this->db->from('v_rpt_trans_formulir');
//where
$this->db->where('kd_kompetensi','TJKT');
$this->db->order_by('no_pendaftaran','desc');
$query = $this->db->get();
return $query->row();
}
// Total nilai tkj
public function tkj()
{
$this->db->select('*');
$this->db->from('v_rpt_trans_formulir');
//where
$this->db->where('kd_kompetensi','TJKT');
$this->db->order_by('no_pendaftaran','desc');
$query = $this->db->get();
return $query->result();
}
}
+106
View File
@@ -0,0 +1,106 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class User_model extends CI_Model {
public function __construct()
{
parent::__construct();
$this->load->database();
}
//ambil data user
public function listing()
{
$this->db->select('*');
$this->db->from('user2');
$this->db->order_by('id','desc');
$query = $this->db->get();
return $query->result();
}
//ambil detail data user
public function detail($id)
{
$this->db->select('*');
$this->db->from('user2');
//where
$this->db->where('id', $id);
$this->db->order_by('id','desc');
$query = $this->db->get();
return $query->row();
}
//Login user
public function login($userid,$password)
{
$this->db->select('*');
$this->db->from('user2');
//where
$this->db->where(array( 'userid' => $userid,
'password' => MD5($password)));
$this->db->order_by('id','desc');
$query = $this->db->get();
return $query->row();
}
//hitung total user
public function total()
{
$this->db->select('COUNT(*) AS total');
$this->db->from('user2');
$this->db->order_by('id','desc');
$query = $this->db->get();
return $query->row();
}
//fungsi delete
public function delete($data)
{
$this->db->where('id', $data['id']);
$this->db->delete('user2', $data);
}
//fungsi edit
public function edit($data)
{
$this->db->where('id', $data['id']);
$this->db->update('user2', $data);
}
//tambah user
public function tambah($data)
{
$this->db->insert('user2', $data);
}
public function menu_psswd()
{
$this->db->select('*');
$this->db->from('pengaturan');
//where
$this->db->where('pengaturan_slug','menu_edit_psswd');
$this->db->order_by('pengaturan_slug','desc');
$query = $this->db->get();
return $query->row();
}
public function menu_pengumuman()
{
$this->db->select('*');
$this->db->from('pengaturan');
//where
$this->db->where('pengaturan_slug','menu_pengumuman');
$this->db->order_by('pengaturan_slug','desc');
$query = $this->db->get();
return $query->row();
}
}
/* End of file User_model.php */
/* Location: ./application/models/User_model.php */
+11
View File
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>