<?php
$cs = Yii::app()->getClientScript();

$baseUrl = Yii::app()->baseUrl;

$livesite = Yii::app()->getBaseUrl(true) . "/";

$modelCompanySettings = new MasCompanySettings();
$modelCompanySettings = $modelCompanySettings->find(array('condition' => 'crm_company_id=' . (int) Yii::app()->user->master_user_company_id));

$current_url = Yii::app()->urlManager->parseUrl(Yii::app()->request);

$mis = '';

switch ($current_url) {

    //MIS MENU

    case '':

        $mis = 'active';

        break;

    case 'mis/index':

        $mis = 'active';

        break;

    case 'hiredashboard/index':

        $mis = 'active';

        break;

    case 'site/index':

        $mis = 'active';

        break;

    case 'dashboard/View':

        $mis = 'active';

        break;

    case 'dashboard/MisDashboard':

        $mis = 'active';

        break;

    case 'managementinfo/index':

        $mis = 'active';

        break;

    case 'meeting/index/index':

        $mis = 'active';

        break;

    case 'desktop/index':

        $mis = 'active';

        break;

    case 'cockpit/index':

        $mis = 'active';

        break;

    case 'calendar/index':

        $mis = 'active';

        break;

    case 'todolist/index':

        $mis = 'active';

        break;
}
?>

<?php
if ($modelCompanySettings->mis_menu == 1) {
    // if ((int) Yii::app()->user->havePermissionOn['dashboard_view'] || (int) Yii::app()->user->havePermissionOn['mis_dashboard_view'] || Yii::app()->user->authorised_user == 1) {
    ?>

    <li id="mis" class="<?php echo $mis . ' has-sub l2'; ?>"><a href="javascript:void(0);" data-target="#mis_menu"><i class="fa fa-dashboard"></i><span>MIS Details</span></a>
    <!--<li id="mas_portal" class="<?php echo $mis . ' has-sub l2'; ?>"><a href="javascript:void(0);" data-target="#mis_menu"><i class="fa fa-dashboard"></i><span>MIS Details</span></a>-->

        <ul class="menu-2-sub" id="mis_menu">



            <!-- <?php
    //if ($allPermissions->mis_calendar == 1) {
    //if (isset(Yii::app()->user->havePermissionOn['calendar_view']) || Yii::app()->user->authorised_user == 1) {
    ?>

            <li><a href="<?php //echo $baseUrl;                    ?>/index.php?r=calendar/index">Calendar</a></li>

    <?php
    // }
    // }
    ?> -->

            <?php
            //  if ((int) Yii::app()->user->havePermissionOn['dashboard_view'] || Yii::app()->user->authorised_user == 1) {
            ?>

            <li><a href="<?php echo $baseUrl; ?>/index.php?r=site/index">Dashboard</a></li>

            <li style="display: none;"><a href="<?php echo $baseUrl; ?>/index.php?r=calendar/index" ><i class="fa fa-cogs"></i><span>&nbsp;Calender&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> </a></li>

    <?php
    //}


    if (isset(Yii::app()->user->havePermissionOn['mobile_dashboard_view']) || Yii::app()->user->authorised_user == 1) {
        ?>

                <?php
            }


            // if ((int) Yii::app()->user->havePermissionOn['mis_dashboard_view'] || Yii::app()->user->authorised_user == 1) {
            ?>

            <li style="display: none;"><a href="<?php echo $baseUrl; ?>/index.php?r=dashboard/MisDashboard">MIS Dashboard</a></li><?php
            //  }




            if (isset(Yii::app()->user->havePermissionOn['dashboard_view']) || Yii::app()->user->authorised_user == 1) {
                ?>

                                                                                                                                                                                                                                                                                                                                                                                    <!-- <li><a href="<?php //echo $baseUrl;                    ?>/index.php?r=managementinfo/index">Info</a></li>-->

        <?php
    }
    ?>

            <!-- li class="sub-l2"><a href="javascript:;">New Options</a>

                <ul class="sub-l2">

                    <li><a href="<?php echo $baseUrl; ?>/index.php?r=desktop/index"><i class="fa fa-desktop"></i>Desktop</a></li>

    <?php /* if ($allPermissions->mis_cockpit == 1) { ?>

      <?php if (isset(Yii::app()->user->havePermissionOn['cockpit_view']) || Yii::app()->user->authorised_user == 1) { ?>

      <li><a href="<?php echo $baseUrl; ?>/index.php?r=mis/index"><i class="fa fa-ship"></i> Cockpit</a></li>

      <?php

      }

      } */
    ?>

            <?php
            if ($allPermissions->mis_workspace == 1) {

                if (isset(Yii::app()->user->havePermissionOn['workspace_view']) || Yii::app()->user->authorised_user == 1) {

                }
            }

            if ($allPermissions->mis_meeting == 1) {

                if (isset(Yii::app()->user->havePermissionOn['meeting_view']) || Yii::app()->user->authorised_user == 1) {

                }
            }

            /* if ($allPermissions->master_shippingmethods == 1) {

              if (Yii::app()->user->authorised_user == 1 || isset(Yii::app()->user->havePermissionOn['shipping_method_view'])) {

              ?>

              <li><a href="<?php echo $baseUrl; ?>/index.php?r=logistics/index"><i class="fa fa-map-marker"></i> Tracking</a></li>

              <?php

              }

              } */
            ?>

            </ul>

        </li>-->

    <?php if (isset(Yii::app()->user->havePermissionOn['customer_activity']) || Yii::app()->user->authorised_user == 1) { ?>

                <!-- <li><a href="#" onclick="loadPopupModal('activity/calendarcreateactivity', 'Add New Activity', 'lg')">Activity</a></li> -->

    <?php } ?>

        </ul>

    </li> <?php
}
//  }
?>