function __construct()
 {
     parent::__construct();
     $this->form = new TQuickForm('form_Contribuinte');
     $this->form->setFormTitle('Contribuinte');
     $this->form->class = 'tform';
     parent::setDatabase('liger');
     parent::setActiveRecord('Contribuinte');
     $contribuinte_id = new TEntry('contribuinte_id');
     $contribuinte_nome = new TEntry('contribuinte_nome');
     $contribuinte_tipo = new TCombo('contribuinte_tipo');
     $contribuinte_endereco = new TEntry('contribuinte_endereco');
     $contribuinte_bairro = new TEntry('contribuinte_bairro');
     $contribuinte_cidade = new TEntry('contribuinte_cidade');
     $contribuinte_estado = new TDBCombo('tb_estados_uf_id', 'liger', 'Estado', 'uf_id', 'uf_nome');
     $contribuinte_cep = new TEntry('contribuinte_cep');
     $contribuinte_telefone = new TEntry('contribuinte_telefone');
     $contribuinte_cpf = new TEntry('contribuinte_cpf');
     $contribuinte_dtnascimento = new TDate('contribuinte_dtnascimento');
     $contribuinte_rg = new TEntry('contribuinte_rg');
     $contribuinte_cnpj = new TEntry('contribuinte_cnpj');
     $contribuinte_inscricaoestadual = new TEntry('contribuinte_inscricaoestadual');
     $contribuinte_inscricaomunicipal = new TEntry('contribuinte_inscricaomunicipal');
     $contribuinte_regjuceg = new TEntry('contribuinte_regjuceg');
     $contribuinte_ramo = new TEntry('contribuinte_ramo');
     $contribuinte_codatividade = new TEntry('contribuinte_codatividade');
     $contribuinte_numempregados = new TEntry('contribuinte_numempregados');
     $contribuinte_inicioatividades = new TDate('contribuinte_inicioatividades');
     $tipo = array(1 => "Físico", 2 => "Jurídico");
     $contribuinte_id->setEditable(false);
     $contribuinte_tipo->addItems($tipo);
     $this->form->addQuickField('ID', $contribuinte_id, 100);
     $this->form->addQuickField('Nome/Razão Social', $contribuinte_nome, 400);
     $this->form->addQuickField('Tipo', $contribuinte_tipo, 200);
     $this->form->addQuickField('Endereço', $contribuinte_endereco, 400);
     $this->form->addQuickField('Bairro', $contribuinte_bairro, 200);
     $this->form->addQuickField('Cidade', $contribuinte_cidade, 200);
     $this->form->addQuickField('Estado', $contribuinte_estado, 200);
     $this->form->addQuickField('CEP', $contribuinte_cep, 200);
     $this->form->addQuickField('Telefone', $contribuinte_telefone, 200);
     $this->form->addQuickField('CPF', $contribuinte_cpf, 200);
     $this->form->addQuickField('Data de Nascimento', $contribuinte_dtnascimento, 200);
     $this->form->addQuickField('RG', $contribuinte_rg, 200);
     $this->form->addQuickField('CNPJ', $contribuinte_cnpj, 200);
     $this->form->addQuickField('Inscrição Municipal', $contribuinte_inscricaomunicipal, 200);
     $this->form->addQuickField('Inscrição Estadual', $contribuinte_inscricaoestadual, 200);
     $this->form->addQuickField('Registro JUCEG', $contribuinte_regjuceg, 200);
     $this->form->addQuickField('Ramo', $contribuinte_ramo, 200);
     $this->form->addQuickField('Código de Atividade', $contribuinte_codatividade, 200);
     $this->form->addQuickField('Nº de Empregados', $contribuinte_numempregados, 200);
     $this->form->addQuickField('Início das Atividades', $contribuinte_inicioatividades, 200);
     $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');
     $this->form->addQuickAction(_t('Back to the listing'), new TAction(array('ContribuinteList', 'onReload')), 'ico_datagrid.png');
     $container = new TTable();
     $container->style = 'width: 80%';
     $container->addRow()->addCell(new TXMLBreadCrumb('menu.xml', 'ContribuinteList'));
     $container->addRow()->addCell($this->form);
     parent::add($container);
 }
예제 #2
0
 /**
  * Class constructor
  * Cria da página e o formulário de registro
  */
 function __construct()
 {
     parent::__construct();
     // cria o formulário
     $this->form = new TQuickForm('form_Funcionalidade');
     $this->form->setFormTitle('Cadastro de Funcionalidades');
     $this->form->class = 'tform';
     // CSS class
     // Cria os campos do formulário
     $id = new TEntry('id');
     $nome = new TEntry('nome');
     $classe = new TEntry('classe');
     $id->setEditable(false);
     // Adiciona os campos ao formulário
     $this->form->addQuickField('Código:', $id, 50);
     $this->form->addQuickField('Nome: ', $nome, 500);
     $this->form->addQuickField('Classe de controle: ', $classe, 500);
     // Validadores
     $nome->addValidation('Nome', new TRequiredValidator());
     $classe->addValidation('Classe de controle', new TRequiredValidator());
     // Adiciona as ações do formulário
     $this->form->addQuickAction('Salvar', new TAction(array($this, 'onSave')), 'ico_save.png');
     $this->form->addQuickAction('Novo', new TAction(array($this, 'onEdit')), 'ico_new.png');
     $this->form->addQuickAction('Voltar para a listagem', new TAction(array('FuncionalidadeList', 'onReload')), 'ico_datagrid.png');
     $container = new TTable();
     $container->style = 'width: 80%';
     $container->addRow()->addCell(new TXMLBreadCrumb('menu.xml', 'FuncionalidadeList'));
     $container->addRow()->addCell($this->form);
     // Adiciona o formulário a pagina
     parent::add($container);
 }
