コード例 #1
0
ファイル: ObjetosForm.php プロジェクト: Crisstthian/Reminder
 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);
 }
コード例 #2
0
ファイル: CustomVocab.php プロジェクト: jimsafley/CustomVocab
 public function getTemplate(PhpRenderer $view)
 {
     // Normalize vocab terms for use in a select element.
     $terms = array_map('trim', explode(PHP_EOL, $this->vocab->terms()));
     $valueOptions = array_combine($terms, $terms);
     $hidden = new Hidden('customvocab');
     $hidden->setAttributes(['class' => 'language'])->setValue($this->vocab->lang());
     $select = new Select('customvocab');
     $select->setAttributes(['class' => 'terms'])->setEmptyOption('Select Below')->setValueOptions($valueOptions);
     return $view->formHidden($hidden) . $view->formSelect($select);
 }
コード例 #3
0
 public function __construct(EntityManager $em, $name = null, $options = array())
 {
     $this->em = $em;
     // we want to ignore the name passed
     parent::__construct('vehiclemodelversion');
     $this->setAttribute('method', 'post');
     $this->add(array('name' => 'vehicleModelVersionId', 'attributes' => array('type' => 'hidden')));
     /*     
             $this->add(array(
                 'name' => 'vehicleModelId',
                 
                 'type'  => 'Zend\Form\Element\Select',
                 'options' => array(
                          'label' => 'Vehicle Model',
                          'empty_option' => 'Select',
                     
                    
                  ),
                 'attributes' => array(
              'id' => 'vehicleModel',
         ),
             )); 
     */
     $vehicleModel = new Element\Select('vehicleModelId');
     $vehicleModel->setEmptyOption("Models");
     $vehicleModel->setAttributes(array('id' => 'vehicleModel', 'class' => 'dropDnInput'));
     $vehicleModel->setDisableInArrayValidator(TRUE);
     $this->add($vehicleModel);
     $vehicleBrand = new Element\Select('vehicleBrandId');
     $vehicleBrand->setEmptyOption("Select Brand");
     $vehicleBrand->setAttributes(array('id' => 'vehicleBrand', 'class' => 'dropDnInput'));
     $vehicleBrand->setValueOptions($this->getOptionsForSelectBrands());
     $vehicleBrand->setDisableInArrayValidator(TRUE);
     $this->add($vehicleBrand);
     $this->add(array('name' => 'vehicleModelVersionName', 'attributes' => array('type' => 'text', 'class' => 'commonDropDnInput', 'placeholder' => 'Vehicle Model Version Name')));
     $vehicleModeltemp = new Element\Hidden('vehicleModelIdTemp');
     $vehicleModeltemp->setLabel('Vehicle ModelId');
     $vehicleModeltemp->setAttributes(array('id' => 'vehicleModelIdTemp'));
     $this->add($vehicleModeltemp);
     $this->add(array('name' => 'status', 'type' => 'Select', 'attributes' => array('class' => 'dropDnInput'), 'options' => array('empty_option' => 'Select Status', 'value_options' => array('0' => 'InActive', '1' => 'Active'))));
     $this->add(array('name' => 'submit', 'attributes' => array('type' => 'submit', 'value' => 'vehiclemodelversionadd', 'id' => 'submitbutton', 'class' => "btn-blue")));
 }
