<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class User_model extends CI_Model {


// Listing
/* =======================USER MODEL KOSMETIK========================================================= */
public function excel_kosmetik_dipa_kimia(){
 $data = array( 'title' => 'Kosmetik(Kimia)',
 'user' => $this->user_model->kosmetik_kimia());
 $this->load->view('/admin/excel_kosmetik_dipa_kimia',$data);
 }
 public function excel_kosmetik_pnp_kimia(){
 $data = array( 'title' => 'Kosmetik PNP(Kimia)',
 'user' => $this->user_model->kosmetik_kimia_pnp());
 $this->load->view('/admin/excel_kosmetik_pnp_kimia',$data);
 }
 
 
 public function excel_kosmetik_dipa_mik(){
 $data = array( 'title' => 'Kosmetik(mikrobiologi)',
 'user' => $this->user_model->kosmetik_mik());
 $this->load->view('/admin/excel_kosmetik_dipa_mik',$data);
 }
  
 public function excel_kosmetik_pnp_mik(){
 $data = array( 'title' => 'Kosmetik PNP(mikrobiologi)',
 'user' => $this->user_model->kosmetik_mikro_pnp());
 $this->load->view('/admin/excel_kosmetik_pnp_mik',$data);
 }
 
/* ======================MODEL DB KOSMETIK========================================================== */
 public function kosmetik_kimia() {
 $this->db->select('*');
 $this->db->from('t_add_monkos');
 $query = $this->db->get();
 return $query->result();
 }
  public function kosmetik_kimia_pnp() {
 $this->db->select('*');
 $this->db->from('t_add_monkos_pnp');
 $query = $this->db->get();
 return $query->result();
 }
  public function kosmetik_mik() {
 $this->db->select('*');
 $this->db->from('t_add_monkos_mik');
 $query = $this->db->get();
 return $query->result();
 }
 public function kosmetik_mik_pnp() {
 $this->db->select('*');
 $this->db->from('t_add_monkos_mik_pnp');
 $query = $this->db->get();
 return $query->result();
 }
 
 /* =======================USER MODEL PANGAN========================================================= */
public function excel_pangan_dipa_kimia(){
 $data = array( 'title' => 'Pangan(Kimia)',
 'user' => $this->user_model->kosmetik_kimia());
 $this->load->view('/admin/excel_pangan_dipa_kimia',$data);
 }
 public function excel_pangan_pnp_kimia(){
 $data = array( 'title' => 'Pangan PNP(Kimia)',
 'user' => $this->user_model->pangan_kimia_pnp());
 $this->load->view('/admin/excel_pangan_pnp_kimia',$data);
 }
 
 
 public function excel_pangan_dipa_mik(){
 $data = array( 'title' => 'Pangan(mikrobiologi)',
 'user' => $this->user_model->pangan_mik());
 $this->load->view('/admin/excel_pangan_dipa_mik',$data);
 }
  
 public function excel_pangan_pnp_mik(){
 $data = array( 'title' => 'Pangan PNP(mikrobiologi)',
 'user' => $this->user_model->pangan_mik_pnp());
 $this->load->view('/admin/excel_pangan_pnp_mik',$data);
 }
 
/* ======================MODEL DB PANGAN========================================================== */
 public function pangan_kimia() {
 $this->db->select('*');
 $this->db->from('t_add_monpang');
 $query = $this->db->get();
 return $query->result();
 }
  public function pangan_kimia_pnp() {
 $this->db->select('*');
 $this->db->from('t_add_monpang_pnp');
 $query = $this->db->get();
 return $query->result();
 }
  public function pangan_mik() {
 $this->db->select('*');
 $this->db->from('t_add_monpang_mik');
 $query = $this->db->get();
 return $query->result();
 }
 public function pangan_mik_pnp() {
 $this->db->select('*');
 $this->db->from('t_add_monpang_mik_pnp');
 $query = $this->db->get();
 return $query->result();
 }
 /* ================================================================================= */
 /* =======================USER MODEL OBAT========================================================= */
public function excel_obat_dipa_kimia(){
 $data = array( 'title' => 'Obat(Kimia)',
 'user' => $this->user_model->obat_kimia());
 $this->load->view('/admin/excel_obat_dipa_kimia',$data);
 }
 public function excel_obat_pnp_kimia(){
 $data = array( 'title' => 'Obat PNP(Kimia)',
 'user' => $this->user_model->obat_kimia_pnp());
 $this->load->view('/admin/excel_obat_pnp_kimia',$data);
 }
 
 
 public function excel_obat_dipa_mik(){
 $data = array( 'title' => 'Obat(mikrobiologi)',
 'user' => $this->user_model->Obat_mik());
 $this->load->view('/admin/excel_obat_dipa_mik',$data);
 }
  
 public function excel_obat_pnp_mik(){
 $data = array( 'title' => 'Obat PNP(mikrobiologi)',
 'user' => $this->user_model->obat_mik_pnp());
 $this->load->view('/admin/excel_obat_pnp_mik',$data);
 }
 /* ======================MODEL DB obat========================================================== */
 public function obat_kimia() {
 $this->db->select('*');
 $this->db->from('t_add_monob');
 $query = $this->db->get();
 return $query->result();
 }
  public function obat_kimia_pnp() {
 $this->db->select('*');
 $this->db->from('t_add_monob_pnp');
 $query = $this->db->get();
 return $query->result();
 }
  public function obat_mik() {
 $this->db->select('*');
 $this->db->from('t_add_monob_mik');
 $query = $this->db->get();
 return $query->result();
 }
 public function obat_mik_pnp() {
 $this->db->select('*');
 $this->db->from('t_add_monob_mik_pnp');
 $query = $this->db->get();
 return $query->result();
 }
 
/* =======================USER MODEL PRODUK KOMPLEMEN========================================================= */
public function excel_pk_dipa_kimia(){
 $data = array( 'title' => 'PK(Kimia)',
 'user' => $this->user_model->kosmetik_kimia());
 $this->load->view('/admin/excel_pk_dipa_kimia',$data);
 }
 public function excel_pk_pnp_kimia(){
 $data = array( 'title' => 'PK PNP(Kimia)',
 'user' => $this->user_model->kosmetik_kimia_pnp());
 $this->load->view('/admin/excel_pk_pnp_kimia',$data);
 }
 
 
 public function excel_pk_dipa_mik(){
 $data = array( 'title' => 'PK(mikrobiologi)',
 'user' => $this->user_model->pk_mik());
 $this->load->view('/admin/excel_pk_dipa_mik',$data);
 }
  
 public function excel_pk_pnp_mik(){
 $data = array( 'title' => 'PK PNP(mikrobiologi)',
 'user' => $this->user_model->pk_mik_pnp());
 $this->load->view('/admin/excel_pk_pnp_mik',$data);
 }
 /* ======================MODEL DB PRODUK KOMPLEMEN========================================================== */
 public function pk_kimia() {
 $this->db->select('*');
 $this->db->from('t_add_monpk');
 $query = $this->db->get();
 return $query->result();
 }
  public function pk_kimia_pnp() {
 $this->db->select('*');
 $this->db->from('t_add_monpk_pnp');
 $query = $this->db->get();
 return $query->result();
 }
  public function pk_mik() {
 $this->db->select('*');
 $this->db->from('t_add_monpk_mik');
 $query = $this->db->get();
 return $query->result();
 }
 public function pk_mik_pnp() {
 $this->db->select('*');
 $this->db->from('t_add_monpk_mik_pnp');
 $query = $this->db->get();
 return $query->result();
 }
 /* =======================USER MODEL OT========================================================= */
public function excel_otr_dipa_kimia(){
 $data = array( 'title' => 'OT(Kimia)',
 'user' => $this->user_model->otr_kimia());
 $this->load->view('/admin/excel_otr_dipa_kimia',$data);
 }
 public function excel_otr_pnp_kimia(){
 $data = array( 'title' => 'OT PNP(Kimia)',
 'user' => $this->user_model->otr_kimia_pnp());
 $this->load->view('/admin/excel_otr_pnp_kimia',$data);
 }
 
 
 public function excel_otr_dipa_mik(){
 $data = array( 'title' => 'PK(mikrobiologi)',
 'user' => $this->user_model->otr_mik());
 $this->load->view('/admin/excel_otr_dipa_mik',$data);
 }
  
 public function excel_otr_pnp_mik(){
 $data = array( 'title' => 'PK PNP(mikrobiologi)',
 'user' => $this->user_model->otr_mik_pnp());
 $this->load->view('/admin/excel_otr_pnp_mik',$data);
 }
  /* ======================MODEL DB OT========================================================== */
 public function otr_kimia() {
 $this->db->select('*');
 $this->db->from('t_add_monotr');
 $query = $this->db->get();
 return $query->result();
 }
  public function otr_kimia_pnp() {
 $this->db->select('*');
 $this->db->from('t_add_monotr_pnp');
 $query = $this->db->get();
 return $query->result();
 }
  public function otr_mik() {
 $this->db->select('*');
 $this->db->from('t_add_monotr_mik');
 $query = $this->db->get();
 return $query->result();
 }
 public function otr_mik_pnp() {
 $this->db->select('*');
 $this->db->from('t_add_monotr_mik_pnp');
 $query = $this->db->get();
 return $query->result();
 }
   public function insertuser($data)  
   {  
   return $this->db->insert('user', $data);  
  }  
  public function verifyemail($key)  
   {  
    $data = array('status' => 1);  
      $this->db->where('md5(email)', $key);  
      return $this->db->update('user', $data);  
   }  

 
   public function search_blog($latar){
        $this->db->like('kode', $latar , 'both');
        $this->db->order_by('kode', 'ASC');
        $this->db->limit(10);
        return $this->db->get('ref_klasifikasi')->result();
    }
	
	public function lengkap ($nama){
        $this->db->like('nama', $nama , 'both');
        $this->db->order_by('nama', 'ASC');
        $this->db->limit(10);
        return $this->db->get('t_ttd')->result();
    }
    public function kwitansi ($sutug){
        $this->db->like('id_st', $sutug , 'both');
        $this->db->order_by('id_st', 'ASC');
        $this->db->where('nip', $this->session->userdata('admin_nip'));
        $this->db->where('nama_ppk !=', '');
        $this->db->limit(10);
        return $this->db->get('view_surat_tugas')->result();
    }
   
	public function lengkap_loka ($nama_loka){
        $this->db->like('nama', $nama_loka , 'both');
        $this->db->order_by('nama', 'ASC');
        $this->db->limit(10);
        return $this->db->get('t_ttd_loka')->result();
    }
	public function search_ppk($belakang){
        $this->db->like('nama_ppk', $belakang , 'both');
        $this->db->order_by('nama_ppk', 'ASC');
        $this->db->limit(10);
        return $this->db->get('t_komit')->result();
    }
	public function pegawai ($peg){
        $this->db->like('nama', $peg, 'both');
        $this->db->order_by('nama', 'ASC');
        $this->db->limit(10);
        return $this->db->get('view_pegawai')->result();
    }
  
  }  
 
 
 	
 
 
 
 
 


/* End of file User_model.php */
/* Location: ./application/models/User_model.php */