0) { DBConnect(); $res = GetRecordSet("nb_library_users", array("*"), "id_user=".$id_user); $res = $res[0]; $id_company = 0; if ($res['id_company'] == -1) { $id_company = $res['id_user']; if ($_SESSION['library_login_by_ip'] != 1) { $status = 'Администратор организации'; $is_admin = true; } else { $status = 'Сотрудник организации'; } } else if ($res['id_company'] == -2) { $status = 'Директор'; } else { $id_company = $res['id_company']; $status = 'Сотрудник организации'; } $id_tariff = GetSQLValue("nb_library_company_tariffes", "id_tariff", "id_company=".$id_company); $tariff = isset($tariffes[$id_tariff]) ? $tariffes[$id_tariff] : ""; if ($is_admin) { $tariff .= " (до ".$res['end_date'].")"; } DBDisconnect(); } else { $id_user = -$id_user; EDBConnect(); $res = GetRecordSet("emag_users", array("*"), "id_user=".$id_user); $res = $res[0]; EDBDisconnect(); $status = 'Физическое лицо'; $tariff = "Индивидуальный/базовый"; } $name = $res['name'].' '.$res['middlename'].' '.$res['surname']; $email = $res['login']; DBConnect(); $balans = GetSQLValue("nb_library_user_rights", "balans", "id_user=".$_SESSION['library_id_user']); if (!is_numeric($balans)) { $balans = 0; } DBDisconnect(); $profile = new CSimplePage('library_profile/index.tpl'); SetVarsForMainTemplate($profile, 3); $profile->AddVar("name", $name); $profile->AddVar("email", $email); $profile->AddVar("tariff", $tariff); $profile->AddVar("status", $status); $profile->AddVar("balans", $balans); $profile->AddVar("login_by_ip", $_SESSION['library_login_by_ip']); $profile->AddVar("is_admin", $is_admin ? 1 : 0); $profile->Show(); ShowBottomPart(); ?>