<?php
	if (isset($_SESSION['user_id'])) {
        $user_type = $_SESSION['user_type'];
        $user_id = $_SESSION['user_id'];
        $user_name = $_SESSION['user_name'];
        $branch_id = $_SESSION['branch_id'];
        $branch_name = $_SESSION['branch_name'];
        $store_id = $_SESSION['store_id'];
        $store_name = $_SESSION['store_name'];
}else{
    header('Location: login');
    die();
}
$rights_id = $user_id;
include('user_permissions.php');
?>
	<div class="left-side-bar">
		<div class="brand-logo">
			<a href="dashboard">
				<img style="width:55px;height:55px;padding: 5px;display: block" src="images/zeelogo_mini.png" alt="" class="mobile-logo">
			</a>
		</div>
		<div class="menu-block customscroll">
			<div class="sidebar-menu">
				<ul id="accordion-menu">
				<li>
						<a href="dashboard" class="dropdown-toggle no-arrow">
							<span class="fa fa-dashboard text-primary"></span><span class="mtext">Dashboard</span>
						</a>
					</li>
					<?php if($user_type=='admin')
						{
							echo '
							
						
					<li class="dropdown">
						<a href="javascript:;" class="dropdown-toggle">
							<span class="fa fa-cogs text-warning"></span><span class="mtext">Settings</span>
						</a>
						<ul class="submenu">
							
							
							<li><a href="user_detail">Users</a></li>
							<li><a href="sales_man_detail">Sales Man</a></li><li><a href="employees">Employees</a></li
							>
							
							
							<li><a href="item_uom">Item UOM</a></li>	
							<li><a href="titles">Print Title</a></li>
							<li><a href="system_setup">Update LP Rate</a></li>
							<li><a href="my_backup">Backup</a></li>
							
							
						</ul>
					</li>';
					}
					?>
					<!--GL-->
					<li class="dropdown">
						<?php if($gl=='ON')
						{
							echo '
							<a href="javascript:;" class="dropdown-toggle">
							<span class="fa fa-line-chart text-success"></span><span class="mtext">GL</span>
						</a>';
						}
						?>
						<ul class="submenu">
							<?php if($gl_parent_accounts=='ON')
						{
							echo '
							<li><a href="accounts_parent">Parent Account</a></li>';}?>
							<?php if($gl_accounts=='ON')
						{
							echo '
							<li><a href="accounts">Sub Accounts</a></li>';}?>
							
							<?php if($jv=='ON')
						{
							echo '
							<li><a href="jv">JVs</a></li>
							<li><a href="cashbook">ExpenseBook</a></li>
							<li><a href="rpt_daybook">Daybook</a></li>';}?>
							
							<li class="dropdown">
								<?php if($gl_reports=='ON')
						{
							echo '
								<a href="javascript:;" class="dropdown-toggle">
									<span class="fa fa-print"></span><span class="mtext">Reports</span>
								</a>';}?>
								<ul class="submenu child">
								<li><a href="gl">General Ledger</a></li>
								<?php if($gl_reports_trial_balance=='ON')
						{
							echo '
									<li><a href="rpt_trial_balance" target="_blank">Trial Balance</a></li>';}?>
								<?php if($gl_reports_sub_accounts=='ON')
						{
							echo '
									<li><a href="rpt_sub_accounts" target="_blank">Sub Accounts Balance</a></li>
							<li><a href="rpt_sub_accounts_detail">Parent Account Detail</a></li>
							<li><a href="rpt_pl_stat">PL State</a></li>';}?>
								</ul>
							</li>
							
						</ul>
					</li>
					<li class="dropdown">
						<?php if($inventory=='ON')
						{
							echo '
						<a href="javascript:;" class="dropdown-toggle">
							<span class="fa fa-tags text-secondary"></span><span class="mtext">Inventory</span>
						</a>';}?>
						<ul class="submenu">
							
						<?php if($items=='ON')
						{
							echo '
							<li><a href="items">Items</a></li>
							<li><a href="item_type">Item Type</a></li>
							<li><a href="inventory_detail">Item Inquiry</a></li>
							<li><a href="item_adjust">Item Adjustment</a></li>
							<li><a href="inventory_update">Price Update</a></li>';}?>
							
							
							<li class="dropdown">
							<?php if($inventory_reports=='ON')
						{
							echo '
								<a href="javascript:;" class="dropdown-toggle">
									<span class="fa fa-print"></span><span class="mtext">Reports</span>
								</a>';}?>
								<ul class="submenu child">
									<?php if($inventory_reports_item_ledger=='ON')
						{
							echo '
									<li><a href="rpt_dead_item" target="_blank">Dead Items</a></li>
									<li><a href="rpt_item_ledger" target="_blank">Item Ledger</a></li>';}?>
									
								
									<?php if($inventory_reports_stockavailable=='ON')
						{
							echo '
									<li><a href="rpt_stock_available" target="_blank">Stock Available</a></li>';}?>
									<?php if($inventory_reports_stockavailable_value=='ON')
						{
							echo '
									<li><a href="rpt_stock_available_value" target="_blank">Stock Available Value</a></li>';}?>
									<?php if($inventory_reports_min_stock=='ON')
						{
							echo '
									<li><a href="rpt_min_stock" target="_blank">Minimum Stock</a></li>';}?>
									<?php if($inventory_reports_min_stock=='ON')
						{
							echo '
									<li><a href="rpt_max_stock" target="_blank">Maximum Stock</a></li>';}?>
									
								</ul>
							</li>
							
						</ul>
					</li>
					<!--Accounts Payable-->
					<li class="dropdown">
						<?php if($accounts_payable=='ON')
						{
							echo '
						<a href="javascript:;" class="dropdown-toggle">
							<span class="fa fa-paypal text-danger"></span><span class="mtext">Purchase</span>
						</a>';}?>
						<ul class="submenu">
							<?php if($vendors=='ON')
						{
							echo '
							<li><a href="vendor">Vendors</a></li>';}?>
							
							<?php if($purchase=='ON')
						{
							echo '
							<li><a href="purchase">Pruchase Invoices</a></li>';}?>
							<?php if($purchase_return=='ON')
						{
							echo '
							<li><a href="pr">Pruchase Return</a></li>';}?>
							<li class="dropdown">
							
							<?php if($accounts_payable_payments=='ON')
						{
							echo '
								<a href="javascript:;" class="dropdown-toggle">
									<span class="fa fa-money"></span><span class="mtext">Payment Voucher</span>
								</a>';}?>
								<ul class="submenu child">
								<?php if($accounts_payable_payments=='ON')
						{
							echo '
									<li><a href="ap_cash_payment">Cash</a></li>';}?>
								
									<?php if($accounts_payable_payments=='ON')
						{
							echo '
									<li><a href="ap_cheque_payment">Cheques</a></li>';}?>
								</ul>
							</li>
							
							<li class="dropdown">
								<?php if($accounts_payable_reports=='ON')
						{
							echo '
								<a href="javascript:;" class="dropdown-toggle">
									<span class="fa fa-print"></span><span class="mtext">Reports</span>
								</a>';}?>
								<ul class="submenu child">
									<?php if($accounts_receivable_reports_cl=='ON')
						{
							echo '
									<li><a href="cl">Account Ledger</a></li>';}?>
								
								
									<?php if($accounts_payable_reports_os=='ON')
						{
							echo '
									<li><a href="rpt_ar" target="_blank">Out Standings</a></li>';}?>
								
									<?php if($accounts_payable_reports_payments=='ON')
						{
							echo '
									<li><a href="rpt_pay">Payments</a></li>';}?>
									<?php if($accounts_payable_reports_purchase_report=='ON')
						{
							echo '
									<li><a href="rpt_purchase_summary">Purchase Summary</a></li>';}?>
									
								</ul>
							</li>
							
						</ul>
					</li>
					<!--Accounts Receivable-->
					<li class="dropdown">
						<?php if($accounts_receivable=='ON')
						{
							echo '
						<a href="javascript:;" class="dropdown-toggle">
							<span class="fa fa-credit-card-alt text-info"></span><span class="mtext">Sale</span>
						</a>';}?>
						<ul class="submenu">
							
						<?php if($customers=='ON')
						{
							echo '
							<li><a href="customer">Customers</a></li>';}?>
							<?php if($wholesale_invoices=='ON')
						{
							echo '
							<li><a href="sales">Credit Sale Invoices</a></li>';}?>
							
							
							<?php if($cash_invoices=='ON')
						{
							echo '
							<li><a href="csales">Cash Sale Invoices</a></li>';}?>
							
							<?php if($return_retail=='ON')
						{
							echo '
							<li><a href="csr">Cash Sale Return</a></li>';}?>
							
							<?php if($return_wholesale=='ON')
						{
							echo '
							<li><a href="wsr">Credit Sale Return</a></li>';}?>
							<li class="dropdown">
								<?php if($accounts_receivable_payments=='ON')
						{
							echo '
								<a href="javascript:;" class="dropdown-toggle">
									<span class="fa fa-money"></span><span class="mtext">Receipt Voucher</span>
								</a>';}?>
								<ul class="submenu child">
									
								<?php if($accounts_receivable_payments=='ON')
						{
							echo '
									<li><a href="ar_cash_receipt">Cash Receipt</a></li>';}?>
								
									<?php if($accounts_receivable_payments=='ON')
						{
							echo '
									<li><a href="ar_cheque_receipt">Cheques Receipt</a></li>';}?>
								</ul>
							</li>
							
							<li class="dropdown">
								<?php if($accounts_receivable_reports=='ON')
						{
							echo '
								<a href="javascript:;" class="dropdown-toggle">
									<span class="fa fa-print"></span><span class="mtext">Reports</span>
								</a>';}?>
								<ul class="submenu child">
								<?php if($accounts_receivable_reports_cl=='ON')
						{
							echo '
									
									<li><a href="rpt_cl">Account Ledger</a></li>';}?>
								
									<?php if($accounts_receivable_reports_os=='ON')
						{
							echo '
									<li><a href="rpt_ar" target="_blank">Out Standings</a></li>
									<li><a href="rpt_cust_recovery_status" target="_blank">Sales and Recovery</a></li>
									<li><a href="rpt_sales_summary">Sales Summary</a></li>
									';}?>
								
									<?php if($accounts_receivable_reports_payments=='ON')
						{
							echo '
										<li><a href="rpt_rec">Payments</a></li>
										';}?>
										<?php if($accounts_receivable_reports_cash_invoices=='ON')
						{
							echo '
										
										<li><a href="rpt_cash_sale">Cash Sale Detail</a></li>
										<li><a href="rpt_sale_invoices">Credit Sale Detail</a></li>
										';}?>
										
										<?php if($accounts_receivable_reports_aging=='ON')
						{
							echo '
										
										<li><a href="rpt_ar_aging_detail">invoice Aging Report</a></li>
										';}?>
										<?php if($user_type=='admin')
						{
							echo '
										
										<li><a href="rpt_sales_profit">Sales Profit</a></li>
										';}?>
								</ul>
							</li>
							
						</ul>
					</li>
				</ul>
			</div>
		</div>
	</div>