<?php
class Floatmodel extends CI_Model
{

    var $id;
    var $client_id;
    var $client_float;
    var $topped_on;
    var $addedby;
    var $addedon;
    var $record_state = 0;
    var $type;

    function __construct()
    {
        parent::__construct();
    }

    function get($condition = "")
    {
        if (!empty($condition))
            $this->db->where($condition);
        return $this->db->get('client_float');
    }

    function update($data, $condition)
    {
        return $this->db->update('client_float', $data, $condition);
    }

    function insert()
    {
        $date = $this->input->post('date');

        $this->record_state = 0;
        $this->addedby = $this->session->userdata('username');
        $this->addedon = date('Y-m-d H:i:s');
        $this->topped_on = date('Y-m-d', strtotime($date));
        $this->client_float = $this->input->post('float');
        $this->client_id = $this->input->post('client');
        $this->type = $this->input->post('cpartner');
        
        return $this->db->insert('client_float', $this);
    }
}