예제 #3
0
 /**
  * método construtor
  * instancia objeto TQuestion
  * @param $message = pergunta ao usuário
  * @param $action_yes = ação para resposta positiva
  * @param $action_no = ação para resposta negativa
  */
 function __construct($message, $url_yes, $url_no)
 {
     // instancia o painel para exibir o diálogo
     $painel = new TElement('div');
     $painel->class = "tquestion";
     // cria um botão para a resposta positiva
     $button1 = new TElement('input');
     $button1->type = 'button';
     $button1->value = 'Sim';
     $button1->onclick = "javascript:location='{$url_yes}'";
     $button1->id = 'bt1';
     // cria um botão para a resposta negativa
     $button2 = new TElement('input');
     $button2->type = 'button';
     $button2->value = 'Não';
     $button2->onclick = "javascript:location='{$url_no}'";
     // cria uma tabela para organizar o layout
     $table = new TTable();
     $table->align = 'center';
     $table->cellspacing = 10;
     // cria uma linha para o ícone e a mensagem
     $row = $table->addRow();
     $row->addCell(new TImage('app.misc/images/question.png'));
     $row->addCell($message);
     // cria uma linha para os botões
     $row = $table->addRow();
     $row->addCell($button1);
     $row->align = 'left';
     $row->addCell($button2);
     // adiciona a tabela ao painél
     $painel->add($table);
     // exibe o painél
     $painel->show();
 }
 public function __construct()
 {
     parent::__construct();
     // instancia objeto DataGrid
     $this->datagrid = new TDataGrid();
     // instancia as colunas da DataGrid
     $codigo = new TDataGridColumn('id', 'Código', 'left', 50);
     $nome = new TDataGridColumn('nome', 'Nome', 'left', 180);
     $endereco = new TDataGridColumn('endereco', 'Endereço', 'left', 140);
     $qualifica = new TDataGridColumn('qualifica', 'Qualificações', 'left', 200);
     // adiciona as colunas à DataGrid
     $this->datagrid->addColumn($codigo);
     $this->datagrid->addColumn($nome);
     $this->datagrid->addColumn($endereco);
     $this->datagrid->addColumn($qualifica);
     // cria o modelo da DataGrid, montando sua estrutura
     $this->datagrid->createModel();
     $this->navbar = new TPageNavigation();
     $this->navbar->setAction(new TAction(array($this, 'onReload')));
     $table = new TTable();
     $row = $table->addRow();
     $row->addCell($this->datagrid);
     $row = $table->addRow();
     $row->addCell($this->navbar);
     // adiciona a DataGrid à página
     parent::add($table);
 }
예제 #5
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 TQuickForm('form_SystemProgram');
     $this->form->setFormTitle(_t('Program'));
     $this->form->class = 'tform';
     // CSS class
     // defines the database
     parent::setDatabase('permission');
     // defines the active record
     parent::setActiveRecord('SystemProgram');
     // create the form fields
     $id = new TEntry('id');
     $name = new TEntry('name');
     $controller = new TEntry('controller');
     $id->setEditable(false);
     // add the fields
     $this->form->addQuickField('ID', $id, 50);
     $this->form->addQuickField(_t('Name') . ': ', $name, 200);
     $this->form->addQuickField(_t('Controller') . ': ', $controller, 200);
     // validations
     $name->addValidation(_t('Name'), new TRequiredValidator());
     $controller->addValidation('Controller', new TRequiredValidator());
     // add form actions
     $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');
     $this->form->addQuickAction(_t('Back to the listing'), new TAction(array('SystemProgramList', 'onReload')), 'ico_datagrid.png');
     $container = new TTable();
     $container->style = 'width: 80%';
     $container->addRow()->addCell(new TXMLBreadCrumb('menu.xml', 'SystemProgramList'));
     $container->addRow()->addCell($this->form);
     // add the form to the page
     parent::add($container);
 }
 /**
  * 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);
 }
 /**
  * Constructor method
  */
 public function __construct()
 {
     parent::__construct();
     // load the styles
     TPage::include_css('app/resources/styles.css');
     // define two actions
     $action1 = new TAction(array($this, 'onAction1'));
     $action2 = new TAction(array($this, 'onAction2'));
     // create a quick form with two action buttons
     $form = new TQuickForm();
     $form->addQuickAction('Action 1', $action1, 'ico_view.png');
     $form->addQuickAction('Action 2', $action2, 'ico_view.png');
     try {
         // create the HTML Renderer
         $this->html = new THtmlRenderer('app/resources/content.html');
         // define replacements for the main section
         $replace = array();
         $replace['name'] = 'Test name';
         $replace['address'] = 'Test address';
         // replace the main section variables
         $this->html->enableSection('main', $replace);
         // Table wrapper (form and HTML)
         $table = new TTable();
         $table->addRow()->addCell(new TXMLBreadCrumb('menu.xml', __CLASS__));
         $table->addRow()->addCell($form);
         $table->addRow()->addCell($this->html);
         parent::add($table);
     } catch (Exception $e) {
         new TMessage('error', $e->getMessage());
     }
 }
