Files

63 lines
1.3 KiB
PHP

<?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 */