/** * 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); }
/** * 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 Columns'); $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'); $address = new TEntry('address'); $telephone = new TEntry('telephone'); $city = new TCombo('city'); $text = new TText('text'); $items = array(); $items['1'] = 'Porto Alegre'; $items['2'] = 'Lajeado'; $city->addItems($items); // adjust the size of the code $id->setSize(70); // add rows for the fields $table->addRowSet(new TLabel('Code'), $id); $table->addRowSet(new TLabel('Name'), $name); $table->addRowSet(new TLabel('City'), $city); $table->addRowSet(new TLabel('Address'), $address); $table->addRowSet(new TLabel('Telephone'), $telephone); // wrap the page content using vertical box $vbox = new TVBox(); $vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__)); $vbox->add($table); parent::add($vbox); }
*/ function __autoload($classe) { if (file_exists("../app.widgets/{$classe}.class.php")) { include_once "../app.widgets/{$classe}.class.php"; } } //Cria o Formulario $form = new TForm('formPessoas'); //Cria um Painel $painel = new TPanel('440', '200'); //Adicona o Painel ao Formulario $form->add($painel); //Cria um rotulo de texto para o Titulo $titulo = new TLabel('Exemplo'); $titulo->setFontFace('Arial'); $titulo->setFontColor('#ff0000'); $titulo->setFontSize('18'); //Posiciona o titulo no Painel $painel->put($titulo, '120', '4'); $imagem = new TImage('../app.images/mouse.png'); //Posiciona a imagem no painel $painel->put($imagem, '320', '120'); //Cria uma serie de Campos de entrada de dados $codigo = new TEntry('codigo'); $nome = new TEntry('nome'); $endereco = new TEntry('endereco'); $telefone = new TEntry('telefone'); $cidade = new TCombo('cidade'); $itens = array(); $itens['1'] = 'Porto Alegre';
/** * Class constructor * Creates the page and the registration form */ function __construct() { parent::__construct(); // creates the form $this->form = new TForm('form_clienteRegistro_Detalhe'); new TSession(); // creates a table $table = new TTable(); $panel = new TPanel(480, 250); // $panel->style = "background-image: url(app/images/background.png);"; $notebook = new TNotebook(500, 250); // add the notebook inside the form $this->form->add($notebook); // add the notebook inside the form $this->form->add($table); // envia key e fk para sessao TSession::setValue('crm_key', $_GET['key']); TSession::setValue('cliente_fk', $_GET['fk']); //dados do cliente CRM TTransaction::open('db_crmbf'); $criteria = new TCriteria(); $criteria->add(new TFilter('cliente_id', '=', $_GET['fk'])); $repository = new TRepository('CRM'); $CRM = $repository->load($criteria); foreach ($CRM as $crms) { $codigoCRM = $crms->id; $tituloCRM = $crms->titulo; $projetoCRM = $crms->projeto_nome; $dataCRM = $crms->data_crm; $tempoCRM = $crms->tempo; $porcentagemCRM = $crms->porcentagem; $descricaoCRM = $crms->descricao; $solicitanteCRM = $crms->solicitante; $usuarioalteracaoCRM = $crms->usuarioalteracao; $responsavel_nomeCRM = $crms->responsavel_nome; $tipo_nomeCRM = $crms->tipo_nome; $cliente_nomeCRM = $crms->cliente_nome; $prioridade_nomeCRM = $crms->prioridade_nome; $status_nomeCRM = $crms->status_nome; } TTransaction::close(); $titulo = new TLabel('CRM - Registros'); $titulo->setFontSize(14); $titulo->setFontFace('Arial'); $titulo->setFontColor('red'); // add a row for the field code $panel->put($titulo, 10, 5); $panel->put("CRM: " . $codigoCRM, 10, 25); $panel->put("Titulo: " . $tituloCRM, 10, 45); $panel->put("Projeto: " . $projetoCRM, 10, 65); $panel->put("Data de Criação: " . $dataCRM, 10, 85); $panel->put("Aberto por: " . $usuarioalteracaoCRM, 10, 105); $panel->put("Cliente: " . $cliente_nomeCRM, 10, 125); $panel->put("Responsavel: " . $responsavel_nomeCRM, 10, 145); $panel->put("Tipo: " . $tipo_nomeCRM, 10, 165); $panel->put("Percentual Conclusão: " . $porcentagemCRM, 10, 185); $panel->put("Tempo Gasto: " . $tempoCRM, 10, 205); $panel->put("Situação: " . $status_nomeCRM, 10, 225); //inserir button no panel $panel->put($button1, 10, 325); $panel->put($button2, 100, 325); // create an action button $button1 = new TButton('action1'); $action1 = new TAction(array('CRMClienteList', 'onReload')); $action1->setParameter('key', $_GET['fk']); $button1->setImage('ico_datagrid.png'); $button1->setAction($action1, 'Voltar'); // create an action button $button2 = new TButton('action2'); $action2 = new TAction(array('RegistroForm', 'onEdit')); $action2->setParameter('fk', $_GET['fk']); $button2->setImage('ico_save.png'); $button2->setAction($action2, 'Inserir Registro'); // define wich are the form fields $this->form->setFields(array($button1, $button2)); $subtable = new TTable(); $row = $subtable->addRow(); $row->addCell($button2); $row->addCell($button1); $table_layout = new TTable(); $table_layout->addRow()->addCell($subtable); $table_layout->addRow()->addCell($this->form); //dados do cliente CRM TTransaction::open('db_crmbf'); $criteria2 = new TCriteria(); // $criteria->add(new TFilter('crm_id', '=', $_GET['key'])); $criteria2->setProperty('order', 'id desc'); $repository2 = new TRepository('Registro'); $reg = $repository2->load($criteria2); foreach ($reg as $regs) { $row = $table->addRow(); $row->addCell(new TLabel('ID:')); $cell = $row->addCell($regs->id); $row = $table->addRow(); $row->addCell(new TLabel('CRM:')); $cell = $row->addCell($regs->crm_id); $row = $table->addRow(); $row->addCell(new TLabel('CRM:')); $cell = $row->addCell($regs->tiporegistro_id); $row = $table->addRow(); $row->addCell(new TLabel('Tempo:')); $cell = $row->addCell($regs->tempo_registro); $row = $table->addRow(); $row->addCell(new TLabel('Data:')); $cell = $row->addCell($regs->data_registro); $row = $table->addRow(); $row->addCell(new TLabel('Horario:')); $cell = $row->addCell($regs->hora_registro); $row = $table->addRow(); $row->addCell(new TLabel('Numero Registro:')); $cell = $row->addCell($regs->numero_registro); $row = $table->addRow(); $row->addCell(new TLabel('Registro:')); $cell = $row->addCell($regs->registro); $row = $table->addRow(); $row->addCell(new TLabel(' ')); $cell = $row->addCell(' '); } TTransaction::close(); parent::add($panel); parent::add($table_layout); }
/** * Class constructor * Creates the page */ public function __construct() { parent::__construct(); new TSession(); // creates the items form and add a table inside $this->form_item = new TForm('form_pos'); $this->form_item->class = 'tform'; $table_item = new TTable(); $table_item->width = '100%'; $this->form_item->add($table_item); // create the form fields $product_id = new TDBSeekButton('product_id', 'samples', 'form_pos', 'Product', 'description', 'product_id', 'product_description'); $product_description = new TEntry('product_description'); $sale_price = new TEntry('sale_price'); $amount = new TEntry('amount'); $discount = new TEntry('discount'); $total = new TEntry('total'); // add validators $product_id->addValidation('Product', new TRequiredValidator()); $amount->addValidation('Amount', new TRequiredValidator()); // define the exit actions $product_id->setExitAction(new TAction(array($this, 'onExitProduct'))); $amount->setExitAction(new TAction(array($this, 'onUpdateTotal'))); $discount->setExitAction(new TAction(array($this, 'onUpdateTotal'))); // define some attributes $product_id->style = 'font-size: 17pt; height: 30px'; $product_description->style = 'font-size: 17pt; height: 30px'; $sale_price->style = 'font-size: 17pt; height: 30px'; $amount->style = 'font-size: 17pt; height: 30px'; $discount->style = 'font-size: 17pt; height: 30px'; $total->style = 'font-size: 17pt; height: 30px'; $product_id->button->style = 'height: 30px; margin-top:0px; vertical-align:top'; // define some properties $product_id->setSize(50); $product_description->setEditable(FALSE); $sale_price->setEditable(FALSE); $total->setEditable(FALSE); $sale_price->setNumericMask(2, '.', ','); $discount->setNumericMask(2, '.', ','); $total->setNumericMask(2, '.', ','); $sale_price->setSize(100); $amount->setSize(100); $discount->setSize(100); $total->setSize(100); // add a row for the form title $row = $table_item->addRow(); $row->class = 'tformtitle'; // CSS class $cell = $row->addCell(new TLabel('Point of Sales')); $cell->colspan = 4; // create the field labels $lab_pro = new TLabel('Product'); $lab_des = new TLabel('Description'); $lab_pri = new TLabel('Price'); $lab_amo = new TLabel('Amount'); $lab_dis = new TLabel('Discount'); $lab_tot = new TLabel('Total'); $lab_pro->setFontSize(17); $lab_des->setFontSize(17); $lab_pri->setFontSize(17); $lab_amo->setFontSize(17); $lab_dis->setFontSize(17); $lab_tot->setFontSize(17); $lab_pro->setFontFace('Trebuchet MS'); $lab_des->setFontFace('Trebuchet MS'); $lab_pri->setFontFace('Trebuchet MS'); $lab_amo->setFontFace('Trebuchet MS'); $lab_dis->setFontFace('Trebuchet MS'); $lab_tot->setFontFace('Trebuchet MS'); $lab_pro->setFontColor('red'); $lab_amo->setFontColor('red'); // creates the action button $button1 = new TButton('add'); $button1->setAction(new TAction(array($this, 'onAddItem')), 'Add item'); $button1->setImage('ico_add.png'); // add the form fields $table_item->addRowSet($lab_pro, $product_id, $lab_des, $product_description); $table_item->addRowSet($lab_pri, $sale_price, $lab_amo, $amount); $table_item->addRowSet($lab_dis, $discount, $lab_tot, array($total, $button1)); // define the form fields $this->form_item->setFields(array($product_id, $product_description, $sale_price, $amount, $discount, $total, $button1)); // creates the customer form and add a table inside it $this->form_customer = new TForm('form_customer'); $this->form_customer->class = 'tform'; $table_customer = new TTable(); $table_customer->width = '100%'; $this->form_customer->add($table_customer); // add a row for the form title $row = $table_customer->addRow(); $row->class = 'tformtitle'; // CSS class $cell = $row->addCell(new TLabel('Customer')); $cell->colspan = 5; // create the form fields $customer_id = new TDBSeekButton('customer_id', 'samples', 'form_customer', 'Customer', 'name', 'customer_id', 'customer_name'); $customer_name = new TEntry('customer_name'); // define validation and other properties $customer_id->addValidation('Customer', new TRequiredValidator()); $customer_id->style = 'font-size: 17pt; height: 30px'; $customer_name->style = 'font-size: 17pt; height: 30px'; $customer_id->button->style = 'height: 30px; margin-top:0px; vertical-align:top'; $customer_id->setSize(50); $customer_name->setEditable(FALSE); // create tha form labels $lab_cus = new TLabel('Customer'); $lab_nam = new TLabel('Name'); $lab_cus->setFontSize(17); $lab_nam->setFontSize(17); $lab_cus->setFontFace('Trebuchet MS'); $lab_nam->setFontFace('Trebuchet MS'); $lab_cus->setFontColor('red'); // action button $button2 = new TButton('save'); $button2->setAction(new TAction(array($this, 'onSave')), 'Save and finish'); $button2->setImage('ico_save.png'); // add the form fields inside the table $table_customer->addRowSet($lab_cus, $customer_id, $lab_nam, $customer_name, $button2); // define the form fields $this->form_customer->setFields(array($customer_id, $customer_name, $button2)); // creates the grid for items $this->cartgrid = new TQuickGrid(); $this->cartgrid->class = 'tdatagrid_table customized-table'; $this->cartgrid->makeScrollable(); $this->cartgrid->setHeight(150); parent::include_css('app/resources/custom-table.css'); $this->cartgrid->addQuickColumn('ID', 'product_id', 'right', 25); $this->cartgrid->addQuickColumn('Description', 'product_description', 'left', 230); $this->cartgrid->addQuickColumn('Price', 'sale_price', 'right', 80); $this->cartgrid->addQuickColumn('Amount', 'amount', 'right', 70); $this->cartgrid->addQuickColumn('Discount', 'discount', 'right', 70); $this->cartgrid->addQuickColumn('Total', 'total', 'right', 100); $this->cartgrid->addQuickAction('Delete', new TDataGridAction(array($this, 'onDelete')), 'product_id', 'ico_delete.png'); $this->cartgrid->createModel(); // wrap the page content using vertical box $vbox = new TVBox(); $vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__)); $vbox->add($this->form_item); $vbox->add(new TLabel(' ')); $vbox->add($this->cartgrid); $vbox->add(new TLabel(' ')); $vbox->add($this->form_customer); parent::add($vbox); }
/** * Class constructor * Creates the page */ function __construct() { parent::__construct(); // creates a panel $panel = new TPanel(480, 260); if (PHP_SAPI !== 'cli') { $panel->style = "background-image: url(app/images/background.png);"; } // creates a label with the title $titulo = new TLabel('Panel Layout'); $titulo->setFontSize(18); $titulo->setFontFace('Arial'); $titulo->setFontColor('red'); // put the title label in the panel $panel->put($titulo, 120, 4); $imagem = new TImage('app/images/mouse.png'); // put the image in the panel $panel->put($imagem, 260, 140); // create the input widgets $id = new TEntry('id'); $name = new TEntry('name'); $address = new TEntry('address'); $telephone = new TEntry('telephone'); $city = new TCombo('city'); $items = array(); $items['1'] = 'Porto Alegre'; $items['2'] = 'Lajeado'; // add the options to the combo $city->addItems($items); // adjust the size of the fields $id->setSize(70); $name->setSize(140); $address->setSize(140); $telephone->setSize(140); $city->setSize(140); // create the labels $label1 = new TLabel('Code'); $label2 = new TLabel('Name'); $label3 = new TLabel('City'); $label4 = new TLabel('Address'); $label5 = new TLabel('Telephone'); // put the widgets in the panel $panel->put($label1, 10, 40); $panel->put($id, 10, 60); $panel->put($label2, 30, 90); $panel->put($name, 40, 110); $panel->put($label3, 100, 140); $panel->put($city, 100, 160); $panel->put($label4, 230, 40); $panel->put($address, 230, 60); $panel->put($label5, 200, 90); $panel->put($telephone, 200, 110); if (PHP_SAPI !== 'cli') { $label6 = new TLabel('Obs'); $label6->setFontStyle('b'); $label6->setValue('PS: The panel background is just for understanding purposes.'); $panel->put($label6, 2, 237); } // wrap the page content using vertical box $vbox = new TVBox(); $vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__)); $vbox->add($panel); parent::add($vbox); }
/** * 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 Layout'); $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 two sub-tables $table1 = new TTable(); $table2 = new TTable(); $table->border = '1'; $table->cellpadding = '4'; $table->style = 'border-collapse:collapse;'; $table1->border = '1'; $table1->cellpadding = '2'; $table1->style = 'border-collapse:collapse; border-color: red'; $table2->border = '1'; $table2->cellpadding = '2'; $table2->style = 'border-collapse:collapse; border-color: blue'; // creates a series of input widgets $id = new TEntry('id'); $name = new TEntry('name'); $address = new TEntry('address'); $telephone = new TEntry('telephone'); $city = new TCombo('city'); $text = new TText('text'); $items = array(); $items['1'] = 'Porto Alegre'; $items['2'] = 'Lajeado'; $city->addItems($items); // adjust the size of the fields $id->setSize(70); $name->setSize(140); $address->setSize(140); $telephone->setSize(140); $city->setSize(140); $text->setSize(400, 100); // creates a series of labels $label1 = new TLabel('Code'); $label2 = new TLabel('Name'); $label3 = new TLabel('City'); $label4 = new TLabel('Address'); $label5 = new TLabel('Telephone'); // adds a row for the code field $row = $table1->addRow(); $row->addCell($label1); $row->addCell($id); // adds a row for the name field $row = $table1->addRow(); $row->addCell($label2); $row->addCell($name); // adds a row for the city field $row = $table1->addRow(); $row->addCell($label3); $row->addCell($city); // adds a row for the address field $row = $table2->addRow(); $row->addCell($label4); $row->addCell($address); // adds a row for the phone field $row = $table2->addRow(); $row->addCell($label5); $row->addCell($telephone); // adds the tables side by side $row = $table->addRow(); $row->addCell($table1); $row->addCell($table2); $row = $table->addRow(); $cell = $row->addCell($text); $cell->colspan = 2; $label6 = new TLabel('Obs'); $label6->setFontStyle('b'); $label6->setValue('PS: The table borders are just for understanding purposes.'); $row = $table->addRow(); $cell = $row->addCell($label6); $cell->colspan = 2; // wrap the page content using vertical box $vbox = new TVBox(); $vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__)); $vbox->add($table); parent::add($vbox); }