public function __construct($name, $options = array()) { parent::__construct($name, $options); $this->submitElement = new Button(self::SUBMIT); $this->submitElement->setAttributes(array('type' => 'submit', 'class' => 'btn btn-primary', 'data-loading' => FakeTranslator::translate('Saving...')))->setLabel(FakeTranslator::translate("Save")); $this->add($this->submitElement); }
/** * LancamentosForm constructor. * @param ObjectManager $objectManager */ public function __construct(ObjectManager $objectManager) { $this->setObjectManager($objectManager); parent::__construct(null); $this->setAttribute('method', 'POST'); $this->setAttribute('class', 'form-horizontal'); $prioridade = new ObjectSelect('prioridade'); $prioridade->setLabel('Prioridade')->setOptions(array('object_manager' => $this->getObjectManager(), 'target_class' => 'Prioridade\\Entity\\Prioridade', 'property' => 'name', 'empty_option' => '--Selecione--', 'is_method' => true, 'find_method' => array('name' => 'findBy', 'params' => array('criteria' => array(), 'orderBy' => array('name' => 'ASC')))))->setAttributes(array('class' => 'form-control')); $this->add($prioridade); $categoria = new ObjectSelect('categoria'); $categoria->setLabel('Categoria')->setOptions(array('object_manager' => $this->getObjectManager(), 'target_class' => 'Categoria\\Entity\\Categoria', 'property' => 'name', 'empty_option' => '--Selecione--', 'is_method' => true, 'find_method' => array('name' => 'findBy', 'params' => array('criteria' => array(), 'orderBy' => array('name' => 'ASC')))))->setAttributes(array('class' => 'form-control')); $this->add($categoria); $operacao = new ObjectSelect('operacao'); $operacao->setLabel('Operacoes')->setOptions(array('object_manager' => $this->getObjectManager(), 'target_class' => 'Operacoes\\Entity\\Operacoes', 'property' => 'name', 'empty_option' => '--Selecione--', 'is_method' => true, 'find_method' => array('name' => 'findBy', 'params' => array('criteria' => array(), 'orderBy' => array('name' => 'ASC')))))->setAttributes(array('class' => 'form-control')); $this->add($operacao); $origem = new ObjectSelect('origem'); $origem->setLabel('Origem')->setOptions(array('object_manager' => $this->getObjectManager(), 'target_class' => 'Origem\\Entity\\Origem', 'property' => 'name', 'empty_option' => '--Selecione--', 'is_method' => true, 'find_method' => array('name' => 'findBy', 'params' => array('criteria' => array(), 'orderBy' => array('name' => 'ASC')))))->setAttributes(array('class' => 'form-control')); $this->add($origem); //Input Saldo Inicial $valorInicial = new Text('valorInicial'); $valorInicial->setLabel('Valor Inicial')->setAttributes(array('maxlength' => 10, 'class' => 'form-control')); $this->add($valorInicial); //Input Saldo Inicial $valorFinal = new Text('valorFinal'); $valorFinal->setLabel('Valor Final')->setAttributes(array('maxlength' => 10, 'class' => 'form-control')); $this->add($valorFinal); $tipo = new ObjectSelect('tipo'); $tipo->setLabel('Tipo')->setOptions(array('object_manager' => $this->getObjectManager(), 'target_class' => 'Tipo\\Entity\\Tipo', 'property' => 'name', 'empty_option' => '--Selecione--', 'is_method' => true, 'find_method' => array('name' => 'findBy', 'params' => array('criteria' => array(), 'orderBy' => array('name' => 'ASC')))))->setAttributes(array('class' => 'form-control')); $this->add($tipo); //Botao submit $button = new Button('submit'); $button->setAttributes(array('type' => 'submit', 'class' => 'btn btn-success', 'value' => 'Salvar')); $this->add($button); $this->setInputFilter(new LancamentosFilter($categoria->getValueOptions(), $operacao->getValueOptions(), $origem->getValueOptions(), $tipo->getValueOptions(), $prioridade->getValueOptions())); }
public function __construct($name = null) { parent::__construct('usuariosform'); $this->setAttribute('method', 'post'); $this->setAttribute('role', 'form'); $this->setAttributes(array('id' => 'usuariosform')); $usuarios_id = new Element('usuarios_id'); $usuarios_id->setLabel('ID'); $usuarios_id->setAttributes(array('type' => 'text', 'placeholder' => 'Este campo se genera automáticamente', 'id' => 'usuarios_id', 'readonly' => 'readonly', 'class' => 'form-control')); $usuarios_username = new Element('usuarios_username'); $usuarios_username->setLabel('Usuario'); $usuarios_username->setAttributes(array('type' => 'text', 'placeholder' => 'dvader', 'id' => 'usuarios_username', 'class' => 'form-control')); $usuarios_nombres = new Element('usuarios_nombres'); $usuarios_nombres->setLabel('Nombre'); $usuarios_nombres->setAttributes(array('type' => 'text', 'placeholder' => 'Darth Vader', 'id' => 'usuarios_nombres', 'class' => 'form-control')); $usuarios_estado = new Element\Select('usuarios_estado'); $usuarios_estado->setLabel('Estado'); //$usuarios_estado->setEmptyOption('ELige un Estado..'); $usuarios_estado->setOptions(array('disable_inarray_validator' => true)); $usuarios_estado->setAttributes(array('id' => 'usuarios_estado', 'class' => "form-control", 'data-rule-required' => "true", 'data-msg-required' => "Debe seleccionar el Estado")); $guardar = new Element\Button('guardar'); $guardar->setAttributes(array('class' => 'btn btn-success mr5', 'type' => 'submit', 'id' => 'guardar')); $guardar->setOptions(array('label' => '<i class="glyphicon glyphicon-floppy-disk"></i>', 'label_options' => array('disable_html_escape' => true))); $this->add($usuarios_id); $this->add($usuarios_username); $this->add($usuarios_nombres); $this->add($usuarios_estado); $this->add($guardar); }
public function __construct($name = null) { parent::__construct('datbaseform'); $this->setAttribute('class', 'p-t-15'); $this->setAttributes(array('id' => 'form-datos-bd', 'class' => 'form-horizontal')); $username = new Element('username'); $username->setLabel('Nombre de Usuario:')->setLabelAttributes(array('class' => 'col-sm-3 control-label')); $username->setAttributes(array('type' => 'text', 'placeholder' => 'ej. Admin', 'id' => 'username', 'class' => 'form-control', 'data-rule-required' => "true", 'data-msg-required' => "Este campo debe estar lleno", 'data-rule-minlength' => "6", 'data-msg-minlength' => "Debe tener al menos 6 caracteres")); $password = new Element\Password('password'); $password->setLabel('Contraseña:')->setLabelAttributes(array('class' => 'col-sm-3 control-label required')); $password->setAttributes(array('placeholder' => 'No uses 1234 ;)', 'id' => 'password', 'class' => 'form-control', 'data-rule-required' => "true", 'data-msg-required' => "Este campo debe estar lleno")); $confirmaPassword = new Element\Password('confirmaPassword'); $confirmaPassword->setLabel(' ')->setLabelAttributes(array('class' => 'col-sm-3 control-label')); $confirmaPassword->setAttributes(array('placeholder' => 'Por seguridad este campo es necesario', 'id' => 'confirmaPassword', 'class' => 'form-control')); $email = new Element\Email('email'); $email->setLabel('Correo Electrónico:')->setLabelAttributes(array('class' => 'col-sm-3 control-label')); $email->setAttributes(array('placeholder' => '*****@*****.**', 'id' => 'email', 'class' => 'form-control')); $buttonContinuar = new Element\Button('buttonContinuar'); $buttonContinuar->setLabel('Instalar'); $buttonContinuar->setAttributes(array('class' => 'btn btn-success', 'type' => 'submit', 'id' => 'buttonContinuar')); $buttonLimpiar = new Element\Button('buttonLimpiar'); $buttonLimpiar->setLabel('<i class="pg-close"></i> Limpiar')->setLabelOptions(array('disable_html_escape' => true)); $buttonLimpiar->setAttributes(array('class' => 'btn btn-default', 'id' => 'buttonLimpiar', 'type' => 'reset')); $this->add($username); $this->add($password); $this->add($email); $this->add($confirmaPassword); $this->add($buttonContinuar); $this->add($buttonLimpiar); }
public function __construct($name = null) { parent::__construct('datbaseform'); $this->setAttribute('class', 'p-t-15'); $this->setAttributes(array('id' => 'form-datos-bd', 'class' => 'form-horizontal')); $servidorBd = new Element('servidorBd'); $servidorBd->setLabel('Servidor de la base de datos:')->setLabelAttributes(array('class' => 'col-sm-3 control-label')); $servidorBd->setAttributes(array('type' => 'text', 'placeholder' => 'ej. localhost', 'id' => 'servidorBd', 'class' => 'form-control', 'data-rule-required' => "true", 'data-msg-required' => "Este campo debe estar lleno", 'data-rule-minlength' => "6", 'data-msg-minlength' => "Debe tener al menos 6 caracteres")); $nombreBd = new Element('nombreBd'); $nombreBd->setLabel('Nombre de la base de datos:')->setLabelAttributes(array('class' => 'col-sm-3 control-label required')); $nombreBd->setAttributes(array('type' => 'text', 'placeholder' => 'ej. tributum-produccion', 'id' => 'nombreBd', 'class' => 'form-control', 'data-rule-required' => "true", 'data-msg-required' => "Este campo debe estar lleno")); $prefijoTablasBd = new Element('prefijoTablasBd'); $prefijoTablasBd->setLabel('Prefijo de tablas de la base de datos:')->setLabelAttributes(array('class' => 'col-sm-3 control-label')); $prefijoTablasBd->setAttributes(array('type' => 'text', 'placeholder' => 'ej. trb-', 'id' => 'prefijoTablasBd', 'class' => 'form-control')); $nombreUsuarioBd = new Element('nombreUsuarioBd'); $nombreUsuarioBd->setLabel('Nombre de usuario de la base de datos:')->setLabelAttributes(array('class' => 'col-sm-3 control-label')); $nombreUsuarioBd->setAttributes(array('type' => 'text', 'placeholder' => 'ej. root', 'id' => 'nombreUsuarioBd', 'class' => 'form-control', 'data-rule-required' => "true", 'data-msg-required' => "Este campo debe estar lleno")); $contrasenaDb = new Element\Password('contrasenaDb'); $contrasenaDb->setLabel('Contraseña de la base de datos:')->setLabelAttributes(array('class' => 'col-sm-3 control-label')); $contrasenaDb->setAttributes(array('placeholder' => 'Por seguridad este campo es necesario', 'id' => 'contrasenaDb', 'class' => 'form-control')); $buttonContinuar = new Element\Button('buttonContinuar'); $buttonContinuar->setLabel('Continuar'); $buttonContinuar->setAttributes(array('class' => 'btn btn-success', 'type' => 'submit', 'id' => 'buttonContinuar')); $buttonLimpiar = new Element\Button('buttonLimpiar'); $buttonLimpiar->setLabel('<i class="pg-close"></i> Limpiar')->setLabelOptions(array('disable_html_escape' => true)); $buttonLimpiar->setAttributes(array('class' => 'btn btn-default', 'id' => 'buttonLimpiar', 'type' => 'reset')); $this->add($servidorBd); $this->add($nombreBd); $this->add($prefijoTablasBd); $this->add($nombreUsuarioBd); $this->add($contrasenaDb); $this->add($buttonContinuar); $this->add($buttonLimpiar); }
public function __construct($name = null) { parent::__construct('objetosform'); $this->setAttribute('method', 'post'); $this->setAttribute('role', 'form'); $this->setAttributes(array('id' => 'objetosform')); $objetos_actividad_id = new Element('objetos_actividad_id'); $objetos_actividad_id->setLabel('Actividad'); $objetos_actividad_id->setAttributes(array('type' => 'text', 'placeholder' => 'Este campo se genera automáticamente', 'id' => 'objetos_actividad_id', 'readonly' => 'readonly', 'class' => 'form-control')); $objetos_id = new Element('objetos_id'); $objetos_id->setLabel('ID'); $objetos_id->setAttributes(array('type' => 'text', 'placeholder' => 'Este campo se genera automáticamente', 'id' => 'objetos_id', 'readonly' => 'readonly', 'class' => 'form-control')); $objetos_nombre = new Element('objetos_nombre'); $objetos_nombre->setLabel('Nombre'); $objetos_nombre->setAttributes(array('type' => 'text', 'placeholder' => 'ej: wKER001', 'id' => 'objetos_nombre', 'class' => 'form-control')); $objetos_tipo = new Element\Select('objetos_tipo'); $objetos_tipo->setLabel('Tipo'); $objetos_tipo->setEmptyOption('Elige un Tipo..'); $objetos_tipo->setOptions(array('disable_inarray_validator' => true)); $objetos_tipo->setAttributes(array('id' => 'objetos_tipo', 'class' => "form-control")); $guardar = new Element\Button('guardar'); $guardar->setAttributes(array('class' => 'btn btn-success mr5', 'type' => 'submit', 'id' => 'guardar')); $guardar->setOptions(array('label' => '<i class="glyphicon glyphicon-floppy-disk"></i>', 'label_options' => array('disable_html_escape' => true))); $etiquetas_id = new Element\Hidden('etiquetas_id'); $etiquetas_id->setAttributes(array('id' => 'etiquetas_id')); $this->add($objetos_actividad_id); $this->add($objetos_id); $this->add($objetos_nombre); $this->add($objetos_tipo); $this->add($etiquetas_id); $this->add($guardar); }
public function __construct($name = null) { parent::__construct('actividadesform'); $this->setAttribute('method', 'post'); $this->setAttribute('role', 'form'); $this->setAttributes(array('id' => 'actividadesform')); $actividades_id = new Element('actividades_id'); $actividades_id->setLabel('ID'); $actividades_id->setAttributes(array('type' => 'text', 'placeholder' => 'Este campo se genera automáticamente', 'id' => 'actividades_id', 'readonly' => 'readonly', 'class' => 'form-control')); $actividades_nombre = new Element('actividades_nombre'); $actividades_nombre->setLabel('Nombre'); $actividades_nombre->setAttributes(array('type' => 'text', 'placeholder' => 'ej: Mi Primera Actividad', 'id' => 'actividades_nombre', 'class' => 'form-control')); $actividades_estado = new Element\Select('actividades_estado'); $actividades_estado->setLabel('Estado'); //$actividades_estado->setEmptyOption('ELige un Estado..'); $actividades_estado->setOptions(array('disable_inarray_validator' => true)); $actividades_estado->setAttributes(array('id' => 'actividades_estado', 'class' => "form-control", 'data-rule-required' => "true", 'data-msg-required' => "Debe seleccionar el Estado")); $actividades_responsable = new Element\Select('actividades_responsable'); $actividades_responsable->setLabel('Responsable'); // $actividades_responsable->setEmptyOption('Elige un Responsable..'); $actividades_responsable->setOptions(array('disable_inarray_validator' => true)); $actividades_responsable->setAttributes(array('id' => 'actividades_responsable', 'class' => "form-control")); $actividades_area = new Element\Select('actividades_area'); $actividades_area->setLabel('Área'); $actividades_area->setEmptyOption('Elige una Área..'); $actividades_area->setOptions(array('disable_inarray_validator' => true)); $actividades_area->setAttributes(array('id' => 'actividades_area', 'class' => "form-control")); $actividades_reporta = new Element('actividades_reporta'); $actividades_reporta->setLabel('Reportada Por'); $actividades_reporta->setAttributes(array('type' => 'text', 'placeholder' => 'Persona que reporta', 'id' => 'actividades_reporta', 'class' => 'form-control')); $actividades_fecha = new Element('actividades_fecha'); $actividades_fecha->setLabel('Fecha de Inicio'); $actividades_fecha->setAttributes(array('placeholder' => 'Fecha de Inicio', 'id' => 'actividades_fecha', 'class' => 'form-control')); $actividades_fecha_fin = new Element('actividades_fecha_fin'); $actividades_fecha_fin->setLabel('Fecha de Finalización'); $actividades_fecha_fin->setAttributes(array('placeholder' => 'Fecha de Finalización', 'id' => 'actividades_fecha_fin', 'class' => 'form-control')); $guardar = new Element\Button('guardar'); $guardar->setAttributes(array('class' => 'btn btn-success mr5', 'type' => 'submit', 'id' => 'guardar')); $guardar->setOptions(array('label' => '<i class="glyphicon glyphicon-floppy-disk"></i>', 'label_options' => array('disable_html_escape' => true))); $this->add($actividades_id); $this->add($actividades_nombre); $this->add($actividades_fecha); $this->add($actividades_estado); $this->add($actividades_responsable); $this->add($actividades_area); $this->add($actividades_reporta); $this->add($actividades_fecha_fin); $this->add($guardar); }
public function __construct(OrmCongregacao $orm = null) { parent::__construct("formProduto"); $txtId = new Element\Hidden("id"); $txtNome = new Element\Text("nome"); $txtNome->setAttributes(array('class' => 'form-control', 'placeholder' => 'Nome da Congregação', 'data-parsley-trigger' => 'change', 'pattern' => '^[aA-zZ]+((\\s[aA-zZ]+)+)?$', 'required' => 'true')); $txtCep = new Element\Text("cep"); $txtCep->setAttributes(array('class' => 'form-control', 'placeholder' => 'XXXXXXXX', 'data-parsley-trigger' => 'change', 'pattern' => '/^[0-9]{2}[0-9]{3}[0-9]{3}$/', 'max-length' => '8', 'required' => 'true')); $txtNumero = new Element\Text("numero"); $txtNumero->setAttributes(array('class' => 'form-control', 'placeholder' => 'Numero', 'data-parsley-trigger' => 'change', 'pattern' => '/^[0-9]+$/', 'max-length' => '6', 'required' => 'true')); $txtLogradouro = new Element\Text("logradouro"); $txtLogradouro->setAttributes(array('class' => 'form-control', 'placeholder' => 'Ex: Rua, Avenida, Travessa...', 'required' => 'true')); $txtBairro = new Element\Text("bairro"); $txtBairro->setAttributes(array('class' => 'form-control', 'required' => 'true')); $txtCidade = new Element\Text("cidade"); $txtCidade->setAttributes(array('class' => 'form-control', 'required' => 'true')); $txtUf = new Element\Text("uf"); $txtUf->setAttributes(array('class' => 'form-control', 'max-length' => '2', 'required' => 'true')); $iToken = new Element\Csrf("iToken"); $btnSalvar = new Element\Button('salvar'); $btnSalvar->setAttributes(array('class' => 'btn btn-darkgray btn-ef btn-ef-4 btn-ef-4c mb-10', 'type' => 'button')); $btnVoltar = new Element\Button('voltar'); $btnVoltar->setAttributes(array('class' => 'btn btn-blue btn-ef btn-ef-4 btn-ef-4c mb-10', 'type' => 'button')); if ($orm != null) { $txtId->setValue($orm->getId()); $txtNome->setValue($orm->getNome()); $txtCep->setValue($orm->getCep()); $txtNumero->setValue($orm->getNumero()); $txtLogradouro->setValue($orm->getLogradouro()); $txtBairro->setValue($orm->getBairro()); $txtCidade->setValue($orm->getCidade()); $txtUf->setValue($orm->getUf()); } // $this->add($txtId); $this->add($txtNome); $this->add($txtCep); $this->add($txtNumero); $this->add($txtLogradouro); $this->add($txtBairro); $this->add($txtCidade); $this->add($txtUf); $this->add($iToken); $this->add($btnSalvar); $this->add($btnVoltar); $this->setAttributes(array('id' => 'form', 'data-parsley-validate' => NULL)); }
public function __construct($name = null) { parent::__construct('categoria'); $id = new Hidden('categoria_id'); $nome = new Text('categoria_nome'); $nome->setLabel('Nome: '); $nome->setAttributes(array('class' => 'form-control', 'id' => 'categoria_nome')); $submit = new Button('submit'); $submit->setLabel('Cadastrar'); $submit->setAttributes(array('type' => 'submit', 'class' => 'btn btn-success')); $cancel = new Button('cancel'); $cancel->setLabel('Cancelar'); $cancel->setAttributes(array('type' => 'button', 'class' => 'btn btn-default', 'onclick' => 'javascript:history.go(-1)')); $this->add($id); $this->add($nome); $this->add($submit); $this->add($cancel); }
public function __construct($name = null) { parent::__construct('filmes'); $this->setAttribute('enctype', 'multipart/form-data'); $id = new Hidden('filmes_id'); $nome = new Text('filmes_nome'); $nome->setLabel('Nome: '); $nome->setAttributes(array('class' => 'form-control', 'id' => 'filmes_nome')); $preco = new Text('filmes_preco'); $preco->setLabel('Valor Aluguel: '); $preco->setAttributes(array('class' => 'form-control', 'id' => 'filmes_preco')); $categoria = new Select('categoria_id'); $categoria->setLabel('Categoria: '); $categoria->setAttributes(array('class' => 'form-control', 'id' => 'categoria_id', 'empty_option' => 'Please select an author', 'value_options' => $this->getOptionsForSelect())); $foto = new File('filmes_foto'); $foto->setLabel('Cartaz: '); $foto->setAttributes(array('class' => 'form-control')); $descricao = new Textarea('filmes_descricao'); $descricao->setLabel('Dados do Filme: '); $descricao->setAttributes(array('style' => 'height: 100px;', 'class' => 'form-control', 'id' => 'filmes_descricao')); $status = new Checkbox('filmes_status'); $status->setLabel("Mostrar?"); $status->setValue(1); $submit = new Button('submit'); $submit->setLabel('Cadastrar'); $submit->setAttributes(array('type' => 'submit', 'class' => 'btn btn-success')); $cancel = new Button('cancel'); $cancel->setLabel('Cancelar'); $cancel->setAttributes(array('type' => 'button', 'class' => 'btn btn-default', 'onclick' => 'javascript:history.go(-1)')); $this->add($id); $this->add($nome); $this->add($preco); $this->add($foto); $this->add($descricao); $this->add($categoria); $this->add($status); $this->add($submit); $this->add($cancel); }
public function __construct() { parent::__construct('loginForm'); $this->setAttributes(array('id' => 'loginForm', 'role' => 'form', 'method' => 'post')); $username = new Element('username'); $username->setLabel('Nombre de Usuario'); $username->setAttributes(array('type' => 'text', 'placeholder' => 'Escribe tu Nombre de Usuario', 'id' => 'username', 'class' => 'form-control')); $password = new Element\Password('password'); $password->setLabel('Contraseña'); $password->setAttributes(array('placeholder' => 'Escribe tu Contraseña', 'id' => 'password', 'class' => 'form-control')); $remember = new Element\Checkbox('remember'); $remember->setLabel('Mantener mi sesión activa'); $remember->setUseHiddenElement(true); $remember->setCheckedValue("1"); $remember->setUncheckedValue("0"); $remember->setAttributes(array('id' => 'remember')); $loginButton = new Element\Button('loginButton'); $loginButton->setLabel('Inicia Sesión'); $loginButton->setAttributes(array('class' => 'btn btn-primary', 'type' => 'submit', 'id' => 'loginButton')); $this->add($username); $this->add($password); $this->add($remember); $this->add($loginButton); }
public function __construct(EntityManager $em, OrmRelatorio $orm = null) { parent::__construct("formRelatorio"); /* * txtID */ $txtId = new Element\Hidden("id"); /* * txtAno */ $option = array(); $ano = 0; if (date("m") >= 9) { $ano = 1; } $ano = $ano + date("Y"); $option[$ano] = $ano; $option[$ano - 1] = $ano - 1; $cmbAno = new Element\Select('ano'); $cmbAno->setValueOptions($option); $cmbAno->setEmptyOption("Escolha o ano"); $cmbAno->setAttributes(array('class' => 'chosen-select', 'style' => 'width:140px;', 'required' => 'true')); /* * txtMes */ setlocale(LC_ALL, 'pt_BR', 'pt_BR.utf-8', 'pt_BR.utf-8', 'portuguese'); date_default_timezone_set('America/Sao_Paulo'); $option = array(); for ($index = 1; $index < 13; $index++) { $option[$index] = strftime("%B", strtotime(date("Y") . "/" . $index . "/01")); } $cmbMes = new Element\Select('mes'); $cmbMes->setValueOptions($option); $cmbMes->setEmptyOption("Escolha o ano"); $cmbMes->setAttributes(array('class' => 'chosen-select', 'style' => 'width:140px;', 'required' => 'true')); /* * cmbPublicador */ $dao = $em->getRepository('Stj\\Entity\\OrmPublicador'); $lista = $dao->findAll(); $option = array(); foreach ($lista as $key => $value) { $congregacao = new OrmCongregacao(); $congregacao = $value; $option[$congregacao->getId()] = $congregacao->getNome(); } $cmbPublicador = new Element\Select('publicador'); $cmbPublicador->setValueOptions($option); $cmbPublicador->setEmptyOption("Escolha o publicador"); $cmbPublicador->setAttributes(array('class' => 'chosen-select', 'style' => 'width:140px;', 'required' => 'true')); /* * txtLivros */ $txtPublicacoes = new Element\Number("publicacoes"); $txtPublicacoes->setAttributes(array('class' => 'form-control', 'placeholder' => 'Quantidade', 'data-parsley-trigger' => 'change', 'pattern' => '/^[0-9]+$/', 'data-parsley-maxlength' => "3", 'required' => 'true')); /* * $txtVideos */ $txtVideos = new Element\Number("videos"); $txtVideos->setAttributes(array('class' => 'form-control', 'placeholder' => 'Quantidade', 'data-parsley-trigger' => 'change', 'pattern' => '/^[0-9]+$/', 'data-parsley-maxlength' => "3", 'required' => 'true')); /* * $txtPublicacoes */ $txtHoras = new Element\Text("horas"); $txtHoras->setAttributes(array('class' => 'form-control', 'placeholder' => 'HH:MM', 'data-parsley-trigger' => 'change', 'pattern' => '/^[0-9]+\\:[0-9]{2}$/', 'data-parsley-maxlength' => "6", 'required' => 'true')); /* * txtRevisitas */ $txtRevisitas = new Element\Number("revisitas"); $txtRevisitas->setAttributes(array('class' => 'form-control', 'placeholder' => 'Quantidade', 'data-parsley-trigger' => 'change', 'pattern' => '/^[0-9]+$/', 'data-parsley-maxlength' => "2", 'required' => 'true')); /* * txtEstudos */ $txtEstudos = new Element\Number("estudos"); $txtEstudos->setAttributes(array('class' => 'form-control', 'placeholder' => 'Quantidade', 'data-parsley-trigger' => 'change', 'pattern' => '/^[0-9]+$/', 'data-parsley-maxlength' => "2", 'required' => 'true')); /* * txtObs */ $txtObs = new Element\Textarea("obs"); $txtObs->setAttributes(array('class' => 'form-control', 'placeholder' => 'Digites suas observações aqui')); /* * Itoken */ $iToken = new Element\Csrf("iToken"); /* * btnSalvar */ $btnSalvar = new Element\Button('salvar'); $btnSalvar->setAttributes(array('class' => 'btn btn-darkgray btn-ef btn-ef-4 btn-ef-4c mb-10', 'type' => 'button')); /* * btnVoltar */ $btnVoltar = new Element\Button('voltar'); $btnVoltar->setAttributes(array('class' => 'btn btn-blue btn-ef btn-ef-4 btn-ef-4c mb-10', 'type' => 'button')); /* * Preencher Componentes */ if ($orm != null) { $txtId->setValue($orm->getId()); $cmbAno->setValue($orm->getAno()); $cmbMes->setValue($orm->getMes()); $cmbPublicador->setValue($orm->getPublicador()->getId()); $txtPublicacoes->setValue($orm->getPublicacoes()); $txtVideos->setValue($orm->getVideos()); $txtHoras->setValue($orm->getHoras()); $txtRevisitas->setValue($orm->getRevisitas()); $txtEstudos->setValue($orm->getEstudos()); } // Adiciona componetes no form $this->add($txtId); // $this->add(); $this->add($cmbAno); $this->add($cmbMes); $this->add($cmbPublicador); $this->add($txtPublicacoes); $this->add($txtVideos); $this->add($txtHoras); $this->add($txtRevisitas); $this->add($txtEstudos); $this->add($txtObs); $this->add($iToken); $this->add($btnSalvar); $this->add($btnVoltar); $this->setAttributes(array('id' => 'form', 'data-parsley-validate' => NULL)); }
public function __construct(EntityManager $em) { parent::__construct("formEstudante"); // var_dump($option); // exit(); /* * txtID */ $txtId = new Element\Hidden("id"); /* * cmbPublicador */ $dao = $em->getRepository('Stj\\Entity\\OrmEstudante'); $lista = $dao->findBy(array("status" => FALSE, "ciclo" => FALSE)); $option = array(); foreach ($lista as $key => $value) { $estudante = new OrmEstudante(); $estudante = $value; $option[$estudante->getId()] = $estudante->getPublicador()->getNome(); } $cmbEstudante = new Element\Select('estudante'); $cmbEstudante->setValueOptions($option); $cmbEstudante->setEmptyOption("Selecionar"); $cmbEstudante->setAttributes(array('class' => 'chosen-select', 'style' => 'width:175px;', 'required' => 'true')); $dao = $em->getRepository('Stj\\Entity\\OrmEstudante'); $lista = $dao->findBy(array("status" => FALSE)); $option = array(); foreach ($lista as $key => $value) { $estudante = new OrmEstudante(); $estudante = $value; $option[$estudante->getId()] = $estudante->getPublicador()->getNome(); } /* * $cmbAjudante */ $cmbAjudante = new Element\Select('ajudante'); $cmbAjudante->setValueOptions($option); $cmbAjudante->setEmptyOption("Selecionar"); $cmbAjudante->setAttributes(array('class' => 'chosen-select', 'style' => 'width:175px;', 'required' => 'true')); /* * $cmbSubstitutoEstudante */ $cmbSubstitutoEstudante = new Element\Select('substitutoEstudante'); $cmbSubstitutoEstudante->setValueOptions($option); $cmbSubstitutoEstudante->setEmptyOption("Selecionar"); $cmbSubstitutoEstudante->setAttributes(array('class' => 'chosen-select', 'style' => 'width:175px;', 'required' => 'true')); /* * $cmbSubstitutoAjudante */ $cmbSubstitutoAjudante = new Element\Select('substitutoAjudante'); $cmbSubstitutoAjudante->setValueOptions($option); $cmbSubstitutoAjudante->setEmptyOption("Selecionar"); $cmbSubstitutoAjudante->setAttributes(array('class' => 'chosen-select', 'style' => 'width:175px;', 'required' => 'true')); /* * $txtData */ $txtData = new Element\Text("data"); $txtData->setAttributes(array('class' => 'form-control', 'placeholder' => 'XX/XX/XXXX', 'max-length' => '10', 'required' => 'true')); $dao = $em->getRepository('Stj\\Entity\\OrmCaracteristicaOratoria'); $lista = $dao->findAll(); $option = array(); foreach ($lista as $key => $value) { $oratoria = new \Stj\Entity\OrmCaracteristicaOratoria(); $oratoria = $value; $option[$oratoria->getId()] = $oratoria->getId() . ' - ' . $oratoria->getCaracteristica(); } $cmbOratoria = new Element\Select("oratoria"); $cmbOratoria->setValueOptions($option); $cmbOratoria->setEmptyOption("Selecionar"); $cmbOratoria->setAttributes(array('class' => 'chosen-select', 'style' => 'width:175px;', 'required' => 'true')); /* * $chkDesignação */ $dao = $em->getRepository('Stj\\Entity\\OrmDesignacao'); $lista = $dao->findAll(); $option = array(); $this->listachk = array(); foreach ($lista as $key => $value) { $designacao = new \Stj\Entity\OrmDesignacao(); $designacao = $value; $this->listachk[$designacao->getId()]["id"] = $designacao->getId(); $this->listachk[$designacao->getId()]["nome"] = $designacao->getNome(); } $dao = $em->getRepository('Stj\\Entity\\OrmLocal'); $lista = $dao->findAll(); $option = array(); $this->localchk = array(); foreach ($lista as $key => $value) { $local = new \Stj\Entity\OrmLocal(); $local = $value; $this->localchk[$local->getId()]["id"] = $local->getId(); $this->localchk[$local->getId()]["nome"] = $local->getNome(); } /* * $txtoutros */ $txtoutros = new Element\Text("outros"); $txtoutros->setAttributes(array('class' => 'form-control underline-input', 'placeholder' => 'Titulo da designação')); /* * Itoken */ $iToken = new Element\Csrf("iToken"); /* * btnSalvar */ $btnSalvar = new Element\Button('salvar'); $btnSalvar->setAttributes(array('class' => 'btn btn-darkgray btn-ef btn-ef-4 btn-ef-4c mb-10', 'type' => 'button')); /* * btnVoltar */ $btnVoltar = new Element\Button('voltar'); $btnVoltar->setAttributes(array('class' => 'btn btn-blue btn-ef btn-ef-4 btn-ef-4c mb-10', 'type' => 'button')); /* * Preencher Componentes */ // if ($orm != null) { // $txtId->setValue($orm->getId()); // } // Adiciona componetes no form $this->add($txtId); $this->add($cmbEstudante); $this->add($cmbAjudante); $this->add($txtData); $this->add($cmbOratoria); $this->add($cmbSubstitutoEstudante); $this->add($cmbSubstitutoAjudante); $this->add($txtoutros); $this->add($iToken); $this->add($btnSalvar); $this->add($btnVoltar); $this->setAttributes(array('id' => 'form', 'data-parsley-validate' => NULL)); }
public function __construct(EntityManager $em, OrmPublicador $tipoPrivilegio = null, OrmPrivilegios $orm = null) { parent::__construct("formPrivilegios"); // var_dump($option); // exit(); /* * txtID */ $txtId = new Element\Hidden("id"); /* * txtNome */ $txtDataInicio = new Element\Text("dataInicio"); $txtDataInicio->setAttributes(array('class' => 'form-control', 'placeholder' => 'XX/XX/XXXX', 'max-length' => '10', 'required' => 'true')); $txtDataTermino = new Element\Text("dataTermino"); $txtDataTermino->setAttributes(array('class' => 'form-control', 'placeholder' => 'XX/XX/XXXX', 'max-length' => '10')); /* * cmbPublicador */ $dao = $em->getRepository('Stj\\Entity\\OrmPublicador'); if (empty($tipoPrivilegio)) { $lista = $dao->findAll(); } else { $lista = $dao->ListALLWhere($tipoPrivilegio->getId()); } $option = array(); foreach ($lista as $key => $value) { $tipoPrivilegio = new OrmPublicador(); $tipoPrivilegio = $value; $option[$tipoPrivilegio->getId()] = $tipoPrivilegio->getNome(); } $cmbPublicador = new Element\Select('publicador'); $cmbPublicador->setValueOptions($option); $cmbPublicador->setEmptyOption("Selecionar"); $cmbPublicador->setAttributes(array('class' => 'chosen-select', 'style' => 'width:175px;', 'required' => 'true')); /* * cmbPrivilegio */ $dao = $em->getRepository('Stj\\Entity\\OrmTipoPrivilegios'); $lista = $dao->findAll(); $option = array(); foreach ($lista as $key => $value) { $tipoPrivilegio = new OrmTipoPrivilegios(); $tipoPrivilegio = $value; $option[$tipoPrivilegio->getId()] = $tipoPrivilegio->getNome(); } $cmbPrivilegio = new Element\Select('privilegio'); $cmbPrivilegio->setValueOptions($option); $cmbPrivilegio->setEmptyOption("Selecionar"); $cmbPrivilegio->setAttributes(array('class' => 'chosen-select', 'style' => 'width:175px;', 'required' => 'true')); /* * Itoken */ $iToken = new Element\Csrf("iToken"); /* * btnSalvar */ $btnSalvar = new Element\Button('salvar'); $btnSalvar->setAttributes(array('class' => 'btn btn-darkgray btn-ef btn-ef-4 btn-ef-4c mb-10', 'type' => 'button')); /* * btnVoltar */ $btnVoltar = new Element\Button('voltar'); $btnVoltar->setAttributes(array('class' => 'btn btn-blue btn-ef btn-ef-4 btn-ef-4c mb-10', 'type' => 'button')); /* * Preencher Componentes */ if ($orm != null) { $txtId->setValue($orm->getId()); $txtDataInicio->setValue($orm->getDataInicio() != "" ? $orm->getDataInicio()->format('d/m/Y') : ""); $txtDataTermino->setValue($orm->getDataTermino() != "" ? $orm->getDataTermino()->format('d/m/Y') : ""); $cmbPrivilegio->setValue($orm->getTipoPrivilegio()->getId()); $cmbPublicador->setValue($orm->getPublicador()->getId()); } // Adiciona componetes no form $this->add($txtId); $this->add($txtDataInicio); $this->add($txtDataTermino); $this->add($cmbPublicador); $this->add($cmbPrivilegio); $this->add($iToken); $this->add($btnSalvar); $this->add($btnVoltar); $this->setAttributes(array('id' => 'form', 'data-parsley-validate' => NULL)); }
public function __construct(EntityManager $em, OrmPublicador $publicador = null, OrmLogin $orm = null) { parent::__construct("formLogin"); // var_dump($option); // exit(); /* * txtID */ $txtId = new Element\Hidden("id"); /* * txtNome */ $txtEmail = new Element\Email("email"); $txtEmail->setAttributes(array('class' => 'form-control', 'placeholder' => 'Nome do Grupo', 'data-parsley-trigger' => 'change', 'required' => 'true')); /* * txtSenha */ $txtSenha = new Element\Password("senha"); $txtSenha->setAttributes(array('id' => "senha", 'class' => 'form-control', 'placeholder' => 'Nome do Grupo', 'required' => 'true', "data-parsley-trigger" => "change", "data-parsley-length" => "[6, 20]")); /* * txtSenhaConfirma */ $txtSenhaConfirma = new Element\Password("senhaconfirmar"); $txtSenhaConfirma->setAttributes(array('class' => 'form-control', 'placeholder' => 'Nome do Grupo', 'required' => 'true', "data-parsley-trigger" => "change", "data-parsley-equalto" => "#senha")); /* * cmbPublicador */ $dao = $em->getRepository('Stj\\Entity\\OrmPublicador'); if (empty($publicador)) { $lista = $dao->findAll(); } else { $lista = $dao->ListALLWhere($publicador->getGrupo()->getCongregacao()->getId()); } $option = array(); foreach ($lista as $key => $value) { $publicador = new OrmPublicador(); $publicador = $value; $option[$publicador->getId()] = $publicador->getNome(); } $cmbPublicador = new Element\Select('publicador'); $cmbPublicador->setValueOptions($option); $cmbPublicador->setEmptyOption("Selecionar"); $cmbPublicador->setAttributes(array('class' => 'chosen-select', 'style' => 'width:175px;', 'required' => 'true')); /* * cmbNivel */ $dao = $em->getRepository('Stj\\Entity\\OrmNivel'); $lista = $dao->ListALL(FALSE); $option = array(); foreach ($lista as $key => $value) { $nivel = new OrmNivel(); $nivel = $value; $option[$nivel->getId()] = $nivel->getNome(); } $cmbNivel = new Element\Select('nivel'); $cmbNivel->setValueOptions($option); $cmbNivel->setEmptyOption("Selecionar"); $cmbNivel->setAttributes(array('class' => 'chosen-select', 'style' => 'width:175px;', 'required' => 'true')); /* * Itoken */ $iToken = new Element\Csrf("iToken"); /* * btnSalvar */ $btnSalvar = new Element\Button('salvar'); $btnSalvar->setAttributes(array('class' => 'btn btn-darkgray btn-ef btn-ef-4 btn-ef-4c mb-10', 'type' => 'button')); /* * btnVoltar */ $btnVoltar = new Element\Button('voltar'); $btnVoltar->setAttributes(array('class' => 'btn btn-blue btn-ef btn-ef-4 btn-ef-4c mb-10', 'type' => 'button')); /* * Preencher Componentes */ if ($orm != null) { $txtId->setValue($orm->getId()); $txtEmail->setValue($orm->getEmail()); $cmbPublicador->setValue($orm->getPublicador()->getId()); $cmbNivel->setValue($orm->getNivel()->getId()); } // Adiciona componetes no form $this->add($txtId); $this->add($txtEmail); $this->add($txtSenha); $this->add($txtSenhaConfirma); $this->add($cmbPublicador); $this->add($cmbNivel); $this->add($iToken); $this->add($btnSalvar); $this->add($btnVoltar); $this->setAttributes(array('id' => 'form', 'data-parsley-validate' => NULL)); }
public function __construct(EntityManager $em, OrmPublicador $orm = null, $publicador = null) { parent::__construct("formPublicador"); $dao = $em->getRepository('Stj\\Entity\\OrmGrupo'); if ($publicador == null) { $lista = $dao->findAll(); } else { $lista = $dao->ListALL(FALSE, $publicador->getGrupo()->getCongregacao()); } $option = array(); $grupoarray = array(); $i = 0; $nomeCongregacao = ""; foreach ($lista as $key => $value) { $grupo = new OrmGrupo(); $grupo = $value; if ($nomeCongregacao != "") { if ($grupo->getCongregacao()->getNome() == $nomeCongregacao) { $option[$grupo->getCongregacao()->getNome()]['options'][$grupo->getId()] = $grupo->getNome(); } else { $option[$grupo->getCongregacao()->getNome()] = array('label' => $grupo->getCongregacao()->getNome()); $option[$grupo->getCongregacao()->getNome()]['options'][$grupo->getId()] = $grupo->getNome(); } } else { $option[$grupo->getCongregacao()->getNome()] = array('label' => $grupo->getCongregacao()->getNome()); $option[$grupo->getCongregacao()->getNome()]['options'][$grupo->getId()] = $grupo->getNome(); } $nomeCongregacao = $grupo->getCongregacao()->getNome(); } /* * txtID */ $txtId = new Element\Hidden("id"); /* * txtNome */ $txtNome = new Element\Text("nome"); $txtNome->setAttributes(array('class' => 'form-control', 'placeholder' => 'Nome do Publicador', 'data-parsley-trigger' => 'change', 'pattern' => '^[aA-zZ]+((\\s[aA-zZ]+)+)?$', 'required' => 'true')); /* * cmbGrupo */ $cmbGrupo = new Element\Select('grupo'); $cmbGrupo->setValueOptions($option); $cmbGrupo->setEmptyOption("Escolha o grupo"); $cmbGrupo->setAttributes(array('class' => 'chosen-select', 'style' => 'width:140px;', 'required' => 'true')); /* * cmbClasse */ $cmbClasse = new Element\Select('classe'); $cmbClasse->setValueOptions(array('OO' => 'Outra Ovelha', 'U' => 'Ungido')); $cmbClasse->setEmptyOption("Escolha a classe"); $cmbClasse->setAttributes(array('class' => 'chosen-select', 'style' => 'width:140px;', 'required' => 'true')); /* * cmbSexo */ $cmbSexo = new Element\Select('sexo'); $cmbSexo->setValueOptions(array('M' => 'Masculino', 'F' => 'Feminino')); $cmbSexo->setEmptyOption("Escolha o sexo"); $cmbSexo->setAttributes(array('class' => 'chosen-select', 'style' => 'width:140px;', 'required' => 'true')); /* * txtdataNascimento */ $txtNascimento = new Element\Text("nascimento"); $txtNascimento->setAttributes(array('class' => 'form-control', 'placeholder' => 'XX/XX/XXXX', 'max-length' => '10')); /* * txtdataEmissao */ $txtEmissao = new Element\Text("emissao"); $txtEmissao->setAttributes(array('class' => 'form-control', 'placeholder' => 'XX/XX/XXXX', 'max-length' => '10')); /* * txtTelefone */ $txtTelefone = new Element\Text("telefone"); $txtTelefone->setAttributes(array('class' => 'form-control', 'placeholder' => '(11)1234-1234', 'max-length' => '13', 'data-parsley-trigger' => "change", 'pattern' => "^\\([0-9]{2}\\)[0-9]{4}-[0-9]{4}")); /* * txtCelular */ $txtCelular = new Element\Text("celular"); $txtCelular->setAttributes(array('class' => 'form-control', 'placeholder' => '(11)12345-1234', 'max-length' => '14', 'data-parsley-trigger' => "change", 'pattern' => "^\\([0-9]{2}\\)[0-9]{5}-[0-9]{4}")); /* * txtCep */ $txtCep = new Element\Text("cep"); $txtCep->setAttributes(array('class' => 'form-control', 'placeholder' => 'XXXXXXXX', 'data-parsley-trigger' => 'change', 'pattern' => '/^[0-9]{2}[0-9]{3}[0-9]{3}$/', 'max-length' => '8')); /* * txtNumero */ $txtNumero = new Element\Text("numero"); $txtNumero->setAttributes(array('class' => 'form-control', 'placeholder' => 'Numero', 'data-parsley-trigger' => 'change', 'pattern' => '/^[0-9]+$/', 'max-length' => '6')); /* * txtLogradouro */ $txtLogradouro = new Element\Text("logradouro"); $txtLogradouro->setAttributes(array('class' => 'form-control', 'placeholder' => 'Ex: Rua, Avenida, Travessa...')); /* * txtComplemento */ $txtComplemento = new Element\Text("complemento"); $txtComplemento->setAttributes(array('class' => 'form-control', 'placeholder' => 'Ex: Rua, Avenida, Travessa...')); /* * txtBairro */ $txtBairro = new Element\Text("bairro"); $txtBairro->setAttributes(array('class' => 'form-control')); /* * txtCidade */ $txtCidade = new Element\Text("cidade"); $txtCidade->setAttributes(array('class' => 'form-control')); /* * txtUf */ $txtUf = new Element\Text("uf"); $txtUf->setAttributes(array('class' => 'form-control', 'max-length' => '2')); /* * Itoken */ $iToken = new Element\Csrf("iToken"); /* * btnSalvar */ $btnSalvar = new Element\Button('salvar'); $btnSalvar->setAttributes(array('class' => 'btn btn-darkgray btn-ef btn-ef-4 btn-ef-4c mb-10', 'type' => 'button')); /* * btnVoltar */ $btnVoltar = new Element\Button('voltar'); $btnVoltar->setAttributes(array('class' => 'btn btn-blue btn-ef btn-ef-4 btn-ef-4c mb-10', 'type' => 'button')); /* * Preencher Componentes */ if ($orm != null) { $txtId->setValue($orm->getId()); $txtNome->setValue($orm->getNome()); $cmbGrupo->setValue($orm->getGrupo()->getId()); $cmbClasse->setValue($orm->getClasse()); $cmbSexo->setValue($orm->getSexo()); if ($orm->getDtNascimento() != "") { $txtNascimento->setValue($orm->getDtNascimento()->format('d-m-Y')); } if ($orm->getDtEmissao() != "") { $txtEmissao->setValue($orm->getDtEmissao()->format('d-m-Y')); } $txtTelefone->setValue($orm->getTel()); $txtCelular->setValue($orm->getCel()); $txtCep->setValue($orm->getCep()); $txtNumero->setValue($orm->getNumero()); $txtLogradouro->setValue($orm->getLogradouro()); $txtComplemento->setValue($orm->getComplemento()); $txtBairro->setValue($orm->getBairro()); $txtCidade->setValue($orm->getCidade()); $txtUf->setValue($orm->getUf()); } // Adiciona componetes no form $this->add($txtId); $this->add($txtNome); $this->add($cmbGrupo); $this->add($cmbClasse); $this->add($cmbSexo); $this->add($txtNascimento); $this->add($txtEmissao); $this->add($txtTelefone); $this->add($txtCelular); $this->add($txtCep); $this->add($txtNumero); $this->add($txtLogradouro); $this->add($txtComplemento); $this->add($txtBairro); $this->add($txtCidade); $this->add($txtUf); $this->add($iToken); $this->add($btnSalvar); $this->add($btnVoltar); $this->add($cmbGrupo); $this->setAttributes(array('id' => 'form', 'action' => '/Publicador/Salvar', 'data-parsley-validate' => NULL)); }
public function __construct(OrmNivel $orm = null) { parent::__construct("formNivel"); /* * txtId */ $txtId = new Element\Hidden("id"); $txtNome = new Element\Text("nome"); $txtNome->setAttributes(array('class' => 'form-control', 'placeholder' => 'Nome da Categoria', 'data-parsley-trigger' => 'change', 'pattern' => '^[aA-zZ]+((\\s[aA-zZ]+)+)?$', 'required' => 'true')); /* * chkDashbord */ $chkDashbord = new Element\Checkbox('dashboard'); $chkDashbord->setAttributes(array('id' => "switch01", 'class' => 'onoffswitch-checkbox')); $chkPublicador = new Element\Checkbox('publicador'); $chkPublicador->setAttributes(array('id' => "switch02", 'class' => 'onoffswitch-checkbox')); /* * chkCongregacao */ $chkCongregacao = new Element\Checkbox('congregacao'); $chkCongregacao->setAttributes(array('id' => "switch07", 'class' => 'onoffswitch-checkbox')); /* * chkRelatorio */ $chkRelatorio = new Element\Checkbox('relatorio'); $chkRelatorio->setAttributes(array('id' => "switch03", 'class' => 'onoffswitch-checkbox')); /* * chkGrupo */ $chkGrupo = new Element\Checkbox('grupo'); $chkGrupo->setAttributes(array('id' => "switch04", 'class' => 'onoffswitch-checkbox')); /* * chkUsuario */ $chkUsuario = new Element\Checkbox('usuario'); $chkUsuario->setAttributes(array('id' => "switch05", 'class' => 'onoffswitch-checkbox')); /* * chkNivel */ $chkNivel = new Element\Checkbox('nivel'); $chkNivel->setAttributes(array('id' => "switch06", 'class' => 'onoffswitch-checkbox')); /* * chkPrivilegios */ $chkPrivilegios = new Element\Checkbox('privilegios'); $chkPrivilegios->setAttributes(array('id' => "switch07", 'class' => 'onoffswitch-checkbox')); /* * chkEscolaMinisterio */ $chkEscolaMinisterio = new Element\Checkbox('escola'); $chkEscolaMinisterio->setAttributes(array('id' => "switch08", 'class' => 'onoffswitch-checkbox')); /* * iToken */ $iToken = new Element\Csrf("iToken"); /* * btnSalvar */ $btnSalvar = new Element\Button('salvar'); $btnSalvar->setAttributes(array('class' => 'btn btn-darkgray btn-ef btn-ef-4 btn-ef-4c mb-10', 'type' => 'button')); /* * btnVoltar */ $btnVoltar = new Element\Button('voltar'); $btnVoltar->setAttributes(array('class' => 'btn btn-blue btn-ef btn-ef-4 btn-ef-4c mb-10', 'type' => 'button')); /* * Preencher Objetos */ if ($orm != null) { $txtId->setValue($orm->getId()); $txtNome->setValue($orm->getNome()); $chkDashbord->setValue($orm->getDashboard()); $chkPublicador->setValue($orm->getPublicador()); $chkGrupo->setValue($orm->getGrupo()); $chkCongregacao->setValue($orm->getCongregacao()); $chkRelatorio->setValue($orm->getRelatorio()); $chkUsuario->setValue($orm->getUsuario()); $chkPrivilegios->setValue($orm->getPrivilegios()); $chkEscolaMinisterio->setValue($orm->getEscolaMinisterio()); $chkNivel->setValue($orm->getNivel()); } /* * Adiciona Objetos ao form */ $this->add($txtId); $this->add($txtNome); $this->add($chkDashbord); $this->add($chkPublicador); $this->add($chkGrupo); $this->add($chkRelatorio); $this->add($chkCongregacao); $this->add($chkUsuario); $this->add($chkNivel); $this->add($chkPrivilegios); $this->add($chkEscolaMinisterio); $this->add($iToken); $this->add($btnSalvar); $this->add($btnVoltar); /* * Form */ $this->setAttributes(array('id' => 'form', 'data-parsley-validate' => NULL)); }
public function __construct(EntityManager $em, OrmPublicador $publicador) { parent::__construct("frmImprimi"); /* * cmbPublicador */ $dao = $em->getRepository('Stj\\Entity\\OrmPublicador'); if (empty($publicador)) { $lista = $dao->findAll(); } else { $lista = $dao->ListALLWhere($publicador->getGrupo()->getCongregacao()->getId()); } $option = array(); foreach ($lista as $key => $value) { $tipoPrivilegio = new OrmPublicador(); $tipoPrivilegio = $value; $option[$tipoPrivilegio->getId()] = $tipoPrivilegio->getNome(); } $cmbPublicador = new Element\Select('publicador'); $cmbPublicador->setValueOptions($option); $cmbPublicador->setEmptyOption("Selecionar"); $cmbPublicador->setAttributes(array('class' => 'chosen-select', 'style' => 'width:175px;', 'required' => 'true')); /* * chkDados */ $chkDados = new Element\Checkbox('dados'); $chkDados->setAttributes(array('id' => "switch00", 'class' => 'onoffswitch-checkbox')); $chkDados->setValue(TRUE); /* * chkSetembro */ $chkSetembro = new Element\Checkbox('setembro'); $chkSetembro->setAttributes(array('id' => "switch01", 'class' => 'onoffswitch-checkbox')); $chkSetembro->setValue(TRUE); /* * $chkOutubro */ $chkOutubro = new Element\Checkbox('outubro'); $chkOutubro->setAttributes(array('id' => "switch02", 'class' => 'onoffswitch-checkbox')); $chkOutubro->setValue(TRUE); /* * $chkNovembro */ $chkNovembro = new Element\Checkbox('novembro'); $chkNovembro->setAttributes(array('id' => "switch03", 'class' => 'onoffswitch-checkbox')); $chkNovembro->setValue(TRUE); /* * $chkDezembro */ $chkDezembro = new Element\Checkbox('dezembro'); $chkDezembro->setAttributes(array('id' => "switch04", 'class' => 'onoffswitch-checkbox')); $chkDezembro->setValue(TRUE); /* * $chkJaneiro */ $chkJaneiro = new Element\Checkbox('janeiro'); $chkJaneiro->setAttributes(array('id' => "switch05", 'class' => 'onoffswitch-checkbox')); $chkJaneiro->setValue(TRUE); /* * $chkFevereiro */ $chkFevereiro = new Element\Checkbox('fevereiro'); $chkFevereiro->setAttributes(array('id' => "switch06", 'class' => 'onoffswitch-checkbox')); $chkFevereiro->setValue(TRUE); /* * $chkMarco */ $chkMarco = new Element\Checkbox('marco'); $chkMarco->setAttributes(array('id' => "switch07", 'class' => 'onoffswitch-checkbox')); $chkMarco->setValue(TRUE); /* * $chkAbril */ $chkAbril = new Element\Checkbox('abril'); $chkAbril->setAttributes(array('id' => "switch08", 'class' => 'onoffswitch-checkbox')); $chkAbril->setValue(TRUE); /* * $chkMaio */ $chkMaio = new Element\Checkbox('maio'); $chkMaio->setAttributes(array('id' => "switch09", 'class' => 'onoffswitch-checkbox')); $chkMaio->setValue(TRUE); /* * $chkJunho */ $chkJunho = new Element\Checkbox('junho'); $chkJunho->setAttributes(array('id' => "switch10", 'class' => 'onoffswitch-checkbox')); $chkJunho->setValue(TRUE); /* * $chkJulho */ $chkJulho = new Element\Checkbox('julho'); $chkJulho->setAttributes(array('id' => "switch11", 'class' => 'onoffswitch-checkbox')); $chkJulho->setValue(TRUE); /* * $chkAgosto */ $chkAgosto = new Element\Checkbox('agosto'); $chkAgosto->setAttributes(array('id' => "switch12", 'class' => 'onoffswitch-checkbox')); $chkAgosto->setValue(TRUE); /* * iToken */ $iToken = new Element\Csrf("iToken"); /* * btnImprimir */ $btnSalvar = new Element\Button('imprimir'); $btnSalvar->setAttributes(array('class' => 'btn btn-darkgray btn-ef btn-ef-4 btn-ef-4c mb-10', 'type' => 'button')); /* * btnVoltar */ $btnVoltar = new Element\Button('voltar'); $btnVoltar->setAttributes(array('class' => 'btn btn-blue btn-ef btn-ef-4 btn-ef-4c mb-10', 'type' => 'button')); /* * Adiciona Objetos ao form */ $this->add($cmbPublicador); $this->add($chkDados); $this->add($chkSetembro); $this->add($chkOutubro); $this->add($chkNovembro); $this->add($chkDezembro); $this->add($chkJaneiro); $this->add($chkFevereiro); $this->add($chkMarco); $this->add($chkAbril); $this->add($chkMaio); $this->add($chkJunho); $this->add($chkJulho); $this->add($chkAgosto); $this->add($iToken); $this->add($btnSalvar); $this->add($btnVoltar); /* * Form */ $this->setAttributes(array('id' => 'form', 'data-parsley-validate' => NULL)); }
/** * Função que prepara os botões do formulário * @param type $buttonName * @param array $params * @return \Zend\Form\Element\Button */ private function prepareButtons($buttonName, array $params = array()) { /* Preparação dos botões */ $class = "btn "; $this->aOptions = array(); if (strtolower($params['type']) == 'submit') { //$element = new ZendFormElement\Submit($buttonName); $element = new ZendFormElement\Button($buttonName); $this->aAttributes['type'] = 'submit'; //$class .= ' btn-success '; } elseif (strtolower($params['type']) == 'button') { $element = new ZendFormElement\Button($buttonName); //$class .= ' btn_default '; } if (isset($params['class']) and !empty($params['class'])) { $this->aAttributes['class'] = $class . $params['class']; } $this->aOptions['column-size'] = 'sm-6 col-sm-offset-2'; $this->aOptions['twb-layout'] = 'inline'; $element->setValue($this->getTranslator('btn_' . $buttonName)); $element->setLabel($this->getTranslator('btn_' . $buttonName)); $element->setAttributes($this->aAttributes); $element->setOptions($this->aOptions); return $element; }
public function __construct(EntityManager $em, $publicador = null, OrmGrupo $orm = null) { parent::__construct("formGrupo"); $dao = $em->getRepository('Stj\\Entity\\OrmCongregacao'); $lista = $dao->findAll(); $option = array(); foreach ($lista as $key => $value) { $congregacao = new OrmCongregacao(); $congregacao = $value; $option[$congregacao->getId()] = $congregacao->getNome(); } // var_dump($option); // exit(); /* * txtID */ $txtId = new Element\Hidden("id"); /* * txtNome */ $txtNome = new Element\Text("nome"); $txtNome->setAttributes(array('class' => 'form-control', 'placeholder' => 'Nome do Grupo', 'data-parsley-trigger' => 'change', 'pattern' => '^[aA-zZ0-9]+((\\s[aA-zZ0-9]+)+)?$', 'required' => 'true')); /* * cmbCongregacao */ $cmbCongregacao = new Element\Select('congregacao'); $cmbCongregacao->setValueOptions($option); $cmbCongregacao->setEmptyOption("Escolha a congregação"); $cmbCongregacao->setAttributes(array('class' => 'chosen-select', 'style' => 'width:140px;', 'required' => 'true')); /* * txtCep */ $txtCep = new Element\Text("cep"); $txtCep->setAttributes(array('class' => 'form-control', 'placeholder' => 'XXXXXXXX', 'data-parsley-trigger' => 'change', 'pattern' => '/^[0-9]{2}[0-9]{3}[0-9]{3}$/', 'max-length' => '8')); /* * txtNumero */ $txtNumero = new Element\Text("numero"); $txtNumero->setAttributes(array('class' => 'form-control', 'placeholder' => 'Numero', 'data-parsley-trigger' => 'change', 'pattern' => '/^[0-9]+$/', 'max-length' => '6')); /* * txtLogradouro */ $txtLogradouro = new Element\Text("logradouro"); $txtLogradouro->setAttributes(array('class' => 'form-control', 'placeholder' => 'Ex: Rua, Avenida, Travessa...')); /* * txtComplemento */ $txtComplemento = new Element\Text("complemento"); $txtComplemento->setAttributes(array('class' => 'form-control', 'placeholder' => 'Ex: Rua, Avenida, Travessa...')); /* * txtBairro */ $txtBairro = new Element\Text("bairro"); $txtBairro->setAttributes(array('class' => 'form-control')); /* * txtCidade */ $txtCidade = new Element\Text("cidade"); $txtCidade->setAttributes(array('class' => 'form-control')); /* * txtUf */ $txtUf = new Element\Text("uf"); $txtUf->setAttributes(array('class' => 'form-control', 'max-length' => '2')); /* * Itoken */ $iToken = new Element\Csrf("iToken"); /* * btnSalvar */ $btnSalvar = new Element\Button('salvar'); $btnSalvar->setAttributes(array('class' => 'btn btn-darkgray btn-ef btn-ef-4 btn-ef-4c mb-10', 'type' => 'button')); /* * btnVoltar */ $btnVoltar = new Element\Button('voltar'); $btnVoltar->setAttributes(array('class' => 'btn btn-blue btn-ef btn-ef-4 btn-ef-4c mb-10', 'type' => 'button')); /* * Preencher Componentes */ if ($orm != null) { $txtId->setValue($orm->getId()); $txtNome->setValue($orm->getNome()); $cmbCongregacao->setValue($orm->getCongregacao()->getId()); $txtCep->setValue($orm->getCep()); $txtNumero->setValue($orm->getNumero()); $txtLogradouro->setValue($orm->getLogradouro()); $txtComplemento->setValue($orm->getComplemento()); $txtBairro->setValue($orm->getBairro()); $txtCidade->setValue($orm->getCidade()); $txtUf->setValue($orm->getUf()); } // Adiciona componetes no form $this->add($txtId); $this->add($txtNome); if (empty($publicador)) { $this->add($cmbCongregacao); } $this->add($txtCep); $this->add($txtNumero); $this->add($txtLogradouro); $this->add($txtComplemento); $this->add($txtBairro); $this->add($txtCidade); $this->add($txtUf); $this->add($iToken); $this->add($btnSalvar); $this->add($btnVoltar); $this->setAttributes(array('id' => 'form', 'data-parsley-validate' => NULL)); }