<?php defined('BASEPATH') or exit('No direct script access allowed'); ?>
<?php init_head(); ?>
<style>
body {background:white!important;}</style>
<div id="wrapper" class="comisioane">

    <div class="content">
        <div class="row">
            <div class="col-md-12">
                <div class="panel_s">
                    <div class="panel-body">
                       <div class="_buttons">
                        <?php if(has_permission('knowledge_base','','create')){ ?>
                        <div class="_buttons">
                            <a href="#" onclick="new_kb_product(); return false;" class="btn btn-primary pull-left display-block">
                               <i class="plus-icon-new fa-sharp fa-solid fa-plus"></i> <?php //INACTIVE: echo _l('new_product'); ?>
                            </a>
                            <?php } ?>
                            <a href="<?php echo admin_url('knowledge_base'); ?>" class="btn btn-info pull-left display-block mleft5">
                                Inapoi la <?php echo _l('als_all_articles'); ?>
                            </a>
                            <div class="clearfix"></div>
                            <hr class="hr-panel-heading" />
                        </div>
                        <?php if(count($products) > 0){ ?>
                        <table class="table dt-table scroll-responsive">
                            <thead>
                                <th><?php echo _l('product_table_name_heading'); ?></th>
                            </thead>
                            <tbody>
                                <?php foreach($products as $product){?>
                                <tr>
                                    <td><?php echo $product['product_name']; ?> <span class="badge mleft5"><?php echo total_rows('tblknowledgebase','productid='.$product['productid']); ?></span></td>

                                </tr>
                                <?php } ?>
                            </tbody>
                        </table>
                        <?php } else { ?>
                            <p class="no-margin"><?php echo _l('kb_no_products_found'); ?></p>
                        <?php } ?>
                    </div>
                </div>
            </div>
        </div>
    </div>
    
</div>
<?php $this->load->view('admin/knowledge_base/product'); ?>
<?php show_footer(); ?><?php init_tail(); ?>
</body>
</html>
