public function showForm($id = '')
 {
     $this->prepareForm($id, array('method' => 'post', 'action' => $id > 0 ? 'conta_bancaria/atualizar/' . $id : 'conta_bancaria/adicionar', 'includeTabs' => true));
     echo "<table class='easy-form-table'>";
     echo "<tr>";
     echo "<td colspan='2'>";
     SystemHelper::addTextfield(array('label' => 'Titular da conta', 'name' => 'nome_titular', 'value' => $this->fields['nome_titular']));
     echo "</td>";
     echo "<td>";
     SystemHelper::addTextfield(array('label' => 'CPF do titular', 'name' => 'cpf_titular', 'mask' => 'ls-mask-cpf', 'value' => $this->fields['cpf_titular']));
     echo "</td>";
     echo "</tr>";
     echo "<tr>";
     echo "<td>";
     SystemHelper::addTextfield(array('label' => 'Banco', 'name' => 'banco_nome', 'value' => $this->fields['banco_nome']));
     echo "</td>";
     echo "<td>";
     SystemHelper::addTextfield(array('label' => 'Agência', 'name' => 'banco_agencia', 'align' => 'center', 'width' => '90px', 'value' => $this->fields['banco_agencia']));
     echo "</td>";
     echo "<td>";
     SystemHelper::addTextfield(array('label' => 'Conta', 'name' => 'banco_conta', 'align' => 'center', 'width' => '130px', 'value' => $this->fields['banco_conta']));
     echo "</td>";
     echo "</tr>";
     echo "</table>";
     SystemHelper::addLargeTextfield(array('label' => 'Observações', 'name' => 'observacoes', 'rows' => 7, 'value' => $this->fields['observacoes']));
     if ($id > 0) {
         SystemHelper::addSubmitButton(array('label' => 'Atualizar', 'icon' => 'ls-ico-checkmark'));
     } else {
         SystemHelper::addButton(array('label' => 'Adicionar', 'icon' => 'ls-ico-checkmark', 'onClick' => '$futuri.addBankAccount();', 'data' => array('popupcloser' => true)));
     }
     SystemHelper::addButton(array('label' => 'Cancelar', 'icon' => 'ls-ico-close', 'data' => array('popupcloser' => true)));
 }
 public function showForm($id = -1)
 {
     $this->prepareForm($id, array('method' => 'post', 'action' => $id > 0 ? 'contato/atualizar/' . $id : 'contato/adicionar', 'includeTabs' => true));
     echo "<table class='easy-form-table'>";
     echo "<tr>";
     echo "<td colspan='3'>";
     SystemHelper::addTextfield(array('label' => 'Nome', 'name' => 'nome_contato', 'value' => $this->fields['nome_contato']));
     echo "</td>";
     echo "</tr>";
     echo "<tr>";
     echo "<td>";
     SystemHelper::addTextfield(array('label' => 'Tel casa', 'name' => 'tel_casa', 'mask' => 'ls-mask-phone8_with_ddd', 'value' => $this->fields['tel_casa']));
     echo "</td>";
     echo "<td>";
     SystemHelper::addTextfield(array('label' => 'Cel 1', 'name' => 'tel_cel', 'mask' => 'ls-mask-phone9_with_ddd', 'value' => $this->fields['tel_cel']));
     echo "</td>";
     echo "<td>";
     SystemHelper::addTextfield(array('label' => 'Cel 2', 'name' => 'tel_outro', 'mask' => 'ls-mask-phone9_with_ddd', 'value' => $this->fields['tel_outro']));
     echo "</td>";
     echo "</tr>";
     echo "<tr>";
     echo "<td colspan='2'>";
     SystemHelper::addTextfield(array('label' => 'Email', 'name' => 'contato_email', 'value' => $this->fields['contato_email']));
     echo "</td>";
     echo "</tr>";
     echo "</table>";
     SystemHelper::addLargeTextfield(array('label' => 'Observações', 'name' => 'observacoes', 'rows' => 7, 'value' => $this->fields['observacoes']));
     if ($id > 0) {
         SystemHelper::addSubmitButton(array('label' => 'Atualizar', 'icon' => 'ls-ico-checkmark'));
     } else {
         SystemHelper::addButton(array('label' => 'Adicionar', 'icon' => 'ls-ico-checkmark', 'onClick' => '$futuri.addContact();', 'data' => array('popupcloser' => true)));
     }
     SystemHelper::addButton(array('label' => 'Cancelar', 'icon' => 'ls-ico-close', 'data' => array('popupcloser' => true)));
 }
