<?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">
                        <h4 class="no-margin">
                            <?php echo $title; ?>
                        </h4>
                        <hr class="hr-panel-heading"/>
                        <?php if (isset($item)) { ?>
                            <a href="<?php echo admin_url("hpyproducts/minute/" . $item->event_id); ?>"
                               class="btn btn-success pull-right mbot20 display-block"><?php echo _l('new_minute'); ?></a>
                            <div class="clearfix"></div>
                        <?php } ?>
                        <?php echo form_open($this->uri->uri_string()); ?>
                        <input type="hidden" name="event_id" value="<?= $eventId ?>"/>
                        <?php echo render_select('contact_id', $contacts, array('id', ['firstname','lastname']), 'contact', (isset($product) ? $product->contact_id : [])); ?>
                        <?php echo render_input('name', 'product_categ_add_edit_name', (isset($item) ? $item->name : ''), 'text', array('autofocus' => true, 'required' => true)); ?>
                        <?php $value = (isset($item) ? $item->description : ''); ?>
                        <?php echo render_textarea('description', 'lead_description', $value); ?>
                        <div class="ckbox ckbox-primary " for="is_public">
                            <input type="checkbox" name="is_public" <?php if (isset($lead)) {
    if ($lead->is_public == 1) {
        echo 'checked';
    }
}; ?> id="is_public" value="1">
                            <span><?php echo _l('lead_public'); ?></span>
                        </div>
                        <button type="submit" class="btn btn-info pull-right"><?php echo _l('submit'); ?></button>
                        <?php echo form_close(); ?>
                    </div>
                </div>
            </div>
        </div>
    </div>
    
</div>
<?php show_footer(); ?><?php init_tail(); ?>
<script>
    $(function () {
        _validate_form($('form'), {name: 'required'});
    });
</script>
</body>
</html>