예제 #9
0
 /**
  * Class constructor
  * Creates the page and the registration form
  */
 function __construct()
 {
     parent::__construct();
     // creates the form
     $this->form = new TQuickForm('form_Bairro');
     $this->form->setFormTitle('Bairro');
     $this->form->class = 'tform';
     // CSS class
     // defines the database
     parent::setDatabase('liger');
     // defines the active record
     parent::setActiveRecord('Bairro');
     // create the form fields
     $bairros_id = new TEntry('bairros_id');
     $bairros_nome = new TEntry('bairros_nome');
     $tb_cidades_cid_id = new TDBCombo('tb_cidades_cid_id', 'liger', 'Cidade', 'cid_id', 'cid_nome');
     $bairros_id->setEditable(false);
     // add the fields
     $this->form->addQuickField('ID', $bairros_id, 50);
     $this->form->addQuickField('Bairro: ', $bairros_nome, 200);
     $this->form->addQuickField('Cidade: ', $tb_cidades_cid_id, 200);
     // add form actions
     $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');
     $this->form->addQuickAction(_t('Back to the listing'), new TAction(array('BairroList', 'onReload')), 'ico_datagrid.png');
     $container = new TTable();
     $container->style = 'width: 80%';
     $container->addRow()->addCell(new TXMLBreadCrumb('menu.xml', 'BairroList'));
     $container->addRow()->addCell($this->form);
     // add the form to the page
     parent::add($container);
 }
예제 #10
0
 /**
  * Class constructor
  * Creates the page and the registration form
  */
 function __construct()
 {
     parent::__construct();
     // creates the table container
     $table = new TTable();
     $table->style = 'width:100%';
     // creates the form
     $this->form = new TForm('form_System_Provider');
     $this->form->class = 'tform';
     // add the notebook inside the form
     $this->form->add($table);
     $row1 = $table->addRow();
     $row1->class = 'tformtitle';
     $cell1 = $row1->addCell(new TLabel('Add new provider'), '');
     $cell1->colspan = 2;
     // create the form fields
     $id = new TEntry('id');
     $nif = new TEntry('nif');
     $name = new TEntry('name');
     $id->setEditable(false);
     // define the sizes
     $id->setSize(100);
     $nif->setSize(300);
     $name->setSize(300);
     // validations
     $nif->addValidation('nif', new TRequiredValidator());
     $name->addValidation('name', new TRequiredValidator());
     // add a row for the field id
     $table->addRowSet(new TLabel('ID:'), $id);
     $table->addRowSet(new TLabel('NIF: '), $nif);
     $table->addRowSet(new TLabel('Name: '), $name);
     // create an action button (save)
     $save_button = new TButton('save');
     $save_button->setAction(new TAction(array($this, 'onSave')), _t('Save'));
     $save_button->setImage('fa:floppy-o');
     // create an new button (edit with no parameters)
     $new_button = new TButton('new');
     $new_button->setAction(new TAction(array($this, 'onEdit')), _t('New'));
     $new_button->setImage('fa:plus-square green');
     $list_button = new TButton('list');
     $list_button->setAction(new TAction(array('SystemProvidersList', 'onReload')), _t('Back to the listing'));
     $list_button->setImage('fa:table blue');
     // define the form fields
     $this->form->setFields(array($id, $nif, $name, $save_button, $new_button, $list_button));
     $buttons = new THBox();
     $buttons->add($save_button);
     $buttons->add($new_button);
     $buttons->add($list_button);
     $container = new TTable();
     $container->width = '80%';
     $container->addRow()->addCell(new TXMLBreadCrumb('menu.xml', 'SystemProvidersList'));
     $container->addRow()->addCell($this->form);
     $row = $table->addRow();
     $row->class = 'tformaction';
     $cell = $row->addCell($buttons);
     $cell->colspan = 2;
     // add the form to the page
     parent::add($container);
 }
 /**
  * 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('Classification');
     // creates the form
     $this->form = new TQuickForm('form_Classification');
     // 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', 200, 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 table
     $table = new TTable();
     // add a row to the form
     $row = $table->addRow();
     $row->addCell($this->form);
     // add a row to the datagrid
     $row = $table->addRow();
     $row->addCell($this->datagrid);
     // add a row for page navigation
     $row = $table->addRow();
     $row->addCell($this->pageNavigation);
     // add the table inside the page
     parent::add($table);
 }
 /**
  * Shows the exception stack
  */
 function show()
 {
     $error_array = $this->e->getTrace();
     $table = new TTable();
     $row = $table->addRow();
     $message = $this->e->getMessage();
     $message = str_replace('<br>', "\n", $message);
     $title = new GtkLabel();
     $title->set_markup('<b>General Error: ' . $message . '</b>' . "\n");
     $row->addCell($title);
     var_dump($this->e->getTraceAsString());
     foreach ($error_array as $error) {
         $file = isset($error['file']) ? $error['file'] : '';
         $line = isset($error['line']) ? $error['line'] : '';
         $file = str_replace(PATH, '', $file);
         $row = $table->addRow();
         $row->addCell('File: ' . $file . ' : ' . $line);
         $row = $table->addRow();
         $args = array();
         if ($error['args']) {
             foreach ($error['args'] as $arg) {
                 if (is_object($arg)) {
                     $args[] = get_class($arg) . ' object';
                 } else {
                     if (is_array($arg)) {
                         $array_param = array();
                         foreach ($arg as $value) {
                             if (is_object($value)) {
                                 $array_param[] = get_class($value);
                             } else {
                                 if (is_array($value)) {
                                     $array_param[] = 'array';
                                 } else {
                                     $array_param[] = $value;
                                 }
                             }
                         }
                         $args[] = implode(',', $array_param);
                     } else {
                         $args[] = (string) $arg;
                     }
                 }
             }
         }
         $label = new GtkLabel();
         $row->addCell($label);
         $class = isset($error['class']) ? $error['class'] : '';
         $type = isset($error['type']) ? $error['type'] : '';
         $label->set_markup('  <i>' . '<span foreground="#78BD4C">' . $class . '</span>' . '<span foreground="#600097">' . $type . '</span>' . '<span foreground="#5258A3">' . $error['function'] . '</span>' . '(' . '<span foreground="#894444">' . implode(',', $args) . '</span>' . ')</i>');
     }
     $scroll = new TScroll();
     $scroll->setSize(690, 390);
     $scroll->add($table);
     $scroll->child->modify_bg(GTK::STATE_NORMAL, GdkColor::parse('#ffffff'));
     parent::add($scroll);
     parent::show();
 }