Exemplo n.º 3
0
 public function showForm($id = -1)
 {
     $this->prepareForm($id, array('method' => 'post', 'action' => $id > 0 ? 'cliente/atualizar/' . $id : 'cliente/adicionar'));
     echo "<div id='infos' class='ls-tab-content ls-active' role='tabpanel'>";
     echo "<table class='easy-form-table'>";
     echo "<tr>";
     echo "<td colspan='2'>";
     SystemHelper::addTextfield(array('label' => 'Razão Social', 'name' => 'razao_social', 'required' => true, 'value' => $this->fields['razao_social']));
     echo "</td>";
     echo "</tr>";
     echo "<tr>";
     echo "<td>";
     SystemHelper::addTextfield(array('label' => 'Nome Fantasia', 'name' => 'nome_fantasia', 'required' => true, 'value' => $this->fields['nome_fantasia']));
     echo "</td>";
     echo "<td>";
     SystemHelper::addTextfield(array('label' => 'CNPJ', 'name' => 'cnpj', 'required' => true, 'mask' => 'ls-mask-cnpj', 'value' => $this->fields['cnpj']));
     echo "</td>";
     echo "</tr>";
     echo "<tr>";
     echo "<td>";
     SystemHelper::addTextfield(array('label' => 'Inscrição Estadual', 'name' => 'ins_estadual', 'required' => true, 'width' => '130px', 'align' => 'center', 'value' => $this->fields['ins_estadual']));
     echo "</td>";
     echo "<td>";
     SystemHelper::addTextfield(array('label' => 'Inscrição Municipal', 'name' => 'ins_municipal', 'required' => true, 'width' => '130px', 'align' => 'center', 'value' => $this->fields['ins_municipal']));
     echo "</td>";
     echo "</tr>";
     echo "</table>";
     SystemHelper::addLargeTextfield(array('label' => 'Observações', 'name' => 'observacoes', 'rows' => 8, 'value' => $this->fields['observacoes']));
     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 "</div>";
     $this->addButtons();
 }
 public function showForm($id = -1)
 {
     $this->prepareForm($id, array('method' => 'post', 'action' => $id > 0 ? 'produto/atualizar/' . $id : 'produto/adicionar'));
     echo "<div id='infos' class='ls-tab-content ls-active' role='tabpanel'>";
     echo "<table class='easy-form-table'>";
     echo "<tr>";
     echo "<td colspan='2'>";
     SystemHelper::addTextfield(array('label' => 'Produto / Serviço', 'name' => 'nome', 'value' => $this->fields['nome']));
     echo "</td>";
     echo "<td>";
     $fornecedor_options = array();
     $this->load->model("supplier_model");
     foreach ($this->supplier_model->getObjects() as $index => $supInfo) {
         $fornecedor_options[] = array("value" => $supInfo['id'], "label" => $supInfo['nome_fantasia']);
     }
     SystemHelper::addCombobox(array('label' => 'Fornecedor', 'name' => 'fornecedor_id', 'options' => $fornecedor_options, 'value' => $this->fields['fornecedor_id']));
     echo "</td>";
     echo "</tr>";
     echo "<tr>";
     echo "<td>";
     SystemHelper::addTextfield(array('label' => 'Quantidade', 'name' => 'quantidade', 'align' => 'right', 'value' => $this->fields['quantidade']));
     echo "</td>";
     echo "<td>";
     SystemHelper::addTextfield(array('label' => 'Valor Unitário (R$)', 'name' => 'valor_unitario', 'align' => 'right', 'mask' => 'ls-mask-money', 'value' => $this->fields['valor_unitario']));
     echo "</td>";
     echo "<td>";
     SystemHelper::addTextfield(array('label' => 'Valor Total (R$)', 'name' => 'valor', 'align' => 'right', 'mask' => 'ls-mask-money', 'value' => $this->fields['valor']));
     echo "</td>";
     echo "</tr>";
     echo "<tr>";
     echo "<td>";
     SystemHelper::addDatefield(array('label' => 'Data da compra', 'name' => 'dt_compra', 'width' => '120px', 'value' => SystemHelper::convertDateFromUS($this->fields['dt_compra']), 'useIcon' => true));
     echo "</td>";
     echo "<td>";
     SystemHelper::addDatefield(array('label' => 'Data do recebimento', 'name' => 'dt_entrega', 'width' => '140px', 'value' => SystemHelper::convertDateFromUS($this->fields['dt_entrega']), 'useIcon' => true));
     echo "</td>";
     echo "</tr>";
     echo "</table>";
     SystemHelper::addLargeTextfield(array('label' => 'Observações', 'name' => 'observacoes', 'rows' => 8, 'value' => $this->fields['observacoes']));
     echo "</div>";
     $this->addButtons();
 }
 public function showForm($id = -1)
 {
     $this->prepareForm($id, array('method' => 'post', 'action' => $id > 0 ? 'endereco/atualizar/' . $id : 'endereco/adicionar', 'includeTabs' => true));
     echo "<table class='easy-form-table'>";
     echo "<tr>";
     echo "<td colspan='3'>";
     SystemHelper::addTextfield(array('label' => 'Nome', 'name' => 'nome_endereco', 'value' => $this->fields['nome_endereco']));
     echo "</td>";
     echo "</tr>";
     echo "<tr>";
     echo "<td>";
     SystemHelper::addTextfield(array('label' => 'CEP', 'name' => 'endereco_cep', 'width' => '130px', 'onKeyUp' => '$futuri.searchCep(this);', 'mask' => 'ls-mask-cep', 'value' => $this->fields['endereco_cep']));
     echo "</td>";
     echo "</tr>";
     echo "<tr>";
     echo "<td>";
     SystemHelper::addTextfield(array('label' => 'Endereço', 'name' => 'endereco', 'value' => $this->fields['endereco']));
     echo "</td>";
     echo "<td>";
     SystemHelper::addTextfield(array('label' => 'Bairro', 'name' => 'endereco_bairro', 'value' => $this->fields['endereco_bairro']));
     echo "</td>";
     echo "<td>";
     SystemHelper::addTextfield(array('label' => 'UF', 'name' => 'endereco_uf', 'maxLength' => 2, 'align' => 'center', 'width' => '50px', 'value' => $this->fields['endereco_uf']));
     echo "</td>";
     echo "</tr>";
     echo "<tr>";
     echo "<td>";
     SystemHelper::addTextfield(array('label' => 'Número', 'name' => 'endereco_numero', 'width' => '80px', 'align' => 'center', 'value' => $this->fields['endereco_numero']));
     echo "</td>";
     echo "<td>";
     SystemHelper::addTextfield(array('label' => 'Complemento', 'name' => 'endereco_complemento', 'value' => $this->fields['endereco_complemento']));
     echo "</td>";
     echo "</tr>";
     echo "</table>";
     SystemHelper::addLargeTextfield(array('label' => 'Observações', 'name' => 'observacoes', 'rows' => 7, 'value' => $this->fields['observacoes']));
     if ($id > 0) {
         SystemHelper::addSubmitButton(array('label' => 'Atualizar', 'icon' => 'ls-ico-checkmark'));
     } else {
         SystemHelper::addButton(array('label' => 'Adicionar', 'icon' => 'ls-ico-checkmark', 'onClick' => '$futuri.addAddress();', 'data' => array('popupcloser' => true)));
     }
     SystemHelper::addButton(array('label' => 'Cancelar', 'icon' => 'ls-ico-close', '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();
 }
Exemplo n.º 7
0
 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();
 }