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

$baseUrl = Yii::app()->getBaseUrl(true);
?>

<!DOCTYPE html>

<html lag="en">



    <head>

        <meta charset="utf-8">

        <meta http-equiv="X-UA-Compatible" content="IE=edge">

        <title>YAMAHA | Dashboard</title>

        <!-- Tell the browser to be responsive to screen width -->

        <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">

        <link href="https://fonts.googleapis.com/css?family=Ubuntu:300,400,500,700" rel="stylesheet">

        <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">

        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jstree/3.2.1/themes/default/style.min.css" />

        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/clusterize.js/0.18.0/clusterize.css" />

        <script src="https://cdnjs.cloudflare.com/ajax/libs/clusterize.js/0.18.0/clusterize.js"></script>

        <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300">

        <link rel="stylesheet" href="https://cdn.rawgit.com/yahoo/pure-release/v0.6.0/pure-min.css">

        <?php $cs->registerCssFile($baseUrl . "/css/bootstrap.min.css"); ?>

        <?php $cs->registerCssFile($baseUrl . "/css/font-awesome.min.css"); ?>

        <?php $cs->registerCssFile($baseUrl . "/css/jquery.material.form.css"); ?>

        <?php $cs->registerCssFile($baseUrl . "/css/jquery-ui.css"); ?>

        <?php $cs->registerCssFile($baseUrl . "/css/jquery.alerts.css"); ?>

        <?php $cs->registerCssFile($baseUrl . "/css/admin/admin-style.css"); ?>

        <?php $cs->registerCssFile($baseUrl . "/css/admin/tree-style.css"); ?>

        <?php $cs->registerCssFile($baseUrl . "/css/admin/accordian_nav/style.css"); ?>

        <?php $cs->registerCssFile($baseUrl . "/plugins/xChart/xcharts.css"); ?>

        <?php $cs->registerCssFile($baseUrl . "/plugins/toastr8/toastr8.min.css"); ?>

        <?php $cs->registerCssFile($baseUrl . "/plugins/fullcalendar/fullcalendar.css"); ?>

        <?php $cs->registerCssFile($baseUrl . "/plugins/fullcalendar/fullcalendar.print.css"); ?>

        <?php $cs->registerCssFile($baseUrl . "/plugins/multiselect/bootstrap-multiselect.css"); ?>

        <?php $cs->registerCssFile($baseUrl . "/plugins/clockpicker/bootstrap-clockpicker.min.css"); ?>

        <?php $cs->registerCssFile($baseUrl . "/plugins/datetimepicker/bootstrap-datetimepicker.css"); ?>

        <?php $cs->registerCssFile($baseUrl . "/plugins/datatable/datatable.css"); ?>

        <?php $cs->registerCssFile($baseUrl . "/plugins/nvd3/nv.d3.min.css"); ?>

        <?php $cs->registerCssFile($baseUrl . "/css/HoldOn.css"); ?>







        <!-- SCRIPT FILES -->

        <?php $cs->registerScriptFile($baseUrl . "/js/jquery-2.1.4.min.js", CClientScript::POS_HEAD); ?>

        <?php $cs->registerScriptFile($baseUrl . "/js/bootstrap.min.js", CClientScript::POS_HEAD); ?>

        <?php $cs->registerScriptFile($baseUrl . "/js/jquery-ui.js", CClientScript::POS_HEAD); ?>

        <?php $cs->registerScriptFile($baseUrl . "/js/jstree.js", CClientScript::POS_HEAD); ?>

        <?php $cs->registerScriptFile($baseUrl . "/js/jquery.alerts.js", CClientScript::POS_HEAD); ?>

        <?php $cs->registerScriptFile($baseUrl . "/js/jquery.material.form.js", CClientScript::POS_HEAD); ?>

        <?php $cs->registerScriptFile($baseUrl . "/js/jquery.nicescroll.js", CClientScript::POS_HEAD); ?>

        <?php $cs->registerScriptFile($baseUrl . "/plugins/d3/d3.min.js", CClientScript::POS_HEAD); ?>

        <?php $cs->registerScriptFile($baseUrl . "/plugins/xChart/d3.v3.min.js", CClientScript::POS_HEAD); ?>

        <?php $cs->registerScriptFile($baseUrl . "/plugins/xChart/xcharts.js", CClientScript::POS_HEAD); ?>

        <?php $cs->registerScriptFile($baseUrl . "/plugins/Sparkline/jquery.sparkline.min.js", CClientScript::POS_HEAD); ?>

        <?php $cs->registerScriptFile($baseUrl . "/plugins/jquery-ui/jquery-ui.min.js", CClientScript::POS_HEAD); ?>

        <?php $cs->registerScriptFile($baseUrl . "/plugins/toastr8/toastr8.min.js", CClientScript::POS_HEAD); ?>

        <?php $cs->registerScriptFile($baseUrl . "/plugins/fullcalendar/lib/moment.min.js", CClientScript::POS_HEAD); ?>

        <?php $cs->registerScriptFile($baseUrl . "/plugins/fullcalendar/fullcalendar.min.js", CClientScript::POS_HEAD); ?>

        <?php $cs->registerScriptFile($baseUrl . "/js/eModal.min.js", CClientScript::POS_HEAD); ?>

        <?php $cs->registerScriptFile($baseUrl . "/js/tree.min.js", CClientScript::POS_HEAD); ?>

        <?php $cs->registerScriptFile($baseUrl . "/js/jquery.form-validator.min.js", CClientScript::POS_HEAD); ?>

        <?php //$cs->registerScriptFile($baseUrl . "/js/jquery.maskedinput.js", CClientScript::POS_HEAD);
        ?>

        <?php $cs->registerScriptFile($baseUrl . "/js/jquery.mask.min.js", CClientScript::POS_HEAD); ?>

        <?php $cs->registerScriptFile($baseUrl . "/plugins/multiselect/bootstrap-multiselect.js", CClientScript::POS_HEAD); ?>

        <?php $cs->registerScriptFile($baseUrl . "/plugins/clockpicker/bootstrap-clockpicker.min.js", CClientScript::POS_HEAD); ?>

        <?php $cs->registerScriptFile($baseUrl . "/plugins/datetimepicker/bootstrap-datetimepicker.js", CClientScript::POS_HEAD); ?>

        <?php $cs->registerScriptFile($baseUrl . "/plugins/datatable/jquery.dataTables.js", CClientScript::POS_HEAD); ?>

        <?php $cs->registerScriptFile($baseUrl . "/plugins/datatable/dataTables.bootstrap.js", CClientScript::POS_HEAD); ?>

        <?php $cs->registerScriptFile($baseUrl . "/plugins/datatable/dataTables.fixedHeader.js", CClientScript::POS_HEAD); ?>

        <?php $cs->registerScriptFile($baseUrl . "/plugins/chartjs/Chart.min.js", CClientScript::POS_HEAD); ?>

        <?php $cs->registerScriptFile($baseUrl . "/plugins/nvd3/nv.d3.min.js", CClientScript::POS_HEAD); ?>

        <?php $cs->registerScriptFile($baseUrl . "/js/tinymce.min.js", CClientScript::POS_HEAD); ?>

        <?php $cs->registerScriptFile($baseUrl . "/js/admin/script.js", CClientScript::POS_END); ?>

        <?php $cs->registerScriptFile($baseUrl . "/js/common.js", CClientScript::POS_END); ?>

        <?php $cs->registerScriptFile($baseUrl . "/js/paginathing.js", CClientScript::POS_END); ?>

        <?php $cs->registerScriptFile($baseUrl . "/js/HoldOn.js", CClientScript::POS_END); ?>





        <?php $cs->registerScriptFile($baseUrl . "/js/admin/accordian_nav/script.js", CClientScript::POS_END); ?>

        <!-- Notifiaction  -->

        <?php $cs->registerCssFile($baseUrl . '/css/jquery.pnotify.default.css'); ?>

        <?php $cs->registerScriptFile($baseUrl . '/js/jquery.pnotify.min.js', CClientScript::POS_END); ?>

        <!-- END Notifiaction  -->

        <?php $cs->registerScript('pins-notify', 'function notification(msg,type) {

    var opts = {

      title: "Messages",

      text: msg,

      hide: true,

      nonblock: false,

      nonblock_opacity: .2,

      animation: {

        "effect_in": "drop",

      }

    };

    switch (type) {

      case "error":

      opts.title = "Error";

      opts.text = msg;

      opts.type = "error";

      opts.hide = false;

      break;

      case "info":

      opts.title = "Information";

      opts.text = msg;

      opts.type = "info";

      opts.hide = false;

      break;

      case "success":

      opts.title = "Success";

      opts.text = msg;

      opts.type = "success";

      opts.nonblock= true;

      break;

    }

    $.pnotify(opts);

  }

  ', CClientScript::POS_HEAD); ?>

        <?php $cs->registerScript("autocomplete-source-section", " function autoCompleteSource(request, response,url) {  console.log('auto-complete-common'); $.ajax({ type      : 'GET', data    : 'term='+ request.term, url       : url, dataType  : 'json', success : function(data) { response($.map( data, function( n, i ) { return { label :  n.label,  value : n.value, shipping_adds : n.shipping_adds, billing_adds : n.billing_adds, stock_id : n.stock_id, unit : n.unit, description : n.description, coo : n.coo, hsc : n.hsc, nt_weight : n.nt_weight, gr_weight : n.gr_weight, cbm : n.cbm, payment_term : n.payment_term, destination : n.destination, currency : n.currency }  })); } }); } ", CClientScript::POS_HEAD); ?>

        <?php $cs->registerScript("isRowEmpty", " function isRowEmpty(tr) { var rowfilled=false; tr.find('td:gt(0)').each(function() { inpt    =   $(this).find('input').val(); if(typeof inpt !== 'undefined' && inpt!=='' && inpt!=='0.00') { rowfilled=true; return false;  } }); if(rowfilled) return (confirm('Do you want to remove this item?')); return true; } ", CClientScript::POS_HEAD); ?>

        <?php $cs->registerScript("addTableRow", " function addTableRow(jQtable) {

                $('.quotation-helper,.purchase-helper,.stock-helper').each(function(){ $(this).hide(); $(this).find('table').remove();});

                formIdStarter   =   jQtable.attr('id').split(/_(.+)?/)[0];

                lastId = jQtable.find('tr:last input:first').attr('id');



                thenum = lastId.match(/\d+/g);

                newId = Number(thenum) + 1;

                //alert(thenum);

                newrow= jQtable.find('tr:last').clone();

                newrow.find('label:first').html(newId+1);

                newrow.attr('class',newId);

                newrow.find('.hasDatepicker').removeClass('hasDatepicker');

                newrow.find('.datetimepicker').siblings().remove();

                newrow.find('.datetimepicker').datetimepicker( 'destroy' );

                newrow.find('a,div,input,textarea,checkbox,select,.errorMessage').each(function() {

                    this.id= this.id.replace(/\d+/,newId);

                   if(!$(this).is(':checkbox'))

                        this.value  = '';

                    else

                        $(this).prop('checked', false);

                    (this.name!==undefined) ? this.name= this.name.replace(/\d+/,newId) : this.style  =   '';});

                jQtable.append(newrow);

                //$('#OutboundCites_'+newId+'_collection_date').datetimepicker({format: 'DD/MM/YYYY'});



    }", CClientScript::POS_HEAD); ?>

        <?php
        $cs->registerScript(
                "removeTableRow",
                " function removeTableRow(jQtable,evt) {

            formIdStarter   =   jQtable.attr('id').split(/_(.+)?/)[0];

            var num_rows    =   jQtable.find('tr:gt(0)').length;

            if(num_rows>1){

            var tr  =   $(evt).parent().parent();

            if(isRowEmpty(tr)) {

                amount = $(evt).parents('tr').find('[id$=\"_amount\"]').val();

                total =   $('.'+formIdStarter+'_total .total').text();

                total =   (Number(total)-Number(amount)).toFixed(2);

                $('.'+formIdStarter+'_total .total').text(total)

                gd_total =   $('.'+formIdStarter+'_grand_total .grandtotal').text();

                gd_total =   (Number(gd_total)-Number(amount)).toFixed(2);

                $('.'+formIdStarter+'_grand_total .grandtotal').text(gd_total);

                $(evt).parents('tr').remove();

                var i=0;

                jQtable.find('tr:gt(0)').each(function() { $(this).find('input,select,textarea,.errorMessage').each(function()

                {

                old_id   =   $(this).attr('id');

                new_id   =   old_id.replace(/\d+/,i);

                $('#OutboundInvoiceItems_'+i+'_row_id').val(i);

                $(this).attr('id',new_id);

                old_name =   $(this).attr('name');



                if(old_name!==undefined) {

                    new_name =   old_name.replace(/\d+/,i);

                    $(this).attr('name',new_name);} });

                    $(this).find('td:first label').html(++i); });

		//if(jQtable=='delivery_item_table'){



			bottom_total();

		//}





}

                    //adjustPopup();

                    } else alert('Atleast one item needed here'); }",
                CClientScript::POS_HEAD
        );
        ?>

        <?php $cs->registerScript("capitalize-first-letter", " function capitaliseFirstLetter(string) {console.log('letter-capitalise'); return string.charAt(0).toUpperCase() + string.slice(1); } ", CClientScript::POS_HEAD); ?>



        <?php $cs->registerScript("removeExtrasRow", " function removeExtrasRow(jQtable,evt) {

            formIdStarter   =   jQtable.attr('id').split(/_(.+)?/)[0];

            var num_rows    =   jQtable.find('tr').length;

            extra_val = $(evt).parents('tr').find('input:eq(2)').val();

            gd_total =   $('.'+formIdStarter+'_grand_total .grandtotal').text();

            gd_total=gd_total.replace(/,/g , '');

            if(jQtable.attr('id')==='purchasingOrder_final_add_table' || jQtable.attr('id')==='quotes_final_add_table' || jQtable.attr('id')==='order_final_add_table')

                gd_total =   (Number(gd_total)-Number(extra_val)).toFixed(2);

            else gd_total =   (Number(gd_total)+Number(extra_val)).toFixed(2);

            $('.'+formIdStarter+'_grand_total .grandtotal').text(gd_total);

            if(num_rows>1) $(evt).parents('tr').remove();

            else $(evt).parents('tr').find('input').val('');

        }

        ", CClientScript::POS_HEAD); ?>

        <?php $cs->registerScript("isNumberKey", " function isNumberKey(evt) { console.log('is-number-key'); var charCode = (evt.which) ? evt.which : evt.keyCode; if (charCode > 31 && (charCode < 48 || charCode > 57) && charCode !== 46 && charCode !== 37) return false; return true; }", CClientScript::POS_HEAD); ?>

        <?php $cs->registerScript("isNumber", " function isNumber(n) { console.log('is-number'); return !isNaN(parseFloat(n)) && isFinite(n); } ", CClientScript::POS_HEAD); ?>

        <?php
        $cs->registerScript("reloadTable", "function reloadTable(table_id){

                var table = $(table_id).DataTable();

                table.ajax.reload( function ( json ) {

                      $('#myInput').val( json.lastInput );

                } );

        }", CClientScript::POS_HEAD);

        $cs->registerScript("isPositiveNumber", " function isPositiveNumber(event) {

            if (event.which != 8 && event.which != 0 &&(event.which != 46 || $(this).val().indexOf('.') != -1) && (event.which < 48 || event.which > 57)) {

                event.preventDefault();

            }

        } ", CClientScript::POS_HEAD);
        ?>

    </head>

    <?php
    $operations = '';

    $master = '';

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

    $masstyleclass = '';
    $adnstyleclass = '';
    $ordreptstyleclass = '';
    $operationsstyleclass = '';

    switch ($current_url) {

        //Master MENU

        case 'distributer/index':

            $master = 'active';

            $masstyleclass = 'style="display: block;"';

            break;

        case 'masproductcategory/index':

            $master = 'active';

            $masstyleclass = 'style="display: block;"';

            break;

        case 'masregion/index':

            $master = 'active';

            $masstyleclass = 'style="display: block;"';

            break;

        case 'MasComments/index':

            $master = 'active';

            $masstyleclass = 'style="display: block;"';

            break;
        case 'distributertype/index':

            $master = 'active';

            $masstyleclass = 'style="display: block;"';

            break;

        case 'initialbacklog/index':

            $master = 'active';

            $masstyleclass = 'style="display: block;"';

            break;

        case 'inventory/index':

            $master = 'active';

            $masstyleclass = 'style="display: block;"';

            break;
        case 'hiddengmc/index':

            $master = 'active';

            $masstyleclass = 'style="display: block;"';

            break;

        case 'mastersettings/create':

            $master = 'active';

            $masstyleclass = 'style="display: block;"';

            break;

        //Master MENU end
        //Operations MENU

        case 'order/index':

            $operations = 'active';

            $operationsstyleclass = 'style="display: block;"';

            break;

        case 'order/ConsolidatedOrder':

            $operations = 'active';

            $operationsstyleclass = 'style="display: block;"';

            break;

        case 'inventoryupload/inventoryindex':

            $operations = 'active';

            $operationsstyleclass = 'style="display: block;"';

            break;

        case 'inventoryupload/goodsinindex':

            $operations = 'active';

            $operationsstyleclass = 'style="display: block;"';

            break;

        //added by rahul 19-5-22//

        case 'uploadunshipped/index':

            $operations = 'active';

            $operationsstyleclass = 'style="display: block;"';

            break;

        //added by rahul 19-5-22//

        case 'uploadbacklog/index':

            $operations = 'active';

            $operationsstyleclass = 'style="display: block;"';

            break;

        case 'supplyconfirmation/index':

            $operations = 'active';

            $operationsstyleclass = 'style="display: block;"';

            break;

        case 'uploadsales/index':

            $operations = 'active';

            $operationsstyleclass = 'style="display: block;"';

            break;

        case 'reports/ConsolidatedSupplyConfirmation':

            $operations = 'active';

            $operationsstyleclass = 'style="display: block;"';

            break;

        //Operations MENU end







        case 'masproductcategory/index':

            $master = 'active';

            $masstyleclass = 'style="display: block;"';

            break;

        case 'users/index':

            $admin = 'active';

            $adnstyleclass = 'style="display: block;"';

            break;

        case 'usergroup/index':

            $admin = 'active';

            $adnstyleclass = 'style="display: block;"';

            break;

        case 'auditlog/index':

            $admin = 'active';

            $adnstyleclass = 'style="display: block;"';

            break;
        case 'ordertakingreport/index':
            $ordreport = 'active';
            $ordreptstyleclass = 'style="display: block;"';
            break;
        case 'ordertakingreport/report':
            $ordreport = 'active';
            $ordreptstyleclass = 'style="display: block;"';
            break;
    }
    ?>

    <script>

    </script>



    <body class="menu-closed">

        <header class="main">

            <div class="logo-holder">

                <div class="logo"><img src="images/logo1.png"></div>

                <div class="menu-ham open">

                    <span></span>

                    <span></span>

                    <span></span>

                    <span></span>

                    <span></span>

                    <span></span>

                </div>

            </div>

            <div class="header-right">

                <div class="submenu-holder" id="submenu-holder">

                </div>

                <div class="hrt menu-2">

                    <!--  notification end -->

                    <div class="pull-right profile">

                        <ul class="nav top-menu dd-list">

                            <!-- settings start -->



                            <!-- inbox dropdown end -->

                        </ul>

                        <!--search & user info start-->

                        <ul class="nav top-menu">

                            <!-- user login dropdown start-->

                            <li class="dropdown">

                                <a data-toggle="dropdown" class="dropdown-toggle" href="#">

                                    <img alt="" src="images/avatar.png" width="30px" height="30px">

                                    <span class="username"><?php
                                        $user = User::model()->findByPk(Yii::app()->user->id);
                                        echo $user->username;
                                        ?></span>

                                    <b class="caret"></b>

                                </a>

                                <ul class="dropdown-menu extended logout">

                                    <div class="log-arrow-up"></div>

                                <!--<li><a href="#" onclick="loadPopupModal('users/profile', 'View Profile', 'lg')"><i class=" fa fa-suitcase"></i>Profile</a></li>-->

                                <!--<li><a href="#"><i class="fa fa-cog"></i> Settings</a></li>-->

                                <!--<li><a href="#"><i class="fa fa-bell-o"></i> Notification</a></li>-->

                                    <li><a href="#" onclick="loadPopupModal('site/changepassword', 'Change Password', 'lg')"><i class="fa fa-key"></i> Change Password</a></li>

                                    <li><a href="<?php echo $baseUrl; ?>/administrator.php?r=site/logout"><i class="fa fa-key"></i> Log Out</a></li>



                                </ul>

                            </li>

                            <!-- user login dropdown end -->

                        </ul>

                    </div>

                </div>


            </div>

        </header>



        <div id='cssmenu'>

            <ul>

                <?php
                if (
                        Yii::app()->user->authorised_user == 1 || isset(Yii::app()->user->havePermissionOn['menu_orders']) || isset(Yii::app()->user->havePermissionOn['menu_consolidated_orders']) || isset(Yii::app()->user->havePermissionOn['menu_inventory']) || isset(Yii::app()->user->havePermissionOn['menu_goods_in']) || isset(Yii::app()->user->havePermissionOn['menu_supplyconfirmation']) || isset(Yii::app()->user->havePermissionOn['menu_sales']) || isset(Yii::app()->user->havePermissionOn['menu_backlog']) || isset(Yii::app()->user->havePermissionOn['menu_consolidated_supplyconfirmation']) || isset(Yii::app()->user->havePermissionOn['menu_unshipped_sales'])
                ) {
                    ?>

                    <li <?php echo "class='$operations has-sub l2'"; ?>><a href='#'><span><i class="fa fa-file"></i> Operations</span></a>

                        <ul <?php echo $operationsstyleclass; ?>>

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

                            <li><a href='<?php echo $this->createUrl('order/index') ?>'><span>Fixed Orders</span></a></li>

                            <?php } ?>

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

                            <li><a href='<?php echo $this->createUrl('order/ConsolidatedOrder') ?>'><span>Consolidated Orders</span></a></li>

                            <?php } ?>

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

                            <li><a href='<?php echo $this->createUrl('inventoryupload/inventoryindex') ?>'><span>Inventory</span></a></li>

                            <?php } ?>

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

                            <li><a href='<?php echo $this->createUrl('inventoryupload/goodsinindex') ?>'><span>Goods In</span></a></li>

                            <?php } ?>

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

                            <li><a href='<?php echo $this->createUrl('uploadunshipped/index') ?>'><span>Unshipped</span></a></li>

                            <?php } ?>

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

                            <li><a href='<?php echo $this->createUrl('uploadbacklog/index') ?>'><span>Backlog</span></a></li>

                            <?php } ?>

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

                            <li><a href='<?php echo $this->createUrl('supplyconfirmation/index') ?>'><span>Supply Confirmation</span></a></li>

                            <?php } ?>

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

                            <li><a href='<?php echo $this->createUrl('uploadsales/index') ?>'><span>Sales</span></a></li>

                            <?php } ?>

                            <?php if (Yii::app()->user->authorised_user == 1 || isset(Yii::app()->user->havePermissionOn['inv_ymgfstk_view'])) { ?>
                            <li><a href='<?php echo $this->createUrl('inventoryreport/stockIndex') ?>'><span> Inventory Report- YMGF_StockDetails</span></a></li>
                            <?php } ?>

                            <?php if (Yii::app()->user->authorised_user == 1 || isset(Yii::app()->user->havePermissionOn['inv_baselist_view'])) { ?>
                            <li><a href='<?php echo $this->createUrl('inventoryreport/baseinvIndex') ?>'><span> Inventory Report- BASE INVENTORY LIST</span></a></li>
                            <?php } ?>

                            <?php if (Yii::app()->user->authorised_user == 1 || isset(Yii::app()->user->havePermissionOn['inv_ymgf_psi_bgt_view'])) { ?>
                            <li><a href='<?php echo $this->createUrl('inventoryreport/budgetIndex') ?>'><span> Inventory Report - YMGF_PSI Budget</span></a></li>
                            <?php } ?>
                            
                            <?php if (Yii::app()->user->authorised_user == 1 || isset(Yii::app()->user->havePermissionOn['credithold_view'])) {  ?>
                            <li><a href='<?php echo $this->createUrl('credithold/index') ?>'><span> Credit Hold</span></a></li>
                            <?php }  ?>
                            
                            <?php if (Yii::app()->user->authorised_user == 1 || isset(Yii::app()->user->havePermissionOn['gw_report'])) {   ?>
                            <li><a href='<?php echo $this->createUrl('ordertakingreport/index') ?>'><span> GW Files</span></a></li>
                            <?php } ?>

                             <?php if (Yii::app()->user->authorised_user == 1 || isset(Yii::app()->user->havePermissionOn['bdgt_report'])) {   ?>
                            <li><a href='<?php echo $this->createUrl('ordertakingreport/budget') ?>'><span> Budget</span></a></li>
                            <?php } ?>

                            <?php if (Yii::app()->user->authorised_user == 1 || isset(Yii::app()->user->havePermissionOn['storage_upload_view'])) { ?>
                            <li><a href='<?php echo $this->createUrl('documentstorage/index') ?>'><span> Storage Upload</span></a></li>
                            <?php }  ?>

                        </ul>

                    </li>

                <?php } ?>

                <?php
                if (
                        Yii::app()->user->authorised_user == 1 || isset(Yii::app()->user->havePermissionOn['master_gmc_view']) || isset(Yii::app()->user->havePermissionOn['master_distributer_view']) || isset(Yii::app()->user->havePermissionOn['master_product_view']) || isset(Yii::app()->user->havePermissionOn['master_region_view']) || isset(Yii::app()->user->havePermissionOn['master_initialbacklog']) || isset(Yii::app()->user->havePermissionOn['master_setting_view'])
                ) {
                    ?>

                    <li <?php echo "class='$master has-sub l2'"; ?>><a href='#'><span><i class="fa fa-cogs"></i> Masters</span></a>

                        <ul <?php echo $masstyleclass; ?>>



                            <?php if (Yii::app()->user->authorised_user == 1 || isset(Yii::app()->user->havePermissionOn['master_gmc_view'])) { ?>
                                <li><a href='<?php echo $this->createUrl('inventory/index') ?>'><span>GMC</span></a></li>
                                <li><a href='<?php echo $this->createUrl('inventoryprice/index') ?>'><span>Price</span></a></li>
                            <?php } ?>

                            <?php if (Yii::app()->user->authorised_user == 1 || isset(Yii::app()->user->havePermissionOn['master_distributer_view'])) { ?>
                                <li><a href='<?php echo $this->createUrl('distributer/index') ?>'><span> Distributor</span></a></li>
                            <?php } ?>

                            <?php if (Yii::app()->user->authorised_user == 1 || isset(Yii::app()->user->havePermissionOn['master_product_view'])) { ?>
                                <li><a href='<?php echo $this->createUrl('masproductcategory/index') ?>'><span> Product Category</span></a></li>
                            <?php } ?>

                            <?php if (Yii::app()->user->authorised_user == 1 || isset(Yii::app()->user->havePermissionOn['master_region_price_view'])) { ?>
                            <li><a href='<?php echo $this->createUrl('masregion/index') ?>'><span> Region Price Type </span></a></li>
                            <?php } ?>

                            <?php if (Yii::app()->user->authorised_user == 1 || isset(Yii::app()->user->havePermissionOn['master_area_view'])) { ?>
                            <li><a href='<?php echo $this->createUrl('masarea/index') ?>'><span> Area </span></a></li>
                            <?php } ?>
                            <?php if (Yii::app()->user->authorised_user == 1 || isset(Yii::app()->user->havePermissionOn['master_comments_view'])) { ?>
                                <li><a href='<?php echo $this->createUrl('MasComments/index') ?>'><span>Comments</span></a></li>
                            <?php } ?>

                            <?php if (Yii::app()->user->authorised_user == 1 || isset(Yii::app()->user->havePermissionOn['master_distributer_type_view'])) { ?>
                            <li><a href='<?php echo $this->createUrl('Distributertype/index') ?>'><span>Distributer Type</span></a></li>
                            <?php } ?>

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

                            <li><a href='<?php echo $this->createUrl('mastersettings/create') ?>'><span> Settings</span></a></li>

                            <?php } ?>
                            <?php if (Yii::app()->user->authorised_user == 1 || isset(Yii::app()->user->havePermissionOn['master_rstd_gmc_view'])) { ?>
                            <li><a href='<?php echo $this->createUrl('hiddengmc/index') ?>'><span> Restricted GMCs</span></a></li>
                            <?php } ?>

                            <?php if (Yii::app()->user->authorised_user == 1 || isset(Yii::app()->user->havePermissionOn['master_category_view'])) { ?>
                            <li><a href='<?php echo $this->createUrl('categorytype/index') ?>'><span> Category Type</span></a></li>
                            <?php } ?>

                           

                            <?php if (Yii::app()->user->authorised_user == 1 || isset(Yii::app()->user->havePermissionOn['master_upld_category_view'])) { ?>
                            <li><a href='<?php echo $this->createUrl('documentcategory/index') ?>'><span> Reports Storage</span></a></li>
                            <?php } ?>


                        </ul>

                    </li>



                <?php } ?>

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

                    <li <?php echo "class='$admin has-sub l2'"; ?>><a href='#'><span><i class="fa fa-users"></i> Admin</span></a>

                        <ul <?php echo $adnstyleclass; ?>>

                                <?php if (Yii::app()->user->authorised_user == 1 || isset(Yii::app()->user->havePermissionOn['admin_users_add_edit'])) { ?>
                                <li><a href='<?php echo $this->createUrl('users/index') ?>'><span> Users</span></a></li>
                                <?php
                            }

                            if (Yii::app()->user->authorised_user == 1 || isset(Yii::app()->user->havePermissionOn['admin_usergroup_add'])) { ?>
                                <li><a href='<?php echo $this->createUrl('usergroup/index') ?>'><span> User Group</span></a></li>
                                <!--<li><a href='<?php //echo $this->createUrl('auditlog/index')
                                ?>'><span> Audit Log</span></a></li>-->
                            <?php } ?>
                            <?php if (Yii::app()->user->authorised_user == 1 || isset(Yii::app()->user->havePermissionOn['upload_static_order_view'])) { ?>
                            <li><a href='<?php echo $this->createUrl('uploadstaticdata/create') ?>'><span> Upload Static Order</span></a></li>
                            <?php } ?>

                            <?php if (Yii::app()->user->authorised_user == 1 || isset(Yii::app()->user->havePermissionOn['upload_static_other_view'])) { ?>
                            <li><a href='<?php echo $this->createUrl('uploadstaticdata/CreateInventoryGoodsIn') ?>'><span> Upload Static Other</span></a></li>
                            <?php } ?>

                        </ul>



                    </li>

