<!-- Header start -->
<header class="header">
    <div class="toggle-btns">
        <a id="toggle-sidebar" href="#">
            <i class="icon-list"></i>
        </a>
        <a id="pin-sidebar" href="#">
            <i class="icon-list"></i>
        </a>
    </div>
    <div class="header-items">
        <!-- Custom search start -->
        <div class="custom-search">
            <input type="text" class="search-query" placeholder="جستجو کنید ...">
            <i class="icon-search1"></i>
        </div>
        <!-- Custom search end -->

        <!-- Header actions start -->
        <ul class="header-actions">
            <li class="dropdown">
                <a href="#" id="notifications" data-toggle="dropdown" aria-haspopup="true">
                    <i class="icon-bell"></i>
                    <span class="count-label"><?= $this->event_countToday ?></span>
                </a>
                <div class="dropdown-menu dropdown-menu-right lrg" aria-labelledby="notifications">
                    <div class="dropdown-menu-header">
                        اعلانات (<?= $this->event_count ?>)
                    </div>
                    <ul class="header-notifications">
                        <?php
                        foreach ($this->event as $event) {
                            echo '
                                <li>
                                    <a href="#">
                                        <div class="user-img away">
                                            <img src="' . base_url('Assets/userImg/') . $event->user_Img . '" alt="User">
                                        </div>
                                        <div class="details">
                                            <div class="user-title">' . $event->user_firstName . ' ' . $event->user_lastName . '</div>
                                            <div class="noti-details">' . substr($event->event_Description, 0, 50) . '...</div>
                                            <div class="noti-date">' . $event->event_Date . ' - ' . $event->event_Time . '</div>
                                        </div>
                                    </a>
                                </li>
                                ';
                        }
                        ?>
                        <li class="text-center">
                            <a target="_blank" href="<?= base_url('Dashboard/event') ?>">
                                <p class="text-center">مشاهده بیشتر</p>
                            </a>
                        </li>

                    </ul>
                </div>
            </li>
            <li class="dropdown">
                <a href="#" id="userSettings" class="user-settings" data-toggle="dropdown" aria-haspopup="true">
                    <span class="user-name"><?= $this->user_name ?></span>
                    <span class="avatar">
                        <?php
                        if ($this->user_access == "1")
                            echo "مدیر";
                        else
                            echo "انباردار";
                        ?>
                        <span class="status busy"></span></span>
                </a>
                <div class="dropdown-menu dropdown-menu-right" aria-labelledby="userSettings">
                    <div class="header-profile-actions">
                        <div class="header-user-profile">
                            <div class="header-user">
                                <img src="<?= base_url('Assets/userImg/' . $this->user_img) ?>" alt="Admin Template">
                            </div>
                            <h5><?= $this->user_name ?></h5>
                            <p><?php
                                if ($this->user_access == "1")
                                    echo "مدیر";
                                else
                                    echo "انباردار";
                                ?>
                            </p>
                        </div>
                        <a href="<?= base_url('User/Setting') ?>"><i class="icon-user1"></i> پروفایل من</a>
                        <a href="<?= base_url('User/LogOut') ?>"><i class="icon-log-out1"></i> خروج از سیستم</a>
                    </div>
                </div>
            </li>
        </ul>
        <!-- Header actions end -->
    </div>
</header>
<!-- Header end -->