예제 #13
0
 /**
  * Constructor method
  */
 function __construct($e)
 {
     $error_array = $e->getTrace();
     $table = new TTable();
     $row = $table->addRow();
     $row->addCell('<b>Error: ' . $e->getMessage() . '<br>');
     $row = $table->addRow();
     $row->addCell('&nbsp;');
     foreach ($error_array as $error) {
         $file = isset($error['file']) ? $error['file'] : '';
         $line = isset($error['line']) ? $error['line'] : '';
         $file = str_replace(PATH, '', $file);
         $row = $table->addRow();
         $row->addCell('File: ' . $file . ' : ' . $line);
         $row = $table->addRow();
         $args = array();
         if ($error['args']) {
             foreach ($error['args'] as $arg) {
                 if (is_object($arg)) {
                     $args[] = get_class($arg) . ' object';
                 } else {
                     if (is_array($arg)) {
                         $array_param = array();
                         foreach ($arg as $value) {
                             if (is_object($value)) {
                                 $array_param[] = get_class($value);
                             } else {
                                 if (is_array($value)) {
                                     $array_param[] = 'array';
                                 } else {
                                     $array_param[] = $value;
                                 }
                             }
                         }
                         $args[] = implode(',', $array_param);
                     } else {
                         $args[] = (string) $arg;
                     }
                 }
             }
         }
         $class = isset($error['class']) ? $error['class'] : '';
         $type = isset($error['type']) ? $error['type'] : '';
         $row->addCell('&nbsp;&nbsp;<i>' . '<font color=green>' . $class . '</font>' . '<font color=olive>' . $type . '</font>' . '<font color=darkblue>' . $error['function'] . '</font>' . '(' . '<font color=maroon>' . implode(',', $args) . '</font>' . ')</i>');
     }
     $scroll = new TScroll();
     $scroll->setSize(690, 390);
     $scroll->add($table);
     ob_start();
     $table->show();
     $content = ob_get_clean();
     new TMessage('error', $content);
 }
 /**
  * Class constructor
  * Creates the page, the form and the listing
  */
 public function __construct()
 {
     parent::__construct();
     parent::setDatabase('samples');
     // defines the database
     parent::setActiveRecord('City');
     // defines the active record
     parent::setFilterField('name');
     // define the filter field
     parent::setDefaultOrder('id', 'asc');
     // define the default order
     // creates the form
     $this->form = new TQuickForm('form_search_City');
     $this->form->setFormTitle('Standard datagrid');
     $this->form->class = 'tform';
     $this->form->style = 'width: 500px';
     $name = new TEntry('name');
     $this->form->addQuickField('Name:', $name, 200);
     $this->form->addQuickAction('Find', new TAction(array($this, 'onSearch')), 'ico_find.png');
     $this->form->addQuickAction('New', new TAction(array('StandardFormView', 'onEdit')), 'ico_new.png');
     // keep the form filled with the search data
     $this->form->setData(TSession::getValue('City_filter_data'));
     // creates the DataGrid
     $this->datagrid = new TQuickGrid();
     $this->datagrid->setHeight(230);
     // creates the datagrid columns
     $this->datagrid->addQuickColumn('id', 'id', 'right', 40, new TAction(array($this, 'onReload')), array('order', 'id'));
     $name = $this->datagrid->addQuickColumn('name', 'name', 'left', 400, new TAction(array($this, 'onReload')), array('order', 'name'));
     // creates two datagrid actions
     $this->datagrid->addQuickAction('Edit', new TDataGridAction(array('StandardFormView', 'onEdit')), 'id', 'ico_edit.png');
     $this->datagrid->addQuickAction('Delete', new TDataGridAction(array($this, 'onDelete')), 'id', 'ico_delete.png');
     // turn on inline editing
     $editaction = new TDataGridAction(array($this, 'onInlineEdit'));
     $editaction->setField('id');
     $name->setEditAction($editaction);
     // 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(new TXMLBreadCrumb('menu.xml', __CLASS__));
     $table->addRow()->addCell($this->form);
     $table->addRow()->addCell($this->datagrid);
     $table->addRow()->addCell($this->pageNavigation);
     // add the table inside the page
     parent::add($table);
 }
