<?php
class Panalty_Model extends CI_Model {
	 private $tableName = 'loan';
  
  
  function __construct() 
  {
   		/* Call the Model constructor */
    	parent::__construct();
        $this->load->database();
        $this->load->helper('url');
        $this->load->library(array('email'));
  }
 
	function s($loan_id,$data)
	{		
		$this->db->where('loan_id', $loan_id);
		return $this->db->update('loan',$data);
		
	}
	
	function savsse_loan_issue($data)
	{
		if ($data)
		{			
			return $this->db->insert('loan_issue',$data);
		}else{
			return false;	
		}
	}
   
   
  
	
   function get_panalty_charge()
   {
	   $this->db->select('mstr_panalty_charge_rate.panalty_rate'); 
	   $this->db->from('mstr_panalty_charge_rate');
	   $this->db->where("mstr_panalty_charge_rate.status",1);
		$this->db->order_by("mstr_panalty_charge_rate.id", "desc");
		$this->db->limit(1);
		$query = $this->db->get();
		 if($query->num_rows() >0)
    	 {
      		 return $query->row_array();
    	 }
    	 else
     	{
       		return false;
     	}
   }
   
   
   
}