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);
 }
示例#2
0
 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);
 }
示例#3
0
 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);
 }
示例#4
0
 public function buildDashboard()
 {
     $quarterlySales = new ChartComponent('quarterlySales');
     $quarterlySales->setDimensions(6, 6);
     $quarterlySales->setCaption("Quarterly Sales");
     $quarterlySales->setLabels(array("Q1", "Q2", "Q3", "Q4"));
     $quarterlySales->addYAxis('quantity', "Quantity");
     $quarterlySales->addSeries('sales', "Sales", array(13122, 41312, 46132, 51135), array('numberPrefix' => "\$"));
     $quarterlySales->addSeries('quantity', "Quantity", array(121, 392, 420, 489), array('yAxis' => 'quantity'));
     $quarterlySales->addComponentKPI('beverage', array('caption' => 'Beverages', 'value' => 22900, 'numberPrefix' => ' $', 'numberHumanize' => true));
     $quarterlySales->addComponentKPI('vegetable', array('caption' => 'Vegetables', 'value' => 10401, 'numberPrefix' => ' $', 'numberHumanize' => true));
     $quarterlySales->addComponentKPI('dairy', array('caption' => 'Dairy', 'value' => 27700, 'numberPrefix' => ' $', 'numberHumanize' => true));
     $quarterlySales->addDrillStep('drillIntoMonths', $this);
     $this->addComponent($quarterlySales);
     $numTickets = new KPIComponent('numTickets');
     $numTickets->setDimensions(3, 3);
     $numTickets->setCaption("Open Support Tickets");
     $numTickets->setValue(42);
     $this->addComponent($numTickets);
     $satisfactionGauge = new GaugeComponent('satisfactionGauge');
     $satisfactionGauge->setDimensions(3, 3);
     $satisfactionGauge->setCaption('Customer Satisfaction');
     $satisfactionGauge->setValue(8);
     $satisfactionGauge->setLimits(0, 10);
     $this->addComponent($satisfactionGauge);
     $ticketPriorities = new KPIGroupComponent('ticketPriorities');
     $ticketPriorities->setDimensions(6, 3);
     $ticketPriorities->setCaption('Ticket Priorities');
     $ticketPriorities->addKPI('high', array('caption' => 'High Priority', 'value' => 6));
     $ticketPriorities->addKPI('normal', array('caption' => 'Normal Priority', 'value' => 36));
     $this->addComponent($ticketPriorities);
     $productsTable = new TableComponent('productsTable');
     $productsTable->setDimensions(6, 6);
     $productsTable->setCaption('Products');
     $productsTable->addColumn('name', 'Name');
     $productsTable->addColumn('category', 'Category');
     $productsTable->addColumn('price', 'Price', array('dataType' => "number", 'numberPrefix' => "\$", 'textAlign' => "right", 'numberForceDecimals' => true));
     $productsTable->addMultipleRows($this->tableData);
     $this->addComponent($productsTable);
     $productFilterForm = new FormComponent('productFilterForm');
     $productFilterForm->setDimensions(6, 6);
     $productFilterForm->setCaption('Filter Products');
     $productFilterForm->addMultiSelectField('category', 'Select Category', array('Vegetables', 'Dairy', 'Beverages'));
     $productFilterForm->addTextField('name', 'Product Name Contains');
     $productFilterForm->addNumericRangeField('price', 'Price', array(5, 20));
     $this->addComponent($productFilterForm);
     $productFilterForm->onApplyClick(array($productsTable), 'handleApplyClick', $this);
 }
示例#5
0
 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);
 }
 public function buildDashboard()
 {
     $categories = ['Beverages', 'Condiments', 'Confections', 'Dairy Products', 'Grains/Cereal', 'Meat/Poultry', 'Produce', 'Seafood'];
     $c1 = new TableComponent("table1");
     $c1->setCaption("List of items in stock");
     $c1->setDimensions(6, 6);
     $c1->addColumn('ProductID', 'Product ID');
     $c1->addColumn('ProductName', 'Product Name');
     $c1->addColumn('CategoryName', 'Category');
     $c1->addColumn('UnitPrice', 'Price', array('dataType' => 'number', 'numberPrefix' => '$', 'numberForceDecimals' => true, 'numberDecimalPoints' => 2));
     $c1->addColumn('UnitsInStock', 'Stock');
     $c1->addColumn('Discontinued', 'Discontinued?');
     $this->addComponent($c1);
     $c2 = new FormComponent('form1');
     $c2->setCaption("Form items in stock");
     $c2->setDimensions(6, 6);
     $c2->addTextField('contains', 'Product Name Contains');
     $c2->addNumericRangeField('stock', 'Units In Stock', array(10, 100));
     $c2->addCheckboxField('discontinued', 'Exclude Discontinued Items', false);
     $this->addComponent($c2);
 }