function bsa_space($id, $column = NULL) { $params = explode(',', $column); if ($params != null) { foreach ($params as $param) { if ($param != '') { if (isset($_SESSION['bsa_space_' . $id][$param]) && $_SESSION['bsa_space_' . $id][$param] != '') { return $_SESSION['bsa_space_' . $id][$param]; } else { $model = new BSA_PRO_Model(); $get_space = $model->getSpace($id); if ($param != null) { if (isset($get_space[$param])) { $_SESSION['bsa_space_' . $id][$param] = $get_space[$param]; return $get_space[$param]; } else { return null; } } else { if (isset($get_space)) { $_SESSION['bsa_space_' . $id]['id'] = $get_space['id']; return $get_space['id']; } else { return null; } } } } else { $model = new BSA_PRO_Model(); $get_space = $model->getSpace($id); if (isset($get_space)) { $_SESSION['bsa_space_' . $id]['id'] = $get_space['id']; return $get_space['id']; } else { return null; } } } } else { $model = new BSA_PRO_Model(); $get_space = $model->getSpace($id); if (isset($get_space)) { $_SESSION['bsa_space_' . $id]['id'] = $get_space['id']; return $get_space['id']; } else { return null; } } }