<?php init_head(); ?>
<div id="wrapper" class="commission">
    <div class="breadcrumb">
        <a href="<?php echo admin_url(); ?>"><?= _l('breadcrumb_dashboard'); ?></a>&nbsp;&nbsp;&nbsp;/&nbsp;&nbsp;&nbsp;<a
                href="<?php echo admin_url("commission/manage_commission"); ?>"><?php echo _l('commission'); ?></a>&nbsp;&nbsp;&nbsp;/&nbsp;&nbsp;&nbsp;<?php echo html_entity_decode($title); ?>
    </div>
    <div class="admin-title">
        <h1><?= $this->config->item('icons')['commission']; ?>
            <?php echo html_entity_decode($title); ?></h1>
    </div>
    <div class="content">
        <div class="row">
            <div class="col-sm-12">
                <div class="panel_s">
                    <div class="panel-body">

                        <?php if ($is_client == 1) { ?>
                            <a href="<?php echo admin_url('commission/new_applicable_client'); ?>"
                               class="btn btn-info mbot10"> <i
                                        class="plus-icon-new fa-sharp fa-solid fa-plus"></i> <?php //INACTIVE:echo _l('new'); ?>
                            </a>
                        <?php } else { ?>
                            <a href="<?php echo admin_url('commission/new_applicable_staff'); ?>"
                               class="btn btn-info mbot10"> <i
                                        class="plus-icon-new fa-sharp fa-solid fa-plus"></i> <?php //INACTIVE:echo _l('new'); ?>
                            </a>
                        <?php } ?>
                        <div class="row mbot15">
                            <div class="col-md-3">
                                <?php echo form_hidden('is_client', $is_client); ?>
                                <?php if ($is_client == 1) {
                                    echo render_select('staff_filter', $clients, array('userid', 'company'), 'client', '', array('multiple' => true, 'data-actions-box' => true), array(), '', '', false);
                                } else {
                                    echo render_select('staff_filter', $staffs, array('staffid', 'firstname', 'lastname'), 'staff', '', array('multiple' => true, 'data-actions-box' => true), array(), '', '', false);
                                } ?>
                            </div>
                            <div class="col-md-3">
                                <?php $commission_policy_type = [0 => ['id' => '1', 'name' => _l('calculated_as_ladder')],
                                    1 => ['id' => '2', 'name' => _l('calculated_as_percentage')],
                                    2 => ['id' => '3', 'name' => _l('calculated_by_the_product')],
                                    3 => ['id' => '4', 'name' => _l('calculated_product_as_ladder')]];
                                echo render_select('commission_policy_type', $commission_policy_type, array('id', 'name'), 'commission_policy_type', '', array('multiple' => true, 'data-actions-box' => true), array(), '', '', false); ?>
                            </div>
                            <div class="col-md-3">
                                <?php echo render_date_input('from_date', 'from_date'); ?>
                            </div>
                            <div class="col-md-3">
                                <?php echo render_date_input('to_date', 'to_date'); ?>
                            </div>
                            <div class="clearfix"></div>
                        </div>
                        <table class="table table-applicable-staff">
                            <thead>
                            <th><?php echo _l('name'); ?></th>
                            <th><?php echo _l('commission_policy'); ?></th>
                            <th><?php echo _l('from_date'); ?></th>
                            <th><?php echo _l('to_date'); ?></th>
                            <th><?php echo _l('options'); ?></th>
                            </thead>
                            <tbody>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>

</div>
<?php show_footer(); ?><?php init_tail(); ?>
</body>
</html>