예제 #15
0
 /**
  * método construtor
  * instancia objeto TQuestion
  * @param $message = pergunta ao usuário
  * @param $action_yes = ação para resposta positiva
  * @param $action_no = ação para resposta negativa
  */
 function __construct($message, TAction $action_yes, TAction $action_no)
 {
     $style = new TStyle('tquestion');
     $style->position = 'absolute';
     $style->left = '30%';
     $style->top = '30%';
     $style->width = '300';
     $style->height = '150';
     $style->border_width = '1px';
     $style->color = 'black';
     $style->background = '#DDDDDD';
     $style->border = '4px solid #000000';
     $style->z_index = '10000000000000000';
     // converte os nomes de métodos em URL's
     $url_yes = $action_yes->serialize();
     $url_no = $action_no->serialize();
     // exibe o estilo na tela
     $style->show();
     // instancia o painel para exibir o diálogo
     $painel = new TElement('div');
     $painel->class = "tquestion";
     // cria um botão para a resposta positiva
     $button1 = new TElement('input');
     $button1->type = 'button';
     $button1->value = 'Sim';
     $button1->onclick = "javascript:location='{$url_yes}'";
     // cria um botão para a resposta negativa
     $button2 = new TElement('input');
     $button2->type = 'button';
     $button2->value = 'Não';
     $button2->onclick = "javascript:location='{$url_no}'";
     // cria uma tabela para organizar o layout
     $table = new TTable();
     $table->align = 'center';
     $table->cellspacing = 10;
     // cria uma linha para o ícone e a mensagem
     $row = $table->addRow();
     $row->addCell(new TImage('app.images/question.png'));
     $row->addCell($message);
     // cria uma linha para os botões
     $row = $table->addRow();
     $row->addCell($button1);
     $row->addCell($button2);
     // adiciona a tabela ao painél
     $painel->add($table);
     // exibe o painél
     $painel->show();
 }
 /**
  * Class constructor
  * Creates the page, the form and the listing
  */
 public function __construct()
 {
     parent::__construct();
     // define the database
     parent::setDatabase('samples');
     // define the Active Record
     parent::setActiveRecord('Category');
     // define the default order
     parent::setDefaultOrder('id', 'asc');
     // turn off limit for datagrid
     $this->setLimit(-1);
     // create the form
     $this->form = new TQuickForm('form_categories');
     $this->form->class = 'tform';
     // CSS class
     $this->form->style = 'width: 500px';
     $this->form->setFormTitle('Form/Datagrid');
     // create the form fields
     $id = new TEntry('id');
     $name = new TEntry('name');
     $name->addValidation(_t('Name'), new TRequiredValidator());
     // add the form fields
     $this->form->addQuickField('ID', $id, 40);
     $this->form->addQuickField('Name', $name, 200);
     // define the form actions
     $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');
     // make id not editable
     $id->setEditable(FALSE);
     // create the datagrid
     $this->datagrid = new TQuickGrid();
     $this->datagrid->setHeight(320);
     // add the columns
     $this->datagrid->addQuickColumn('ID', 'id', 'center', 50, new TAction(array($this, 'onReload')), array('order', 'id'));
     $this->datagrid->addQuickColumn('Name', 'name', 'left', 390, new TAction(array($this, 'onReload')), array('order', 'name'));
     // add the actions
     $this->datagrid->addQuickAction('Editar', new TDataGridAction(array($this, 'onEdit')), 'id', 'ico_edit.png');
     $this->datagrid->addQuickAction('Deletar', new TDataGridAction(array($this, 'onDelete')), 'id', 'ico_delete.png');
     // create the datagrid model
     $this->datagrid->createModel();
     // wrap objects inside a table
     $table = new TTable();
     $table->addRow()->addCell(new TXMLBreadCrumb('menu.xml', __CLASS__));
     $table->addRow()->addCell($this->form);
     $table->addRow()->addCell($this->datagrid);
     // pack the table inside the page
     parent::add($table);
 }
