<?php require_once "rf/razorflow.php"; require_once "models/config.php"; if (!securePage($_SERVER['PHP_SELF'])) { die; } require_once "models/header.php"; //Left Nav bar echo "\r\n<body>\r\n<div id='wrapper'>\r\n<div id='top'><div id='logo'></div></div>\r\n<div id='content'>\r\n\r\n<div id='left-nav'>"; include "left-nav.php"; //Main Content echo "\r\n</div>\r\n<div id='main'>\r\n"; $dataSource = new MySQLDataSource('2013teamb', '2013teamb', '29G8l!06J82ofpPw', 'devdb.fulgentcorp.com'); $dataSource->setSQLSource('Item'); // Create a chart to show aggregated sales by genre $itemPriority = new ChartComponent(); $itemPriority->setCaption("Item Priority"); $itemPriority->setDataSource($dataSource); $itemPriority->setLabelExpression("Name", "Item.ItemName"); $itemPriority->addSeries("Priority", "Item.Priority"); $itemPriority->setOption('limit', 10); Dashboard::addComponent($itemPriority); Dashboard::Render(); echo "\r\n</div>\r\n\r\n\r\n<div id='bottom'></div>\r\n</div>\r\n</body>\r\n</html>";
$project = mysqli_query($connection, "SELECT * FROM " . "Project WHERE ProjectName = '{$token}'"); $projectInfo = mysqli_fetch_array($project); $ProjectID = $projectInfo['ProjectID']; $ProjectName = $projectInfo['ProjectName']; $DateCreated = $projectInfo['DateCreated']; $DateCompleted = $projectInfo['DateCompleted']; $Creator = $projectInfo['Creator']; $CurrentSprint = $projectInfo['CurrentSprint']; $SprintDuration = $projectInfo['SprintDuration']; $dataSource = new MySQLDataSource('2013teamb', '2013teamb', '29G8l!06J82ofpPw', 'devdb.fulgentcorp.com'); $dataSource->setSQLSource("Sprint"); $sprintRange = new ChartComponent(); $sprintRange->setCaption("Sprint Metrics"); $sprintRange->setDataSource($dataSource); $sprintRange->addCondition("Sprint.ProjectID", "==", "{$ProjectID}"); //$sprintRange->setLabelExpression("Sprint", "Sprint.SprintNum"); $sprintRange->setLabelExpression("Day", "Sprint.FinishTime", array('timestampRange' => 'time', 'timeUnit' => 'day', 'customTimeUnitPath' => array('year', 'month', 'day'), 'autoDrill' => true)); //$sprintRange->setYAxis("Day"); $sprintRange->addSeries("Day", "SprintNum"); //$sprintRange->setOption('limit', 10); Dashboard::addComponent($sprintRange); $itemSource = new MySQLDataSource('2013teamb', '2013teamb', '29G8l!06J82ofpPw', 'devdb.fulgentcorp.com'); $itemSource->setSQLSource("Item"); $itemRange = new ChartComponent(); $itemRange->setCaption("Item Metrics"); $itemRange->setDataSource($itemSource); $itemRange->addCondition("Item.ProjectID", "==", "{$ProjectID}"); $itemRange->setLabelExpression("Name", "Item.ItemName"); $itemRange->addSeries("Item", "Item.Priority"); Dashboard::addComponent($itemRange); Dashboard::Render();
$saleTable = new TableComponent(); $saleTable->setCaption("Sales Table"); $saleTable->setWidth(3); $saleTable->setDataSource($dataSource); $saleTable->addColumn("Track", "track.Name"); $saleTable->addColumn("Album", "album.Title"); $saleTable->addColumn("Sale Date", "invoice.InvoiceDate", array('width' => 50)); $saleTable->addColumn("Amount", "track.UnitPrice * invoiceLine.Quantity", array('width' => 50, 'textAlign' => 'right', 'numberPrefix' => '$')); Dashboard::addComponent($saleTable); // Link the artist chart to the sales table $artistSales->autoLink($saleTable); // Create a Key Performance Indicators to measure the total sales last month $saleKPI = new KPIComponent(); $saleKPI->setCaption("Last Month's sales"); $saleKPI->setDataSource($dataSource); $saleKPI->setValueExpression("track.UnitPrice * invoiceLine.Quantity", array('aggregate' => true, 'aggregateFunction' => "SUM", 'numberPrefix' => '$')); $saleKPI->setTimestampExpression("invoice.InvoiceDate", array('timeUnit' => 'month')); Dashboard::addComponent($saleKPI); // Link the artist chart to sales KPI $artistSales->autoLink($saleKPI); $yearlySalesGauge = new GaugeComponent(); $yearlySalesGauge->setCaption("This Year's sales"); $yearlySalesGauge->setPlaceholder("Please select an artist"); $yearlySalesGauge->setDataSource($dataSource); $yearlySalesGauge->setValueExpression("invoiceLine.Quantity", array('aggregate' => true, 'aggregateFunction' => "SUM")); $yearlySalesGauge->setTimestampExpression("invoice.InvoiceDate", array('timeUnit' => 'year')); $yearlySalesGauge->setKeyPoints(array(5, 10, 20, 30)); Dashboard::addComponent($yearlySalesGauge); // Link the artist chart to the yearly sales gauge $artistSales->autoLink($yearlySalesGauge); Dashboard::Render();