<?php defined('BASEPATH') or exit('No direct script access allowed'); ?>
<?php init_head(); ?>
<div id="wrapper">
    <div class="content">
        <div class="row">
            <div class="col-md-12">
                <div class="panel_s">
                    <div class="panel-body">
                        <div class="_buttons">
                            <button type="button" class="btn btn-info"
                                    onclick="add_template('contracts', 0);"><?php echo _l('add_template'); ?> (<?php echo _l('hr_document'); ?>)</button>

                            <button type="button" class="btn btn-info"
                                    onclick="add_template('proposals', 0);"><?php echo _l('add_template'); ?> (<?php echo _l('proposal'); ?>)</button>

                            <button type="button" class="btn btn-info"
                                    onclick="add_template('supplier_contract', 0);"><?php echo _l('add_template'); ?> (<?php echo _l('purchase_contract'); ?>)</button>
                        </div>
                        <div class="clearfix"></div>
                        <hr class="hr-panel-heading" />
                        <div class="clearfix"></div>
                        <?php render_datatable(array(
                            _l('#'),
                            _l('name'),
                            _l('type'),
                            _l('options')
                        ),'contract-templates'); ?>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div id="modal-wrapper"></div>
<?php init_tail(); ?>
<script>
    $(function(){
        initDataTable('.table-contract-templates', window.location.href, [3], [3]);

        $('#contract-templates').load(admin_url + 'templates', {
            rel_type: 'contract',
            rel_id: 0
        });

    });
</script>
</body>
</html>
