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

class Log_m extends MY_Model
{
    public $_table_name = 'mobile_inventory_log';

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

    public function getTransferCount($year, $month)
    {
        $no = 'BIN_TRANSER_['.$year.']['.$month.']';
        $sql = "SELECT COUNT(*) AS A FROM $this->_table_name WHERE Reference_No like '%$no%'";
        $res =  $this->runQuery($sql, true);
        return $res['A'];
    }

    public function runQuery($query, $single = false)
    {
        $query = $this->db->query($query);
        if ($single)
            return $query->row_array();
        else
            return $query->result_array();
    }

}