public function showForm($id = -1) { $this->prepareForm($id, array('method' => 'post', 'action' => 'backup/adicionar')); SystemHelper::addHiddenfield('', 'usuario_id_criacao', FUTURI_Session::getUserID()); SystemHelper::addHiddenfield('', 'dt_criacao', date('Y-m-d H:i:s')); echo "<div class='ls-tab-content ls-active' id='infos'>"; echo "<table class='easy-form-table'>"; echo "<tr>"; echo "<td>"; SystemHelper::addTextfield(array('label' => 'Nome', 'required' => true, 'name' => 'nome_backup')); echo "</td>"; echo "</tr>"; echo "</table>"; echo "<b>Opções do backup</b>"; echo "<div class='ls-box'>"; echo "<table class='easy-form-table'>"; echo "<tr>"; echo "<td>"; SystemHelper::addYesNoToggle(array('label' => 'Banco de dados', 'name' => 'incluir_banco_dados', 'value' => 1, 'checked' => $this->fields['incluir_banco_dados'])); echo "</td>"; echo "<td>"; SystemHelper::addYesNoToggle(array('label' => 'Fotos casting/trabalhos', 'name' => 'incluir_casting_fotos', 'value' => 1, 'checked' => $this->fields['incluir_casting_fotos'])); echo "</td>"; echo "<td>"; SystemHelper::addYesNoToggle(array('label' => 'Documentos', 'name' => 'incluir_documentos', 'value' => 1, 'checked' => $this->fields['incluir_documentos'])); echo "</td>"; echo "</tr>"; echo "</table>"; echo "</div>"; echo "</div>"; $this->addButtons(); }
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 showForm($id = -1) { $this->prepareForm($id, array('method' => 'post', 'action' => $id > 0 ? 'casting/atualizar/' . $id : 'casting/adicionar/')); echo "<div id='infos' class='ls-tab-content ls-active' role='tabpanel'>"; if ($this->objectID <= 0) { SystemHelper::addHiddenfield('', 'dt_criacao', date('Y-m-d')); } echo "<table class='easy-form-table'>"; echo "<tr>"; if ($this->objectID > 0) { echo "<td valign='top' rowspan='2'>"; echo "<div class='casting-profile-container'>"; if (!is_null($this->fields['foto'])) { echo "<img src='assets/pictures/" . $this->fields['foto'] . "' class='casting-profile'></img>"; } else { if ($this->fields['sexo'] == SystemHelper::SEXTYPE_MALE) { echo "<img src='assets/images/no_profile_homem.jpg' class='casting-profile'></img>"; } else { echo "<img src='assets/images/no_profile_mulher.jpg' class='casting-profile'></img>"; } } echo "<a href='#' class='changePhoto' data-url_change='ajax/casting/changePicture/' data-profile_id='" . $id . "'><span class='fa fa-camera fa-2x'></span> Alterar foto</a>"; echo "</div>"; echo "</td>"; } echo "<td>"; echo "<table>"; echo "<tr>"; echo "<td>"; SystemHelper::addTagLabel(array('label' => 'Status', 'value' => 'Ativo', 'color' => 'success')); echo "</td>"; echo "</tr>"; echo "<tr>"; echo "<td>"; SystemHelper::addTextfield(array('label' => "Nome completo", 'name' => 'nome_completo', 'required' => true, 'value' => $this->fields['nome_completo'])); echo "</td>"; echo "<td>"; $this->load->model("job_model", "job_model"); $options = array(); foreach ($this->job_model->getObjects() as $index => $jobInfo) { $options[] = array("value" => $jobInfo['id'], "label" => $jobInfo['nome']); } SystemHelper::addCombobox(array('label' => "Função", 'name' => 'funcao_id', 'options' => $options, 'required' => true, 'value' => $this->fields['funcao_id'])); echo "</td>"; echo "</tr>"; echo "<tr>"; echo "<td>"; $sexo_options = array(); $this->load->model("sexo_model"); foreach ($this->sexo_model->getObjects() as $index => $sexoInfo) { $sexo_options[] = array('label' => $sexoInfo['nome'], 'value' => $sexoInfo['id']); } SystemHelper::addRadioGroup(array('label' => "Sexo", 'name' => 'sexo', 'onChange' => '$futuri.showHideUniformSection(this.value);', 'options' => $sexo_options, 'value' => $this->fields['sexo'] ? $this->fields['sexo'] : 'F')); echo "</td>"; echo "<td>"; SystemHelper::addDatefield(array('label' => "Data de Nascimento", 'name' => 'dt_nascimento', 'useIcon' => true, 'width' => '120px', 'value' => SystemHelper::convertDateFromUS($this->fields['dt_nascimento']))); echo "</td>"; echo "</tr>"; echo "<tr>"; echo "<td>"; $this->load->model("relationship_model"); $estado_options = array(); foreach ($this->relationship_model->getObjects() as $index => $relationInfo) { $estado_options[] = array("value" => $relationInfo['id'], "label" => $relationInfo['nome']); } SystemHelper::addCombobox(array('label' => "Estado Cívil", 'name' => 'estado_civil', 'required' => true, 'options' => $estado_options, 'value' => $this->fields['estado_civil'])); echo "</td>"; echo "<td>"; $this->load->model("nationality_model"); $country_options = array(); foreach ($this->nationality_model->getObjects() as $index => $nationInfo) { $country_options[] = array("value" => $nationInfo['id'], "label" => $nationInfo['nome']); } SystemHelper::addCombobox(array('label' => "Nacionalidade", 'name' => 'nacionalidade', 'required' => true, 'options' => $country_options, 'value' => $this->fields['nacionalidade'])); echo "</td>"; echo "</tr>"; echo "<tr>"; echo "<td colspan='2'>"; $this->load->model("profiletype_model"); $profile_options = array(); foreach ($this->profiletype_model->getObjects() as $index => $profileInfo) { $profile_options[] = array("value" => $profileInfo['id'], "label" => $profileInfo['nome']); } SystemHelper::addRadioGroup(array('label' => "Perfil", 'name' => 'perfil', 'required' => true, 'options' => $profile_options, 'value' => $this->fields['perfil'])); echo "</td>"; echo "</tr>"; echo "<tr>"; echo "<td colspan='2'>"; $this->load->model("languages_model"); $this->load->model("castinglanguage_model"); $languages_options = array(); foreach ($this->languages_model->getObjects(array("orderBy" => "nome ASC")) as $index => $languageInfo) { $languages_options[] = array("value" => $languageInfo['id'], "label" => $languageInfo['nome']); } // get casting languages $my_languages = array(); foreach ($this->castinglanguage_model->getObjects(array("where" => "promotor_id = '" . $this->objectID . "'")) as $index => $lang) { $my_languages[] = $lang['lingua_id']; } SystemHelper::addCheckboxGroup(array('label' => "Idiomas", 'name' => 'idiomas', 'options' => $languages_options, 'value' => $my_languages)); echo "</td>"; echo "</tr>"; echo "<tr>"; echo "<td colspan='2'>"; echo "<b>Características Pessoais</b>"; echo "<div class='ls-box'>"; echo "<table>"; echo "<tr>"; echo "<td>"; $this->load->model("skincolor_model"); $skins_options = array(); foreach ($this->skincolor_model->getObjects() as $index => $skinInfo) { $skins_options[] = array("value" => $skinInfo['id'], "label" => $skinInfo['nome']); } SystemHelper::addCombobox(array('label' => "Cor da pele", 'name' => 'cor_pele', 'options' => $skins_options, 'value' => $this->fields['cor_pele'])); echo "</td>"; echo "<td>"; $this->load->model("eyecolor_model"); $eye_options = array(); foreach ($this->eyecolor_model->getObjects() as $index => $eyeInfo) { $eye_options[] = array("value" => $eyeInfo['id'], "label" => $eyeInfo['nome']); } SystemHelper::addCombobox(array('label' => "Cor dos olhos", 'name' => 'cor_olho', 'options' => $eye_options, 'value' => $this->fields['cor_olho'])); echo "</td>"; echo "</tr>"; echo "<tr>"; echo "<td>"; $this->load->model("haircolor_model"); $hair_options = array(); foreach ($this->haircolor_model->getObjects() as $index => $hairInfo) { $hair_options[] = array("value" => $hairInfo['id'], "label" => $hairInfo['nome']); } SystemHelper::addCombobox(array('label' => "Cor do cabelo", 'name' => 'cor_cabelo', 'options' => $hair_options, 'value' => $this->fields['cor_cabelo'])); echo "</td>"; echo "<td>"; SystemHelper::addTextfield(array('label' => "Estilo de Cabelo", 'name' => 'estilo_cabelo', 'value' => $this->fields['estilo_cabelo'])); echo "</td>"; echo "</tr>"; echo "<tr>"; echo "<td colspan=2>"; SystemHelper::addTextfield(array('label' => "Tatuagem", 'name' => 'tatuagem', 'value' => $this->fields['tatuagem'])); echo "</td>"; echo "</tr>"; echo "<tr>"; echo "<td>"; SystemHelper::addTextfield(array('label' => "Altura", 'name' => 'altura', 'value' => $this->fields['altura'])); echo "</td>"; echo "<td>"; SystemHelper::addTextfield(array('label' => "Peso", 'name' => 'peso', 'value' => $this->fields['peso'])); echo "</td>"; echo "</tr>"; echo "</table>"; echo "<b>Uniforme</b>"; echo "<div class='ls-box'>"; echo "<table id='female-uniform-table' " . ($this->fields['sexo'] == SystemHelper::SEXTYPE_MALE ? "class='hidden'" : "") . ">"; echo "<tr>"; echo "<td>"; SystemHelper::addTextfield(array('label' => 'Vestido', 'name' => 'vestido', 'align' => 'center', 'value' => $this->fields['vestido'])); echo "</td>"; echo "<td>"; SystemHelper::addTextfield(array('label' => 'Camisa/Camiseta', 'name' => 'camisa_fem', 'align' => 'center', 'value' => $this->fields['camisa_fem'])); echo "</td>"; echo "</tr>"; echo "<tr>"; echo "<td>"; SystemHelper::addTextfield(array('label' => 'Quadril', 'name' => 'quadril_fem', 'align' => 'center', 'value' => $this->fields['quadril_fem'])); echo "</td>"; echo "<td>"; SystemHelper::addTextfield(array('label' => 'Cintura', 'name' => 'cintura_fem', 'align' => 'center', 'value' => $this->fields['cintura_fem'])); echo "</td>"; echo "</tr>"; echo "<tr>"; echo "<td>"; SystemHelper::addTextfield(array('label' => 'Calça', 'name' => 'calca_fem', 'align' => 'center', 'value' => $this->fields['calca_fem'])); echo "</td>"; echo "<td>"; SystemHelper::addTextfield(array('label' => 'Sapato', 'name' => 'sapato_fem', 'align' => 'center', 'value' => $this->fields['sapato_fem'])); echo "</td>"; echo "</tr>"; echo "</table>"; echo "<table id='male-uniform-table' " . ($this->fields['sexo'] == SystemHelper::SEXTYPE_FEMALE ? "class='hidden'" : "") . ">"; echo "<tr>"; echo "<td>"; SystemHelper::addTextfield(array('label' => 'Polo/Camiseta', 'name' => 'camisa_masc', 'align' => 'center', 'value' => $this->fields['camisa_masc'])); echo "</td>"; echo "<td>"; SystemHelper::addTextfield(array('label' => 'Camisa Social', 'name' => 'camisasocial_masc', 'align' => 'center', 'value' => $this->fields['camisasocial_masc'])); echo "</td>"; echo "</tr>"; echo "<tr>"; echo "<td>"; SystemHelper::addTextfield(array('label' => 'Calça', 'name' => 'calca_masc', 'align' => 'center', 'value' => $this->fields['calca_masc'])); echo "</td>"; echo "<td>"; SystemHelper::addTextfield(array('label' => 'Toráx', 'name' => 'torax_masc', 'align' => 'center', 'value' => $this->fields['torax_masc'])); echo "</td>"; echo "</tr>"; echo "<tr>"; echo "<td>"; SystemHelper::addTextfield(array('label' => 'Sapato', 'name' => 'sapato_masc', 'align' => 'center', 'value' => $this->fields['sapato_masc'])); echo "</td>"; echo "</tr>"; echo "</table>"; echo "</div>"; echo "</div>"; echo "</td>"; echo "</tr>"; echo "</table>"; echo "</td>"; echo "</tr>"; echo "</table>"; echo "<b>Filiação</b>"; echo "<div class='ls-box'>"; echo "<table style='width:100%'>"; echo "<tr>"; echo "<td>"; SystemHelper::addTextfield(array('label' => "Nome da mãe", 'name' => 'nome_mae', 'required' => true, 'value' => $this->fields['nome_mae'])); echo "</td>"; echo "</tr>"; echo "<tr>"; echo "<td>"; SystemHelper::addTextfield(array('label' => "Nome do pai", 'name' => 'nome_pai', 'value' => '')); echo "</td>"; echo "</tr>"; echo "</table>"; echo "</div>"; echo "<br>"; echo "<b>Disponibilidade</b>"; echo "<div class='ls-box'>"; echo "<table style='width:100%'>"; echo "<tr>"; echo "<td>"; echo "<b>Horário</b>"; echo "<div class='ls-box'>"; $my_horarios = explode(",", $this->fields['disponibilidade_horario']); SystemHelper::addCheckboxGroup(array('label' => '', 'name' => 'disponibilidade_horario', 'value' => $my_horarios, 'breakLine' => true, 'options' => $this->hours_disponibles)); echo "</div>"; echo "</td>"; echo "<td>"; echo "<b>Locomoção</b>"; echo "<div class='ls-box'>"; $my_veiculos = explode(",", $this->fields['disponibilidade_veiculos']); SystemHelper::addCheckboxGroup(array('label' => '', 'name' => 'disponibilidade_veiculos', 'value' => $my_veiculos, 'breakLine' => true, 'options' => $this->vehicle_disponibles)); echo "</div>"; echo "</td>"; echo "</tr>"; echo "</table>"; echo "</div>"; SystemHelper::addLargeTextfield(array('label' => 'Observações', 'name' => 'observacoes', 'rows' => '7', 'value' => $this->fields['observacoes'])); echo "</div>"; echo "<div id='docs' class='ls-tab-content' role='tabpanel'>"; echo "<table class='easy-form-table'>"; echo "<tr>"; echo "<td colspan='3'>"; echo "<div id='cpf_duplicity_result'></div>"; echo "</td>"; echo "</td>"; echo "<tr>"; echo "<td>"; SystemHelper::addTextfield(array('label' => "CPF", 'name' => 'CPF', 'required' => true, 'mask' => 'ls-mask-cpf', 'onChange' => '$futuri.checkCPFDuplicity(this)', 'value' => $this->fields['CPF'])); echo "</td>"; echo "</tr>"; echo "<tr>"; echo "<td>"; SystemHelper::addTextfield(array('label' => "Identidade (RG)", 'name' => 'RG', 'required' => true, 'mask' => 'ls-mask-rg', 'value' => $this->fields['RG'])); echo "</td>"; echo "<td>"; SystemHelper::addDatefield(array('label' => "Data Expedição", 'name' => 'dt_expedicao', 'useIcon' => true, 'width' => '120px', 'value' => SystemHelper::convertDateFromUS($this->fields['dt_expedicao']))); echo "</td>"; echo "</tr>"; echo "<tr>"; echo "<td>"; SystemHelper::addTextfield(array('label' => "Titulo Eleitoral", 'name' => 'titulo_eleitor', 'value' => $this->fields['titulo_eleitor'])); echo "</td>"; echo "<td>"; SystemHelper::addTextfield(array('label' => "Zona Eleitoral", 'name' => 'zona', 'value' => $this->fields['zona'])); echo "</td>"; echo "<td>"; SystemHelper::addTextfield(array('label' => "Seção Eleitoral", 'name' => 'secao', 'value' => $this->fields['secao'])); echo "</td>"; echo "</tr>"; echo "</table>"; echo "</div>"; $type_object = $this->getType(); echo "<div id='enderecos' class='ls-tab-content' role='tabpanel'>"; include "Address.php"; $this->address = new Address(); $this->load->model("address_model"); $this->address_model = new Address_Model(); $addresses = array(); foreach ($this->address_model->getObjects(array("where" => "cadastro_tipo = '" . $type_object . "' AND conexao_id = '" . $this->objectID . "'")) as $index => $addInfo) { $this->address->setID($addInfo['id']); $addresses[] = array($addInfo['nome_endereco'], $addInfo['endereco_cep'], $addInfo['endereco'] . " " . $addInfo['endereco_numero'] . ", " . $addInfo['endereco_complemento'], array("edit_button" => $this->address->getActionOptions()["actions"][0], "remove_button" => $this->address->getActionOptions()["actions"][1])); } $this->address->redefineActionsURL($type_object, $this->objectID); $this->address->showListPanel(array('title' => 'Endereços', 'id' => 'endereco', 'add_button' => $this->address->getActionOptions()["add"], 'headers' => array('Nome', 'CEP', 'Endereço', ''), 'list' => $addresses)); echo "<br>"; include "Contact.php"; $this->contact = new Contact(); $this->load->model("contact_model"); $this->contact_model = new Contact_Model(); $contacts = array(); foreach ($this->contact_model->getObjects(array("where" => "cadastro_tipo = '" . $type_object . "' AND conexao_id = '" . $this->objectID . "'")) as $index => $contactInfo) { $this->contact->setID($contactInfo['id']); $contacts[] = array($contactInfo['nome_contato'], $contactInfo['tel_casa'], $contactInfo['tel_cel'], $contactInfo['tel_outro'], $contactInfo['contato_email'], array("edit_button" => $this->contact->getActionOptions()["actions"][0], "remove_button" => $this->contact->getActionOptions()["actions"][1])); } $this->contact->redefineActionsURL($type_object, $this->objectID); $this->contact->showListPanel(array('title' => 'Contatos', 'id' => 'contatos', 'headers' => array('Nome', 'Tel Casa', 'Cel 1', 'Cel 2', 'Email', ''), 'add_button' => $this->contact->getActionOptions()["add"], 'list' => $contacts)); echo "<br>"; include "BankAccount.php"; $this->bank_account = new Bankaccount(); $this->load->model("bankaccount_model"); $this->bankaccount_model = new Bankaccount_Model(); $bank_accounts = array(); foreach ($this->bankaccount_model->getObjects(array("where" => "cadastro_tipo = '" . $type_object . "' AND conexao_id = '" . $this->objectID . "'")) as $index => $bankInfo) { $this->bank_account->setID($bankInfo['id']); $bank_accounts[] = array($bankInfo['nome_titular'], $bankInfo['banco_nome'], $bankInfo['banco_agencia'], $bankInfo['banco_conta'], array("remove_button" => $this->bank_account->getActionOptions()["actions"][1])); } $this->bank_account->redefineActionsURL($type_object, $this->objectID); $this->bank_account->showListPanel(array('title' => 'Contas Bancárias', 'id' => 'bancos', 'headers' => array('Titular', 'Banco', 'Agência', 'Conta', ''), 'add_button' => $this->bank_account->getActionOptions()["add"], 'list' => $bank_accounts)); echo "</div>"; $this->addButtons(); }
} ?> <div class="dataviewPage-searchEngine"> <div class="filterContainer"> <form method="post"> <table class="easy-form-table" id="searchForm" style='width:700px;'> <tr> <td></td> <td><label class="ls-label"><b>Campo</b></label></td> <td><label class="ls-label"><b>Palavra-chave</b></label></td> </tr> <?php $input = $controller->getInputController(); if ($input->post("pager_limit")) { SystemHelper::addHiddenfield('', 'pager_limit', $input->post("pager_limit")); } if ($input->post("search_field")) { foreach ($input->post("search_field") as $ind => $search_field) { echo "<tr>"; echo $ind == 0 ? "<td>Buscar</td>" : "<td></td>"; 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>';
if ($p >= $pager_interval) { break; } } if ($controller->selectedPage < $pager_interval) { echo '<li>'; echo "<form method='post'>"; echo "<a href='#' onClick='this.parentNode.submit();'>"; if ($input->post("search_field")) { foreach ($input->post("search_field") as $ind => $search_field) { SystemHelper::addHiddenfield('', 'search_field[]', $search_field); SystemHelper::addHiddenfield('', 'search_value[]', $input->post("search_value")[$ind]); } } SystemHelper::addHiddenfield('', 'pager_limit', $controller->selectedPagerLimit); SystemHelper::addHiddenfield('', 'pager_page', $controller->selectedPage + 1); echo "Próxima »</a>"; echo "</form>"; echo '</li>'; } else { echo '<li class="ls-disabled"><a href="#">Próxima »</a></li>'; } ?> </ul> </div> </div> </div> <?php } ?> </div>
public function showForm($id = -1, $not_in_admin = false) { $this->prepareForm($id, array('method' => 'post', 'action' => $id > 0 ? 'usuario/atualizar/' . $id : 'usuario/adicionar')); echo "<div class='ls-tab-content ls-active' id='#infos'>"; echo "<table class='easy-form-table'>"; if ($this->objectID > 0) { echo "<tr>"; echo "<td>"; echo "<div class='casting-profile-container'>"; echo "<img src='data:image/jpg;base64," . $this->fields['foto'] . "' class='casting-profile'></img>"; echo "<a href='#' class='changePhoto' data-url_change='" . base_url() . "ajax/usuario/changePicture/' data-profile_id='" . $id . "'><span class='fa fa-camera fa-2x'></span> Alterar foto</a>"; echo "</div>"; echo "</td>"; echo "</tr>"; } echo "<tr>"; echo "<td>"; SystemHelper::addTextfield(array('label' => 'Nome de exibição', 'name' => 'nome_exibicao', 'required' => true, 'value' => $this->fields['nome_exibicao'])); echo "</td>"; echo "<td>"; SystemHelper::addDatefield(array('label' => 'Data de Nascimento', 'name' => 'dt_nasc', 'useIcon' => true, 'width' => '120px', 'value' => SystemHelper::convertDateFromUS($this->fields['dt_nasc']))); echo "</td>"; echo "</tr>"; echo "<tr>"; echo "<td colspan='2'>"; SystemHelper::addTextfield(array('label' => 'Email', 'name' => 'email', 'required' => true, 'value' => $this->fields['email'])); echo "</td>"; echo "</tr>"; echo "<tr>"; echo "<td>"; SystemHelper::addTextfield(array('label' => 'Usuário', 'name' => 'usuario', 'required' => $id < 0 ? true : false, 'disabled' => $this->objectID > 0 ? true : false, 'value' => $this->fields['usuario'])); echo "</td>"; echo "</tr>"; if (!$not_in_admin) { echo "<tr>"; echo "<td>"; SystemHelper::addPasswordfield(array('label' => 'Senha', 'name' => 'senha')); echo "</td>"; echo "<td>"; SystemHelper::addPasswordfield(array('label' => 'Confirmação da senha', 'name' => 'senha_confirmacao')); echo "</td>"; echo "</tr>"; echo "<tr>"; echo "<td>"; SystemHelper::addYesNoToggle(array('label' => 'Administrador', 'name' => 'administrador', 'value' => 1, 'checked' => $this->fields['administrador'])); echo "</td>"; echo "</tr>"; } // ajuste para manter a configuração de administrado caso usuário atualize seu perfil if ($not_in_admin) { SystemHelper::addHiddenfield('', 'administrador', $this->fields['administrador']); } echo "</table>"; echo "</div>"; $this->addButtons(); }
public function showForm($id = -1) { $this->prepareForm($id, array('method' => 'post', 'action' => $id > 0 ? 'trabalho/atualizar/' . $id : 'trabalho/adicionar')); if ($this->objectID < 0) { SystemHelper::addHiddenfield('', 'dt_criacao', date('Y-m-d H:i:s')); SystemHelper::addHiddenfield('', 'usuario_id_criacao', FUTURI_Session::getUserID()); } echo "<div id='infos' class='ls-tab-content ls-active' role='tabpanel'>"; echo "<table class='easy-form-table'>"; echo "<tr>"; echo "<td colspan='2'>"; $status_options = array(); $this->load->model("taskstatus_model"); foreach ($this->taskstatus_model->getObjects() as $index => $stInfo) { $status_options[] = array("value" => $stInfo['id'], "label" => $stInfo['nome']); } SystemHelper::addCombobox(array('label' => 'Status', 'name' => 'status', 'options' => $status_options, 'value' => $this->fields['status'])); echo "</td>"; echo "</tr>"; echo "<tr>"; echo "<td colspan='5'>"; SystemHelper::addRadioGroup(array('label' => 'Empresa', 'name' => 'empresa_id', 'options' => $this->empresas_options, 'value' => $this->fields['empresa_id'])); echo "</td>"; echo "</tr>"; echo "<tr>"; echo "<td colspan='2'>"; SystemHelper::addTextfield(array('label' => 'Nome do evento', 'name' => 'nome_evento', 'required' => true, 'value' => $this->fields['nome_evento'])); echo "</td>"; echo "<td colspan='3'>"; $client_options = array(); $this->load->model("client_model"); foreach ($this->client_model->getObjects() as $index => $cliInfo) { $client_options[] = array("value" => $cliInfo['id'], "label" => $cliInfo['nome_fantasia']); } SystemHelper::addCombobox(array('label' => 'Cliente', 'name' => 'cliente_id', 'required' => true, 'options' => $client_options, 'value' => $this->fields['cliente_id'])); echo "</td>"; echo "</tr>"; echo "<tr>"; echo "<td colspan='2'>"; SystemHelper::addDatefield(array('label' => 'Data de início', 'name' => 'dt_inicio', 'width' => '120px', 'value' => SystemHelper::convertDateFromUS($this->fields['dt_inicio']), 'useIcon' => true)); echo "</td>"; echo "<td colspan='3'>"; SystemHelper::addDatefield(array('label' => 'Data de término', 'name' => 'dt_termino', 'width' => '120px', 'value' => SystemHelper::convertDateFromUS($this->fields['dt_termino']), 'useIcon' => true)); echo "</td>"; echo "</tr>"; echo "<tr>"; echo "<td>"; SystemHelper::addTextfield(array('label' => 'Custo real (R$)', 'name' => 'custo_real', 'mask' => 'ls-mask-money', 'value' => $this->fields['custo_real'])); echo "</td>"; echo "<td>"; SystemHelper::addTextfield(array('label' => 'Lucro (R$)', 'name' => 'lucro', 'mask' => 'ls-mask-money', 'value' => $this->fields['lucro'])); echo "</td>"; echo "<td>"; SystemHelper::addTextfield(array('label' => 'Margem Contrib(%)', 'name' => 'margem_contrib', 'mask' => 'ls-mask-percent', 'align' => 'right', 'value' => $this->fields['margem_contrib'])); echo "</td>"; echo "<td>"; SystemHelper::addTextfield(array('label' => 'Extras (R$)', 'name' => 'despesas_extras', 'mask' => 'ls-mask-money', 'value' => $this->fields['despesas_extras'])); echo "</td>"; echo "<td>"; SystemHelper::addTextfield(array('label' => 'Total (R$)', 'name' => 'valor_total', 'required' => true, 'mask' => 'ls-mask-money', 'value' => $this->fields['valor_total'])); echo "</td>"; echo "</tr>"; echo "</table>"; SystemHelper::addLargeTextfield(array('label' => 'Observações', 'name' => 'observacoes', 'rows' => 8, 'value' => $this->fields['observacoes'])); echo "</div>"; echo "<div id='efetivo' class='ls-tab-content' role='tabpanel'>"; include "TaskCasting.php"; include "Casting.php"; include "BankAccount.php"; $this->task_casting = new TaskCasting(); $add_button = $this->task_casting->getActionOptions()["add"]; $base_url = $add_button["url"]; $add_button["url"] = $base_url . "/promotor"; $promotores = array(); $supervisores = array(); $produtores = array(); $this->load->model("taskcasting_model"); $this->taskcasting_model = new Taskcasting_Model(); $remove_bt = array('icon' => 'ls-ico-close', 'url' => '#', 'label' => '', 'onClick' => '$futuri.removeCastingOrProductTask(this);'); //$this->taskcasting_model->debugMode = true; foreach ($this->taskcasting_model->getObjects(array("where" => "trabalho_id = " . $this->objectID)) as $index => $promInfo) { $this->casting = new Casting($promInfo['promotor_id']); $this->bank_account = new BankAccount($promInfo['promotor_conta_banco_id']); $hidden = "<input type='hidden' name='trabalho_select_casting[]' value='" . $promInfo['promotor_id'] . "'>"; $hidden2 = "<input type='hidden' name='trabalho_select_bank[]' value='" . $promInfo['promotor_conta_banco_id'] . "'>"; $hidden3 = "<input type='hidden' name='trabalho_select_valor[]' value='" . $promInfo['promotor_valor_recebido'] . "'>"; switch ($this->casting->fields['funcao_id']) { case TaskCasting::CASTINGJOB_PROMOTER_ID: $promotores[] = array($hidden . $this->casting->fields['nome_completo'], $hidden3 . $promInfo['promotor_valor_recebido'], $hidden2 . $this->bank_account->fields['banco_nome'], $this->bank_account->fields['banco_agencia'], $this->bank_account->fields['banco_conta'], array("remove_button" => $remove_bt)); break; case TaskCasting::CASTINGJOB_SUPERVISOR_ID: $supervisores[] = array($hidden . $this->casting->fields['nome_completo'], $hidden3 . $promInfo['promotor_valor_recebido'], $hidden2 . $this->bank_account->fields['banco_nome'], $this->bank_account->fields['banco_agencia'], $this->bank_account->fields['banco_conta'], array("remove_button" => $remove_bt)); break; case TaskCasting::CASTINGJOB_PRODUCER_ID: $produtores[] = array($hidden . $this->casting->fields['nome_completo'], $hidden3 . $promInfo['promotor_valor_recebido'], $hidden2 . $this->bank_account->fields['banco_nome'], $this->bank_account->fields['banco_agencia'], $this->bank_account->fields['banco_conta'], array("remove_button" => $remove_bt)); break; } } $headers = array('Nome', 'Valor recebido', 'Banco', 'Agencia', 'Conta', ''); $this->task_casting->showListPanel(array('title' => 'Promotores', 'hideNoneRowsMsg' => true, 'id' => 'task_promotores', 'headers' => $headers, 'list' => $promotores, 'add_button' => $add_button)); $add_button["url"] = $base_url . "/supervisor"; $this->task_casting->showListPanel(array('title' => 'Supervisores', 'id' => 'task_supervisores', 'hideNoneRowsMsg' => true, 'headers' => $headers, 'list' => $supervisores, 'add_button' => $add_button)); $add_button["url"] = $base_url . "/produtor"; $this->task_casting->showListPanel(array('title' => 'Produtores', 'id' => 'task_produtores', 'hideNoneRowsMsg' => true, 'headers' => $headers, 'list' => $produtores, 'add_button' => $add_button)); echo "<table class='easy-form-table'>"; echo "<tr>"; echo "</tr>"; echo "</table>"; echo "</div>"; echo "<div id='produtos_servicos' class='ls-tab-content' role='tabpanel'>"; include "Product.php"; include "TaskProduct.php"; $this->products = new TaskProduct(); $this->load->model("taskproduct_model"); $produtos = array(); $this->taskproduct_model = new Taskproduct_Model(); foreach ($this->taskproduct_model->getObjects(array("where" => "trabalho_id = '" . $this->objectID . "'")) as $ind => $prodInfo) { $this->product = new Product($prodInfo['produto_id']); $produtos[] = array("<input type='hidden' name='trabalho_select_produto[]' value='" . $prodInfo['produto_id'] . "'>" . $this->product->fields['nome'], "<input type='hidden' name='trabalho_select_quantidade[]' value='" . $prodInfo['produto_quantidade'] . "'>" . $prodInfo['produto_quantidade'], array("remove_button" => $remove_bt)); } $this->products->showListPanel(array('title' => 'Produtos/Serviços', 'hideNoneRowsMsg' => true, 'id' => 'task_produtos', 'list' => $produtos, 'headers' => array('Nome', 'Quantidade', ''), 'add_button' => $this->products->getActionOptions()["add"])); echo "</div>"; $this->addButtons(); }