예제 #17
0
 /**
  * Class Constructor
  * @param $type    Type of the message (info, error)
  * @param $message Message to be shown
  * @param $action  Action to process
  */
 public function __construct($type, $message, TAction $action = NULL)
 {
     $this->id = uniqid();
     if (!is_null($action)) {
         $this->action = '__adianti_load_page(\'' . $action->serialize() . '\');';
     }
     if (TPage::isMobile()) {
         $img = new TElement('img');
         $img->src = "lib/adianti/images/{$type}.png";
         $table = new TTable();
         $table->width = '250px';
         $table->bgcolor = '#E5E5E5';
         $table->style = "border-collapse:collapse";
         $row = $table->addRow();
         $row->addCell($img);
         $row->addCell($message);
         $table->show();
     } else {
         TPage::include_css('lib/adianti/include/tmessage/tmessage.css');
         // creates a pannel to show the dialog
         $painel = new TElement('div');
         $painel->{'class'} = 'tmessage';
         $painel->id = 'tmessage_' . $this->id;
         // creates a table for layout
         $table = new TTable();
         // creates a row for the icon and the message
         $row = $table->addRow();
         $row->addCell(new TImage("lib/adianti/images/{$type}.png"));
         $scroll = new TScroll();
         $scroll->setSize(350, 70);
         $scroll->add($message);
         $scroll->setTransparency(true);
         $cell = $row->addCell($scroll);
         // add the table to the pannel
         $painel->add($table);
         // show the pannel
         $painel->show();
         $script = new TElement('script');
         $script->{'type'} = 'text/javascript';
         $script->add(' $(function() {
             $( "#' . $painel->id . '" ).dialog({
                 height: 180,
                 width: 440,
                 stack: false,
                 zIndex: 3000,
                 modal: true,
                 buttons: {
                     OK: function() {
                         $( this ).dialog( "close" ); ' . $this->action . '
                     }
                 }
                 }).css("visibility", "visible");
                 
             	$( "#' . $painel->id . ' a" ).click(function () {
             	    window.open($(this).attr(\'href\'));
                 }); 
             });');
         $script->show();
     }
 }
 /**
  * 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 and the registration form
  */
 function __construct()
 {
     parent::__construct();
     // defines the database
     parent::setDatabase('blog');
     // defines the active record
     parent::setActiveRecord('Category');
     // creates the form
     $this->form = new TQuickForm('form_Category');
     $this->form->setFormTitle(_t('Categories'));
     $this->form->class = 'tform';
     $this->form->style = 'width: 600px';
     // create the form fields
     $id = new TEntry('id');
     $name = new TEntry('name');
     // add the fields
     $this->form->addQuickField('ID', $id, 100);
     $this->form->addQuickField(_t('Name'), $name, 200);
     $id->setEditable(FALSE);
     // 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
     $id = $this->datagrid->addQuickColumn('ID', 'id', 'left', 100);
     $name = $this->datagrid->addQuickColumn(_t('Name'), 'name', 'left', 440);
     // 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 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);
 }
예제 #20
0
 /**
  * Class constructor
  * Creates the page and the registration form
  */
 function __construct()
 {
     parent::__construct();
     // creates the form
     $this->form = new TQuickForm('form_Servidor');
     $this->form->setFormTitle('Servidores');
     $this->form->class = 'tform';
     // CSS class
     // defines the database
     parent::setDatabase('lacenrh');
     // defines the active record
     parent::setActiveRecord('Servidor');
     // create the form fields
     $id = new TEntry('id');
     $identificacao = new TEntry('identificacao');
     $servidor = new TEntry('servidor');
     $unidade = new TRadioGroup('unidade');
     $id->setEditable(false);
     //create the combo Unidade
     $itemUnidade = array();
     $itemUnidade['XV'] = ' Alto da XV ';
     $itemUnidade['GT'] = ' Guatupê';
     // add the combo options
     $unidade->addItems($itemUnidade);
     //$unidade->setLayout('horizontal');
     // add the fields
     $this->form->addQuickField('ID', $id, 50);
     $this->form->addQuickField('Identificação', $identificacao, 150);
     $this->form->addQuickField('Nome do Servidor', $servidor, 200);
     $this->form->addQuickField('Unidade', $unidade, 200);
     // validations
     $identificacao->addValidation('Identificação', new TRequiredValidator());
     $servidor->addValidation('Nome', new TRequiredValidator());
     $unidade->addValidation('Unidade', new TRequiredValidator());
     // add form actions
     $this->form->addQuickAction(_t('Save'), new TAction(array($this, 'onSave')), 'fa:floppy-o fa-lg');
     $this->form->addQuickAction(_t('New'), new TAction(array($this, 'onEdit')), 'fa:plus-square green fa-lg');
     $this->form->addQuickAction(_t('Back to the listing'), new TAction(array('ServidorList', 'onReload')), 'fa:table blue fa-lg');
     $container = new TTable();
     $container->style = 'width: 80%';
     $container->addRow()->addCell(new TXMLBreadCrumb('menu.xml', 'ServidorList'));
     $container->addRow()->addCell($this->form);
     // add the form to the page
     parent::add($container);
 }
예제 #21
0
 /**
  * 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('changeman');
     if (Member::newFromLogin(TSession::getValue('login'))->role_mnemonic !== 'ADMINISTRATOR' and Member::newFromLogin(TSession::getValue('login'))->role_mnemonic !== 'MANAGER') {
         throw new Exception(_t('Permission denied'));
     }
     TTransaction::close();
     // creates a table
     $table = new TTable();
     // creates the form
     $this->form = new TForm('form_Document');
     $this->form->add($this->notebook);
     $this->form->class = 'tform';
     $this->form->add($table);
     $table->addRowSet(new TLabel(_t('Document')), '')->class = 'tformtitle';
     // create the form fields
     $id = new TEntry('id');
     $id_project = new TDBCombo('id_project', 'changeman', 'Project', 'id', 'description');
     $title = new TEntry('title');
     $content = new THtmlEditor('content');
     $id->setEditable(FALSE);
     // define the sizes
     $id->setSize(100);
     $id_project->setSize(200);
     $title->setSize(200, 40);
     $content->setSize(680, 350);
     $table->addRowSet(new TLabel('ID:'), $id);
     $table->addRowSet(new TLabel(_t('Project') . ': '), $id_project);
     $table->addRowSet(new TLabel(_t('Title') . ': '), $title);
     $hbox = new THBox();
     $hbox->style = 'margin: 10px';
     $hbox->add($content);
     $row = $table->addRow();
     $row->addCell($lbl = new TLabel(_t('Content') . ': '));
     $lbl->setFontStyle('b');
     $row = $table->addRow();
     $cell = $row->addCell($hbox);
     $cell->colspan = 3;
     // create an action button (save)
     $save_button = new TButton('save');
     // define the button action
     $save_button->setAction(new TAction(array($this, 'onSave')), _t('Save'));
     $save_button->setImage('ico_save.png');
     // define wich are the form fields
     $this->form->setFields(array($id, $id_project, $title, $content, $save_button));
     $table->addRowSet($save_button, '')->class = 'tformaction';
     $container = new TTable();
     $container->addRow()->addCell($this->form);
     // add the form to the page
     parent::add($container);
 }
 /**
  * Class constructor
  * Creates the page
  */
 function __construct()
 {
     parent::__construct();
     // creates a table
     $table = new TTable();
     // creates a label with the title
     $title = new TLabel('Table Multi Cell');
     $title->setFontSize(18);
     $title->setFontFace('Arial');
     $title->setFontColor('red');
     // adds a row to the table
     $row = $table->addRow();
     $title = $row->addCell($title);
     $title->colspan = 2;
     // creates a series of input widgets
     $id = new TEntry('id');
     $name = new TEntry('name');
     $min = new TEntry('min');
     $max = new TEntry('max');
     $start_date = new TDate('start_date');
     $end_date = new TDate('end_date');
     $address = new TEntry('address');
     // adjust the size of the code
     $id->setSize(70);
     $start_date->setSize(70);
     $end_date->setSize(70);
     $min->setSize(87);
     $max->setSize(87);
     // add rows for the fields
     $table->addRowSet(new TLabel('Code'), $id);
     $table->addRowSet(new TLabel('Name'), $name);
     // first approach
     $table->addRowSet(new TLabel('Value'), array($min, new TLabel('To'), $max));
     // second approach
     $row = $table->addRow();
     $row->addCell(new TLabel('Date'));
     $row->addMultiCell($start_date, $end_date);
     $table->addRowSet(new TLabel('Address'), $address);
     // wrap the page content using vertical box
     $vbox = new TVBox();
     $vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
     $vbox->add($table);
     parent::add($vbox);
 }
예제 #23
0
 /**
  * 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'));
     }
     // creates a table
     $table = new TTable();
     $this->notebook = new TNotebook();
     $this->notebook->setSize(600, 350);
     $this->notebook->appendPage(_t('Data'), $table);
     // creates the form
     $this->form = new TForm('form_Release');
     $this->form->add($this->notebook);
     $options = array('Y' => _t('Yes'), 'N' => _t('No'));
     // create the form fields
     $id = new TEntry('id');
     $id_project = new TEntry('project');
     $name = new TEntry('name');
     $description = new THtmlEditor('description');
     $id->setEditable(FALSE);
     $id_project->setEditable(FALSE);
     $name->setEditable(FALSE);
     $description->setEditable(FALSE);
     // define the sizes
     $id->setSize(100);
     $id_project->setSize(200);
     $name->setSize(200, 40);
     $description->setSize(530, 200);
     // add a row for the field id
     $row = $table->addRow();
     $row->addCell(new TLabel('ID:'));
     $row->addCell($id);
     // add a row for the field id_project
     $row = $table->addRow();
     $row->addCell(new TLabel(_t('Project') . ': '));
     $row->addCell($id_project);
     // add a row for the field name
     $row = $table->addRow();
     $row->addCell(new TLabel(_t('Name') . ': '));
     $row->addCell($name);
     // add a row for the field description
     $row = $table->addRow();
     $row->addCell($lbl = new TLabel(_t('Description') . ': '));
     $lbl->setFontStyle('b');
     $row = $table->addRow();
     $cell = $row->addCell($description);
     $cell->colspan = 3;
     // define wich are the form fields
     $this->form->setFields(array($id, $id_project, $name, $description));
     $container = new TTable();
     $container->addRow()->addCell($this->form);
     // add the form to the page
     parent::add($container);
 }
예제 #24
0
 /**
  * Class constructor
  * Creates the page, and the listing
  */
 public function __construct()
 {
     parent::__construct();
     // security check
     if (TSession::getValue('logged') !== TRUE) {
         throw new Exception(_t('Not logged'));
     }
     // security check
     TTransaction::open('changeman');
     if (Member::newFromLogin(TSession::getValue('login'))->role_mnemonic !== 'ADMINISTRATOR') {
         throw new Exception(_t('Permission denied'));
     }
     TTransaction::close();
     // defines the database
     parent::setDatabase('changeman');
     // defines the active record
     parent::setActiveRecord('Role');
     // defines the filter field
     parent::setFilterField('description');
     // creates a DataGrid
     $this->datagrid = new TQuickGrid();
     $this->datagrid->setHeight(320);
     // creates the datagrid columns
     $this->datagrid->addQuickColumn('ID', 'id', 'right', 100, new TAction(array($this, 'onReload')), array('order', 'id'));
     $this->datagrid->addQuickColumn(_t('Description'), 'description', 'left', 200, new TAction(array($this, 'onReload')), array('order', 'description'));
     $this->datagrid->addQuickColumn(_t('Mnemonic'), 'mnemonic', 'left', 200, new TAction(array($this, 'onReload')), array('order', 'mnemonic'));
     // 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();
     // add a row to the datagrid
     $row = $table->addRow();
     $row->addCell($this->datagrid);
     // add a row for page navigation
     $row = $table->addRow();
     $row->addCell($this->pageNavigation);
     // add the table inside the page
     parent::add($table);
 }
예제 #25
0
 function __construct()
 {
     parent::__construct();
     $texto = new TLabel("Olá mundo");
     $img = new TImage("app/images/adianti.png");
     $img->width = 50;
     $tabela = new TTable();
     $linha = $tabela->addRow();
     $linha->addCell($texto);
     $linha->addCell($img);
     parent::add($tabela);
 }
예제 #26
0
 /**
  * método construtor
  * instancia objeto TMessage
  * @param $type      = tipo de mensagem (info, error)
  * @param $message = mensagem ao usuário
  */
 public function __construct($type, $message)
 {
     //        $style = new TStyle('tmessage');
     //        $style->position      = 'absolute';
     //        $style->left          = '30%';
     //        $style->top           = '30%';
     //        $style->width         = '600';
     //        $style->height        = '350';
     //        $style->color         = 'black';
     //        $style->background    = '#DDDDDD';
     //        $style->border        = '4px solid #000000';
     //        $style->z_index       = '10000000000000000';
     //
     //        // exibe o estilo na tela
     //        $style->show();
     // instancia o painel para exibir o diálogo
     $painel = new TElement('div');
     $painel->class = "tmessage";
     $painel->id = "tmessage";
     // cria um botão que vai fechar o diálogo
     $button = new TElement('input');
     $button->type = 'button';
     $button->value = 'Fechar';
     $button->onclick = "document.getElementById('tmessage').style.display='none'";
     // cria um tabela para organizar o layout
     $table = new TTable();
     $table->align = 'center';
     // cria uma linha para o ícone e a mensagem
     $row = $table->addRow();
     $row->addCell(new TImage("app.misc/images/{$type}.png"));
     $row->addCell($message);
     // cria uma linha para o botão
     $row = $table->addRow();
     $row->addCell('');
     $row->addCell($button);
     // adiciona a tabela ao painél
     $painel->add($table);
     // exibe o painél
     $painel->show();
 }
 /**
  * Class constructor
  * Creates the page, the form and the listing
  */
 public function __construct()
 {
     parent::__construct();
     // create the form
     $this->form = new TQuickForm('form_categories');
     $this->form->class = 'tform';
     // CSS class
     $this->form->style = 'width: 500px';
     $this->form->setFormTitle('Manual form/datagrid');
     // create the form fields
     $id = new TEntry('id');
     $name = new TEntry('name');
     $name->addValidation('Name', new TRequiredValidator());
     // add the fields in the form
     $this->form->addQuickField('ID', $id, 40);
     $this->form->addQuickField('Name', $name, 200);
     // create the form actions
     $this->form->addQuickAction('Salvar', new TAction(array($this, 'onSave')), 'ico_save.png');
     $this->form->addQuickAction('Novo', new TAction(array($this, 'onEdit')), 'ico_new.png');
     // id not editable
     $id->setEditable(FALSE);
     // create the datagrid
     $this->datagrid = new TQuickGrid();
     $this->datagrid->setHeight(320);
     // add the datagrid columns
     $this->datagrid->addQuickColumn('ID', 'id', 'center', 50, new TAction(array($this, 'onReload')), array('order', 'id'));
     $this->datagrid->addQuickColumn('Name', 'name', 'left', 390, new TAction(array($this, 'onReload')), array('order', 'name'));
     // add the datagrid actions
     $this->datagrid->addQuickAction('Editar', new TDataGridAction(array($this, 'onEdit')), 'id', 'ico_edit.png');
     $this->datagrid->addQuickAction('Deletar', new TDataGridAction(array($this, 'onDelete')), 'id', 'ico_delete.png');
     // create the datagrid model
     $this->datagrid->createModel();
     // wrap objects
     $table = new TTable();
     $table->addRow()->addCell(new TXMLBreadCrumb('menu.xml', __CLASS__));
     $table->addRow()->addCell($this->form);
     $table->addRow()->addCell($this->datagrid);
     // add the table in the page
     parent::add($table);
 }
 function __construct()
 {
     parent::__construct();
     $this->form = new TQuickForm('form_PlantaValores');
     $this->form->setFormTitle('Planta de Valores');
     $this->form->class = 'tform';
     parent::setDatabase('liger');
     parent::setActiveRecord('PlantaValores');
     // create the form fields
     $plantavalores_id = new TEntry('plantavalores_id');
     $anobase = new TDBCombo('anobase', 'liger', 'AnoBase', 'anobase_id', 'anobase_data');
     $plantavalores_valorm2territorial = new TEntry('plantavalores_valorm2territorial');
     $plantavalores_valorm2predial = new TEntry('plantavalores_valorm2predial');
     $plantavalores_aliquotaterritorial1 = new TEntry('plantavalores_aliquotaterritorial1');
     $plantavalores_aliquotaterritorial2 = new TEntry('plantavalores_aliquotaterritorial2');
     $plantavalores_aliquotaresidencial1 = new TEntry('plantavalores_aliquotaresidencial1');
     $plantavalores_aliquotaresidencial2 = new TEntry('plantavalores_aliquotaresidencial2');
     $plantavalores_aliquotanresidencial1 = new TEntry('plantavalores_aliquotanresidencial1');
     $plantavalores_aliquotanresidencial2 = new TEntry('plantavalores_aliquotanresidencial2');
     $plantavalores_id->setEditable(false);
     $this->form->addQuickField('ID: ', $plantavalores_id, 50);
     $this->form->addQuickField('Ano Base: ', $anobase, 100);
     $this->form->addQuickField('Valor M² Territorial: ', $plantavalores_valorm2territorial, 100);
     $this->form->addQuickField('Valor M² Predial: ', $plantavalores_valorm2predial, 100);
     $this->form->addQuickField('Aliquota Territorial 1: ', $plantavalores_aliquotaterritorial1, 100);
     $this->form->addQuickField('Aliquota Territorial 2: ', $plantavalores_aliquotaterritorial2, 100);
     $this->form->addQuickField('Aliquota Residencial 1: ', $plantavalores_aliquotaresidencial1, 100);
     $this->form->addQuickField('Aliquota Residencial 2: ', $plantavalores_aliquotaresidencial2, 100);
     $this->form->addQuickField('Aliquota Não Residencial 1: ', $plantavalores_aliquotanresidencial1, 100);
     $this->form->addQuickField('Aliquota Não Residencial 2: ', $plantavalores_aliquotanresidencial2, 100);
     $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');
     $this->form->addQuickAction(_t('Back to the listing'), new TAction(array('PlantaValoresList', 'onReload')), 'ico_datagrid.png');
     $container = new TTable();
     $container->style = 'width: 80%';
     $container->addRow()->addCell(new TXMLBreadCrumb('menu.xml', 'PlantaValoresList'));
     $container->addRow()->addCell($this->form);
     parent::add($container);
 }
 /**
  * Class constructor
  * Creates the page, the form and the listing
  */
 public function __construct()
 {
     parent::__construct();
     // creates the form
     $this->form = new TForm('form_search_Product');
     // creates a DataGrid
     $this->datagrid = new TDataGrid();
     $this->datagrid->setHeight(320);
     $table = new TTable();
     $table->addRow()->addCell($this->datagrid);
     // define the button action
     $this->saveAction = new TAction(array($this, 'onSave'));
     // add the save button
     $save_button = new TButton('save');
     $save_button->setAction($this->saveAction, _t('Save'));
     $save_button->setImage('ico_save.png');
     $this->form->addField($save_button);
     $table->addRow()->addCell($save_button);
     // add the table inside the form
     $this->form->add($table);
     // add the columns to the DataGrid
     $this->datagrid->addColumn(new TDataGridColumn('id', 'ID', 'left', 40));
     $this->datagrid->addColumn(new TDataGridColumn('description', 'Description', 'left', 250));
     $this->datagrid->addColumn(new TDataGridColumn('unity', 'Unity', 'center', 50));
     $this->datagrid->addColumn(new TDataGridColumn('stock', 'Stock', 'right', 50));
     $this->datagrid->addColumn(new TDataGridColumn('sale_price_edit', 'Sale price', 'right', 140));
     // 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());
     // wrap the page content using vertical box
     $vbox = new TVBox();
     $vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
     $vbox->add($this->form);
     $vbox->add($this->pageNavigation);
     parent::add($vbox);
 }
예제 #30
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);
 }