BBnepal-Accounts/account/application/views/includes/sidebar.php

263 lines
16 KiB
PHP
Raw Normal View History

2024-07-10 12:43:19 +00:00
<?php
$command = $this->uri->segment(1);
$param = $this->uri->segment(2);
$subparam = $this->uri->segment(3);
$subparam2 = $this->uri->segment(4);
?>
<!-- Main Sidebar Container -->
<aside class="main-sidebar main-sidebar-custom sidebar-dark-primary elevation-4">
<!-- Brand Logo --> <a href="<?php echo base_url(); ?>" class="brand-link"> <img src="<?php echo base_url(); ?>dist/img/AdminLTELogo.png" alt="AdminLTE Logo" class="brand-image img-circle elevation-3" style="opacity: .8"> <span class="brand-text font-weight-light">
<?php echo APP_NAME; ?>
</span>
</a> <!-- Sidebar -->
<div class="sidebar">
<!-- Sidebar user panel (optional) -->
<div class="user-panel mt-3 pb-3 mb-3 d-flex">
<div class="image"> <img src="<?php echo base_url(); ?>dist/img/user2-160x160.jpg" class="img-circle elevation-2" alt="User Image"> </div>
<div class="info"> <a href="#" class="d-block"><?php echo $this->session->userdata("CompanyName"); ?> (<?php echo ($this->session->userdata("FiscalYear")->fiscalyear_year); ?>)</a></div>
</div> <!-- SidebarSearch Form -->
<div class="form-inline pb-2">
<div class="input-group" data-widget="sidebar-search">
<select class="form-control form-control-sidebar" name="database-select" id="database-select">
<?php foreach (explode(",", DATABASE_OPTIONS) as $db) : ?>
<option <?php if ($db == DB_DATABASE) : ?>SELECTED<?php endif; ?>><?php echo $db; ?></option>
<?php endforeach; ?>
</select>
<!-- <div class="input-group-append"> <button class="btn btn-sidebar"> <i class="fas fa-save"></i> </button> </div> -->
</div>
</div> <!-- Sidebar Menu -->
<div class="form-inline">
<div class="input-group" data-widget="sidebar-search"> <input class="form-control form-control-sidebar" type="search" placeholder="Search" aria-label="Search">
<div class="input-group-append"> <button class="btn btn-sidebar"> <i class="fas fa-search fa-fw"></i> </button> </div>
</div>
</div> <!-- Sidebar Menu -->
<?php $LoggedUser = $this->session->userdata('loggedInUser'); ?>
<nav class="mt-2">
<ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="true">
<?php /* Accounting Part */ ?>
<?php
$commandsContained = array("accounts", "master");
$paramsContained = array("setup", "fiscalyear", "branches", "acgroups", "accategories", "translations", "accountheads");
$subparamsContained = array("listsingleentryvouchers", "fiscalyear", "list", "parent", "childs", "ratio_analysis", "add", "edit", "editvouchertype");
?>
<li class="nav-item <?php echo (in_array($command, $commandsContained) && in_array($param, $paramsContained) && (isset($subparam) ? in_array($subparam, $subparamsContained) : 1)) ? "menu-open" : ""; ?>"><a href="#" class="nav-link active"><i class="nav-icon fa fa-wrench"></i>
<p>Accounting Setup<i class="right fas fa-angle-left"></i></p>
</a>
<ul class="nav nav-treeview">
<li class="nav-item"><a href="<?php echo site_url("master/fiscalyear"); ?>" class="nav-link <?php echo ($param == "fiscalyear") ? "active" : ""; ?>">
<p>Fiscal Year</p>
</a></li>
<!-- <li class="nav-item"><a href="<?php echo site_url("master/acgroups"); ?>" class="nav-link <?php echo ($param == "acgroups") ? "active" : ""; ?>">
<p>Account Types</p>
</a></li> -->
<li class="nav-item"><a href="<?php echo site_url("master/accategories/parent");
?>" class="nav-link <?php echo (($param == "accategories" && $subparam == "parent") ||
($param == "accategories" && $subparam == "edit_parent") ||
($param == "accategories" && $subparam == "add_parent")
) ? "active" : "";
?>">
<p>Account Categories</p>
</a></li>
<li class="nav-item"><a href="<?php echo site_url("master/accategories/childs"); ?>" class="nav-link <?php echo (($param == "accategories" && $subparam == "childs") ||
($param == "accategories" && $subparam == "add_child") ||
($param == "accategories" && $subparam == "edit_child")
) ? "active" : ""; ?>">
<p>Account Groups</p>
</a>
</li>
<li class="nav-item">
<a href="<?php echo site_url("accounts/setup/listsingleentryvouchers"); ?>" class="nav-link <?php echo ($subparam == "listsingleentryvouchers") ? "active" : ""; ?>">
Voucher Types
</a></li>
<?php if ($LoggedUser == "admin") : ?>
<?php //showMenu("Create New Ledger", "accounts/accountheads/add");
?>
2024-08-08 12:39:25 +00:00
<?php showMenu("Ledgers", "accounts/accountheads/list"); ?>
2024-07-10 12:43:19 +00:00
<?php endif; ?>
</ul>
</li>
<?php
$commandsContained = array("inventory");
$paramsContained = array("paymentmodes", "items", "units", "stocklocations", "itemcategories");
$subparamsContained = array("list", "add", "edit");
?>
<li class="nav-item <?php echo (in_array($command, $commandsContained) && in_array($param, $paramsContained) && in_array($subparam, $subparamsContained)) ? "menu-open" : ""; ?>"><a href="#" class="nav-link active"><i class="nav-icon fa fa-wrench"></i>
<p>Inventory Setup<i class="right fas fa-angle-left"></i></p>
</a>
<ul class="nav nav-treeview">
<?php
// showMenu("Stock Locations", "inventory/stocklocations/list");
showMenu("Inventory Units", "inventory/units/list");
// showMenu("Payment Modes", "inventory/paymentmodes/list");
showMenu("Inventory Groups", "inventory/itemcategories/list");
// showMenu("Categories", "inventory/itemcategories/list");
// showMenu("Create Inventory Item", "inventory/items/add");
showMenu("Inventory Items", "inventory/items/list");
?>
</ul>
</li>
<?php
$subparamsContained = array();
$VoucherTypes = $this->db->query("select * from tbl_vouchertypes where status=1")->result();
foreach ($VoucherTypes as $VoucherType) : $subparamsContained[] = $VoucherType->voucher_alias;
endforeach;
$commandsContained = array("accounts", "inventory");
$paramsContained = array("vouchers", "sales", "purchases");
$subparamsContained[] = "create";
$subparamsContained[] = "add";
// $subparamsContained[] = "create";
// , "add","contra");
?>
<li class="nav-item <?php echo (in_array($command, $commandsContained) && in_array($param, $paramsContained) && in_array($subparam, $subparamsContained)) ? "menu-open" : ""; ?>"><a href="#" class="nav-link active">
<i class="nav-icon fas fa-copy"></i>
<p>Vouchers<i class="right fas fa-angle-left"></i></p>
</a>
<ul class="nav nav-treeview">
<?php if ($LoggedUser == "admin") : ?>
<?php foreach ($VoucherTypes as $VoucherType) : if ($VoucherType->voucher_alias != "sales" && $VoucherType->voucher_alias != "purchase") : ?>
<li class="nav-item"><a href="<?php echo site_url("accounts/vouchers/" . $VoucherType->voucher_alias . "/create"); ?>" class="nav-link <?php echo ($subparam == $VoucherType->voucher_alias && $subparam2 == "create") ? "active" : ""; ?>">
2024-08-18 06:47:21 +00:00
<p><?php echo $VoucherType->voucher_name; ?></p>
2024-07-10 12:43:19 +00:00
</a></li>
<?php endif;
endforeach; ?>
<?php endif; ?>
<?php showMenu("Sales Voucher", "inventory/sales/create"); ?>
<?php showMenu("Purchase Voucher", "inventory/purchases/add"); ?>
</ul>
</li>
<?php
$commandsContained = array("inventory");
$paramsContained = array("purchases", "sales", "reports", "stocks");
$subparamsContained = array("edit", 'details', 'summary', 'purchase_vs_sales','purchase_register','sales_register');
?>
<li class="nav-item <?php echo (in_array($command, $commandsContained) && in_array($param, $paramsContained) && in_array($subparam, $subparamsContained)) ? "menu-open" : ""; ?>">
<a href="#" class="nav-link active"><i class="nav-icon fas fa-file"></i>
<p>Inventory Report<i class="right fas fa-angle-left"></i></p>
</a>
<ul class="nav nav-treeview">
<?php if ($LoggedUser == "admin") :
// showMenu("Inventory Stock", "inventory/stocks/list");
showMenu("Stock Report", "inventory/stocks/summary");
showMenu("Sales Register", "inventory/sales/sales_register");
showMenu("Purchase Register", "inventory/purchases/purchase_register");
showMenu("Purchase Vs Sales", "inventory/reports/purchase_vs_sales");
// showMenu("Balance Sheet (Vertical)", "accounts/reports/balance_sheet_vertical");
endif; ?>
</ul>
</li>
<?php
$commandsContained = array("accounts");
$paramsContained = array("reports", "ledger");
$subparamsContained = array("trialbalance", "pl", "balance_sheet_vertical", "cash_flow", "receipt_and_payment", "ratio_analysis", "balance_sheet");
?>
<li class="nav-item <?php echo (in_array($command, $commandsContained) && in_array($param, $paramsContained) && in_array($subparam, $subparamsContained)) ? "menu-open" : ""; ?>">
<a href="#" class="nav-link active"><i class="nav-icon fas fa-file"></i>
<p>Final Accounts<i class="right fas fa-angle-left"></i></p>
</a>
<ul class="nav nav-treeview">
<?php if ($LoggedUser == "admin") :
showMenu("Trial Balance", "accounts/reports/trialbalance");
showMenu("Profit and Loss Statement", "accounts/reports/pl");
showMenu("Balance Sheet", "accounts/reports/balance_sheet");
// showMenu("Balance Sheet (Vertical)", "accounts/reports/balance_sheet_vertical");
2024-08-14 08:11:37 +00:00
showMenu("Receipt and Payment", "accounts/reports/receipt_and_payment");
2024-07-10 12:43:19 +00:00
// showMenu("Income And Expenses", "accounts/reports/incomes_and_expenses");
showMenu("Cash Flow", "accounts/reports/cash_flow");
showMenu("Ratio Analysis", "accounts/reports/ratio_analysis");
endif; ?>
</ul>
</li>
<?php
$commandsContained = array("accounts","inventory");
$paramsContained = array("reports", "ledger","purchases","sales");
$subparamsContained = array("full", "cash_book", "bank_book", "partyledger", "day_book", "list", "receiveables", "payables");
?>
<li class="nav-item <?php echo (in_array($command, $commandsContained) && in_array($param, $paramsContained) && in_array($subparam, $subparamsContained)) ? "menu-open" : ""; ?>">
<a href="#" class="nav-link active"><i class="nav-icon fas fa-file"></i>
<p>Account Books<i class="right fas fa-angle-left"></i></p>
</a>
<ul class="nav nav-treeview">
<?php if ($LoggedUser == "admin") :
showMenu("Cash Book", "accounts/ledger/cash_book");
showMenu("Bank Book", "accounts/ledger/bank_book");
showMenu("Day Book", "accounts/ledger/day_book");
showMenu("Full Ledger", "accounts/ledger/full");
showMenu("Individual Ledger", "accounts/ledger/partyledger");
// showMenu("Group Summary", "accounts/ledger/partyledger");
showMenu("Group Summary", "accounts/reports/balance_by_group");
// showMenu("Balance by Category", "accounts/reports/balance_by_category");
showMenu("Accounts Receivables", "accounts/ledger/receiveables");
showMenu("Accounts Payables", "accounts/ledger/payables");
showMenu("Purchase Summary", "inventory/purchases/list");
showMenu("Sales Summary", "inventory/sales/list");
endif; ?>
</ul>
</li>
<?php
$commandsContained = array("accounts");
$paramsContained = array("vouchers", "ledger");
$subparamsContained = array("listvouchers", "navigate", "show_voucher");
?>
<li class="nav-item <?php echo (in_array($command, $commandsContained) && in_array($param, $paramsContained) && in_array($subparam, $subparamsContained)) ? "menu-open" : ""; ?>">
<a href="#" class="nav-link active"><i class="nav-icon fas fa-file"></i>
<p>Statements of Accounts<i class="right fas fa-angle-left"></i></p>
</a>
<ul class="nav nav-treeview">
<?php
showMenu("List of Vouchers", "accounts/vouchers/listvouchers/list");
showMenu("List of Ledger", "accounts/ledger/navigate");
showMenu("List of Groups", "accounts/reports/balance_by_category");
if ($this->session->userdata('Branch')->vat)
showMenu("VAT Register", "accounts/ledger/navigate");
?>
</ul>
</li>
<?php /*
<?php
$commandsContained = array("accounts");
$paramsContained = array("vouchers", "ledger", "reports");
$subparamsContained = array("balance_by_type", "trialbalance_table", "balance_by_category", "balance_by_group");
?>
<li class="nav-item <?php echo (in_array($command, $commandsContained) && in_array($param, $paramsContained) && in_array($subparam, $subparamsContained)) ? "menu-open" : ""; ?>">
<a href="#" class="nav-link active"><i class="nav-icon fas fa-file"></i>
<p>Reports<i class="right fas fa-angle-left"></i></p>
</a>
<ul class="nav nav-treeview">
<?php if ($LoggedUser == "admin") :
showMenu("Trial - Tabular", "accounts/reports/trialbalance_table");
showMenu("Balance by Type", "accounts/reports/balance_by_type");
showMenu("Balance by Category", "accounts/reports/balance_by_category");
showMenu("Balance by Groups", "accounts/reports/balance_by_group");
showMenu("Balance Sheet", "accounts/reports/balance_sheet");
endif; ?>
</ul>
</li>
*/ ?>
<?php /* End Accounting Part */ ?>
<?php
// pre($_SESSION);die;
$commandsContained = array("master");
$paramsContained = array("translations");
$subparamsContained = array("list", "add", "edit");
?>
<li class="nav-item <?php echo (in_array($command, $commandsContained) && in_array($param, $paramsContained) && in_array($subparam, $subparamsContained)) ? "menu-open" : ""; ?>"><a href="#" class="nav-link active"><i class="nav-icon fa fa-wrench"></i>
<p>Configuration<i class="right fas fa-angle-left"></i></p>
</a>
<ul class="nav nav-treeview">
<?php if ($LoggedUser == "admin") :
showMenu("Setup Translation", "master/translations/");
// showMenu("Company", "master/branches/list/");
showMenu("Switch to " . (($this->session->userdata("language") == "np") ? "English" : "Nepali"), "togglelanguage");
// showMenu("Fiscal Year", "master/fiscalyear");
?>
<?php
endif; ?>
<li class="nav-item"><a href="<?php echo site_url("logout"); ?>" class="nav-link active"><i class="fas fa-sign-in-alt"></i>
<p>Logout</p>
</a> </li>
</ul>
</li>
</ul>
</nav> <!-- /.sidebar-menu -->
</div> <!-- /.sidebar -->
</aside><i class="fa-thin fa-arrow-right-from-bracket"></i>