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

class Management_Model extends CI_Model {
  
  private $tableNameDeliveryMaster = 'marketing_loading_unloading';
  
  function __construct() 
  {
    /* Call the Model constructor */
    parent::__construct();
  }
  
  

	public function approval_delivery($delivery_id,$status)
	{
		$data = array(
			'approval_status' => $status,
			'loading_status' => 3
		);	
		$this->db->where('id',$delivery_id);
		return $this->db->update($this->tableNameDeliveryMaster, $data);
	}
	
	public function approval_credit_order($id,$data)
	{	
		if($id>0){
			$this->db->where('cus_order_master_id',$id);
			return $this->db->update('customer_order_master', $data);
		}else
		{
			return false;
		}		
	}
	
	public function approval_credit_customer($id,$data)
	{	
		if($id>0){
			$this->db->where('cus_id',$id);
			return $this->db->update('customer', $data);
		}else
		{
			return false;
		}		
	}
	
	
}