<commit_before><?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
?>

<ul class="breadcrumb">
    <li><a href="<?php echo base_url() ?>"><i class="fa fa-home"></i></a></li>
    <li><a href="<?php echo base_url_app() ?>"><?php echo $name_app ?></a></li>
    <li><a href="<?php echo base_url_app('project/' . $project['directory']) ?>"><?php echo $project['name'] ?></a></li>
    <li><a href="<?php echo base_url_app('project/' . $project['directory'] . '/' . $page['directory']) ?>"><?php echo $page['name'] ?></a></li>
    <li class="active"><?php echo $title ?></li>
</ul>
<div class="row">
    <div class="col-md-12">
        <div class="x_panel">
            <div class="x_title">
                <h2><?php echo $title ?></h2>
                <div class="clearfix"></div>
            </div>
            <div class="x_content">
                <?php
                echo getErrors();
                if ($this->uri->segment('4') != 'edit-section' or $this->uri->segment('4') == 'edit-section' && $fields) {
                    echo form_open(current_url() . '?' . $this->input->server('QUERY_STRING'));
                    ?>
                    <h3><?php echo $this->lang->line(APP . '_subtitle_data_basic') ?></h3>
                    <p><?php echo $this->lang->line(APP . '_text_data_basic') ?></p>
                    <div class="row">
                        <div class="col-md-3">
                            <div class="form-group">
                                <label><?php echo $this->lang->line(APP . '_label_name') ?>*</label>
                                <input type="text" name="name" id="dig_name" value="<?php echo set_value('name', $name) ?>" class="form-control">
                            </div>
                        </div>
                        <div class="col-md-3">
                            <div class="form-group">
                                <label><?php echo $this->lang->line(APP . '_label_directory') ?>*</label>
                                <input type="text" name="directory" id="dir_name" value="<?php echo set_value('directory', $directory) ?>" class="form-control">
                            </div>
                        </div>
                        <div class="col-md-3">
                            <div class="form-group">
                                <label><?php echo $this->lang->line(APP . '_label_table') ?>*</label>
                                <?php if (!empty($preffix)) { ?>
                                    <div class="input-group">
                                        <div class="input-group-addon"><?php echo $preffix ?></div>
                                    <?php } ?>
                                    <input type="text" name="table" id="table_name" value="<?php echo set_value('table', $table) ?>" class="form-control">
                                    <?php if (!empty($preffix)) { ?></div><?php } ?>
                            </div>
                        </div>
                        <div class="col-md-3">
                            <div class="form-group">
                                <label><?php echo $this->lang->line(APP . '_label_status') ?>*</label>
                                <select name="status" class="form-control">
                                    <option value="1" <?php echo set_select('status', '1', ($status == '1')) ?>>Ativado</option>
                                    <option value="0" <?php echo set_select('status', '0', ($status == '0')) ?>>Desativado</option>
                                </select>
                            </div>
                        </div>
                    </div>
                    <hr>
                    <h3><?php echo $this->lang->line(APP . '_subtitle_config_advanced') ?></h3>
                    <p><?php echo $this->lang->line(APP . '_text_data_advanced') ?></p>
                    <button type="button" class="btn btn-default btn-primary" id="btn-add-field" data-toggle="modal" data-target="#modal-new-field"> <span class="fa fa-plus"></span> <?php echo $this->lang->line(APP . '_btn_add_field') ?></button>
                    <table class="table table-striped table-responsive table-bordered" id="fields">
                        <thead>
                            <tr>
                                <th><?php echo $this->lang->line(APP . '_label_name') ?></th>
                                <th><?php echo $this->lang->line(APP . '_label_input') ?></th>
                                <th><?php echo $this->lang->line(APP . '_label_column') ?></th>
                                <th><?php echo $this->lang->line(APP . '_label_type') ?></th>
                                <th width="30"><?php echo $this->lang->line(APP . '_label_list') ?></th>
                                <th width="30"><?php echo $this->lang->line(APP . '_label_delete') ?></th>
                            </tr>
                        </thead>
                        <tbody id="sortable">
                            <?php
                            $start_total = 3;
                            $total = count($this->input->post('name_field'));
                            if ($total == 0 && is_array($fields)) {
                                $total = count($fields);
                            }
                            for ($i = 0; $i < $total; $i++) {
                                $input = (isset($fields[$i]['input'])) ? $fields[$i]['input'] : '';
                                $database = (isset($fields[$i]['database'])) ? $fields[$i]['database'] : '';

                                $name_field = (isset($input['label'])) ? $input['label'] : '';
                                $type_field = (isset($input['type'])) ? strtolower($input['type']) : '';
                                $list_registers = (isset($input['list_registers'])) ? $input['list_registers'] : '';
                                $column = (isset($database['column'])) ? $database['column'] : '';
                                $type_column = (isset($database['type_column'])) ? $database['type_column'] : '';
                                $limit = (isset($database['limit'])) ? $database['limit'] : '';
                                $required = (isset($database['required'])) ? $database['required'] : '';
                                $unique = (isset($database['unique'])) ? $database['unique'] : '';
                                $default = (isset($database['default'])) ? $database['default'] : '';
                                $comment = (isset($database['comment'])) ? $database['comment'] : '';
                                $remove = (isset($input['remove'])) ? $input['remove'] : '';
                                $plugin_field = (isset($input['plugins'])) ? $input['plugins'] : '';
                                $observation = (isset($input['observation'])) ? $input['observation'] : '';
                                $attributes = (isset($input['attributes'])) ? $input['attributes'] : '';
                                /*
                                 * Vars of config to select
                                 */
                                $options_field = (isset($input['options_table'])) ? $input['options_table'] : '';
                                $select_trigger_field = (isset($input['options_trigger_select'])) ? $input['options_trigger_select'] : '';
                                $label_options_field = (isset($input['options_label'])) ? $input['options_label'] : '';
                                $label_options = (isset($input['label_options_'])) ? $input['label_options_'] : array();
                                /*
                                 * Vars of config to upload
                                 */<commit_msg>Correção na exibição do campo obrigatório<commit_after><?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
?>

<ul class="breadcrumb">
    <li><a href="<?php echo base_url() ?>"><i class="fa fa-home"></i></a></li>
    <li><a href="<?php echo base_url_app() ?>"><?php echo $name_app ?></a></li>
    <li><a href="<?php echo base_url_app('project/' . $project['directory']) ?>"><?php echo $project['name'] ?></a></li>
    <li><a href="<?php echo base_url_app('project/' . $project['directory'] . '/' . $page['directory']) ?>"><?php echo $page['name'] ?></a></li>
    <li class="active"><?php echo $title ?></li>
</ul>
<div class="row">
    <div class="col-md-12">
        <div class="x_panel">
            <div class="x_title">
                <h2><?php echo $title ?></h2>
                <div class="clearfix"></div>
            </div>
            <div class="x_content">
                <?php
                echo getErrors();
                if ($this->uri->segment('4') != 'edit-section' or $this->uri->segment('4') == 'edit-section' && $fields) {
                    echo form_open(current_url() . '?' . $this->input->server('QUERY_STRING'));
                    ?>
                    <h3><?php echo $this->lang->line(APP . '_subtitle_data_basic') ?></h3>
                    <p><?php echo $this->lang->line(APP . '_text_data_basic') ?></p>
                    <div class="row">
                        <div class="col-md-3">
                            <div class="form-group">
                                <label><?php echo $this->lang->line(APP . '_label_name') ?>*</label>
                                <input type="text" name="name" id="dig_name" value="<?php echo set_value('name', $name) ?>" class="form-control">
                            </div>
                        </div>
                        <div class="col-md-3">
                            <div class="form-group">
                                <label><?php echo $this->lang->line(APP . '_label_directory') ?>*</label>
                                <input type="text" name="directory" id="dir_name" value="<?php echo set_value('directory', $directory) ?>" class="form-control">
                            </div>
                        </div>
                        <div class="col-md-3">
                            <div class="form-group">
                                <label><?php echo $this->lang->line(APP . '_label_table') ?>*</label>
                                <?php if (!empty($preffix)) { ?>
                                    <div class="input-group">
                                        <div class="input-group-addon"><?php echo $preffix ?></div>
                                    <?php } ?>
                                    <input type="text" name="table" id="table_name" value="<?php echo set_value('table', $table) ?>" class="form-control">
                                    <?php if (!empty($preffix)) { ?></div><?php } ?>
                            </div>
                        </div>
                        <div class="col-md-3">
                            <div class="form-group">
                                <label><?php echo $this->lang->line(APP . '_label_status') ?>*</label>
                                <select name="status" class="form-control">
                                    <option value="1" <?php echo set_select('status', '1', ($status == '1')) ?>>Ativado</option>
                                    <option value="0" <?php echo set_select('status', '0', ($status == '0')) ?>>Desativado</option>
                                </select>
                            </div>
                        </div>
                    </div>
                    <hr>
                    <h3><?php echo $this->lang->line(APP . '_subtitle_config_advanced') ?></h3>
                    <p><?php echo $this->lang->line(APP . '_text_data_advanced') ?></p>
                    <button type="button" class="btn btn-default btn-primary" id="btn-add-field" data-toggle="modal" data-target="#modal-new-field"> <span class="fa fa-plus"></span> <?php echo $this->lang->line(APP . '_btn_add_field') ?></button>
                    <table class="table table-striped table-responsive table-bordered" id="fields">
                        <thead>
                            <tr>
                                <th><?php echo $this->lang->line(APP . '_label_name') ?></th>
                                <th><?php echo $this->lang->line(APP . '_label_input') ?></th>
                                <th><?php echo $this->lang->line(APP . '_label_column') ?></th>
                                <th><?php echo $this->lang->line(APP . '_label_type') ?></th>
                                <th width="30"><?php echo $this->lang->line(APP . '_label_list') ?></th>
                                <th width="30"><?php echo $this->lang->line(APP . '_label_delete') ?></th>
                            </tr>
                        </thead>
                        <tbody id="sortable">
                            <?php
                            $start_total = 3;
                            $total = count($this->input->post('name_field'));
                            if ($total == 0 && is_array($fields)) {
                                $total = count($fields);
                            }
                            for ($i = 0; $i < $total; $i++) {
                                $input = (isset($fields[$i]['input'])) ? $fields[$i]['input'] : '';
                                $database = (isset($fields[$i]['database'])) ? $fields[$i]['database'] : '';

                                $name_field = (isset($input['label'])) ? $input['label'] : '';
                                $type_field = (isset($input['type'])) ? strtolower($input['type']) : '';
                                $list_registers = (isset($input['list_registers'])) ? $input['list_registers'] : '';
                                $column = (isset($database['column'])) ? $database['column'] : '';
                                $type_column = (isset($database['type_column'])) ? $database['type_column'] : '';
                                $limit = (isset($database['limit'])) ? $database['limit'] : '';
                                $required = (isset($input['required'])) ? $input['required'] : '';
                                $unique = (isset($database['unique'])) ? $database['unique'] : '';
                                $default = (isset($database['default'])) ? $database['default'] : '';
                                $comment = (isset($database['comment'])) ? $database['comment'] : '';
                                $remove = (isset($input['remove'])) ? $input['remove'] : '';
                                $plugin_field = (isset($input['plugins'])) ? $input['plugins'] : '';
                                $observation = (isset($input['observation'])) ? $input['observation'] : '';
                                $attributes = (isset($input['attributes'])) ? $input['attributes'] : '';
                                /*
                                 * Vars of config to select
                                 */
                                $options_field = (isset($input['options_table'])) ? $input['options_table'] : '';
                                $select_trigger_field = (isset($input['options_trigger_select'])) ? $input['options_trigger_select'] : '';
                                $label_options_field = (isset($input['options_label'])) ? $input['options_label'] : '';
                                $label_options = (isset($input['label_options_'])) ? $input['label_options_'] : array();
                                /*
                                 * Vars of config to upload
                                 */
{'fraction_non_alphanumeric': 0.18272680676576114, 'fraction_numerical': 0.003459764223475141, 'mean_word_length': 1.3380766926303176, 'pattern_counts': {'":': 0, '<': 283, '<?xml version=': 0, '>': 355, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 29, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '14617', 'n_tokens_mistral': 4005, 'n_tokens_neox': 3933, 'n_words': 725}