Ejemplo n.º 1
0
 /**
  * Constructor method
  */
 function __construct($e)
 {
     parent::__construct('Error Report');
     parent::setPosition(200, 100);
     parent::setSize(700, 400);
     $this->e = $e;
 }
 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();
     parent::setTitle('New Window');
     parent::setSize(600, 370);
     parent::setPosition(100, 100);
     // create the form using TQuickForm class
     $this->form = new TQuickForm();
     // create the notebook
     $notebook = new TNotebook(530, 260);
     // adds the notebook page
     $notebook->appendPage('Quick form component', $this->form);
     // create the form fields
     $id = new TEntry('id');
     $description = new TEntry('description');
     $date = new TDate('date');
     $text = new TText('text');
     // add the fields inside the form
     $this->form->addQuickField('Id', $id, 40);
     $this->form->addQuickField('Description', $description, 200);
     $this->form->addQuickField('Date', $date, 100);
     $this->form->addQuickField('Text', $text, 120);
     // define the form action
     $this->form->addQuickAction('Save', new TAction(array($this, 'onSave')), 'ico_save.png');
     // add the form inside the page
     parent::add($notebook);
 }
 /**
  * Class constructor
  * Creates the page
  */
 function __construct()
 {
     parent::__construct();
     parent::setTitle('New Window');
     parent::setSize(800, 400);
     parent::add(new TLabel('Another Window'));
 }
Ejemplo n.º 5
0
 /**
  * Constructor method
  */
 function __construct($e)
 {
     parent::__construct('Error Report');
     parent::connect_simple('destroy', array('Gtk', 'main_quit'));
     parent::setPosition(200, 100);
     parent::setSize(700, 400);
     $this->e = $e;
 }
 public function __construct()
 {
     parent::__construct();
     //checa para verificar se esta logado
     Usuario::checkLogin();
     //verifica o nivel de usuario que pode acessar
     Usuario::acesso(3);
 }
 /**
  * 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
  */
 function __construct()
 {
     parent::__construct();
     parent::setTitle('Detail Window');
     parent::setSize(400, 300);
     $this->label = new TLabel('');
     $this->label->setFontColor('#FF0000');
     $this->label->setFontSize(12);
     // add the form inside the page
     parent::add($this->label);
 }
Ejemplo n.º 9
0
 public function __construct()
 {
     TSession::freeSession();
     parent::__construct();
     $this->setTitle("Login");
     $this->setSize(300, 200);
     $this->form = new TQuickForm('login');
     $login = new TEntry('user');
     $senha = new TPassword('senha');
     $this->form->addQuickField('Login', $login, 200, new TRequiredValidator());
     $this->form->addQuickField('Senha', $senha, 200, new TRequiredValidator());
     $this->form->addQuickAction('Logar', new TAction(array($this, 'logar')));
     parent::add($this->form);
 }
Ejemplo n.º 10
0
 /**
  * Class constructor
  * Creates the page
  */
 function __construct()
 {
     parent::__construct();
     parent::setSize(570, 200);
     // create the form using TQuickForm class
     $this->form = new TQuickForm();
     $this->form->class = 'tform';
     $this->form->setFormTitle('Quick form');
     $this->form->style = 'width: 500px';
     // create the form fields
     $code = new TEntry('code');
     $name = new TEntry('name');
     // add the fields inside the form
     $this->form->addQuickField('Code', $code, 100);
     $this->form->addQuickField('Name', $name, 400);
     // define the form action
     $this->form->addQuickAction('Save', new TAction(array($this, 'onSave')), 'ico_save.png');
     parent::add($this->form);
 }
