/** * 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 * 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); }
/** * 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(); $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); }
/** * BancoDataGrid constructor. */ public function __construct() { parent::__construct(); parent::setDatabase('sobcontrole'); parent::setActiveRecord('banco'); parent::setFilterField('nome'); parent::setDefaultOrder('nome', 'asc'); /** @var TQuickForm $this */ $this->form = new \Adianti\Widget\Wrapper\TQuickForm('BancoDataGrid'); $this->form->setFormTitle('Cadastro Bancos'); $this->form->class = 'tform'; $nome = new \Adianti\Widget\Form\TEntry('nome'); $this->form->addQuickField('Nome: ', $nome, 250); $this->form->addQuickAction('Buscar', new \Adianti\Control\TAction(array($this, 'onSearch')), 'ico_find.png'); $this->form->addQuickAction('Novo', new \Adianti\Control\TAction(array('BancoFormView', 'onClear')), 'ico_new.png'); $this->form->setData(\Adianti\Registry\TSession::getValue('banco_filtro')); $this->datagrid = new \Adianti\Widget\Wrapper\TQuickGrid(); $this->datagrid->style = 'width: 100%'; $this->datagrid->setHeight(300); $this->datagrid->addQuickColumn('ID', 'idbanco', 'right', 50, new \Adianti\Control\TAction(array($this, 'onReload')), array('order', 'idbanco')); $this->datagrid->addQuickColumn('Nome', 'nome', 'right', 250, new \Adianti\Control\TAction(array($this, 'onReload')), array('order', 'nome')); $this->datagrid->addQuickColumn('Sigla', 'sigla', 'right', 100, new \Adianti\Control\TAction(array($this, 'onReload')), array('order', 'sigla')); $this->datagrid->addQuickAction('Editar', new \Adianti\Widget\Datagrid\TDataGridAction(array('BancoFormView', 'onEdit')), 'idbanco', 'ico_edit.png'); $this->datagrid->addQuickAction('Excluir', new \Adianti\Widget\Datagrid\TDataGridAction(array($this, 'onDelete')), 'idbanco', 'ico_delete.png'); $this->datagrid->createModel(); $this->pageNavigation = new \Adianti\Widget\Datagrid\TPageNavigation(); $this->pageNavigation->setAction(new \Adianti\Control\TAction(array($this, 'onReload'))); $this->pageNavigation->setWidth($this->datagrid->getWidth()); $vbox = new TVBox(); $vbox->add(new \Adianti\Widget\Util\TXMLBreadCrumb('menu.xml', 'BancoFormView')); $vbox->add($this->form); $vbox->add($this->datagrid); $vbox->add($this->pageNavigation); 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(); // 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); }
/** * 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); }
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); }
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); }
/** * 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); }
public function __construct() { parent::__construct(); // creates one datagrid $this->datagrid = new TQuickGrid(); $this->datagrid->setHeight(320); // add the columns $this->datagrid->addQuickColumn('Code', 'code', 'right', 200); $this->datagrid->addQuickColumn('Name', 'name', 'left', 400); // add the actions $this->datagrid->addQuickAction('Delete', new TDataGridAction(array($this, 'onDelete')), 'code', 'ico_delete.png'); // creates the datagrid model $this->datagrid->createModel(); $this->form = new TQuickForm('over_form'); $this->form->class = 'tform'; $this->form->setFormTitle('Add items'); $this->form->addQuickAction('Add', new TAction(array('NewWindowForm', 'onLoad')), 'ico_add.png'); // wrap the page content using vertical box $vbox = new TVBox(); $vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__)); $vbox->add($this->datagrid); $vbox->add(' '); $vbox->add($this->form); 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); }
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); }
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); }
/** * 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 $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); }
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 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::setDatabase('samples'); // defines the database parent::setActiveRecord('Product'); // defines the active record parent::setDefaultOrder('id', 'asc'); // defines the default order parent::addFilterField('description', 'like'); // add a filter field parent::addFilterField('unity', '='); // add a filter field // creates the form, with a table inside $this->form = new TQuickForm('form_search_Product'); $this->form->class = 'tform'; $this->form->style = 'width: 650px'; $this->form->setFormTitle('Products'); $units = array('PC' => 'Pieces', 'GR' => 'Grain'); // create the form fields $description = new TEntry('description'); $unit = new TCombo('unity'); $unit->addItems($units); // add a row for the filter field $this->form->addQuickField('Description', $description, 200); $this->form->addQuickField('Unit', $unit, 200); $this->form->setData(TSession::getValue('Product_filter_data')); $this->form->addQuickAction(_t('Find'), new TAction(array($this, 'onSearch')), 'ico_find.png'); $this->form->addQuickAction(_t('New'), new TAction(array('ProductForm', 'onEdit')), 'ico_new.png'); // creates a DataGrid $this->datagrid = new TQuickGrid(); $this->datagrid->setHeight(320); // creates the datagrid columns $id = $this->datagrid->addQuickColumn('ID', 'id', 'center', 50); $description = $this->datagrid->addQuickColumn('Description', 'description', 'left', 300); $stock = $this->datagrid->addQuickColumn('Stock', 'stock', 'right', 70); $sale_price = $this->datagrid->addQuickColumn('Sale Price', 'sale_price', 'right', 70); $unity = $this->datagrid->addQuickColumn('Unit', 'unity', 'right', 70); // create the datagrid actions $edit_action = new TDataGridAction(array('ProductForm', '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(new TXMLBreadCrumb('menu.xml', 'ProductList')); $container->add($this->form); $container->add($this->datagrid); $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, 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 */ 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); }
/** * 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, the form and the listing */ public function __construct() { parent::__construct(); // defines the database parent::setDatabase('samples'); // defines the active record parent::setActiveRecord('Project'); // defines the filter field parent::setFilterField('name'); // creates the form $this->form = new TForm('form_search_Project'); // creates a table $table = new TTable(); // add the table inside the form $this->form->add($table); // create the form fields $filter = new TEntry('name'); $filter->setValue(TSession::getValue('Project_name')); // add a row for the filter field $table->addRowSet(new TLabel('name:'), $filter); // create two action buttons to the form $find_button = new TButton('find'); $new_button = new TButton('new'); $find_button->setAction(new TAction(array($this, 'onSearch')), _t('Find')); $find_button->setImage('ico_find.png'); $new_button->setAction(new TAction(array('ProjectFormView', 'onEdit')), _t('New')); $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', 'left', 50); $name = $this->datagrid->addQuickColumn('Name', 'name', 'left', 190); $start = $this->datagrid->addQuickColumn('Start', 'start_date', 'left', 80); $end = $this->datagrid->addQuickColumn('End', 'end_date', 'left', 80); $customer = $this->datagrid->addQuickColumn('customer', 'customer', 'left', 100); // add the actions to the datagrid $this->datagrid->addQuickAction(_t('Edit'), new TDataGridAction(array('ProjectFormView', 'onEdit')), 'id', 'ico_edit.png'); $this->datagrid->addQuickAction(_t('Delete'), new TDataGridAction(array($this, 'onDelete')), 'id', 'ico_delete.png'); $this->datagrid->addQuickAction(_t('Detail'), new TDataGridAction(array('BacklogFormView', 'onSetProject')), 'id'); // 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()); // pack the elements using a vertical box $vbox = new TVBox(); $vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__)); $vbox->add($this->form); $vbox->add($this->datagrid); $vbox->add($this->pageNavigation); // add the box inside the page parent::add($vbox); }