<?php } ?>
<?php if (
    Yii::app()->user->authorised_user == 1
    || isset(Yii::app()->user->havePermissionOn['gw_report'])
    || isset(Yii::app()->user->havePermissionOn['odr_tkg_smry_report'])
    || isset(Yii::app()->user->havePermissionOn['unshipped_distrwse_report'])
    || isset(Yii::app()->user->havePermissionOn['unshipped_catgryrwse_report'])
    || isset(Yii::app()->user->havePermissionOn['bdgt_report'])
    || isset(Yii::app()->user->havePermissionOn['distr_wse_smry_report'])
    || isset(Yii::app()->user->havePermissionOn['catgry_wse_smry_report'])
    || isset(Yii::app()->user->havePermissionOn['top_mdl_tkg_report'])
    || isset(Yii::app()->user->havePermissionOn['consupplyconf_view'])
    || isset(Yii::app()->user->havePermissionOn['inv_rpt_view'])
    || isset(Yii::app()->user->havePermissionOn['credithold_view'])
) { ?>
                <li <?php echo "class='$ordreport has-sub l2'"; ?>><a href='#'><span><i class="fa fa-users"></i> Reports</span></a>

                    <ul <?php echo $ordreptstyleclass; ?>>
                        <?php if (Yii::app()->user->authorised_user == 1 || isset(Yii::app()->user->havePermissionOn['consupplyconf_view'])) { ?>
                        <li><a href='<?php echo $this->createUrl('reports/ConsolidatedSupplyConfirmation') ?>'><span> Consolidated Supply Confirmation</span></a></li>
                        <?php } ?>

                        <?php if (Yii::app()->user->authorised_user == 1 || isset(Yii::app()->user->havePermissionOn['inv_rpt_view'])) { ?>
                        <li><a href='<?php echo $this->createUrl('inventoryreport/index') ?>'><span> Inventory Report</span></a></li>
                        <?php } ?>

                        <?php if (Yii::app()->user->authorised_user == 1 || isset(Yii::app()->user->havePermissionOn['distr_wse_smry_report'])) { ?>
                        <li><a href='<?php echo $this->createUrl('reports/ConsolidatedOrderReport') ?>'><span> Distributor wise Order Report</span></a></li>
                        <?php } ?>
                        <!-- new-->
                        <!-- updated by nisha 17-10-2025 -->
                        <?php if (Yii::app()->user->authorised_user == 1 || isset(Yii::app()->user->havePermissionOn['credithold_report_view'])) {  ?>
                        <li class=""><a href='<?php echo $this->createUrl('credithold/reportIndex&type=1') ?>'><span> Credit Hold Report - Master File</span></a></li>
                        <?php }  ?>
                        <?php if (Yii::app()->user->authorised_user == 1 || isset(Yii::app()->user->havePermissionOn['credithold_report_distributor_view'])) {  ?>
                        <li class=""><a href='<?php echo $this->createUrl('credithold/reportIndex&type=2') ?>'><span> Credit Hold Report - Distributor</span></a></li>
                        <?php }  ?>
                        <?php if (Yii::app()->user->authorised_user == 1 || isset(Yii::app()->user->havePermissionOn['credithold_report_region_view'])) {  ?>
                        <li class=""><a href='<?php echo $this->createUrl('credithold/reportIndex&type=3') ?>'><span> Credit Hold Report - Region</span></a></li>
                        <?php }  ?>
                        <?php if (Yii::app()->user->authorised_user == 1 || isset(Yii::app()->user->havePermissionOn['credithold_report_distributor_wise_view'])) {  ?>
                        <li class=""><a href='<?php echo $this->createUrl('credithold/reportIndex&type=4') ?>'><span> Credit Hold Report - Distributor Wise</span></a></li>
                        <?php }  ?>
                        <?php if (Yii::app()->user->authorised_user == 1 || isset(Yii::app()->user->havePermissionOn['credithold_report_region_wise_view'])) {  ?>
                        <li class=""><a href='<?php echo $this->createUrl('credithold/reportIndex&type=5') ?>'><span> Credit Hold Report - Region Wise</span></a></li>
                        <?php }  ?>
                        <!--end-->
                        
                        
                        <?php if (Yii::app()->user->authorised_user == 1 || isset(Yii::app()->user->havePermissionOn['credithold_view'])) {  ?>
                        <li class="hidden"><a href='<?php echo $this->createUrl('credithold/index') ?>'><span> Credit Hold</span></a></li>
                        <?php }  ?>

                        <?php if (Yii::app()->user->authorised_user == 1 || isset(Yii::app()->user->havePermissionOn['gw_report'])) {   ?>
                        <li class="hidden"><a href='<?php echo $this->createUrl('ordertakingreport/index') ?>'><span> GW Files</span></a></li>
                        <?php } ?>

                        <?php if (Yii::app()->user->authorised_user == 1 || isset(Yii::app()->user->havePermissionOn['odr_tkg_smry_report'])) {   ?>
                        <li><a href='<?php echo $this->createUrl('ordertakingreport/report') ?>'><span>Order Taking Summary Report</span></a></li>
                        <?php } ?>

                        <?php if (Yii::app()->user->authorised_user == 1 || isset(Yii::app()->user->havePermissionOn['unshipped_distrwse_report'])) {   ?>
                        <li><a href='<?php echo $this->createUrl('ordertakingreport/unshippedreport&type=1') ?>'><span> UnShipped Report-Distributor Wise</span></a></li>
                        <?php } ?>

                        <?php if (Yii::app()->user->authorised_user == 1 || isset(Yii::app()->user->havePermissionOn['unshipped_catgryrwse_report'])) {   ?>
                        <li><a href='<?php echo $this->createUrl('ordertakingreport/unshippedreport&type=2') ?>'><span> UnShipped Report-Category Wise</span></a></li>
                        <?php } ?>

                        <?php if (Yii::app()->user->authorised_user == 1 || isset(Yii::app()->user->havePermissionOn['bdgt_report'])) {   ?>
                        <li class="hidden"><a href='<?php echo $this->createUrl('ordertakingreport/budget') ?>'><span> Budget</span></a></li>
                        <?php } ?>

                        <?php if (Yii::app()->user->authorised_user == 1 || isset(Yii::app()->user->havePermissionOn['distr_wse_smry_report'])) {   ?>
                        <li><a href='<?php echo $this->createUrl('ordertakingreport/DistributerWiseReport') ?>'><span> Distributor Wise Summary</span></a></li>
                        <?php } ?>

                        <?php if (Yii::app()->user->authorised_user == 1 || isset(Yii::app()->user->havePermissionOn['catgry_wse_smry_report'])) {   ?>
                        <li><a href='<?php echo $this->createUrl('ordertakingreport/categoryWiseReport') ?>'><span> Category Wise Summary</span></a></li>
                        <?php } ?>

                        <?php if (Yii::app()->user->authorised_user == 1 || isset(Yii::app()->user->havePermissionOn['top_mdl_tkg_report'])) {   ?>
                        <li><a href='<?php echo $this->createUrl('ordertakingreport/topmodelReport') ?>'><span> Top Model Order Taking Report</span></a></li>
                        <?php } ?>
                        <!-- NEW -->
                        <?php if (Yii::app()->user->authorised_user == 1 || isset(Yii::app()->user->havePermissionOn['docdownload_view'])) { ?>
                        <li><a href='<?php echo $this->createUrl('documentstorage/ReportIndex') ?>'><span> Document Download</span></a></li>
                        <?php }  ?>
                        
                    </ul>



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

        </div>









        <section class="content-body">

            <section class="content">

<?php echo $content; ?>

            </section>

        </section>

        <div id="loader">

            <div class="loading-container">

                <div class="cssload-dots">

                    <div class="cssload-dot"></div>

                    <div class="cssload-dot"></div>

                    <div class="cssload-dot"></div>

                    <div class="cssload-dot"></div>

                    <div class="cssload-dot"></div>

                </div>

                <svg version="1.1" xmlns="http://www.w3.org/2000/svg">

                <defs>

                <filter id="goo">

                    <feGaussianBlur in="SourceGraphic" result="blur" stdDeviation="12"></feGaussianBlur>

                    <feColorMatrix in="blur" mode="matrix" values="1 0 0 0 0  0 1 0 0 0 0 0 1 0 0 0 0 0 18 -7" result="goo"></feColorMatrix>

                    <!--<feBlend in2="goo" in="SourceGraphic" result="mix" ></feBlend>-->

                </filter>

                </defs>

                </svg>

            </div>

        </div>

        <input type="hidden" value="<?php echo $baseUrl . "/"; ?>" name="liveSite" id="liveSite">

        <input type="hidden" id="menu_helper" value="" name="menu_helper">

    </body>



</html>