コード例 #4
0
 public function posterlabAction()
 {
     $id = (int) $this->params()->fromRoute("id", 0);
     $menu = $this->getContenutiDao()->relatorePerId($id);
     $menuArray = $this->getContenutiDao()->defaultPerId($id);
     $ids = (int) $this->params()->fromQuery("ids");
     if (!$ids) {
         $ids = $menuArray->getId();
     }
     $this->initAjaxContext();
     $inizio = $this->getSessioniDao()->BuscoId($id)->getInizio();
     $timer = $this->getPosterlabsDao()->tuttiPerId($id)->getDurata();
     $generaloposter = $this->getPosterlabsDao()->tuttiPerId($id);
     $timerdate = new DateTime($inizio);
     $timerdate->modify('+' . $timer . ' minutes');
     $tiempo = $timerdate->format('Y-m-d H:i:s');
     //print_r($tiempo);die;
     $nombre = $generaloposter->getRelatori()->getNome();
     $apellido = $generaloposter->getRelatori()->getCognome();
     $relator = $nombre . ' ' . $apellido;
     $verifica = $this->getContenutiDao()->buscaId($ids);
     $passwordPosterlab = $generaloposter->getPassword2();
     $layout = $this->layout();
     // asignamos algunas variables al layout
     $layout->timeraggio = $tiempo;
     $layout->password = $passwordPosterlab;
     $seccionactiva = $this->getSessioniDao()->BuscoId($id)->getStato();
     $seccionactual = $this->getSessioniDao()->BuscoId($id)->getId();
     //controllo sessione attiva
     if ($seccionactiva == 0) {
         return $this->redirect()->toRoute('application', array('controller' => 'index', 'action' => 'index'));
     }
     //id seccion activa
     $idseccion = $this->getSessioniDao()->BuscoId($id)->getId();
     //verifico domanda
     if ($verifica->getTipo() == 1) {
         $postit = $this->getInterattivoDao()->posiciones($id, $seccionactual);
         $busco_ultimo = $this->getInterattivoDao()->posiciones($id, $seccionactual)->toArray();
         $contador_postit = count($busco_ultimo);
         if ($contador_postit > 0) {
             $todo_id = array();
             foreach ($busco_ultimo as $key) {
                 $todo_id[] = $key['id'];
             }
             $ultimo = max($todo_id);
         }
         $color = 'yellow';
         $patron = 'Y-m-d H:i:s';
         $fecha = new DateTime();
         $form = new Nascosto("Nascosto");
         $form->get('id')->setValue($ids);
         $form->get('posterlab')->setValue($id);
         $form->get('tipo')->setValue(1);
         $form->get('data')->setValue($fecha->format($patron));
         $form->get('color')->setValue('yellow');
         $form->get('xyz')->setValue('0x101x100');
         $form->get('nome')->setValue($relator);
         $form->get('sessione')->setValue($idseccion);
         $form->get('stato')->setValue(1);
         $hidden = new Element\Hidden('lasted');
         $hidden->setAttributes(array('class' => 'lasted'));
         if ($contador_postit > 0) {
             $hidden->setValue($ultimo);
         } else {
             $hidden->setValue(0);
         }
         $form->add($hidden);
         if ($ids !== 0) {
             $contenuto = $this->getContenutiDao()->buscaId($ids);
             $imagen = $contenuto->getBackground();
         } else {
             $contenuto = $this->getContenutiDao()->defaultPerId($id);
             $imagen = $contenuto->getBackground();
         }
         //print_r($contenuto);die;
         if (null === $menu) {
             return $this->redirect()->toRoute('application', array('controller' => 'index', 'action' => 'index'));
         }
         return new ViewModel(array('form' => $form, 'posterlab' => $menu, 'contenuto' => $contenuto, 'imagen' => $imagen, 'ids' => $ids, 'postit' => $postit, 'timeraggio' => $tiempo, 'cantidad' => $contador_postit, 'color' => $color, 'password' => $passwordPosterlab));
     }
     //verifico risposta
     if ($verifica->getTipo() == 2) {
         $postit = $this->getInterattivoDao()->posiciones2($id, $seccionactual);
         $busco_ultimo = $this->getInterattivoDao()->posiciones2($id, $seccionactual)->toArray();
         //print_r($busco_ultimo);die;
         $contador_postit = count($busco_ultimo);
         if ($contador_postit > 0) {
             $todo_id = array();
             foreach ($busco_ultimo as $key) {
                 $todo_id[] = $key['id'];
             }
             $ultimo = max($todo_id);
         }
         $color = 'blue';
         $patron = 'Y-m-d H:i';
         $fecha = new DateTime();
         $form = new Nascosto("Nascosto");
         $form->get('id')->setValue($ids);
         $form->get('posterlab')->setValue($id);
         $form->get('tipo')->setValue(2);
         $form->get('data')->setValue($fecha->format($patron));
         $form->get('color')->setValue('blue');
         $form->get('xyz')->setValue('0x101x100');
         $form->get('nome')->setValue($relator);
         $form->get('sessione')->setValue($idseccion);
         $form->get('stato')->setValue(1);
         $hidden = new Element\Hidden('lasted');
         $hidden->setValue(1);
         $form->add($hidden);
         $hidden = new Element\Hidden('lasted');
         $hidden->setAttributes(array('class' => 'lasted'));
         if ($contador_postit > 0) {
             $hidden->setValue($ultimo);
         } else {
             $hidden->setValue(0);
         }
         $form->add($hidden);
         if ($ids !== 0) {
             $contenuto = $this->getContenutiDao()->buscaId($ids);
             $imagen = $contenuto->getBackground();
         } else {
             $contenuto = $this->getContenutiDao()->defaultPerId($id);
             $imagen = $contenuto->getBackground();
         }
         if (null === $menu) {
             return $this->redirect()->toRoute('application', array('controller' => 'index', 'action' => 'index'));
         }
         return new ViewModel(array('form' => $form, 'posterlab' => $menu, 'contenuto' => $contenuto, 'imagen' => $imagen, 'ids' => $ids, 'postit' => $postit, 'timeraggio' => $tiempo, 'cantidad' => $contador_postit, 'color' => $color, 'password' => $passwordPosterlab));
     }
     //verifico contenuto
     if ($verifica->getTipo() == 3) {
         if ($ids !== 0) {
             $contenuto = $this->getContenutiDao()->buscaId($ids);
             $imagen = $contenuto->getBackground();
         } else {
             $contenuto = $this->getContenutiDao()->defaultPerId($id);
             $imagen = $contenuto->getBackground();
         }
         if (null === $menu) {
             return $this->redirect()->toRoute('application', array('controller' => 'index', 'action' => 'index'));
         }
         return new ViewModel(array('posterlab' => $menu, 'contenuto' => $contenuto, 'imagen' => $imagen, 'ids' => $ids, 'timeraggio' => $tiempo, 'password' => $passwordPosterlab));
     }
 }