public function getFields()
 {
     include "application/helpers/system_helper.php";
     include "ParamTableComponent.php";
     echo '<tr>';
     echo '<td>';
     SystemHelper::addTextfield(array('name' => 'header_name[]'));
     echo '</td>';
     echo '<td>';
     SystemHelper::addCombobox(array('name' => 'header_type', 'options' => ParamTableComponent::$types));
     echo '</td>';
     echo '<td>';
     SystemHelper::addCombobox(array('name' => 'header_align', 'options' => $this->aligns));
     echo '</td>';
     echo '<td>';
     SystemHelper::addIconButton(['icon' => 'fa fa-times', 'onClick' => '$paramTable.removeFields(this);', 'tooltip' => 'Remover', 'tooltip-align' => 'right']);
     echo '</td>';
     echo '</tr>';
 }
 public function showForm($job_id = '', $id = -1)
 {
     $this->load->model("casting_model", "casting_manager");
     switch ($job_id) {
         default:
             $selecao = array();
             $label_title = 'Promotor';
             $funcao_id = self::CASTINGJOB_PROMOTER_ID;
             $where = array("funcao_id" => self::CASTINGJOB_PROMOTER_ID);
             break;
         case self::CASTINGJOB_SUPERVISOR:
             $selecao = array();
             $label_title = 'Supervisor';
             $funcao_id = self::CASTINGJOB_SUPERVISOR_ID;
             $where = array("funcao_id" => self::CASTINGJOB_SUPERVISOR_ID);
             break;
         case self::CASTINGJOB_PRODUCER:
             $selecao = array();
             $label_title = 'Produtor';
             $funcao_id = self::CASTINGJOB_PRODUCER_ID;
             $where = array("funcao_id" => self::CASTINGJOB_PRODUCER_ID);
             break;
     }
     foreach ($this->casting_manager->getObjects(array('where' => $where, "orderBy" => "nome_completo ASC")) as $index => $castingInfo) {
         $selecao[] = array("label" => $castingInfo['nome_completo'], "value" => $castingInfo['id']);
     }
     SystemHelper::addHiddenfield('', 'filter_funcao', $funcao_id);
     echo "<div id='casting_task' data-cadastro_tipo='" . $job_id . "'>";
     $filter_button = SystemHelper::addIconButton(array('icon' => 'fa fa-search', 'is_popup' => true, 'url' => 'trabalho_casting/filtrar/' . $job_id, 'popup_title' => 'Filtragem de ' . $label_title, 'tooltip' => 'Filtrar', 'tooltip-align' => 'right', 'returnHTML' => true));
     echo "<div class='casting-profile-container hidden' style='width:120px;height:120px;'>";
     echo "<img class='casting-profile' id='casting_select_picture' src='#' ></img>";
     echo "</div>";
     SystemHelper::addCombobox(array('label' => $label_title . " " . $filter_button, 'name' => 'trabalho_select_casting', 'onChange' => '$futuri.getCastingAccounts(this);', 'options' => $selecao));
     SystemHelper::addTextfield(array('label' => 'Valor recebido (R$)', 'name' => 'trabalho_select_valor', 'width' => '140px', 'mask' => 'ls-mask-money'));
     echo "</div>";
     echo "<div id='task_account_casting'></div>";
     echo "<div id='task_account_info'></div>";
     SystemHelper::addButton(array('label' => 'Adicionar', 'icon' => 'ls-ico-checkmark', 'onClick' => '$futuri.addCastingTask();', 'data' => array('popupcloser' => true)));
     SystemHelper::addButton(array('label' => 'Cancelar', 'data' => array('popupcloser' => true)));
 }
 public function getFields()
 {
     include "application/helpers/system_helper.php";
     echo '<tr>';
     echo '<td>';
     SystemHelper::addTextfield(array('name' => 'param_displayname[]'));
     echo '</td>';
     echo '<td>';
     SystemHelper::addTextfield(array('name' => 'param_name[]'));
     echo '</td>';
     echo '<td>';
     SystemHelper::addCombobox(array('name' => 'param_type[]', 'options' => self::$types));
     echo '</td>';
     echo '<td>';
     SystemHelper::addTextfield(array('name' => 'param_default[]'));
     echo '</td>';
     echo '<td>';
     SystemHelper::addYesNoToggle(array('name' => 'param_userinput[]'));
     echo '</td>';
     echo '<td>';
     SystemHelper::addIconButton(['icon' => 'fa fa-times', 'onClick' => '$paramTable.removeFields(this);', 'tooltip' => 'Remover', 'tooltip-align' => 'right']);
     echo '</td>';
     echo '</tr>';
 }
 public function showListPanel($options = array())
 {
     $rand_id = rand(0, 1000);
     $defaults = array('id' => $rand_id, 'headers' => array(), 'title' => '', 'connection_id' => -1, 'list' => array(), 'hideNoneRowsMsg' => false, 'object_type' => '');
     $options = array_merge($defaults, $options);
     $object_type = $options['object_type'];
     $con_id = $options['connection_id'];
     $title = $options['title'];
     $list_data = array();
     $headers_data = $options['headers'];
     $id = $options['id'];
     $hide_none_rows = $options['hideNoneRowsMsg'];
     foreach ($options['list'] as $index => $row) {
         $last_index = count($row) - 1;
         if (isset($row[$last_index]['edit_button'])) {
             $edit_button = SystemHelper::addIconButton(array('icon' => $row[$last_index]['edit_button']['icon'], 'url' => $row[$last_index]['edit_button']['url'], 'tooltip' => $row[$last_index]['edit_button']['label'], 'tooltip-align' => 'right', 'is_popup' => $row[$last_index]['remove_button']['url'] != "#" ? true : false, 'onClick' => isset($row[$last_index]['remove_button']['onClick']) ? $row[$last_index]['remove_button']['onClick'] : "", 'popup_title' => $row[$last_index]['edit_button']['label'], 'returnHTML' => true));
         }
         if (isset($row[$last_index]['remove_button'])) {
             $remove_button = SystemHelper::addIconButton(array('icon' => $row[$last_index]['remove_button']['icon'], 'url' => $row[$last_index]['remove_button']['url'], 'tooltip' => $row[$last_index]['remove_button']['label'], 'tooltip-align' => 'right', 'is_popup' => $row[$last_index]['remove_button']['url'] != "#" ? true : false, 'onClick' => isset($row[$last_index]['remove_button']['onClick']) ? $row[$last_index]['remove_button']['onClick'] : "", 'popup_title' => $row[$last_index]['remove_button']['label'], 'returnHTML' => true));
         }
         $row[$last_index] = (isset($edit_button) ? $edit_button : "") . "&nbsp;&nbsp;" . (isset($remove_button) ? $remove_button : "");
         $list_data[] = $row;
     }
     $add_button = SystemHelper::addIconButton(array('icon' => $options['add_button']['icon'], 'url' => $options['add_button']['url'] . ($rand_id == $id ? "/" . $id : ""), 'tooltip' => $options['add_button']['label'], 'tooltip-align' => 'right', 'is_popup' => true, 'data' => array('panel_id' => $id), 'popup_title' => $options['add_button']['label'], 'returnHTML' => true));
     //$remove_button = $options['buttons']['remove'];
     //$edit_button = $options['buttons']['edit'];
     //$refresh_button = $options['buttons']['refresh'];
     $panel = "<b>" . $title . " " . $add_button . "</b>";
     $panel .= "<div class='ls-box'>";
     $panel .= SystemHelper::createTableFromArray(array('id' => "listpanel_table_" . $id, 'headers' => $headers_data, 'hideNoneRowsMsg' => $hide_none_rows, 'show_always_as_mobile' => true, 'data' => $list_data));
     $panel .= "</div>";
     if (isset($options['returnHTML']) && $options['returnHTML']) {
         return $panel;
     }
     echo $panel;
 }
        echo "<td>";
        SystemHelper::addCombobox(array('name' => 'search_field[]', 'onChange' => '$futuri.loadAsyncSearchOption(this,"' . $controller->getType() . '");', 'options' => $controller->createFieldOptionsForCombobox(), 'value' => $input->post("search_field")[$ind]));
        echo "</td>";
        echo "<td>";
        $controller->getAsyncSearch($search_field, $input->post("search_value")[$ind]);
        echo "</td>";
        if ($ind == 0) {
            echo '<td valign="bottom">';
            SystemHelper::addSubmitButton(array('label' => 'Aplicar'));
            echo '</td>';
            echo '<td valign="bottom">';
            SystemHelper::addButton(array('label' => '', 'id' => 'add_search_clausure', 'onClick' => '$futuri.addSearchClausure("' . $controller->getType() . '");', 'icon' => 'ls-ico-plus'));
            echo '</td>';
        } else {
            echo '<td>';
            SystemHelper::addIconButton(array('icon' => 'fa fa-trash', 'tooltip' => 'Remover', 'onClick' => '$futuri.removeSeachClausure(this)', 'tooltip-align' => 'right', 'returnHTML' => false));
            echo '</td>';
        }
        echo "</tr>";
    }
} else {
    echo "<tr>";
    echo "<td>Buscar</td>";
    echo "<td>";
    SystemHelper::addCombobox(array('name' => 'search_field[]', 'onChange' => '$futuri.loadAsyncSearchOption(this,"' . $controller->getType() . '");', 'options' => $controller->createFieldOptionsForCombobox(), 'value' => ''));
    echo "</td>";
    echo "<td>";
    SystemHelper::addTextfield(array('name' => 'search_value[]'));
    echo "</td>";
    echo '<td valign="bottom">';
    SystemHelper::addSubmitButton(array('label' => 'Aplicar'));