<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
    
    class Event_pdfs_model extends CI_Model {
        
        public function get_totalcount_exp() {
            return $this->db->count_all('calendarT');
        }
        
        public function get_listings_export() {
            
            $option = $this->input->post('sampleinlineradio');
            
            if ($option == "Monthly") {
                
                $this->db->where('MONTH(startDate)', 'MONTH(CURRENT_DATE())', FALSE);
                $qu = $this->db->get('calendarT');
                
                
                if ($qu->num_rows() > 0) {
                    return $qu->result();
                }
                return false;
                
            }
            
            if ($option == "Weekly") {
                
                $this->db->where('YEARWEEK(startDate)', 'YEARWEEK(CURRENT_DATE())', FALSE);
                $qu2 = $this->db->get('calendarT');
                
                
                if ($qu2->num_rows() > 0) {
                    return $qu2->result();
                }
                return false;
            }
        }
        
        public function get_totalpcount_exp() {
            return $this->db->count_all('calendarT');
        }
        
        function event_getall() {
            
            $this->load->database();
            $query = $this->db->get('calendarT');
            
            return $query->result();
        }
        function get_listingsID($id) {


        $this->db->like('userID', $id);
        $query = $this->db->get('calendarT');

        return $query->result();
    }
        
    }
