99 lines
2.1 KiB
PHP
99 lines
2.1 KiB
PHP
<?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();
|
|
}
|
|
|
|
} |