<?php if (display_admin_part() == false) : ?>

	<!-- main-sidebar -->
	<div class="app-sidebar__overlay" data-toggle="sidebar"></div>
	<aside class="app-sidebar sidebar-scroll">
		<div class="main-sidebar-header">
			<a class="desktop-logo logo-light" href="<?php echo esc_url(admin_url('admin.php?page=shelf_planner')); ?>"><img src="<?php echo esc_url(plugin_dir_url(__FILE__)); ?>assets/img/brand/logo.png?1" class="main-logo" style="width: 199px; height: 28px;" alt="logo"></a>
		</div>
		<div class="main-sidemenu">
			<ul class="side-menu">
				<li class="slide">
					<a class="side-menu__item <?php echo esc_attr('shelf_planner_retail_insights' == sanitize_text_field(empty($_GET['page']) ? '' : $_GET['page']) ? 'active' : ''); ?>" href="<?php echo esc_url(admin_url('admin.php?page=shelf_planner_retail_insights')); ?>"><i class="fa fa-line-chart"></i>&nbsp;&nbsp;<span class="side-menu__label"><?php echo esc_html(__('Store Performance', 'inventory-management-woocommerce')); ?></span></a>
				</li>
				<li class="slide">
					<a class="side-menu__item <?php echo esc_attr('shelf_planner' == sanitize_text_field(empty($_GET['page']) ? '' : $_GET['page']) ? 'active' : ''); ?>" href="<?php echo esc_url(admin_url('admin.php?page=shelf_planner')); ?>"><i class="fa fa-tachometer"></i>&nbsp;&nbsp;<span class="side-menu__label"><?php echo esc_html(__('Stock Analyses', 'inventory-management-woocommerce')); ?></span></a>
				</li>
				<li class="sub-slide">
					<a class="side-menu__item" href="#" onclick="jQuery('#id-menu-po-root').slideToggle(); return false;"><i class="fa
					fa-tasks"></i>&nbsp; &nbsp;<span class="side-menu__label"><?php echo esc_html(__('Purchase Orders', 'inventory-management-woocommerce')); ?></span></a>
					<ul style="
					<?php 
					echo esc_attr(in_array(sanitize_text_field(empty($_GET['page']) ? '' : $_GET['page']), array(
									'shelf_planner_purchase_orders',
									'shelf_planner_po_create_po',
									'shelf_planner_po_orders',
								)) ? '' : 'display: none'); 
					?>
								" id="id-menu-po-root" class="side-menu">
						<li class="slide">
							<a class="side-menu__item <?php echo esc_attr('shelf_planner_po_create_po' == sanitize_text_field(empty($_GET['page']) ? '' : $_GET['page']) ? 'sub-slide_active active' : ''); ?>" href="<?php echo esc_url(admin_url('admin.php?page=shelf_planner_po_create_po')); ?>"><span style="margin-left: 12px" class="side-menu__label"> <i class="fa fa-arrow-circle-right"></i>&nbsp;&nbsp;<?php echo esc_html(__('New Order', 'inventory-management-woocommerce')); ?></span></a>
						</li>
						<li class="slide">
							<a class="side-menu__item <?php echo esc_attr('shelf_planner_po_orders' == sanitize_text_field(empty($_GET['page']) ? '' : $_GET['page']) ? 'sub-slide_active active' : ''); ?>" href="<?php echo esc_url(admin_url('admin.php?page=shelf_planner_po_orders')); ?>"><span style="margin-left: 12px" class="side-menu__label"> <i class="fa fa-arrow-circle-right"></i>&nbsp;&nbsp;<?php echo esc_html(__('Orders History', 'inventory-management-woocommerce')); ?></span></a>
						</li>
					</ul>
				</li>
				<li class="slide">
					<a class="side-menu__item <?php echo esc_attr('shelf_planner_suppliers' == sanitize_text_field(empty($_GET['page']) ? '' : $_GET['page']) ? 'active' : ''); ?>" href="<?php echo esc_url(admin_url('admin.php?page=shelf_planner_suppliers')); ?>"><i class="fa fa-truck"></i>&nbsp;&nbsp;<span class="side-menu__label"><?php echo esc_html(__('Suppliers', 'inventory-management-woocommerce')); ?></span></a>
				</li>
				<li class="slide">
					<a class="side-menu__item <?php echo esc_attr('shelf_planner_warehouses' == sanitize_text_field(empty($_GET['page']) ? '' : $_GET['page']) ? 'active' : ''); ?>" href="<?php echo esc_url(admin_url('admin.php?page=shelf_planner_warehouses')); ?>"><i class="fa fa-archive"></i>&nbsp;&nbsp;<span class="side-menu__label"><?php echo esc_html(__('Warehouses', 'inventory-management-woocommerce')); ?></span></a>
				</li>
				<li class="slide">
					<a class="side-menu__item <?php echo esc_attr('shelf_planner_product_management' == sanitize_text_field(empty($_GET['page']) ? '' : $_GET['page']) ? 'active' : ''); ?>" href="<?php echo esc_url(admin_url('admin.php?page=shelf_planner_product_management')); ?>"><i class="fa fa-database"></i>&nbsp;&nbsp;<span class="side-menu__label"><?php echo esc_html(__('Product Management', 'inventory-management-woocommerce')); ?></span></a>
				</li>
				<li class="slide">
					<a class="side-menu__item <?php echo esc_attr('shelf_planner_backorder' == sanitize_text_field(empty($_GET['page']) ? '' : $_GET['page']) ? 'active' : ''); ?>" href="<?php echo esc_url(admin_url('admin.php?page=shelf_planner_backorder')); ?>"><i class="fa fa-shopping-cart"></i>&nbsp;&nbsp;<span class="side-menu__label"><?php echo esc_html(__('Backorder', 'inventory-management-woocommerce')); ?></span></a>
				</li>
				<li class="sub-slide">
					<a class="side-menu__item" href="#" onclick="jQuery('#id-menu-settings-root').slideToggle(); return false"><i class="fa fa-wrench"></i>&nbsp; &nbsp;<span class="side-menu__label"><?php echo esc_html(__('Settings', 'inventory-management-woocommerce')); ?></span></a>
					<ul style="
					<?php 
					echo esc_attr(in_array(sanitize_text_field(empty($_GET['page']) ? '' : $_GET['page']), array(
									'shelf_planner_settings_forecast',
									'shelf_planner_settings_po',
									'shelf_planner_settings_product',
									'shelf_planner_settings_store',
									'shelf_planner_settings_category_mapping',
								)) ? '' : 'display: none'); 
					?>
								" id="id-menu-settings-root" class="side-menu">
						<li class="slide">
							<a class="side-menu__item <?php echo esc_attr('shelf_planner_settings_forecast' == sanitize_text_field(empty($_GET['page']) ? '' : $_GET['page']) ? 'sub-slide_active active' : ''); ?>" href="<?php echo esc_url(admin_url('admin.php?page=shelf_planner_settings_forecast')); ?>"><span style="margin-left: 12px" class="side-menu__label"> <i class="fa fa-arrow-circle-right"></i>&nbsp;&nbsp;<?php echo esc_html(__('Forecast Settings', 'inventory-management-woocommerce')); ?></span></a>
						</li>
						<li class="slide">
							<a class="side-menu__item <?php echo esc_attr('shelf_planner_settings_po' == sanitize_text_field(empty($_GET['page']) ? '' : $_GET['page']) ? 'sub-slide_active active' : ''); ?>" href="<?php echo esc_url(admin_url('admin.php?page=shelf_planner_settings_po')); ?>"><span style="margin-left: 12px" class="side-menu__label"> <i class="fa fa-arrow-circle-right"></i>&nbsp;&nbsp;<?php echo esc_html(__('PO Settings', 'inventory-management-woocommerce')); ?></span></a>
						</li>
						<li class="slide">
							<a class="side-menu__item <?php echo esc_attr('shelf_planner_settings_product' == sanitize_text_field(empty($_GET['page']) ? '' : $_GET['page']) ? 'sub-slide_active active' : ''); ?>" href="<?php echo esc_url(admin_url('admin.php?page=shelf_planner_settings_product')); ?>"><span style="margin-left: 12px" class="side-menu__label"> <i class="fa fa-arrow-circle-right"></i>&nbsp;&nbsp;<?php echo esc_html(__('Product Settings', 'inventory-management-woocommerce')); ?></span></a>
						</li>
						<li class="slide">
							<a class="side-menu__item <?php echo esc_attr('shelf_planner_settings_store' == sanitize_text_field(empty($_GET['page']) ? '' : $_GET['page']) ? 'sub-slide_active active' : ''); ?>" href="<?php echo esc_url(admin_url('admin.php?page=shelf_planner_settings_store')); ?>"><span style="margin-left: 12px" class="side-menu__label"> <i class="fa fa-arrow-circle-right"></i>&nbsp;&nbsp;<?php echo esc_html(__('Store Settings', 'inventory-management-woocommerce')); ?></span></a>
						</li>
						<li class="slide">
							<a class="side-menu__item <?php echo esc_attr('shelf_planner_settings_category_mapping' == sanitize_text_field(empty($_GET['page']) ? '' : $_GET['page']) ? 'sub-slide_active active' : ''); ?>" href="<?php echo esc_url(admin_url('admin.php?page=shelf_planner_settings_category_mapping')); ?>"><span style="margin-left: 12px" class="side-menu__label"> <i class="fa fa-arrow-circle-right"></i>&nbsp;&nbsp;<?php echo esc_html(__('Category Mapping', 'inventory-management-woocommerce')); ?></span></a>
						</li>
					</ul>
				</li>
				<li class="slide">
					<a class="side-menu__item <?php echo esc_attr('sp_integrations' == sanitize_text_field(empty($_GET['page']) ? '' : $_GET['page']) ? 'active' : ''); ?>" href="<?php echo esc_url(admin_url('admin.php?page=sp_integrations')); ?>"><i class="fa fa-cloud-upload"></i>&nbsp;&nbsp;<span class="side-menu__label"><?php echo esc_html(__('Integrations', 'inventory-management-woocommerce')); ?></span></a>
				</li>
				<li class="slide">
					<a class="side-menu__item" href="<?php echo esc_url(admin_url('')); ?>"><i class="fa fa-reply-all"></i>&nbsp;&nbsp;<span class="side-menu__label"><?php echo esc_html(__('Exit to WP Admin', 'inventory-management-woocommerce')); ?></span></a>
				</li>
			</ul>
		</div>
	</aside><!-- main-sidebar -->
	<script>
		function slideSettings() {
			jQuery("#id-menu-settings-root").slideToggle();
		}
	</script>

<?php endif; ?>
