user() : null); // Shortcut permission flags $hdrCanBilling = false; $hdrCanIpdBilling = false; $hdrCanDoctorWork = false; $hdrCanPharmacy = false; if ($authUser && method_exists($authUser, 'can')) { $hdrCanBilling = $authUser->can('billing.access') || $authUser->can('billing.opd.edit') || $authUser->can('billing.opd.pay') || $authUser->can('billing.charges.view') || $authUser->can('billing.charges.edit') || $authUser->can('billing.charges.pay') || $authUser->can('billing.charges.cancel') || $authUser->can('billing.charges.correct') || $authUser->can('billing.ipd.access') || $authUser->can('billing.ipd.current-admission') || $authUser->can('billing.ipd.invoice') || $authUser->can('billing.ipd.cash-balance') || $authUser->can('billing.ipd.export') || $authUser->can('billing.*'); $hdrCanIpdBilling = $authUser->can('billing.ipd.access') || $authUser->can('billing.ipd.current-admission') || $authUser->can('billing.ipd.invoice') || $authUser->can('billing.ipd.cash-balance') || $authUser->can('billing.access'); $hdrCanDoctorWork = $authUser->can('doctor_work.access') || $authUser->can('doctor_work.appointment.view') || $authUser->can('doctor_work.*'); $hdrCanPharmacy = $authUser->can('pharmacy.access') || $authUser->can('billing.access'); } if ($authUser && method_exists($authUser, 'inGroup')) { $inAdminGroup = $authUser->inGroup('superadmin', 'admin', 'developer'); if (! $hdrCanBilling) { $hdrCanBilling = $inAdminGroup; } if (! $hdrCanIpdBilling) { $hdrCanIpdBilling = $inAdminGroup; } if (! $hdrCanDoctorWork) { $hdrCanDoctorWork = $inAdminGroup; } if (! $hdrCanPharmacy) { $hdrCanPharmacy = $inAdminGroup; } } $loginId = trim((string) ($authUser->username ?? '')); if ($loginId === '') { $loginId = trim((string) ($authUser->email ?? '')); } if ($loginId === '') { $loginId = 'User'; } $displayName = $loginId; $displayUserId = (int) ($authUser->id ?? 0); $displayPhoto = ''; if ($displayUserId > 0) { $tables = config('Auth')->tables; $identitiesTable = (string) ($tables['identities'] ?? 'auth_identities'); if (function_exists('db_connect')) { $db = db_connect(); if ($db && $db->tableExists($identitiesTable)) { $identityRow = $db->table($identitiesTable) ->select('extra') ->where('user_id', $displayUserId) ->where('type', 'email_password') ->get(1) ->getRowArray(); $extraRaw = trim((string) ($identityRow['extra'] ?? '')); if ($extraRaw !== '') { $decoded = json_decode($extraRaw, true); if (is_array($decoded)) { $fullName = trim((string) ($decoded['full_name'] ?? '')); if ($fullName !== '') { $displayName = $fullName; } $profilePhoto = trim((string) ($decoded['profile_photo'] ?? '')); if ($profilePhoto !== '') { $displayPhoto = basename($profilePhoto); } } } } } } $profileImageUrl = base_url('assets/img/profile-img.jpg'); if ($displayPhoto !== '') { $profileImageAbsolute = FCPATH . 'assets/images/user_profile/' . $displayPhoto; if (is_file($profileImageAbsolute)) { $profileImageUrl = base_url('assets/images/user_profile/' . $displayPhoto); } } $serverTimeZoneId = 'Asia/Kolkata'; $serverNow = new DateTimeImmutable('now', new DateTimeZone($serverTimeZoneId)); $serverTimeZoneLabel = trim((string) $serverNow->format('T')); if ($serverTimeZoneLabel === '' || $serverTimeZoneLabel === 'GMT') { $serverTimeZoneLabel = $serverTimeZoneId; } $serverEpochMs = (int) round(microtime(true) * 1000); $serverDisplayTime = $serverNow->format('d-m-Y h:i A') . ' (' . $serverTimeZoneLabel . ')'; ?>
  • Help
  • Profile
    • Login ID:
      User ID: id ?? '')) ?>

    • My Profile

    • Sign Out