<?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();
<?php require "rf/razorflow.php"; $dataSource = RFUtil::getSampleDataSource(); // Create a chart to show aggregated sales by genre $genreSales = new ChartComponent(); $genreSales->setCaption("Genre Sales"); $genreSales->setDataSource($dataSource); $genreSales->setLabelExpression("Genre", "genre.Name"); $genreSales->addSeries("Sales", "track.UnitPrice * invoiceline.Quantity", array('sort' => "DESC")); $genreSales->setOption('limit', 10); Dashboard::addComponent($genreSales); // Create a chart to show aggregated sales by artist $artistSales = new ChartComponent(); $artistSales->setCaption("Artist Sales"); $artistSales->setDataSource($dataSource); $artistSales->setLabelExpression("Artist", "artist.Name"); $artistSales->addSeries("Sales", "track.UnitPrice * invoiceline.Quantity", array('sort' => "DESC")); $artistSales->setOption('limit', 10); Dashboard::addComponent($artistSales); // Link the artist chart to artist sales $genreSales->autoLink($artistSales); // Create a table component to show each sale. $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' => '$'));