Ejemplo n.º 11
0
 /**
  * Class constructor
  * Creates the page, the search form and the listing
  */
 public function __construct()
 {
     parent::__construct();
     parent::setSize(600, 400);
     parent::setTitle('Search record');
     new TSession();
     // creates the form
     $this->form = new TQuickForm('form_search_city');
     // create the form fields
     $name = new TEntry('name');
     $name->setValue(TSession::getValue('city_name'));
     // add the form fields
     $this->form->addQuickField('name', $name, 200);
     // define the form action
     $this->form->addQuickAction('Find', new TAction(array($this, 'onSearch')), 'ico_find.png');
     // creates a DataGrid
     $this->datagrid = new TQuickGrid();
     $this->datagrid->setHeight(230);
     // creates the datagrid columns
     $this->datagrid->addQuickColumn('Id', 'id', 'right', 40);
     $this->datagrid->addQuickColumn('Name', 'name', 'left', 340);
     // creates two datagrid actions
     $this->datagrid->addQuickAction('Select', new TDataGridAction(array($this, 'onSelect')), 'id', 'ico_apply.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 table
     $table = new TTable();
     $table->addRow()->addCell($this->form);
     $table->addRow()->addCell($this->datagrid);
     $table->addRow()->addCell($this->pageNavigation);
     // add the table inside the page
     parent::add($table);
 }
 public function __construct()
 {
     // parent classs constructor
     parent::__construct();
     parent::setSize(0.8, 0.8);
     // label to present the docs
     $this->label = new TText('name');
     $this->label->setSize(690, 130);
     // notebook to put the scroll inside
     $note = new TNotebook(700, 150);
     $note->appendPage('Explanation', $this->label);
     // scroll to put the source inside
     $scroll2 = new TScroll();
     $scroll2->setSize(700, 250);
     $this->source = new TSourceCode();
     $scroll2->add($this->source);
     // create a table to organize the layout
     $page = new TTable();
     $row1 = $page->addRow();
     $row2 = $page->addRow();
     $row1->addCell($note);
     $row2->addCell($scroll2);
     parent::add($this->source);
 }
Ejemplo n.º 13
0
 /**
  * constructor method
  */
 public function __construct()
 {
     parent::__construct();
     // creates the form
     $this->form = new TForm('form_item_Seek');
     // creates the table
     $table = new TTable();
     // add the table inside the form
     $this->form->add($table);
     // create the form fields
     $barcode = new TEntry('barcode');
     // keep the session value
     $barcode->setValue(TSession::getValue('test_item_barcode'));
     // add the field inside the table
     $row = $table->addRow();
     $row->addCell(new TLabel(_t('Barcode')));
     $row->addCell($barcode);
     // create a find button
     $find_button = new TButton('search');
     // define the button action
     $find_button->setAction(new TAction(array($this, 'onSearch')), 'Search');
     $find_button->setImage('ico_find.png');
     // add a row for the find button
     $row = $table->addRow();
     $row->addCell($find_button);
     // define wich are the form fields
     $this->form->setFields(array($barcode, $find_button));
     // create the datagrid
     $this->datagrid = new TDataGrid();
     // create the datagrid columns
     $id = new TDataGridColumn('id', _t('Code'), 'right', 70);
     $barcode = new TDataGridColumn('barcode', _t('Barcode'), 'left', 100);
     $title = new TDataGridColumn('title', _t('Title'), 'left', 200);
     $order1 = new TAction(array($this, 'onReload'));
     $order2 = new TAction(array($this, 'onReload'));
     $order1->setParameter('order', 'id');
     $order2->setParameter('order', 'barcode');
     // define the column actions
     $id->setAction($order1);
     $barcode->setAction($order2);
     // add the columns inside the datagrid
     $this->datagrid->addColumn($id);
     $this->datagrid->addColumn($barcode);
     $this->datagrid->addColumn($title);
     // create one datagrid action
     $action1 = new TDataGridAction(array($this, 'onSelect'));
     $action1->setLabel('Selecionar');
     $action1->setImage('ico_apply.png');
     $action1->setField('barcode');
     // add the action to the datagrid
     $this->datagrid->addAction($action1);
     // create the datagrid model
     $this->datagrid->createModel();
     // create the page navigator
     $this->pageNavigation = new TPageNavigation();
     $this->pageNavigation->setAction(new TAction(array($this, 'onReload')));
     $this->pageNavigation->setWidth($this->datagrid->getWidth());
     // create a table for layout
     $table = new TTable();
     // create a row for the form
     $row = $table->addRow();
     $row->addCell($this->form);
     // create a row for the datagrid
     $row = $table->addRow();
     $row->addCell($this->datagrid);
     // create a row for the page navigator
     $row = $table->addRow();
     $row->addCell($this->pageNavigation);
     // add the table inside the page
     parent::add($table);
 }
Ejemplo n.º 14
0
 /**
  * constructor method
  */
 public function __construct()
 {
     parent::__construct();
     parent::setSize(TSession::getValue('width'), TSession::getValue('height'));
     parent::setTitle(TSession::getValue('titulo'));
     new TSession();
     // creates the form
     $this->form = new TForm('formSeekStandart');
     // creates the table
     $table = new TTable();
     // add the table inside the form
     $this->form->add($table);
     // create the form fields
     $name = new TEntry('name');
     // keep the session value
     $name->setValue(TSession::getValue('name'));
     // add the field inside the table
     $row = $table->addRow();
     $row->addCell(new TLabel($this->getFiltro() . ' :'));
     $row->addCell($name);
     // create a find button
     $find_button = new TButton('search');
     // define the button action
     $find_button->setAction(new TAction(array($this, 'onSearch')), 'Search');
     $find_button->setImage('ico_find.png');
     // add a row for the find button
     $row = $table->addRow();
     $row->addCell($find_button);
     // define wich are the form fields
     $this->form->setFields(array($name, $find_button));
     // create the datagrid
     $this->datagrid = new TDataGrid();
     $i = 1;
     // create the datagrid columns
     if (TSession::getValue('campos')) {
         foreach (TSession::getValue('campos') as $field => $label) {
             $campos[] = new TDataGridColumn($field, $label, 'right', 200);
         }
         foreach ($campos as $campo) {
             // add the columns inside the datagrid
             $this->datagrid->addColumn($campo);
         }
     }
     // create one datagrid action
     $action1 = new TDataGridAction(array($this, 'onSelect'));
     $action1->setLabel('Selecionar');
     $action1->setImage('ico_apply.png');
     $action1->setField(TSession::getValue('key'));
     // add the action to the datagrid
     $this->datagrid->addAction($action1);
     // create the datagrid model
     $this->datagrid->createModel();
     // create the page navigator
     $this->pageNavigation = new TPageNavigation();
     $this->pageNavigation->setAction(new TAction(array($this, 'onReload')));
     $this->pageNavigation->setWidth($this->datagrid->getWidth());
     // create a table for layout
     $table = new TTable();
     // create a row for the form
     $row = $table->addRow();
     $row->addCell($this->form);
     // create a row for the datagrid
     $row = $table->addRow();
     $row->addCell($this->datagrid);
     // create a row for the page navigator
     $row = $table->addRow();
     $row->addCell($this->pageNavigation);
     // add the table inside the page
     parent::add($table);
 }
Ejemplo n.º 15
0
 /**
  * constructor method
  */
 public function __construct()
 {
     parent::__construct();
     new TSession();
     // creates the form
     $this->form = new TForm('form_city_Seek');
     // creates the table
     $table = new TTable();
     // add the table inside the form
     $this->form->add($table);
     // create the form fields
     $name = new TEntry('name');
     $code = new TEntry('id');
     $crm_id = new TDBCombo('crm_id', 'db_crmbf', 'CRM', 'id', 'titulo');
     $tiporegistro_id = new TDBCombo('tiporegistro_id', 'db_crmbf', 'RegistroTipo', 'id', 'nome');
     $registro = new TText('registro');
     $temporegistro = new TEntry('tempo_registro');
     //        $temporegistro->setEditable(false);
     $dataregistro = new TDate('data_registro');
     $hora_registro = new TEntry('hora_registro');
     $numero_registro = new TEntry('numero_registro');
     // keep the session value
     //  $name->setValue(TSession::getValue('test_city_name'));
     // add the field inside the table
     //        $row=$table->addRow();
     //        $row->addCell(new TLabel('Name:'));
     //        $row->addCell($name);
     $code->setEditable(FALSE);
     $code->setSize(100);
     $crm_id->setSize(320);
     $registro->setSize(320);
     $temporegistro->setSize(160);
     //$temporegistro->setValue(date("d/m/Y H:i:s"));
     $tiporegistro_id->setSize(160);
     //$dataregistro->setRange(0,1000,1);
     $dataregistro->setSize(90);
     // $hora_registro->setRange(0,100,1);
     $hora_registro->setSize(150);
     $hora_registro->setTip('Horario EX: 8:14');
     $numero_registro->setSize(320);
     $row = $table->addRow();
     $row->addCell(new TLabel('Code:'));
     $row->addCell($code);
     // add a row for the field name
     $row = $table->addRow();
     $row->addCell(new TLabel('CRM Titulo:'));
     $cell = $row->addCell($crm_id);
     // add a row for the field Telefone
     $row = $table->addRow();
     $row->addCell(new TLabel('Tipo Registro:'));
     $cell = $row->addCell($tiporegistro_id);
     // add a row for the field Email
     $row = $table->addRow();
     $row->addCell(new TLabel('Tempo:'));
     $cell = $row->addCell($temporegistro);
     // add a row for the field celular
     $row = $table->addRow();
     $row->addCell(new TLabel('Data:'));
     $cell = $row->addCell($dataregistro);
     // add a row for the field skype
     $row = $table->addRow();
     $row->addCell(new TLabel('Hora:'));
     $cell = $row->addCell($hora_registro);
     // add a row for the field endereco
     $row = $table->addRow();
     $row->addCell(new TLabel('Numero Registro:'));
     $row->addCell($numero_registro);
     // add a row for the field name
     $row = $table->addRow();
     $row->addCell(new TLabel('Registro:'));
     $cell = $row->addCell($registro);
     // create a find button
     $find_button = new TButton('search');
     // define the button action
     $find_button->setAction(new TAction(array($this, 'onSearch')), 'Search');
     $find_button->setImage('ico_find.png');
     // add a row for the find button
     $row = $table->addRow();
     $row->addCell($find_button);
     // define wich are the form fields
     $this->form->setFields(array($name, $find_button));
     // create the datagrid
     $this->datagrid = new TDataGrid();
     // create the datagrid columns
     $id = new TDataGridColumn('id', 'Id', 'right', 70);
     $name = new TDataGridColumn('name', 'Name', 'left', 220);
     $state = new TDataGridColumn('state', 'Estado', 'left', 80);
     $order1 = new TAction(array($this, 'onReload'));
     $order2 = new TAction(array($this, 'onReload'));
     $order1->setParameter('order', 'id');
     $order2->setParameter('order', 'name');
     // define the column actions
     $id->setAction($order1);
     $name->setAction($order2);
     // add the columns inside the datagrid
     $this->datagrid->addColumn($id);
     $this->datagrid->addColumn($name);
     $this->datagrid->addColumn($state);
     // create one datagrid action
     $action1 = new TDataGridAction(array($this, 'onSelect'));
     $action1->setLabel('Selecionar');
     $action1->setImage('ico_apply.png');
     $action1->setField('id');
     // add the action to the datagrid
     $this->datagrid->addAction($action1);
     // create the datagrid model
     $this->datagrid->createModel();
     // create the page navigator
     $this->pageNavigation = new TPageNavigation();
     $this->pageNavigation->setAction(new TAction(array($this, 'onReload')));
     $this->pageNavigation->setWidth($this->datagrid->getWidth());
     // create a table for layout
     $table = new TTable();
     // create a row for the form
     $row = $table->addRow();
     $row->addCell($this->form);
     // create a row for the datagrid
     $row = $table->addRow();
     $row->addCell($this->datagrid);
     // create a row for the page navigator
     $row = $table->addRow();
     $row->addCell($this->pageNavigation);
     // add the table inside the page
     parent::add($table);
 }
Ejemplo n.º 16
0
 /**
  * Class constructor
  * Creates the page and the registration form
  */
 function __construct()
 {
     parent::__construct();
     // creates the form
     $this->form = new TForm('form_crm');
     // creates a table
     //        $table = new TTable;
     $panel = new TPanel(100, 10);
     // add the notebook inside the form
     $this->form->add($panel);
     $panel->put(new TLabel('CRM Titulo:'), 0, 0);
     // $notebook->appendPage('Cidade', $table_contact);
     //        $notebook->appendPage('Skill (aggregation)', $table_skill);
     // create the form fields
     $code = new TEntry('id');
     //        $crm_id = new TDBCombo('crm_id', 'db_crmbf', 'CRM', 'id', 'titulo');
     $crm_id = new TEntry('crm_nome');
     $tiporegistro_id = new TDBCombo('tiporegistro_id', 'db_crmbf', 'RegistroTipo', 'id', 'nome');
     $registro = new TText('registro');
     $temporegistro = new TEntry('tempo_registro');
     //        $temporegistro->setEditable(false);
     $dataregistro = new TDate('data_registro');
     $hora_registro = new TEntry('hora_registro');
     $numero_registro = new TEntry('numero_registro');
     // add field validators
     $registro->addValidation('Nome', new TRequiredValidator());
     // $cidade_id->addValidation('Cidade', new TRequiredValidator);
     // $birthdate->addValidation('Birthdate', new TRequiredValidator);
     //        $cidade_id->addValidation('Category', new TRequiredValidator);
     //$obj = new CidadeFormList;
     //$cidade_id->setAction(new TAction(array($obj, 'onReload')));
     //        $itemGender = array();
     //        $itemGender['M'] = 'Male';
     //        $itemGender['F'] = 'Female';
     //        // add the combo options
     //        $gender->addItems($itemGender);
     //        $gender->setLayout('horizontal');
     //
     //        $itemStatus = array();
     //        $itemStatus['S'] = 'Single';
     //        $itemStatus['C'] = 'Committed';
     //        $itemStatus['M'] = 'Married';
     //        $status->addItems($itemStatus);
     // define some properties for the form fields
     $code->setEditable(FALSE);
     $code->setSize(100);
     $crm_id->setSize(320);
     $registro->setSize(320);
     $temporegistro->setSize(160);
     //$temporegistro->setValue(date("d/m/Y H:i:s"));
     $tiporegistro_id->setSize(160);
     //$dataregistro->setRange(0,1000,1);
     $dataregistro->setSize(90);
     // $hora_registro->setRange(0,100,1);
     $hora_registro->setSize(150);
     $hora_registro->setTip('Horario EX: 8:14');
     $numero_registro->setSize(320);
     $panel->put("Codigo: ", 10, 25);
     $panel->put("CRM: ", 10, 50);
     $panel->put("Tipo: ", 10, 75);
     $panel->put("Tempo: ", 10, 100);
     $panel->put("Data: ", 10, 125);
     $panel->put("Horario: ", 10, 150);
     $panel->put("Nº Registro: ", 10, 175);
     $panel->put("Registro: ", 10, 200);
     $panel->put($code, 100, 25);
     $panel->put($crm_id, 100, 50);
     $panel->put($tiporegistro_id, 100, 75);
     $panel->put($temporegistro, 100, 100);
     $panel->put($dataregistro, 100, 125);
     $panel->put($hora_registro, 100, 150);
     $panel->put($numero_registro, 100, 175);
     $panel->put($registro, 100, 200);
     //        $row = $table->addRow();
     //        $row->addCell(new TLabel('Code:'));
     //        $row->addCell($code);
     //
     //        // add a row for the field name
     //        $row = $table->addRow();
     //        $row->addCell(new TLabel('CRM Titulo:'));
     //        $cell = $row->addCell($crm_id);
     //
     //        // add a row for the field Telefone
     //        $row = $table->addRow();
     //        $row->addCell(new TLabel('Tipo Registro:'));
     //        $cell = $row->addCell($tiporegistro_id);
     //
     //        // add a row for the field Email
     //        $row = $table->addRow();
     //        $row->addCell(new TLabel('Tempo:'));
     //        $cell = $row->addCell($temporegistro);
     //
     //        // add a row for the field celular
     //        $row = $table->addRow();
     //        $row->addCell(new TLabel('Data:'));
     //        $cell = $row->addCell($dataregistro);
     //
     //        // add a row for the field skype
     //        $row = $table->addRow();
     //        $row->addCell(new TLabel('Hora:'));
     //        $cell = $row->addCell($hora_registro);
     //
     //        // add a row for the field endereco
     //        $row = $table->addRow();
     //        $row->addCell(new TLabel('Numero Registro:'));
     //        $row->addCell($numero_registro);
     //
     //        // add a row for the field name
     //        $row = $table->addRow();
     //        $row->addCell(new TLabel('Registro:'));
     //        $cell = $row->addCell($registro);
     // add a row for the field Category
     //        $row = $table_data->addRow();
     //        $row->addCell(new TLabel('Cidade:'));
     //        $cell = $row->addCell($cidade_id);
     // add a row for the field city
     //        $row=$table_data->addRow();
     //        $row->addCell(new TLabel('Cidade:'));
     //        $cell = $row->addCell($cidade_id);
     /*
      // add a row for the field Phone
      $row = $table_data->addRow();
      $row->addCell(new TLabel('Phone:'));
      $row->addCell($phone);
     
      // add a row for the field BirthDate
      $row->addCell(new TLabel('BirthDate:'));
      $row->addCell($birthdate);
     
      // add a row for the field status
      $row = $table_data->addRow();
      $row->addCell(new TLabel('Status:'));
      $cell = $row->addCell($status);
     
      // add a row for the field Email
      $row->addCell(new TLabel('Email:'));
      $cell = $row->addCell($email);
     
      // add a row for the field gender
      $row->addCell(new TLabel('Gender:'));
      $row->addCell($gender);
     
      $row = $table_contact->addRow();
      $cell = $row->addCell(new TLabel('<b>Contact</b>'));
      $cell->valign = 'top';
     
      // add two fields inside the multifield in the second sheet
      $contacts_list->setHeight(100);
      $contacts_list->setClass('Contact'); // define the returning class
      $contacts_list->addField('type', 'Contact Type: ', new TEntry('type'), 200);
      $contacts_list->addField('value', 'Contact Value: ', new TEntry('value'), 200);
      $row = $table_contact->addRow();
      $row->addCell($contacts_list);
     
      // create the radio button for the skills list
      $skill_list = new TDBCheckGroup('skill_list', 'samples', 'Skill', 'id', 'name');
      $table_skill->addRow()->addCell($lbl = new TLabel('Skills'));
      $table_skill->addRow()->addCell($skill_list);
      $lbl->setFontStyle('b');
     
     * 
     */
     // create an action button
     $button1 = new TButton('action1');
     $button1->setAction(new TAction(array($this, 'onSave')), 'Save');
     $button1->setImage('ico_save.png');
     $button1->setProperty('width', 150);
     //  create an action button (go to list)
     $button2 = new TButton('list');
     $button2->setAction(new TAction(array('RegistroList', 'onReload')), 'Ir para Listagem');
     $button2->setImage('ico_datagrid.gif');
     $button2->setProperty('width', 100);
     $panel->put($button1, 100, 325);
     $panel->put($button2, 200, 325);
     // define wich are the form fields
     $this->form->setFields(array($code, $crm_id, $registro, $temporegistro, $tiporegistro_id, $dataregistro, $hora_registro, $numero_registro, $button1, $button2));
     //        $subtable = new TTable;
     //        $row = $subtable->addRow();
     //        $row->addCell($button1);
     //        $row->addCell($button2);
     //        $table_layout = new TTable;
     //        $table_layout->addRow()->addCell($this->form);
     //        $table_layout->addRow()->addCell($subtable);
     // add the form inside the page
     parent::add($panel);
     //        parent::add($table_layout);
 }
Ejemplo n.º 17
0
 public function __construct()
 {
     parent::__construct();
     parent::add(new TLabel('Hello World'));
 }
Ejemplo n.º 18
0
 /**
  * Class constructor
  * Creates the page and the registration form
  */
 public function __construct()
 {
     parent::__construct();
     parent::setSize(640, 350);
     parent::setTitle('Event');
     // creates the form
     $this->form = new TForm('form_Event');
     $this->form->class = 'tform';
     // CSS class
     $this->form->style = 'width: 600px';
     // add a table inside form
     $table = new TTable();
     $table->width = '100%';
     $this->form->add($table);
     // add a row for the form title
     $row = $table->addRow();
     $row->class = 'tformtitle';
     // CSS class
     $row->addCell(new TLabel('Event'))->colspan = 2;
     $hours = array();
     $durations = array();
     for ($n = 0; $n < 24; $n++) {
         $hours[$n] = "{$n}:00";
         $durations[$n + 1] = $n + 1 . ' h';
     }
     array_pop($durations);
     // create the form fields
     $id = new TEntry('id');
     $event_date = new TDate('event_date');
     $start_hour = new TCombo('start_hour');
     $duration = new TCombo('duration');
     $title = new TEntry('title');
     $description = new TText('description');
     $start_hour->addItems($hours);
     $duration->addItems($durations);
     $id->setEditable(FALSE);
     // define the sizes
     $id->setSize(40);
     $event_date->setSize(100);
     $start_hour->setSize(100);
     $duration->setSize(100);
     $title->setSize(400);
     $description->setSize(400, 50);
     // add one row for each form field
     $table->addRowSet(new TLabel('ID:'), $id);
     $table->addRowSet(new TLabel('Event Date:'), $event_date);
     $table->addRowSet(new TLabel('Start Hour:'), $start_hour);
     $table->addRowSet(new TLabel('Duration:'), $duration);
     $table->addRowSet(new TLabel('Title:'), $title);
     $table->addRowSet(new TLabel('Description:'), $description);
     // create an action button (save)
     $save_button = new TButton('save');
     $save_button->setAction(new TAction(array($this, 'onSave')), _t('Save'));
     $save_button->setImage('ico_save.png');
     // create an new button (edit with no parameters)
     $new_button = new TButton('new');
     $new_button->setAction(new TAction(array($this, 'onEdit')), _t('Clear'));
     $new_button->setImage('ico_new.png');
     $this->form->setFields(array($id, $event_date, $start_hour, $duration, $title, $description, $save_button, $new_button));
     $buttons_box = new THBox();
     $buttons_box->add($save_button);
     $buttons_box->add($new_button);
     // add a row for the form action
     $row = $table->addRow();
     $row->class = 'tformaction';
     // CSS class
     $row->addCell($buttons_box)->colspan = 2;
     parent::add($this->form);
 }
Ejemplo n.º 19
0
 /**
  * constructor method
  */
 public function __construct()
 {
     parent::__construct();
     parent::setTitle('Busca de Pessoas');
     parent::setSize(800, 600);
     new TSession();
     // creates the form
     $this->form = new TForm('form_city_Pessoa');
     // creates the table
     $table = new TTable();
     // add the table inside the form
     $this->form->add($table);
     // create the form fields
     $name = new TEntry('pessoa_nome');
     // keep the session value
     $name->setValue(TSession::getValue('test_pessoa_name'));
     // add the field inside the table
     $row = $table->addRow();
     $row->addCell(new TLabel('Nome:'));
     $row->addCell($name);
     // create a find button
     $find_button = new TButton('search');
     // define the button action
     $find_button->setAction(new TAction(array($this, 'onSearch')), 'Search');
     $find_button->setImage('ico_find.png');
     // add a row for the find button
     $row = $table->addRow();
     $row->addCell($find_button);
     // define wich are the form fields
     $this->form->setFields(array($name, $find_button));
     // create the datagrid
     $this->datagrid = new TDataGrid();
     // create the datagrid columns
     $id = new TDataGridColumn('pessoa_codigo', 'Id', 'right', 25);
     $name = new TDataGridColumn('pessoa_nome', 'Nome', 'left', 250);
     $origem = new TDataGridColumn('origem_nome', 'Origem', 'left', 330);
     $order1 = new TAction(array($this, 'onReload'));
     $order2 = new TAction(array($this, 'onReload'));
     $order1->setParameter('order', 'pessoa_codigo');
     $order2->setParameter('order', 'pessoa_nome');
     // define the column actions
     $id->setAction($order1);
     $name->setAction($order2);
     // add the columns inside the datagrid
     $this->datagrid->addColumn($id);
     $this->datagrid->addColumn($name);
     $this->datagrid->addColumn($origem);
     // create one datagrid action
     $action1 = new TDataGridAction(array($this, 'onSelect'));
     $action1->setLabel('Selecionar');
     $action1->setImage('fa:check-circle-o green');
     $action1->setField('pessoa_codigo');
     // add the action to the datagrid
     $this->datagrid->addAction($action1);
     // create the datagrid model
     $this->datagrid->createModel();
     // create the page navigator
     $this->pageNavigation = new TPageNavigation();
     $this->pageNavigation->setAction(new TAction(array($this, 'onReload')));
     $this->pageNavigation->setWidth($this->datagrid->getWidth());
     // create a table for layout
     $table = new TTable();
     // create a row for the form
     $row = $table->addRow();
     $row->addCell($this->form);
     // create a row for the datagrid
     $row = $table->addRow();
     $row->addCell($this->datagrid);
     // create a row for the page navigator
     $row = $table->addRow();
     $row->addCell($this->pageNavigation);
     $table->style = 'width: 100%;max-width: 1200px;';
     $this->datagrid->style = '  width: 100%;  max-width: 1200px;';
     // add the table inside the page
     parent::add($table);
 }
 /**
  * Form constructor
  * @param $param Request
  */
 public function __construct($param)
 {
     parent::__construct();
     // creates the form
     $this->form = new TForm('form_Cliente');
     $this->form->class = 'tform';
     // change CSS class
     $note = new TNotebook(400, 300);
     // add a table inside form
     $table = new TTable();
     $table->width = '100%';
     // add a row for the form title
     $row = $table->addRow();
     $row->class = 'tformtitle';
     // CSS class
     $row->addCell(new TLabel('Clientes'))->colspan = 2;
     // create the form fields
     $id = new TEntry('id');
     $nome = new TEntry('nome');
     // campo para telefones
     $multifield = new TMultiField('telefone');
     $telefone_id = new TEntry('id');
     $telefone_id->setEditable(false);
     $telefone = new TEntry('numero');
     $telefone->setMask('(99)99999-9999');
     //    campo para emails
     $multifield_email = new TMultiField('email');
     $email = new TEntry('email');
     $email_id = new TEntry('id');
     $email->addValidation('email', new TEmailValidator());
     $multifield->addField('id', 'Codigo', $telefone_id, 200);
     $multifield->addField('numero', 'Telefone', $telefone, 200, true);
     $multifield_email->addField('id', 'Codigo', $email_id, 200);
     $multifield_email->addField('email', 'Email', $email, 200, true);
     // define the sizes
     $id->setSize(100);
     $nome->setSize(200);
     // add one row for each form field
     $table->addRowSet(new TLabel('id:'), $id);
     $table->addRowSet(new TLabel('nome:'), $nome);
     $this->form->setFields(array($id, $nome, $multifield, $multifield_email));
     // create the form actions
     $save_button = TButton::create('save', array($this, 'onSave'), _t('Save'), 'bs:floppy-disk red');
     $new_button = TButton::create('new', array($this, 'onEdit'), _t('New'), 'bs:edit green');
     $this->form->addField($save_button);
     $this->form->addField($new_button);
     $buttons_box = new THBox();
     $buttons_box->add($save_button);
     $buttons_box->add($new_button);
     // add a row for the form action
     $row = $table->addRow();
     $row->class = 'tformaction';
     // CSS class
     $row->addCell($buttons_box)->colspan = 2;
     $note->appendPage('Clientes', $table);
     $note->appendPage('Telefone', $multifield);
     $note->appendPage('Email', $multifield_email);
     $this->form->add($note);
     // vertical box container
     $container = new TVBox();
     $container->style = 'width: 90%';
     // $container->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
     $container->add(TPanelGroup::pack('Title', $this->form));
     parent::add($container);
 }