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

class Master_plan_m extends CI_Model {
    public function __construct(){
		parent::__construct();
	}

    public function button_sso(){
        $this->db->select("tgl_aktif");
        $this->db->where("id_company",$this->id_company);
        $this->db->where("tgl_aktif < ","2021-08-23");
        $this->db->from("master_plan");
        $query = $this->db->get()->num_rows();

        if($query > 0){
            return true;
        }else{
            return false;
        }
    }

    function id_paket() {
      $this->db->select('tb_paket.id_paket, master_plan.tgl_daftar');
      $this->db->join('tb_paket', 'master_company.id_tb_paket = tb_paket.id_tb_paket');
      $this->db->join('master_plan', 'master_company.id_company = master_plan.id_company');
      $this->db->where('master_company.id_company', $this->session->userdata('id_company'));
      return $this->db->get('master_company')->row();
    }
}
