<style>

</style>
</head>
<?php $columnNumber = 3;

$ntoo = 0;
_selectRowNoParam(
  "SELECT count(id) FROM noti_user 
            WHERE noti_user.user_id = '$user_id' and see is null",
  $ntoo
);

if ($page == null) $page = '';
?>

<body>
  <nav class="nxl-navigation">
    <div class="navbar-wrapper">
      <div class="m-header">
        <a href="/" class="b-brand">
          <!-- ========   change your logo hear   ============ -->
          <img src="/images/logo-l.jpg" alt="" class="logo logo-lg w-100" />
          <img src="/images/logo.jpg" alt="" class="logo logo-sm" />
        </a>
      </div>
      <div class="navbar-content">
        <ul class="nxl-navbar">
          <li class="nxl-item nxl-caption">
            <label>ҮНДСЭН ЦЭС</label>
          </li>
          <li class="nxl-item">
            <a href="/" class="nxl-link">
              <span class="nxl-micon"><i class="feather-airplay"></i></span>
              <span class="nxl-mtext">Эхлэл</span>
            </a>
          </li>
          <?php
          if (checkErh(13, $user_role, $user_id)) {
          ?>
            <li class="nxl-item nxl-hasmenu">
              <a href="javascript:void(0);" class="nxl-link">
                <span class="nxl-micon"><i class="feather-users"></i></span>
                <span class="nxl-mtext">Бүртгэл</span><span class="nxl-arrow"><i class="feather-chevron-right"></i></span>
              </a>
              <ul class="nxl-submenu">
                <li class="nxl-item"><a class="nxl-link" href="/student/listAll">Суралцагчид</a></li>
                <li class="nxl-item"><a class="nxl-link" href="/class/list">Анги</a></li>
                <li class="nxl-item"><a class="nxl-link" href="/teacher/list">Багш, ажилтан</a></li>
                <li class="nxl-item"><a class="nxl-link" href="/student/graduate">Төгсөгч</a></li>
              </ul>
            </li>
          <?php
          }
          if ($user_role == 1) {
          ?>
            <li class="nxl-item">
              <a href="/att/list" class="nxl-link">
                <span class="nxl-micon"><i class="feather-edit"></i></span>
                <span class="nxl-mtext">Ирц бүртгэх</span>
              </a>
            </li>
            <li class="nxl-item">
              <a href="/tclass/list" class="nxl-link">
                <span class="nxl-micon"><i class="feather-book"></i></span>
                <span class="nxl-mtext">Анги</span>
              </a>
            </li>
            <li class="nxl-item">
              <a href="/lesson/list" class="nxl-link">
                <span class="nxl-micon"><i class="feather-file-text"></i></span>
                <span class="nxl-mtext">Хичээл</span>
              </a>
            </li>
          <?php }
          _selectRowNoParam(
            "SELECT COUNT(id) FROM `class` WHERE teacherid = '$user_id' and tuluv = 1",
            $myClass
          );
          if ($myClass > 0) { ?>
            <li class="nxl-item nxl-hasmenu">
              <a href="javascript:void(0);" class="nxl-link">
                <span class="nxl-micon"><i class="feather-user-check"></i></span>
                <span class="nxl-mtext">Манай анги</span><span class="nxl-arrow"><i class="feather-chevron-right"></i></span>
              </a>
              <ul class="nxl-submenu">
                <li class="nxl-item"><a class="nxl-link" href="/student/list">Суралцагчдын бүртгэл</a></li>
                <li class="nxl-item"><a class="nxl-link" href="/student/j-detial">Ирц бүртгэл</a></li>
              </ul>
            </li>
          <?php }
          if ($user_role == 1 || checkErh(9, $user_role, $user_id)) { ?>
            <li class="nxl-item nxl-hasmenu">
              <a href="javascript:void(0);" class="nxl-link">
                <span class="nxl-micon"><i class="feather-cast"></i></span>
                <span class="nxl-mtext">Ирцийн тайлан, "А" цаг</span><span class="nxl-arrow"><i class="feather-chevron-right"></i></span>
              </a>
              <ul class="nxl-submenu">
                <?php
                if ($user_role == 1) { ?>
                  <?php if ($myClass > 0) { ?>
                    <li class="nxl-item"><a class="nxl-link" href="/report/att">Ангийн ирц</a></li>
                    <li class="nxl-item"><a class="nxl-link" href="/report/tetgeleg">Тэтгэлэг</a></li>
                  <?php  } ?>
                  <li class="nxl-item"><a class="nxl-link" href="/report/cag">Цагийн тооцоо</a></li>
                  <li class="nxl-item"><a class="nxl-link" href="/report/list">Ирц бүртгэл</a></li>
                  <li class="nxl-item"><a class="nxl-link" href="/report/jurnal">Журнал</a></li>
                <?php }
                if (checkErh(9, $user_role, $user_id)) {
                ?>
                  <li class="nxl-item"><a class="nxl-link" href="/report/class-percent">Ангийн ирц гүйцэтгэл</a></li>
                  <li class="nxl-item"><a class="nxl-link" href="/report/class">Ангийн ирц бүртгэл</a></li>
                  <?php if ($user_role != 1) { ?>
                    <li class="nxl-item"><a class="nxl-link" href="/report/list">Багшийн ирц бүртгэл</a></li>
                    <li class="nxl-item"><a class="nxl-link" href="/report/att">Ангийн ирц хувиар</a></li>
                    <li class="nxl-item"><a class="nxl-link" href="/report/jurnal">Журнал</a></li>
                    <li class="nxl-item"><a class="nxl-link" href="/report/tetgeleg">Тэтгэлэг</a></li>
                <?php }
                }
                ?>
              </ul>
            </li>
          <?php }
          if (checkErh(12, $user_role, $user_id)) { ?>
            <li class="nxl-item nxl-hasmenu">
              <a href="javascript:void(0);" class="nxl-link">
                <span class="nxl-micon"><i class="feather-disc"></i></span>
                <span class="nxl-mtext">"Б" цаг</span><span class="nxl-arrow"><i class="feather-chevron-right"></i></span>
              </a>
              <ul class="nxl-submenu">
                <li class="nxl-item"><a class="nxl-link" href="/btime/teacher/current">Тайлан бичих</a></li>
                <li class="nxl-item"><a class="nxl-link" href="/btime/teacher/list">Тайлагийн түүх</a></li>
              </ul>
            </li>
          <?php }
          if (checkErh(11, $user_role, $user_id)) { ?>
            <li class="nxl-item nxl-hasmenu">
              <a href="javascript:void(0);" class="nxl-link">
                <span class="nxl-micon"><i class="feather-edit-3"></i></span>
                <span class="nxl-mtext">"Б" цагийн тооцоо</span><span class="nxl-arrow"><i class="feather-chevron-right"></i></span>
              </a>
              <ul class="nxl-submenu">
                <li class="nxl-item"><a class="nxl-link" href="/btime/work/bodoh">"Б" цаг тооцох</a></li>
                <li class="nxl-item"><a class="nxl-link" href="/btime/work/add">Ажил үйлчилгээ</a></li>
                <li class="nxl-item"><a class="nxl-link" href="/btime/work/btime_report">Нэгтгэл хэвлэх</a></li>
                <li class="nxl-item"><a class="nxl-link" href="/btime/work/analyst">Статистик</a></li>
              </ul>
            </li>
          <?php }
          if (checkErh(1, $user_role, $user_id) == true || checkErh(2, $user_role, $user_id)) {
          ?>
            <li class="nxl-item nxl-hasmenu">
              <a href="javascript:void(0);" class="nxl-link">
                <span class="nxl-micon"><i class="feather-clock"></i></span>
                <span class="nxl-mtext">Цаг бүртгэл</span><span class="nxl-arrow"><i class="feather-chevron-right"></i></span>
              </a>
              <ul class="nxl-submenu">
                <?php if (checkErh(1, $user_role, $user_id)) { ?>
                  <li class="nxl-item"><a class="nxl-link" href="/att_users/attre">Тайлан гаргах</a></li>
                <?php }
                if (checkErh(2, $user_role, $user_id)) { ?>
                  <li class="nxl-item"><a class="nxl-link" href="/att_users/add">Цаг бүртгэх</a></li>
                <?php } ?>
              </ul>
            </li>
          <?php }
          if (checkErh(3, $user_role, $user_id)) {
          ?>
            <li class="nxl-item nxl-hasmenu">
              <a href="javascript:void(0);" class="nxl-link">
                <span class="nxl-micon"><i class="feather-message-circle"></i></span>
                <span class="nxl-mtext">Зар, мэдэгдэл</span><span class="nxl-arrow"><i class="feather-chevron-right"></i></span>
              </a>
              <ul class="nxl-submenu">
                <li class="nxl-item"><a class="nxl-link" href="/noti/send">Илгээсэн зар</a></li>
                <li class="nxl-item"><a class="nxl-link" href="/noti/new">Зар илгээх</a></li>
              </ul>
            </li>
          <?php }
          if (checkErh(4, $user_role, $user_id)) { ?>
            <li class="nxl-item nxl-hasmenu">
              <a href="javascript:void(0);" class="nxl-link">
                <span class="nxl-micon"><i class="feather-settings"></i></span>
                <span class="nxl-mtext">Тохиргоо</span><span class="nxl-arrow"><i class="feather-chevron-right"></i></span>
              </a>
              <ul class="nxl-submenu">
                <li class="nxl-item"><a class="nxl-link" href="/setting/alba">Алба, хэлтэс</a></li>
                <li class="nxl-item"><a class="nxl-link" href="/setting/teacher_normal">Багшийн зэрэг, норм</a></li>
                <li class="nxl-item"><a class="nxl-link" href="/setting/lesson_att">Хичээлийг цаг</a></li>
                <li class="nxl-item"><a class="nxl-link" href="/setting/jil">Хичээлийг жил</a></li>
                <li class="nxl-item"><a class="nxl-link" href="/setting/at">Албан тушаал</a></li>
                <li class="nxl-item"><a class="nxl-link" href="/setting/erh">Хандах эрх</a></li>
                <li class="nxl-item"><a class="nxl-link" href="/setting/cag">Цаг бүртгэл</a></li>
              </ul>
            </li>
          <?php }
          if (checkErh(8, $user_role, $user_id)) { ?>
            <li class="nxl-item nxl-hasmenu">
              <a href="javascript:void(0);" class="nxl-link">
                <span class="nxl-micon"><i class="feather-pie-chart"></i></span>
                <span class="nxl-mtext">Судалгаа</span><span class="nxl-arrow"><i class="feather-chevron-right"></i></span>
              </a>
              <ul class="nxl-submenu">
                <li class="nxl-item"><a class="nxl-link" href="/sudalgaa/shalguurlist">Шалгуур үзүүлэлт</a></li>
                <li class="nxl-item"><a class="nxl-link" href="/sudalgaa/statistics/stschool-detial">Ангиуд</a></li>
                <li class="nxl-item"><a class="nxl-link" href="/sudalgaa/statistics/stcompare">Харьцуулалт</a></li>
                <li class="nxl-item"><a class="nxl-link" href="/sudalgaa/statistics/stnegtgel">Нэгтгэл</a></li>
                <li class="nxl-item"><a class="nxl-link" href="/sudalgaa/statistics/ersdel">Эрсдлийн түвшин</a></li>
              </ul>
            </li>
            <li class="nxl-item nxl-hasmenu">
              <a href="javascript:void(0);" class="nxl-link">
                <span class="nxl-micon"><i class="feather-grid"></i></span>
                <span class="nxl-mtext">Үйлдвэрчин</span><span class="nxl-arrow"><i class="feather-chevron-right"></i></span>
              </a>
              <ul class="nxl-submenu">
                <li class="nxl-item"><a class="nxl-link" href="/ui/plan">Шалгуур үзүүлэлт</a></li>
                <li class="nxl-item"><a class="nxl-link" href="/ui/income">Хуримтлал</a></li>
                <li class="nxl-item"><a class="nxl-link" href="/ui/deposit">Зарлага</a></li>
              </ul>
            </li>
          <?php } ?>
        </ul>
      </div>
    </div>
  </nav>
  <header class="nxl-header">
    <div class="header-wrapper">
      <!--! [Start] Header Left !-->
      <div class="header-left d-flex align-items-center gap-4">
        <!--! [Start] nxl-head-mobile-toggler !-->
        <a href="javascript:void(0);" class="nxl-head-mobile-toggler" id="mobile-collapse">
          <div class="hamburger hamburger--arrowturn">
            <div class="hamburger-box">
              <div class="hamburger-inner"></div>
            </div>
          </div>
        </a>
        <!--! [Start] nxl-head-mobile-toggler !-->
        <!--! [Start] nxl-navigation-toggle !-->
        <div class="nxl-navigation-toggle">
          <a href="javascript:void(0);" id="menu-mini-button">
            <i class="feather-align-left"></i>
          </a>
          <a href="javascript:void(0);" id="menu-expend-button" style="display: none">
            <i class="feather-arrow-right"></i>
          </a>
        </div>

      </div>
      <!--! [End] Header Left !-->
      <!--! [Start] Header Right !-->
      <div class="header-right ms-auto">
        <div class="d-flex align-items-center">
          <div class="nxl-h-item d-none d-sm-flex">
            <div class="full-screen-switcher">
              <a href="javascript:void(0);" class="nxl-head-link me-0" onclick="$('body').fullScreenHelper('toggle');">
                <i class="feather-maximize maximize"></i>
                <i class="feather-minimize minimize"></i>
              </a>
            </div>
          </div>
          <div class="nxl-h-item dark-light-theme">
            <a href="javascript:void(0);" class="nxl-head-link me-0 dark-button">
              <i class="feather-moon"></i>
            </a>
            <a href="javascript:void(0);" class="nxl-head-link me-0 light-button" style="display: none">
              <i class="feather-sun"></i>
            </a>
          </div>
          <div class="dropdown nxl-h-item">
            <a class="nxl-head-link me-3" data-bs-toggle="dropdown" href="#" role="button" data-bs-auto-close="outside">
              <i class="feather-bell"></i>
              <span class="badge bg-danger nxl-h-badge">3</span>
            </a>
            <div class="dropdown-menu dropdown-menu-end nxl-h-dropdown nxl-notifications-menu">
              <div class="d-flex justify-content-between align-items-center notifications-head">
                <h6 class="fw-bold text-dark mb-0">Зар, мэдэгдэл</h6>
                <a href="javascript:void(0);" class="fs-11 text-success text-end ms-auto" data-bs-toggle="tooltip" title="Make as Read">
                  <i class="feather-check"></i>
                  <span>Уншсан</span>
                </a>
              </div>
              <div class="notifications-item">
                <img src="/assets/images/avatar/2.png" alt="" class="rounded me-3 border" />
                <div class="notifications-desc">
                  <a href="javascript:void(0);" class="font-body text-truncate-2-line"> <span class="fw-semibold text-dark">Админ</span> Програмын шинэчлэлтийн талаар!</a>
                  <div class="d-flex justify-content-between align-items-center">
                    <div class="notifications-date text-muted border-bottom border-bottom-dashed">2 минутын өмнө</div>
                    <div class="d-flex align-items-center float-end gap-2">
                      <a href="javascript:void(0);" class="d-block wd-8 ht-8 rounded-circle bg-gray-300" data-bs-toggle="tooltip" title="Make as Read"></a>
                      <a href="javascript:void(0);" class="text-danger" data-bs-toggle="tooltip" title="Remove">
                        <i class="feather-x fs-12"></i>
                      </a>
                    </div>
                  </div>
                </div>
              </div>
              <div class="text-center notifications-footer">
                <a href="javascript:void(0);" class="fs-13 fw-semibold text-dark">Бүгдийг харах</a>
              </div>
            </div>
          </div>
          <div class="dropdown nxl-h-item">
            <?php
            $img = "/images/user.jpg";
            $image_path = ROOT . "/www/images/users/$user_id-t.jpg";
            if (file_exists($image_path)) {
              $img = "/images/users/$user_id-t.jpg";
            }
            ?>
            <a href="javascript:void(0);" data-bs-toggle="dropdown" role="button" data-bs-auto-close="outside" class="d-flex">
              <img src="<?= $img ?>" alt="user-image" class="img-fluid user-avtar me-1" />
              <div class="d-flex flex-column">
                <?= substr(trim($user_fname), 0, 2) ?>.<?= $user_lname ?>
                <small style="font-size: 0.7rem;" class="text-danger"><?= $_SESSION['user_at'] ?></small>
              </div>
            </a>
            <div class="dropdown-menu dropdown-menu-end nxl-h-dropdown nxl-user-dropdown">
              <a href="/profile/info" class="dropdown-item">
                <i class="feather-user"></i>
                <span>Миний мэдээлэл</span>
              </a>
              <a href="/profile/password" class="dropdown-item">
                <i class="feather-settings"></i>
                <span>Нууц үг солих</span>
              </a>
              <div class="dropdown-divider"></div>
              <a href="/sign-out" class="dropdown-item">
                <i class="feather-log-out"></i>
                <span>Гарах</span>
              </a>
            </div>
          </div>
        </div>
      </div>
      <!--! [End] Header Right !-->
    </div>
  </header>
  <main class="nxl-container">
    <div class="nxl-content">