public function buildDashboard() { $this->setDashboardTitle("Stock Dashboard"); $this->setActionPath("/static/transfer/build/tour/motherboard_stock_action.php"); $kpi = new KPIGroupComponent('kpi'); $kpi->setDimensions(12, 2); $kpi->setCaption('Units stock by Category'); $Units = $this->get_units(true); foreach ($Units as $key => $value) { $kpi->addKPI($value['id'], array('caption' => $value['CategoryName'], 'value' => $value['Quantity'], 'numberSuffix' => ' units', 'numberHumanize' => true)); } $this->addComponent($kpi); $table = new TableComponent('table'); $table->setCaption("List of Item in Stock"); $table->setDimensions(6, 5); $stock = $this->get_stock(); $table->addColumn('id', 'Product Id'); $table->addColumn('name', 'Product Name'); $table->addColumn('category', 'Category'); $table->addColumn('price', 'Price', array("numberPrefix" => "\$", "dataType" => "number")); $table->addColumn('stock', 'Stock'); $table->addMultipleRows($this->PolulateData($stock)); $this->addComponent($table); $c12 = new FormComponent('filter'); $c12->setDimensions(6, 5); $c12->setCaption('Filter items in stock'); $category = $this->get_category(); $c12->addSelectField('category', 'Select Category', array_merge(['no selection'], ArrayUtils::pluck($category, 'CategoryName'))); $c12->addTextField('contains', 'Product Name Contains'); $c12->addNumericRangeField('stock', 'Units In Stock', array(0, 100)); $this->addComponent($c12); $c12->onApplyClick(array($table), 'handleApply', $this); }
public function buildDashboard() { $form = new FormComponent('form'); $form->setDimensions(8, 6); $form->setCaption('Form items in stock'); $form->addSelectField('category', 'Select Category', ['No Selection', 'Beverages', 'Condiments', 'Confections', 'Dairy Products', 'Grains/Cereal', 'Meat/Poultry', 'Produce', 'Seafood']); $form->addTextField('contains', 'Product Name Contains'); $form->addNumericRangeField('stock', 'Units In Stock', array(10, 100)); $form->addCheckboxField('discontinued', 'Exclude Discontinued Items', false); $this->addComponent($form); }
public function buildDashboard() { $form = new FormComponent("form"); $form->setCaption("Test Form Component"); $form->setDimensions(4, 4); $form->addTextField('name', 'Name'); $form->addSelectField('products', 'Products', array('Beverages', 'Chips', 'Cookies', 'Cakes', 'Dairy Products', 'Poultry'), array('defaultSelectedIndex' => 2)); $form->addMultiSelectField('cities', 'Cities', array('Bangalore', 'San Fransisco', 'New York', 'Melbourne', 'London', 'Rio De Jeneiro'), array('defaultSelectedOptions' => array(2, 4))); $form->addDateField('delivery_date', 'Delivery Date', array()); $form->addDateRangeField('grace_period', 'Grace Period', array()); $form->addNumericRangeField('units', 'Units in Stock', array(1, 2, 3)); $this->addComponent($form); }
public function buildDashboard() { $table = new TableComponent('table1'); $table->setCaption("Movies & Ratings"); $table->setDimensions(6, 6); $table->setRowsPerPage(8); $table->addColumn('rank', "Rank"); $table->addColumn('title', "Title"); $table->addColumn('rating', "Rating"); $table->addMultipleRows($this->rows); // Adding multiple rows at once $filter = new FormComponent('form'); $filter->setCaption('Filter'); $filter->setDimensions(5, 3); $filter->addSelectField('rating_filter', 'Rating Greater Than', array(5, 6, 7, 8, 9)); $filter->onApplyClick(array($table), 'handleApplyClick', $this); $this->addComponent($table); $this->addComponent($filter); }
public function buildDashboard() { $c1 = new FormComponent("c1"); $c1->setCaption("Test Form Component"); $c1->setDimensions(6, 6); $c1->addTextField('name', 'Name'); $c1->addSelectField('products', 'Products', array('Beverages', 'Chips', 'Cookies', 'Cakes', 'Dairy Products', 'Poultry'), array()); $c1->addMultiSelectField('cities', 'Cities', array('Bangalore', 'San Fransisco', 'New York', 'Melbourne', 'London', 'Rio De Jeneiro'), array()); $c1->addDateField('delivery_date', 'Delivery Date', array()); $c1->addDateRangeField('grace_period', 'Grace Period', array()); $c1->addNumericRangeField('units', 'Units in Stock', array(0, 100)); $kpi = new KPIComponent('kpi1'); $kpi->setCaption('Stock'); $kpi->setDimensions(4, 4); $kpi->setValue(24); $this->addComponent($kpi); $this->addComponent($c1); $c1->onApplyClick(array($kpi), 'handleApply', $this); }