<?php

$uri_m = $this->uri->segment(2);
$uri_parent = $this->uri->segment(3);
$uri_child = $this->uri->segment(4);


$pending_users = $this->mDeliveryModel->get_pending_users();

?>


<?php if (GroupAccess::isGranted('delivery')) : ?>
<li class="treeview <?php if ($uri_m == "delivery") echo "active"; ?>">
    <a href="#"><i class="mdi mdi-package-variant-closed"></i> &nbsp;
        <span><?= Translate::sprint("Delivery") ?></span>
        <span class="pull-right-container">
                      <i class="fa fa-angle-left pull-right"></i>
                    </span>
    </a>

    <ul class="treeview-menu">


        <?php if (GroupAccess::isGranted('user', MANAGE_USERS)) : ?>

            <li class="<?php if ($uri_parent == "delivery") echo "active"; ?>">
                <a href="<?= admin_url("delivery/users") ?>">
                    <i class="mdi mdi-account-multiple"></i>
                    &nbsp;<span> <?= Translate::sprint("Delivery users") ?></span>

                    <?php if ($pending_users > 0): ?>
                        <small class="badge pull-right  bg-yellow"><?= $pending_users ?></small>
                    <?php endif; ?>
                </a>
            </li>

        <?php endif; ?>

        <?php if (GroupAccess::isGranted('delivery', MANAGE_DELIVERY_PAYOUTS)) : ?>

            <!--<li class="<?php if ($uri_parent == "delivery") echo "active"; ?>">
                <a href="<?= admin_url("delivery/payouts") ?>"><i class="mdi mdi-cash-100"></i>
                    &nbsp;<span> <?= Translate::sprint("Delivery payouts") ?></span>

                    <?php
                    $newRequests = $this->mDeliveryModel->getNewRequests();
                    ?>

                    <?php if ($newRequests > 0): ?>
                        <small class="badge pull-right  bg-yellow"><?= $newRequests ?></small>
                    <?php endif; ?>

                </a>
            </li>-->

        <?php endif; ?>


        <?php if (GroupAccess::isGranted('delivery', MANAGE_DELIVERY_USERS)) : ?>
            <li class="<?php if ($uri_parent == "delivery") echo "active"; ?>">
                <a href="<?= admin_url("delivery/delivery_config") ?>"><i class="mdi mdi-cog-outline"></i>
                    &nbsp;<span> <?= Translate::sprint("Delivery config") ?></span></a>
            </li>
        <?php endif; ?>



    </ul>
    </li>
<?php endif; ?>
