<?php

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

class news_subscribe_model extends CI_Model {

    var $tableName = 'tbl_newsletter_subscription';

    function add() {

        if ($this->input->post('email_address'))
            $this->db->set('email_address', $this->input->post('email_address'));
        $this->db->set('status', 'active');
        $this->db->set('add_time', time());

        $query = $this->db->insert($this->tableName);
        $response = $this->db->insert_id();
        return $this->db->insert_id();
    }

}