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

 /**
 * user helper page
 * 
 * @param1       
 * @return       helper functions
 * @access       public
 * @author       M.K.Sah
 * @copyright    N/A
 * @link         application/helper
 * @since        20th Jan 2026
 * @deprecated   N/A
 **/

function isLoggedIn()
{
  $CI = &get_instance();
  if ($CI->session->userdata('is_logged_in') === TRUE && !empty($CI->session->userdata('user_id'))) {
    return TRUE;
  } else {
    return FALSE;
  }
}

function getWeightUnit(int $id)
{
  switch ($id) {
    case 0:
      $var = 'g';
      break;
    case 1:
      $var = 'kg';
      break;
    default:
      $var = '';
      break;
  }
  return $var;
}
