<?php 

class M_whatsapp extends CI_Model{	

    

    function __construct() {

        parent::__construct();

    }

    function data_unit_misioner(){

        $sql = "SELECT * FROM tb_unit_misioner WHERE is_deleted = 0 ";

        return $this->db->query($sql);

    }

    function data_users(){

        $sql = "SELECT id_user,username,tlp FROM tb_user WHERE valid=1 AND is_deleted = 0 ";

        return $this->db->query($sql);

    }

    function data_user_all(){

        $sql = "SELECT tlp FROM tb_user WHERE valid=1 AND is_deleted = 0 ";

        return $this->db->query($sql);

    }

    function data_user_um($data){

        $sql = "SELECT tlp FROM tb_user WHERE unit_misioner = '$data[um]' AND valid=1 AND is_deleted = 0 ";

        return $this->db->query($sql);

    }

}