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

if(!function_exists('getCustomerMerchantId'))
{
    /**
    *@desc Returns Merchant Row ID of the current merchant
    */
    function getCustomerMerchantId()
    {
        $merchant_row_id = isset($_SESSION['portal_merchant_row_id']) ? $_SESSION['portal_merchant_row_id'] : 0;
        return $merchant_row_id;
    }
}

if(!function_exists('checkCustomerLogin'))
{
 function checkCustomerLogin()
    {
      if(!isset($_SESSION['portal_customer_id']) || ($_SESSION['portal_customer_id']== 0 || $_SESSION['portal_merchant_row_id'] == 0 ))
        {
            redirect('portal/portal/logout', 'location');
        }
    }
}
?>