/**
  * Class constructor
  * Creates the page and the registration form
  */
 function __construct()
 {
     parent::__construct();
     parent::setDatabase('samples');
     // defines the database
     parent::setActiveRecord('City');
     // defines the active record
     // creates the form
     $this->form = new TQuickForm('form_City');
     $this->form->class = 'tform';
     // CSS class
     $this->form->style = 'width: 500px';
     // define the form title
     $this->form->setFormTitle('Standard Form');
     // create the form fields
     $id = new TEntry('id');
     $name = new TEntry('name');
     $id->setEditable(FALSE);
     // add the form fields
     $this->form->addQuickField('ID', $id, 100);
     $this->form->addQuickField('Name', $name, 100);
     // define the form action
     $this->form->addQuickAction('Save', new TAction(array($this, 'onSave')), 'ico_save.png');
     $this->form->addQuickAction('New', new TAction(array($this, 'onEdit')), 'ico_new.png');
     $this->form->addQuickAction('Listing', new TAction(array('StandardDataGridView', 'onReload')), 'ico_datagrid.gif');
     // wrap the page content using vertical box
     $vbox = new TVBox();
     $vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
     $vbox->add($this->form);
     parent::add($vbox);
 }
 public function __construct()
 {
     parent::__construct();
     $this->form = new TForm();
     // creates one datagrid
     $this->datagrid = new TQuickGrid();
     $this->datagrid->disableDefaultClick();
     // important!
     $this->form->add($this->datagrid);
     // add the columns
     $this->datagrid->addQuickColumn('Check', 'check', 'right', 40);
     $this->datagrid->addQuickColumn('Code', 'code', 'right', 70);
     $this->datagrid->addQuickColumn('Name', 'name', 'left', 180);
     $this->datagrid->addQuickColumn('Address', 'address', 'left', 180);
     $this->datagrid->addQuickColumn('Phone', 'fone', 'left', 120);
     // creates the datagrid model
     $this->datagrid->createModel();
     // creates the action button
     $button1 = new TButton('action1');
     // define the button action
     $button1->setAction(new TAction(array($this, 'onSave')), 'Save');
     $button1->setImage('ico_save.png');
     $this->form->addField($button1);
     // wrap the page content using vertical box
     $vbox = new TVBox();
     $vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
     $vbox->add($this->form);
     $vbox->add($button1);
     parent::add($vbox);
 }
 /**
  * Class constructor
  * Creates the page and the registration form
  */
 function __construct()
 {
     parent::__construct();
     // creates the form
     $this->form = new TForm('form_Customer');
     try {
         // UIBuilder object
         $ui = new TUIBuilder(500, 340);
         $ui->setController($this);
         $ui->setForm($this->form);
         // reads the xml form
         $ui->parseFile('app/forms/customerlist.form.xml');
         $this->datagrid = $ui->getWidget('datagrid1');
         $this->pageNavigation = $this->datagrid->getPageNavigation();
         $this->form->add($ui);
         $this->form->setFields($ui->getFields());
     } catch (Exception $e) {
         new TMessage('error', $e->getMessage());
     }
     // wrap the page content using vertical box
     $vbox = new TVBox();
     $vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
     $vbox->add($this->form);
     parent::add($vbox);
 }
 public function __construct()
 {
     parent::__construct();
     $this->form = new TForm();
     // creates one datagrid
     $this->datagrid = new TQuickGrid();
     $this->datagrid->disableDefaultClick();
     $this->form->add($this->datagrid);
     // creates the action button
     $button1 = new TButton('action1');
     // define the button action
     $action_button1 = new TAction(array($this, 'onUpdate'));
     $action_button1->setParameter('id', filter_input(INPUT_GET, 'id'));
     $button1->setAction($action_button1, 'Atualizar');
     $button1->setImage('fa:check-circle-o green');
     $this->form->addField($button1);
     // add the columns
     $this->datagrid->addQuickColumn('Tipo de Atividade', 'nome', 'left', 180);
     $this->datagrid->addQuickColumn('Ticket', 'ticket', 'left', 180);
     $this->datagrid->addQuickColumn('Sistema', 'sistema', 'left', 180);
     // creates the datagrid model
     $this->datagrid->createModel();
     // wrap the page content using vertical box
     $vbox = new TVBox();
     $vbox->add($button1);
     $vbox->add($this->form);
     parent::add($vbox);
 }
 /**
  * Class constructor
  */
 function __construct()
 {
     parent::__construct();
     // creates the form
     $this->form = new TForm('form_pdf_shapes');
     // creates a table
     $table = new TTable();
     // add the table inside the form
     $this->form->add($table);
     // create the form fields
     $name = new TEntry('name');
     $name->addValidation('Name', new TRequiredValidator());
     $label = new TLabel('Name' . ': ');
     $label->setFontColor('red');
     $table->addRowSet($label, $name);
     $save_button = new TButton('generate');
     $save_button->setAction(new TAction(array($this, 'onGenerate')), 'Generate');
     $save_button->setImage('ico_save.png');
     // add a row for the form action
     $table->addRowSet($save_button);
     // define wich are the form fields
     $this->form->setFields(array($name, $save_button));
     // wrap the page content using vertical box
     $vbox = new TVBox();
     $vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
     $vbox->add($this->form);
     parent::add($vbox);
 }
 public function __construct()
 {
     parent::__construct();
     // creates one datagrid
     $this->datagrid = new TDataGrid();
     // create the datagrid columns
     $code = new TDataGridColumn('code', 'Code', 'right', 70);
     $name = new TDataGridColumn('name', 'Name', 'left', 180);
     $address = new TDataGridColumn('address', 'Address', 'left', 180);
     $telephone = new TDataGridColumn('fone', 'Phone', 'left', 160);
     // add the columns to the datagrid
     $this->datagrid->addColumn($code);
     $this->datagrid->addColumn($name);
     $this->datagrid->addColumn($address);
     $this->datagrid->addColumn($telephone);
     // creates two datagrid actions
     $action1 = new TDataGridAction(array($this, 'onView'));
     $action1->setLabel('View');
     $action1->setImage('ico_find.png');
     $action1->setField('name');
     $action1->setDisplayCondition(array($this, 'displayColumn'));
     // add the actions to the datagrid
     $this->datagrid->addAction($action1);
     // creates the datagrid model
     $this->datagrid->createModel();
     // wrap the page content using vertical box
     $vbox = new TVBox();
     $vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
     $vbox->add($this->datagrid);
     parent::add($vbox);
 }
 /**
  * Class constructor
  * Creates the page
  */
 function __construct()
 {
     parent::__construct();
     // create the form
     $this->form = new TForm();
     // create the form fields
     $html = new THtmlEditor('html_text');
     $html->setSize(500, 200);
     // creates the action button
     $button1 = new TButton('action1');
     $button1->setAction(new TAction(array($this, 'onShow')), 'Show');
     $button1->setImage('ico_apply.png');
     // creates the table wrapper and put it inside the form
     $table = new TTable();
     $this->form->add($table);
     // pack elements
     $table->addRow()->addCell(new TLabel('HTML:'));
     $table->addRow()->addCell($html);
     $table->addRow()->addCell($button1);
     // define wich are the form fields
     $this->form->setFields(array($html, $button1));
     // wrap the page content using vertical box
     $vbox = new TVBox();
     $vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
     $vbox->add($this->form);
     parent::add($vbox);
 }
 /**
  * Class constructor
  * Creates the page and the registration form
  */
 function __construct()
 {
     parent::__construct();
     // creates the form
     $this->form = new TForm('form_Teste');
     try {
         // TUIBuilder object
         $ui = new TUIBuilder(500, 400);
         $ui->setController($this);
         $ui->setForm($this->form);
         // reads the xml form
         $ui->parseFile('app/forms/datagrid.form.xml');
         // get the datagrid
         $this->datagrid = $ui->getWidget('datagrid');
         // put the TUIBuilder panel inside the TForm object
         $this->form->add($ui);
         // set form fields from interface fields
         $this->form->setFields($ui->getFields());
     } catch (Exception $e) {
         new TMessage('error', $e->getMessage());
     }
     // wrap the page content using vertical box
     $vbox = new TVBox();
     $vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
     $vbox->add($this->form);
     parent::add($vbox);
 }
 /**
  * Class constructor
  * Creates the page
  */
 function __construct()
 {
     parent::__construct();
     // create the form using TQuickForm class
     $this->form = new BootstrapFormWrapper(new TQuickForm());
     $this->form->setFormTitle('cadastroTarefas');
     // create the form fields
     $id = new TEntry('id');
     $id->setEditable(FALSE);
     $description = new TEntry('titulo');
     $list = new TCombo('prioridade');
     $text = new TText('descricao');
     $combo_items = array();
     $combo_items['1'] = 'Baixa';
     $combo_items['2'] = 'Media';
     $combo_items['3'] = 'Alta';
     $list->addItems($combo_items);
     // add the fields inside the form
     $this->form->addQuickField('Id', $id, 40);
     $this->form->addQuickField('Título', $description, 250);
     $this->form->addQuickField('Descrição', $text, 120);
     $this->form->addQuickField('Prioridade', $list, 120);
     $text->setSize(250, 50);
     // define the form action
     $btn = $this->form->addQuickAction('Save', new TAction(array($this, 'onSave')), 'fa:save');
     $btn->class = 'btn btn-success';
     $panel = new TPanelGroup('Cadastro de taredas');
     $panel->add($this->form);
     // wrap the page content using vertical box
     $vbox = new TVBox();
     $vbox->add($panel);
     parent::add($vbox);
 }
 public function __construct()
 {
     parent::__construct();
     $this->datagrid = new TQuickGrid();
     $this->datagrid->setHeight(320);
     // define the CSS class
     $this->datagrid->class = 'customized-table';
     // import the CSS file
     parent::include_css('app/resources/custom-table.css');
     // add the columns
     $this->datagrid->addQuickColumn('ID', 'id', 'left', 50);
     $this->datagrid->addQuickColumn('Description', 'description', 'left', 250);
     $this->datagrid->addQuickColumn('Amount', 'amount', 'right', 140);
     $this->datagrid->addQuickColumn('Price', 'sale_price', 'right', 140);
     // add the actions
     $this->datagrid->addQuickAction('Delete', new TDataGridAction(array($this, 'onDelete')), 'id', 'ico_delete.png');
     // creates the datagrid model
     $this->datagrid->createModel();
     $form_back = new TQuickForm();
     $form_back->addQuickAction('Back', new TAction(array($this, 'onGoToCatalog')), 'ico_back.png');
     // wrap the page content using vertical box
     $vbox = new TVBox();
     $vbox->add(new TXMLBreadCrumb('menu.xml', 'ProductCatalogView'));
     $vbox->add($this->datagrid);
     $vbox->add($form_back);
     parent::add($vbox);
 }
 public function __construct()
 {
     parent::__construct();
     // creates one datagrid
     $this->datagrid = new TDataGrid();
     // create the datagrid columns
     $code = new TDataGridColumn('code', 'Code', 'left', 50);
     $name = new TDataGridColumn('name', 'Name', 'left', 180);
     $address = new TDataGridColumn('address', 'Address', 'left', 140);
     $telephone = new TDataGridColumn('fone', 'Phone', 'center', 100);
     // add the columns to the datagrid
     $this->datagrid->addColumn($code);
     $this->datagrid->addColumn($name);
     $this->datagrid->addColumn($address);
     $this->datagrid->addColumn($telephone);
     $action1 = new TAction(array($this, 'onColumnAction'));
     $action1->setParameter('column', 'code');
     $code->setAction($action1);
     $action2 = new TAction(array($this, 'onColumnAction'));
     $action2->setParameter('column', 'name');
     $name->setAction($action2);
     // creates the datagrid model
     $this->datagrid->createModel();
     // wrap the page content using vertical box
     $vbox = new TVBox();
     $vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
     $vbox->add($this->datagrid);
     parent::add($vbox);
 }
 public function __construct()
 {
     parent::__construct();
     // creates one datagrid
     $this->datagrid = new TDataGrid();
     // make scrollable and define height
     $this->datagrid->setHeight(300);
     $this->datagrid->makeScrollable();
     // create the datagrid columns
     $code = new TDataGridColumn('code', 'Code', 'right', 70);
     $name = new TDataGridColumn('name', 'Name', 'left', 180);
     $address = new TDataGridColumn('address', 'Address', 'left', 180);
     $telephone = new TDataGridColumn('fone', 'Phone', 'left', 160);
     // add the columns to the datagrid
     $this->datagrid->addColumn($code);
     $this->datagrid->addColumn($name);
     $this->datagrid->addColumn($address);
     $this->datagrid->addColumn($telephone);
     // creates the datagrid model
     $this->datagrid->createModel();
     // wrap the page content using vertical box
     $vbox = new TVBox();
     $vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
     $vbox->add($this->datagrid);
     parent::add($vbox);
 }
 /**
  * Class constructor
  * Creates the page
  */
 function __construct()
 {
     parent::__construct();
     // create the form using TQuickForm class
     $this->form = new TQuickForm('form_seek_sample');
     $this->form->setFormTitle('Seek button');
     $this->form->class = 'tform';
     // create the form fields
     $city_id1 = new TSeekButton('city_id1');
     $city_name1 = new TEntry('city_name1');
     $criteria = new TCriteria();
     $criteria->add(new TFilter('id', '>', 1));
     $criteria->add(new TFilter('id', '<', 5));
     $criteria->setProperty('order', 'name');
     // define the action for city_id1
     $obj = new TestCitySeek();
     $action = new TAction(array($obj, 'onReload'));
     $city_id1->setAction($action);
     $city_id1->setSize(100);
     $city_name1->setEditable(FALSE);
     $this->form->addQuickFields('Manual SeekButton', array($city_id1, $city_name1));
     $this->form->addQuickAction('Save', new TAction(array($this, 'onSave')), 'fa:floppy-o');
     // wrap the page content using vertical box
     $vbox = new TVBox();
     $vbox->add($this->form);
     parent::add($vbox);
 }
 /**
  * Form constructor
  * @param $param Request
  */
 public function __construct($param)
 {
     parent::__construct();
     // creates the form
     $this->form = new TQuickForm('form_Sistema');
     $this->form->class = 'tform';
     // change CSS class
     $this->form->style = 'display: table;width:100%';
     // change style
     // define the form title
     $this->form->setFormTitle('Sistema');
     // create the form fields
     $id = new TSeekButton('id');
     $nome = new TText('nome');
     // add the fields
     $this->form->addQuickField('Id', $id, 100);
     $this->form->addQuickField('Nome', $nome, 200);
     if (!empty($id)) {
         $id->setEditable(FALSE);
     }
     /** samples
         $this->form->addQuickFields('Date', array($date1, new TLabel('to'), $date2)); // side by side fields
         $fieldX->addValidation( 'Field X', new TRequiredValidator ); // add validation
         $fieldX->setSize( 100, 40 ); // set size
         **/
     // create the form actions
     $this->form->addQuickAction(_t('Save'), new TAction(array($this, 'onSave')), 'fa:floppy-o');
     $this->form->addQuickAction(_t('New'), new TAction(array($this, 'onClear')), 'bs:plus-sign green');
     // vertical box container
     $container = new TVBox();
     $container->style = 'width: 90%';
     // $container->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
     $container->add($this->form);
     parent::add($container);
 }
 function __construct()
 {
     parent::__construct();
     Clientes::checkCliente();
     $this->pagseguro = new PPagSeguro('progs');
     $this->setSize(550, 400);
     $this->setTitle('Lista de Produtos');
     $this->grid = new TQuickGrid();
     $this->grid->addQuickColumn('id', 'id', 'right', 100);
     $this->grid->addQuickColumn('nome', 'nome', 'right', 200);
     $this->grid->addQuickColumn('qtd', 'qtd', 'right', 100);
     $this->grid->addQuickColumn('preco', 'preco', 'right', 100);
     $action = new TDataGridAction(array('Carrinho', 'updateItem'));
     $this->grid->addQuickAction('UpdateItem', $action, 'id', 'ico_edit.png');
     $form = new TQuickForm('frm_finalizar');
     $action2 = new TAction(array($this, 'finalizar'));
     $form->addQuickAction('finalizar', $action2);
     $this->grid->createModel();
     $produtos = PCart::getItens();
     if ($produtos) {
         foreach ($produtos as $p) {
             $item = new stdClass();
             $item->id = $p->getId();
             $item->nome = $p->getNome();
             $item->qtd = $p->getQtd();
             $item->preco = $p->getPreco();
             $this->grid->addItem($item);
         }
         $box = new TVBox();
         $box->add($this->grid);
         $box->add($form);
         parent::add($box);
     }
 }
 /**
  * Class constructor
  * Creates the page
  */
 function __construct()
 {
     parent::__construct();
     // create the form using TQuickForm class
     $this->form = new TQuickForm('form_dynamic_filter');
     // create the notebook
     $notebook = new TNotebook(530, 160);
     // adds the notebook page
     $notebook->appendPage('Dynamic filtering', $this->form);
     $check_gender = new TCheckGroup('check_gender');
     $check_gender->addItems(array('M' => 'Male', 'F' => 'Female'));
     $check_gender->setLayout('horizontal');
     $combo_status = new TCombo('combo_status');
     $combo_status->addItems(array('S' => 'Single', 'C' => 'Committed', 'M' => 'Married'));
     $combo_customers = new TCombo('customers');
     // add the fields inside the form
     $this->form->addQuickField('Load customers: ', $check_gender, 200);
     $this->form->addQuickField('', $combo_status, 200);
     $this->form->addQuickField('', $combo_customers, 200);
     $check_gender->setChangeAction(new TAction(array($this, 'onGenderChange')));
     $combo_status->setChangeAction(new TAction(array($this, 'onGenderChange')));
     // wrap the page content using vertical box
     $vbox = new TVBox();
     $vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
     $vbox->add($notebook);
     parent::add($vbox);
 }
 /**
  * Class constructor
  * Creates the page
  */
 function __construct()
 {
     parent::__construct();
     // creates the scroll panel
     $scroll = new TScroll();
     $scroll->setSize(400, 300);
     // creates a table for the fields
     $fields_table = new TTable();
     // adds the table inside the scroll
     $scroll->add($fields_table);
     // create the form fields
     $fields = array();
     for ($n = 1; $n <= 20; $n++) {
         $object = new TEntry('field' . $n);
         $fields[$n] = $object;
         // adds a row for each form field
         $row = $fields_table->addRow();
         $row->addCell(new TLabel('Field:' . $n));
         $row->addCell($object);
     }
     // wrap the page content using vertical box
     $vbox = new TVBox();
     $vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
     $vbox->add($scroll);
     parent::add($vbox);
 }
 /**
  * Class constructor
  * Creates the page
  */
 function __construct()
 {
     parent::__construct();
     // loads the galleria javascript library
     TPage::include_js('app/lib/jquery/galleria/galleria-1.2.2.min.js');
     // creates a table
     $table = new TTable();
     // creates the DIV element with the images
     $galleria = new TElement('div');
     $galleria->id = 'images';
     $galleria->style = "width:600px;height:460px";
     for ($n = 1; $n <= 4; $n++) {
         $img = new TElement('img');
         $img->src = "app/images/nature/nature{$n}.jpg";
         $galleria->add($img);
     }
     // add the DIV to the table
     $table->addRow()->addCell($galleria);
     // creates the script element
     $script = new TElement('script');
     $script->type = 'text/javascript';
     $script->add('
         Galleria.loadTheme("app/lib/jquery/galleria/themes/classic/galleria.classic.min.js");
         $("#images").galleria();
     ');
     // add the script to the table
     $table->addRow()->addCell($script);
     // wrap the page content using vertical box
     $vbox = new TVBox();
     $vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
     $vbox->add($table);
     parent::add($vbox);
 }
示例#19
0
 function __construct()
 {
     parent::__construct();
     // create the form using TQuickForm class
     $this->form = new TQuickForm();
     $this->form->class = 'tform';
     $this->form->setFormTitle('Formas de Pagamentos');
     $combo = new TCombo('pagamento');
     $combo_items = array();
     $combo_items['a'] = 'Cartão de Crédito Visa';
     $combo_items['b'] = 'Cartão de Crédito Mastercard';
     $combo_items['c'] = 'Ticket Vale Refeição';
     $combo_items['d'] = 'PagSeguro';
     $combo_items['e'] = 'PayPal';
     $combo_items['f'] = 'DriverCoins';
     $combo->addItems($combo_items);
     $this->form->addQuickField('Forma de Pagamentos', $combo, 500);
     $this->form->addQuickAction('Salvar', new TAction(array($this, 'onSave')), 'ico_save.png');
     // wrap the page content using vertical box
     $vbox = new TVBox();
     $vbox->style = 'width: 100%';
     $vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
     $vbox->add($this->form);
     parent::add($vbox);
 }
 /**
  * Class constructor
  * Creates the page and the registration form
  */
 function __construct()
 {
     parent::__construct();
     // creates the form
     $this->form = new TForm();
     try {
         // UIBuilder object
         $ui = new TUIBuilder(500, 300);
         $ui->setController($this);
         $ui->setForm($this->form);
         // reads the xml form
         $ui->parseFile('app/forms/sample.form.xml');
         // add the TUIBuilder panel inside the form
         $this->form->add($ui);
         // set the form fields from the interface
         $this->form->setFields($ui->getFields());
     } catch (Exception $e) {
         new TMessage('error', $e->getMessage());
     }
     // wrap the page content using vertical box
     $vbox = new TVBox();
     $vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
     $vbox->add($this->form);
     parent::add($vbox);
 }
示例#21
0
 /**
  * Class constructor
  * Creates the page
  */
 function __construct()
 {
     parent::__construct();
     $this->form = new TForm();
     $list1 = new TSortList('list1');
     $list2 = new TSortList('list2');
     $list1->addItems(array('1' => 'One', '2' => 'Two', '3' => 'Three'));
     $list2->addItems(array('a' => 'A', 'b' => 'B', 'c' => 'C'));
     $list1->setSize(200, 100);
     $list2->setSize(200, 100);
     $list1->connectTo($list2);
     $list2->connectTo($list1);
     // creates the action button
     $button1 = new TButton('action1');
     $button1->setAction(new TAction(array($this, 'onSave')), 'Save');
     $button1->setImage('ico_save.png');
     $table = new TTable();
     $row = $table->addRow();
     $row->addCell($list1);
     $row->addCell($list2);
     $table->addRow()->addCell($button1);
     $this->form->setFields(array($list1, $list2, $button1));
     $this->form->add($table);
     // wrap the page content using vertical box
     $vbox = new TVBox();
     $vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
     $vbox->add($this->form);
     parent::add($vbox);
 }
 /**
  * Class constructor
  * Creates the page and the registration form
  */
 function __construct()
 {
     parent::__construct();
     // creates the form
     $this->form = new TForm('form_City');
     $this->form->class = 'tform';
     // CSS class
     $this->form->style = 'width: 500px';
     // creates a table
     $table = new TTable();
     $table->width = '100%';
     $table_buttons = new TTable();
     // add the table inside the form
     $this->form->add($table);
     // create the form fields
     $id = new TEntry('id');
     $name = new TEntry('name');
     // define the sizes
     $id->setSize(100);
     $name->setSize(100);
     $id->setEditable(FALSE);
     // define the form title
     $row = $table->addRow();
     $row->class = 'tformtitle';
     $cell = $row->addCell(new TLabel('Manual form'));
     $cell->colspan = 2;
     // add the form fields
     $table->addRowSet(new TLabel('ID:'), $id);
     $table->addRowSet(new TLabel('Name:'), $name);
     // create an action button (save)
     $save_button = new TButton('save');
     $save_button->setAction(new TAction(array($this, 'onSave')), 'Save');
     $save_button->setImage('ico_save.png');
     // create an action button (new)
     $new_button = new TButton('new');
     $new_button->setAction(new TAction(array($this, 'onEdit')), 'New');
     $new_button->setImage('ico_new.png');
     // create an action button (go to list)
     $goto_button = new TButton('list');
     $goto_button->setAction(new TAction(array('CompleteDataGridView', 'onReload')), 'Listing');
     $goto_button->setImage('ico_datagrid.gif');
     // add a row for the form action
     $row = $table_buttons->addRow();
     $row->addCell($save_button);
     $row->addCell($new_button);
     $row->addCell($goto_button);
     // add a row for the form action
     $row = $table->addRow();
     $row->class = 'tformaction';
     $cell = $row->addCell($table_buttons);
     $cell->colspan = 2;
     // define wich are the form fields
     $this->form->setFields(array($id, $name, $save_button, $new_button, $goto_button));
     // wrap the page content using vertical box
     $vbox = new TVBox();
     $vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
     $vbox->add($this->form);
     parent::add($vbox);
 }
 /**
  * Class constructor
  * Creates the page, the form and the listing
  */
 public function __construct()
 {
     parent::__construct();
     parent::setSize(500, 400);
     parent::setTitle('Telefones');
     // creates a Datagrid
     $this->datagrid = new TDataGrid();
     $this->datagrid = new BootstrapDatagridWrapper($this->datagrid);
     $this->datagrid->style = 'width: 100%';
     $this->datagrid->setHeight(320);
     // $this->datagrid->datatable = 'true';
     // $this->datagrid->enablePopover('Popover', 'Hi <b> {name} </b>');
     // creates the datagrid columns
     $column_check = new TDataGridColumn('check', '', 'center');
     $column_id = new TDataGridColumn('id', 'Id', 'right');
     $column_numero = new TDataGridColumn('numero', 'Numero', 'left');
     // add the columns to the DataGrid
     $this->datagrid->addColumn($column_check);
     $this->datagrid->addColumn($column_id);
     $this->datagrid->addColumn($column_numero);
     // create DELETE action
     $action_del = new TDataGridAction(array($this, 'onDelete'));
     $action_del->setUseButton(TRUE);
     $action_del->setButtonClass('btn btn-default');
     $action_del->setLabel(_t('Delete'));
     $action_del->setImage('fa:trash-o red fa-lg');
     $action_del->setField('id');
     $action_del->setDisplayCondition(array($this, 'checkDelete'));
     $this->datagrid->addAction($action_del);
     // create the datagrid model
     $this->datagrid->createModel();
     // creates the page navigation
     $this->pageNavigation = new TPageNavigation();
     $this->pageNavigation->setAction(new TAction(array($this, 'onReload')));
     $this->pageNavigation->setWidth($this->datagrid->getWidth());
     $this->datagrid->disableDefaultClick();
     // put datagrid inside a form
     $this->formgrid = new TForm();
     $this->formgrid->add($this->datagrid);
     // creates the delete collection button
     $this->deleteButton = new TButton('delete_collection');
     $this->deleteButton->setAction(new TAction(array($this, 'onDeleteCollection')), AdiantiCoreTranslator::translate('Delete selected'));
     $this->deleteButton->setImage('fa:remove red');
     $this->formgrid->addField($this->deleteButton);
     $gridpack = new TVBox();
     $gridpack->style = 'width: 100%';
     $gridpack->add($this->formgrid);
     $gridpack->add($this->deleteButton)->style = 'background:whiteSmoke;border:1px solid #cccccc; padding: 3px;padding: 5px;';
     $this->transformCallback = array($this, 'onBeforeLoad');
     // vertical box container
     $container = new TVBox();
     $container->style = 'width: 90%';
     // $container->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
     $container->add(TPanelGroup::pack('Title', $this->form));
     $container->add($gridpack);
     $container->add($this->pageNavigation);
     parent::add($container);
 }
 /**
  * Class constructor
  * Creates the page, the form and the listing
  */
 public function __construct()
 {
     parent::__construct();
     Usuario::checkLogin();
     parent::setDatabase('sample');
     // defines the database
     parent::setActiveRecord('Usuario');
     // defines the active record
     parent::setDefaultOrder('id', 'asc');
     // defines the default order
     parent::setFilterField('login');
     // defines the filter field
     // creates the form, with a table inside
     $this->form = new TForm('form_search_Usuario');
     $table = new TTable();
     $this->form->add($table);
     // create the form fields
     $filter = new TEntry('login');
     $filter->setValue(TSession::getValue('Usuario_login'));
     // add a row for the filter field
     $table->addRowSet(new TLabel('login:'******'find');
     $new_button = new TButton('new');
     $find_button->setAction(new TAction(array($this, 'onSearch')), _t('Find'));
     $new_button->setAction(new TAction(array('UsuarioForm', 'onEdit')), _t('New'));
     $find_button->setImage('ico_find.png');
     $new_button->setImage('ico_new.png');
     // add a row for the form actions
     $table->addRowSet($find_button, $new_button);
     // define wich are the form fields
     $this->form->setFields(array($filter, $find_button, $new_button));
     // creates a DataGrid
     $this->datagrid = new TQuickGrid();
     $this->datagrid->setHeight(320);
     // creates the datagrid columns
     $id = $this->datagrid->addQuickColumn('id', 'id', 'right', 100);
     $login = $this->datagrid->addQuickColumn('login', 'login', 'left', 200);
     $senha = $this->datagrid->addQuickColumn('senha', 'senha', 'left', 200);
     // create the datagrid actions
     $edit_action = new TDataGridAction(array('UsuarioForm', 'onEdit'));
     $delete_action = new TDataGridAction(array($this, 'onDelete'));
     // add the actions to the datagrid
     $this->datagrid->addQuickAction(_t('Edit'), $edit_action, 'id', 'ico_edit.png');
     $this->datagrid->addQuickAction(_t('Delete'), $delete_action, 'id', 'ico_delete.png');
     // create the datagrid model
     $this->datagrid->createModel();
     // create the page navigation
     $this->pageNavigation = new TPageNavigation();
     $this->pageNavigation->setAction(new TAction(array($this, 'onReload')));
     $this->pageNavigation->setWidth($this->datagrid->getWidth());
     // create the page container
     $container = new TVBox();
     $container->add($this->form);
     $container->add($this->datagrid);
     $container->add($this->pageNavigation);
     parent::add($container);
 }
 /**
  * Class constructor
  * Creates the page
  */
 function __construct()
 {
     parent::__construct();
     // create the form
     $this->form = new TForm();
     $this->form->class = 'tform';
     // creates the form field container
     $table = new TTable();
     $table->width = '100%';
     $this->form->add($table);
     // title row
     $table->addRowSet(new TLabel('Validation'), '')->class = 'tformtitle';
     // create the form fields
     $field1 = new TEntry('field1');
     $field2 = new TEntry('field2');
     $field3 = new TEntry('field3');
     $field4 = new TEntry('field4');
     $field5 = new TEntry('field5');
     $field6 = new TEntry('field6');
     $field7 = new TEntry('field7');
     $field1->addValidation('Field 1', new TMinLengthValidator(), array(3));
     // cannot be less the 3 characters
     $field2->addValidation('Field 2', new TMaxLengthValidator(), array(20));
     // cannot be greater the 20 characters
     $field3->addValidation('Field 3', new TMinValueValidator(), array(1));
     // cannot be less the 1
     $field4->addValidation('Field 4', new TMaxValueValidator(), array(10));
     // cannot be greater the 10
     $field5->addValidation('Field 5', new TRequiredValidator());
     // required field
     $field6->addValidation('Field 6', new TEmailValidator());
     // email field
     $field7->addValidation('Field 7', new TNumericValidator());
     // numeric field
     // add a row for one field
     $table->addRowSet(new TLabel('1. Min length validator (3):'), $field1);
     $table->addRowSet(new TLabel('2. Max length validator (20):'), $field2);
     $table->addRowSet(new TLabel('3. Min value validator (1):'), $field3);
     $table->addRowSet(new TLabel('4. Max value validator (10):'), $field4);
     $table->addRowSet(new TLabel('5. Required validator:'), $field5);
     $table->addRowSet(new TLabel('6. Email validator:'), $field6);
     $table->addRowSet(new TLabel('7. Numeric validator:'), $field7);
     // creates the action button
     $button1 = new TButton('action1');
     $button1->setAction(new TAction(array($this, 'onSave')), 'Save');
     $button1->setImage('ico_save.png');
     // add a row for the button
     $table->addRowSet($button1, '')->class = 'tformaction';
     // define wich are the form fields
     $this->form->setFields(array($field1, $field2, $field3, $field4, $field5, $field6, $field7, $button1));
     // wrap the page content using vertical box
     $vbox = new TVBox();
     $vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
     $vbox->add($this->form);
     parent::add($vbox);
 }
 /**
  * Constructor Method
  * Creates the page, the search form and the listing
  */
 public function __construct()
 {
     parent::__construct();
     // creates a new form
     $this->form = new TForm('form_standard_seek');
     // creates a new table
     $table = new TTable();
     // adds the table into the form
     $this->form->add($table);
     // create the form fields
     $display_field = new TEntry('display_field');
     // keeps the field's value
     $display_field->setValue(TSession::getValue('tstandardseek_display_value'));
     // add a row for the filter field
     $row = $table->addRow();
     $row->addCell(new TLabel('Field:'));
     $row->addCell($display_field);
     // create the action button
     $find_button = new TButton('busca');
     // define the button action
     $find_button->setAction(new TAction(array($this, 'onSearch')), TAdiantiCoreTranslator::translate('Search'));
     $find_button->setImage('ico_find.png');
     // add a row for the button in the table
     $row = $table->addRow();
     $row->addCell($find_button);
     // define wich are the form fields
     $this->form->setFields(array($display_field, $find_button));
     // creates a new datagrid
     $this->datagrid = new TDataGrid();
     // create two datagrid columns
     $id = new TDataGridColumn('id', 'ID', 'right', 70);
     $display = new TDataGridColumn('display_field', 'Field', 'left', 220);
     // add the columns to the datagrid
     $this->datagrid->addColumn($id);
     $this->datagrid->addColumn($display);
     // create a datagrid action
     $action1 = new TDataGridAction(array($this, 'onSelect'));
     $action1->setLabel('Selecionar');
     $action1->setImage('ico_apply.png');
     $action1->setField('id');
     // add the actions to the datagrid
     $this->datagrid->addAction($action1);
     // create the datagrid model
     $this->datagrid->createModel();
     // creates the paginator
     $this->pageNavigation = new TPageNavigation();
     $this->pageNavigation->setAction(new TAction(array($this, 'onReload')));
     $this->pageNavigation->setWidth($this->datagrid->getWidth());
     // creates the container
     $vbox = new TVBox();
     $vbox->add($this->form);
     $vbox->add($this->datagrid);
     $vbox->add($this->pageNavigation);
     // add the container to the page
     parent::add($vbox);
 }
示例#27
0
 /**
  * Class constructor
  * Creates the page and the registration form
  */
 function __construct()
 {
     parent::__construct();
     $table = new TTable();
     $table->width = '100%';
     // creates the form
     $this->form = new TForm('form_User');
     $this->form->class = 'tform';
     $this->form->style = 'width: 450px;margin:auto; margin-top:10px;';
     // add the notebook inside the form
     $this->form->add($table);
     // create the form fields
     $login = new TEntry('login');
     $password = new TPassword('password');
     // define the sizes
     $login->setSize(320, 40);
     $password->setSize(320, 40);
     $login->style = 'height:35px; font-size:14px;float:left;border-bottom-left-radius: 0;border-top-left-radius: 0;';
     $password->style = 'height:35px;margin-bottom: 15px;font-size:14px;float:left;border-bottom-left-radius: 0;border-top-left-radius: 0;';
     $row = $table->addRow();
     $row->addCell(new TLabel('Login'))->colspan = 2;
     $row->class = 'tformtitle';
     $login->placeholder = _t('User');
     $password->placeholder = _t('Password');
     $user = '******';
     $locker = '<span style="float:left;width:35px;margin-left:45px;height:35px;" class="input-group-addon"><span class="glyphicon glyphicon-lock"></span></span>';
     $container1 = new TElement('div');
     $container1->add($user);
     $container1->add($login);
     $container2 = new TElement('div');
     $container2->add($locker);
     $container2->add($password);
     $row = $table->addRow();
     $row->addCell($container1)->colspan = 2;
     // add a row for the field password
     $row = $table->addRow();
     $row->addCell($container2)->colspan = 2;
     // create an action button (save)
     $save_button = new TButton('save');
     // define the button action
     $save_button->setAction(new TAction(array($this, 'onLogin')), _t('Log in'));
     $save_button->class = 'btn btn-success btn-defualt';
     $save_button->style = 'margin-left:32px;width:355px;height:40px;border-radius:6px;font-size:18px';
     $row = $table->addRow();
     $row->class = 'tformaction';
     $cell = $row->addCell($save_button);
     $cell->colspan = 2;
     $this->form->setFields(array($login, $password, $save_button));
     // add the form to the page
     $caixa = new TVBox();
     $caixa->style = "text-align:center";
     $caixa->add(new TImage("app/images/pgo.png"));
     $caixa->add($this->form);
     parent::add($caixa);
 }
 /**
  * Class constructor
  * Creates the page and the registration form
  */
 function __construct()
 {
     parent::__construct();
     // security check
     if (TSession::getValue('logged') !== TRUE) {
         throw new Exception(_t('Not logged'));
     }
     // security check
     TTransaction::open('library');
     if (User::newFromLogin(TSession::getValue('login'))->role->mnemonic !== 'LIBRARIAN') {
         throw new Exception(_t('Permission denied'));
     }
     TTransaction::close();
     // defines the database
     parent::setDatabase('library');
     // defines the active record
     parent::setActiveRecord('Collection');
     // creates the form
     $this->form = new TQuickForm('form_Collection');
     $this->form->class = 'tform';
     $this->form->style = 'width: 600px';
     $this->form->setFormTitle(_t('Collections', ''));
     // create the form fields
     $id = new TEntry('id');
     $description = new TEntry('description');
     $id->setEditable(FALSE);
     // define the sizes
     $this->form->addQuickField(_t('Code'), $id, 100);
     $this->form->addQuickField(_t('Description'), $description, 200);
     // define the form action
     $this->form->addQuickAction(_t('Save'), new TAction(array($this, 'onSave')), 'ico_save.png');
     $this->form->addQuickAction(_t('New'), new TAction(array($this, 'onEdit')), 'ico_new.png');
     // creates a DataGrid
     $this->datagrid = new TQuickGrid();
     $this->datagrid->setHeight(320);
     // creates the datagrid columns
     $this->datagrid->addQuickColumn(_t('Code'), 'id', 'left', 100, new TAction(array($this, 'onReload')), array('order', 'id'));
     $this->datagrid->addQuickColumn(_t('Description'), 'description', 'left', 440, new TAction(array($this, 'onReload')), array('order', 'description'));
     // add the actions to the datagrid
     $this->datagrid->addQuickAction(_t('Edit'), new TDataGridAction(array($this, 'onEdit')), 'id', 'ico_edit.png');
     $this->datagrid->addQuickAction(_t('Delete'), new TDataGridAction(array($this, 'onDelete')), 'id', 'ico_delete.png');
     // create the datagrid model
     $this->datagrid->createModel();
     // creates the page navigation
     $this->pageNavigation = new TPageNavigation();
     $this->pageNavigation->setAction(new TAction(array($this, 'onReload')));
     $this->pageNavigation->setWidth($this->datagrid->getWidth());
     // creates the page structure using a vbox
     $container = new TVBox();
     $container->add($this->form);
     $container->add($this->datagrid);
     $container->add($this->pageNavigation);
     // add the vbox inside the page
     parent::add($container);
 }
 public function __construct()
 {
     parent::__construct();
     $qform = new TQuickForm();
     $qform->class = 'tform';
     $qform->addQuickAction('Open Input dialog', new TAction(array($this, 'onInputDialog')), 'ico_open.png');
     $vbox = new TVBox();
     $vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
     $vbox->add($qform);
     parent::add($vbox);
 }
 /**
  * Class constructor
  * Creates the page
  */
 function __construct()
 {
     parent::__construct();
     // create the form
     $this->form = new TForm();
     $this->form->class = 'tform';
     // creates the form field container
     $table = new TTable();
     $table->width = '100%';
     $this->form->add($table);
     // title row
     $table->addRowSet(new TLabel('Automatic selections'), '')->class = 'tformtitle';
     // create the form fields
     // parameters (name, database, model, key, value)
     $radio = new TDBRadioGroup('radio', 'samples', 'Category', 'id', 'name');
     $check = new TDBCheckGroup('check', 'samples', 'Category', 'id', 'name');
     $combo = new TDBCombo('combo', 'samples', 'Category', 'id', 'name');
     $select = new TDBSelect('select', 'samples', 'Category', 'id', 'name');
     $search = new TDBMultiSearch('search', 'samples', 'Category', 'id', 'name');
     $autocomp = new TDBEntry('autocomplete', 'samples', 'Category', 'name');
     $search->setMinLength(3);
     $search->setOperator('like');
     //default data:
     $radio->setValue(2);
     $check->setValue(array(1, 3));
     $combo->setValue(2);
     $select->setValue(array(1, 3));
     $search->setValue(array(99 => 'Predefined'));
     $radio->setLayout('horizontal');
     $check->setLayout('horizontal');
     $combo->setSize(160);
     $select->setSize(200, 70);
     $search->setSize(300, 70);
     // add the fields to the table
     $table->addRowSet(new TLabel('TDBRadioGroup:'), $radio);
     $table->addRowSet(new TLabel('TDBCheckGroup:'), $check);
     $table->addRowSet(new TLabel('TDBCombo:'), $combo);
     $table->addRowSet(new TLabel('TDBSelect:'), $select);
     $table->addRowSet(new TLabel('TDBMultiSearch:'), $search);
     $table->addRowSet(new TLabel('TDBEntry:'), $autocomp);
     // creates the action button
     $button1 = new TButton('action1');
     // define the button action
     $button1->setAction(new TAction(array($this, 'onSave')), 'Save');
     $button1->setImage('ico_save.png');
     $table->addRowSet($button1, '')->class = 'tformaction';
     // define wich are the form fields
     $this->form->setFields(array($radio, $check, $combo, $select, $search, $autocomp, $button1));
     // wrap the page content using vertical box
     $vbox = new TVBox();
     $vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
     $vbox->add($this->form);
     parent::add($vbox);
 }