add all files

This commit is contained in:
Rucus
2026-02-17 09:29:34 -06:00
parent b8c8d67c67
commit 782d203799
21925 changed files with 2433086 additions and 0 deletions

View File

@@ -0,0 +1,107 @@
<?php
$dataLines = array();
/*
* connect to the database
*/
$dbLink = mysql_connect("[DBSERVER]",
"[DBUSER]",
"[DBPASSWORD]");
if (!$dbLink) {
print "Could not connect: ".mysql_error();
exit(0);
}
if (!mysql_select_db("jpsamplesalesdb", $dbLink)) {
print "Could not select database: ".mysql_error();
exit(0);
}
/*
* perform the query for each series of data
*/
$dataLines = array();
/*
* Blue Robots
*/
$sql = "SELECT SUM(amount) AS monthAmount
FROM salesByMonth
WHERE saleYear=2008
AND product_id = '1'
GROUP BY saleMonth
ORDER BY saleMonth ";
$result = mysql_query($sql, $dbLink);
$dataNum = 1;
while ( $row = mysql_fetch_array($result,MYSQL_ASSOC) ) {
$dataLines[] = "data".$dataNum."series1: ".$row["monthAmount"];
$dataNum++;
}
mysql_free_result($result);
/*
* Green Robots
*/
$sql = "SELECT SUM(amount) AS monthAmount
FROM salesByMonth
WHERE saleYear=2008
AND product_id = '2'
GROUP BY saleMonth
ORDER BY saleMonth ";
$result = mysql_query($sql, $dbLink);
$dataNum = 1;
while ( $row = mysql_fetch_array($result,MYSQL_ASSOC) ) {
$dataLines[] = "data".$dataNum."series2: ".$row["monthAmount"];
$dataNum++;
}
mysql_free_result($result);
/*
* Red Robots
*/
$sql = "SELECT SUM(amount) AS monthAmount
FROM salesByMonth
WHERE saleYear=2008
AND product_id = '3'
GROUP BY saleMonth
ORDER BY saleMonth ";
$result = mysql_query($sql, $dbLink);
$dataNum = 1;
while ( $row = mysql_fetch_array($result,MYSQL_ASSOC) ) {
$dataLines[] = "data".$dataNum."series3: ".$row["monthAmount"];
$dataNum++;
}
mysql_free_result($result);
/*
* Yellow Robots
*/
$sql = "SELECT SUM(amount) AS monthAmount
FROM salesByMonth
WHERE saleYear=2008
AND product_id = '4'
GROUP BY saleMonth
ORDER BY saleMonth ";
$result = mysql_query($sql, $dbLink);
$dataNum = 1;
while ( $row = mysql_fetch_array($result,MYSQL_ASSOC) ) {
$dataLines[] = "data".$dataNum."series4: ".$row["monthAmount"];
$dataNum++;
}
mysql_free_result($result);
/*
* Output the data lines
*/
foreach ($dataLines as $dataLine)
{
print $dataLine . PHP_EOL;
}
/*
* all finished so close db connection and exit
*/
mysql_close($dbLink);
exit(0);
?>

View File

@@ -0,0 +1,28 @@
<?php
// Abstraction Class
$jpDatabase["abstractionClass"] = "DBMySQL.class.php";
// Database Login Info
$jpDatabase["dbServer"] = "[DBSERVER]";
$jpDatabase["dbUser"] = "[DBUSER]";
$jpDatabase["dbPassword"] = "[DBPASSWORD]";
$jpDatabase["dbDatabase"] = "[DBDATABASE]";
// Data Queries
$jpDatabase["data"] = array();
$jpDatabase["data"][0]["query"] = "SELECT value FROM table ";
$jpDatabase["data"][0]["valueField"] = "value";
$jpDatabase["data"][0]["valueXField"] = "value";
$jpDatabase["data"][0]["valueYField"] = "value";
$jpDatabase["data"][0]["valueZField"] = "value";
$jpDatabase["data"][0]["datatextField"] = "";
$jpDatabase["data"][0]["datalinkField"] = "";
$jpDatabase["data"][0]["targetWindowField"] = "";
$jpDatabase["data"][1]["query"] = "SELECT value2 FROM table2 ";
$jpDatabase["data"][1]["valueField"] = "value2";
?>

View File

@@ -0,0 +1,31 @@
<?php
// Abstraction Class
$jpDatabase["abstractionClass"] = "DBMySQL.class.php";
// Database Login Info
$jpDatabase["dbServer"] = "[DBSERVER]";
$jpDatabase["dbUser"] = "[DBUSER]";
$jpDatabase["dbPassword"] = "[DBPASSWORD]";
$jpDatabase["dbDatabase"] = "[DBDATABASE]";
// Data Queries
$jpDatabase["data"] = array();
$jpDatabase["data"][0]["query"] = "SELECT product_ID,SUM(amount) AS totalAmount
FROM salesByMonth
WHERE saleYear=2008
GROUP BY product_ID
ORDER BY product_ID ";
$jpDatabase["data"][0]["valueField"] = "totalAmount";
$jpDatabase["data"][0]["valueXField"] = "";
$jpDatabase["data"][0]["valueYField"] = "";
$jpDatabase["data"][0]["valueZField"] = "";
$jpDatabase["data"][0]["datatextField"] = "";
$jpDatabase["data"][0]["datalinkField"] = "";
$jpDatabase["data"][0]["targetWindowField"] = "";
?>

View File

@@ -0,0 +1,51 @@
<?php
// Abstraction Class
$jpDatabase["abstractionClass"] = "DBMySQL.class.php";
// Database Login Info
$jpDatabase["dbServer"] = "[DBSERVER]";
$jpDatabase["dbUser"] = "[DBUSER]";
$jpDatabase["dbPassword"] = "[DBPASSWORD]";
$jpDatabase["dbDatabase"] = "[DBDATABASE]";
// Data Queries
$jpDatabase["data"] = array();
// Blue Robots
$jpDatabase["data"][0]["query"] = "SELECT SUM(amount) AS monthAmount
FROM salesByMonth
WHERE saleYear=2008
AND product_id = '1'
GROUP BY saleMonth
ORDER BY saleMonth ";
$jpDatabase["data"][0]["valueField"] = "monthAmount";
// Green Robots
$jpDatabase["data"][1]["query"] = "SELECT SUM(amount) AS monthAmount
FROM salesByMonth
WHERE saleYear=2008
AND product_id = '2'
GROUP BY saleMonth
ORDER BY saleMonth ";
$jpDatabase["data"][1]["valueField"] = "monthAmount";
// Red Robots
$jpDatabase["data"][2]["query"] = "SELECT SUM(amount) AS monthAmount
FROM salesByMonth
WHERE saleYear=2008
AND product_id = '3'
GROUP BY saleMonth
ORDER BY saleMonth ";
$jpDatabase["data"][2]["valueField"] = "monthAmount";
// Yellow Robots
$jpDatabase["data"][3]["query"] = "SELECT SUM(amount) AS monthAmount
FROM salesByMonth
WHERE saleYear=2008
AND product_id = '4'
GROUP BY saleMonth
ORDER BY saleMonth ";
$jpDatabase["data"][3]["valueField"] = "monthAmount";
?>

View File

@@ -0,0 +1,51 @@
<?php
// Abstraction Class
$jpDatabase["abstractionClass"] = "DBMySQL.class.php";
// Database Login Info
$jpDatabase["dbServer"] = "[DBSERVER]";
$jpDatabase["dbUser"] = "[DBUSER]";
$jpDatabase["dbPassword"] = "[DBPASSWORD]";
$jpDatabase["dbDatabase"] = "[DBDATABASE]";
// Data Queries
$jpDatabase["data"] = array();
// Blue Robots
$jpDatabase["data"][0]["query"] = "SELECT SUM(amount) AS regionAmount
FROM salesByMonth
WHERE saleYear=2008
AND product_id = '1'
GROUP BY region_ID
ORDER BY region_ID ";
$jpDatabase["data"][0]["valueField"] = "regionAmount";
// Green Robots
$jpDatabase["data"][1]["query"] = "SELECT SUM(amount) AS regionAmount
FROM salesByMonth
WHERE saleYear=2008
AND product_id = '2'
GROUP BY region_ID
ORDER BY region_ID ";
$jpDatabase["data"][1]["valueField"] = "regionAmount";
// Red Robots
$jpDatabase["data"][2]["query"] = "SELECT SUM(amount) AS regionAmount
FROM salesByMonth
WHERE saleYear=2008
AND product_id = '3'
GROUP BY region_ID
ORDER BY region_ID ";
$jpDatabase["data"][2]["valueField"] = "regionAmount";
// Yellow Robots
$jpDatabase["data"][3]["query"] = "SELECT SUM(amount) AS regionAmount
FROM salesByMonth
WHERE saleYear=2008
AND product_id = '4'
GROUP BY region_ID
ORDER BY region_ID ";
$jpDatabase["data"][3]["valueField"] = "regionAmount";
?>

View File

@@ -0,0 +1,69 @@
<!-- Chart Characteristics -->
width: 550
height: 400
ndecplaces: 0
pecentndecplaces: 0
depth3d: 30
3dangle: 40
<!-- Chart Switches -->
3d: true
displayPercentages: true
labellines: false
quality: very high
<!-- Segment Labels -->
segmentlabels: true
segmentlabelfont: arial
segmentlabelfontsize: 10
segmentlabelfontbold: false
segmentlabelfontitalic: false
segmentlabelcolor: #000088
<!-- Popup segment Value Pre & Post Symbols -->
valuepresym: $
<!-- thousand seperater -->
thousandseparator: ,
<!-- Additional color information -->
backgroundcolor: #FFFFFF
<!-- Title -->
titletext: 2008 Total Sales
titlefont: arial
titlefontsize: 14
titlecolor: #000000
titleposition: -1,60
<!-- Legend Information -->
legend: true
legendfont: arial
legendfontsize: 11
legendfontbold: false
legendfontitalic: false
legendposition: -1,80
legendtitle:
legendbgcolor: #FFFFFF
legendbordercolor: #DDDDDD
legendtextcolor: #202020
legendstyle: horizontal
<!-- Pie Data -->
<!-- PieN x,y|size|seperation -->
pie1: 250,240|220|10
<!-- segment Data -->
<!-- segmentN series color|legend label| -->
segment1: #0000FF|Blue Robots|
segment2: #88FF00|Green Robots|
segment3: #FF2E00|Red Robots|
segment4: #FFB200|Yellow Robots|

View File

@@ -0,0 +1,48 @@
width: 700
height: 400
3d: true
depth3d: 10
ndecplaces: 0
thousandseparator: ,
backgroundcolor: #ffffff
barspacing: 1
barwidth: 10
displaybarvalues: false
gradientfill: true
vspace: 40
ylabelpre: $
series1: #0000FF|Blue Robots|left
series2: #88FF00|Green Robots|left
series3: #FF2E00|Red Robots|left
series4: #FFB200|Yellow Robots|left
xlabels: January|February|March|April|May|June|July|August|September|October|November|December
xlabelorientation: up angle
xlabelcolor: #000000
xlabelfont: arial
xlabelfontsize: 10
xlabelfontbold: false
xlabelfontitalic: false
<!-- Legend Information -->
legend: true
legendfont: arial
legendfontsize: 11
legendfontbold: false
legendfontitalic: false
legendposition: -1,80
legendtitle:
legendbgcolor: #FFFFFF
legendbordercolor: #DDDDDD
legendtextcolor: #202020
legendstyle: horizontal
target: 75000 | #000000 | Sales Target | arial,10,bold | solid | left |

View File

@@ -0,0 +1,48 @@
width: 700
height: 400
3d: true
depth3d: 25
ndecplaces: 0
thousandseparator: ,
backgroundcolor: #ffffff
barspacing: 5
barwidth: 45
displaybarvalues: false
gradientfill: true
vspace: 50
ylabelpre: $
series1: #0000AA|Blue Robots|left
series2: #44AA00|Green Robots|left
series3: #AA2800|Red Robots|left
series4: #AA9200|Yellow Robots|left
xlabels: January|February|March|April|May|June|July|August|September|October|November|December
xlabelorientation: up angle
xlabelcolor: #000000
xlabelfont: arial
xlabelfontsize: 10
xlabelfontbold: false
xlabelfontitalic: false
<!-- Legend Information -->
legend: true
legendfont: arial
legendfontsize: 11
legendfontbold: false
legendfontitalic: false
legendposition: -1,40
legendtitle:
legendbgcolor: #FFFFFF
legendbordercolor: #DDDDDD
legendtextcolor: #202020
legendstyle: horizontal
target: 200000 | #000000 | Sales Target | arial,10,bold | solid | left |

View File

@@ -0,0 +1,78 @@
width: 700
height: 400
3d: true
depth3d: 10
ndecplaces: 0
thousandseparator: ,
backgroundcolor: #ffffff
barspacing: 5
barwidth: 19
displaybarvalues: false
gradientfill: true
vspace: 50
ylabelpre: $
series1: #0000CC|Blue Robots|left
series2: #44CC00|Green Robots|left
series3: #CC2800|Red Robots|left
series4: #CCA200|Yellow Robots|left
<!-- Legend Information -->
legend: true
legendfont: arial
legendfontsize: 11
legendfontbold: false
legendfontitalic: false
legendposition: -1,40
legendtitle:
legendbgcolor: #FFFFFF
legendbordercolor: #DDDDDD
legendtextcolor: #202020
legendstyle: horizontal
xlabelorientation: up angle
xlabelcolor: #000000
xlabelfont: arial
xlabelfontsize: 10
xlabelfontbold: false
xlabelfontitalic: false
<?php
// Dynamically get the X axis labels from the region table
// Database Login Info
$jpDatabase["dbServer"] = "[DBSERVER]";
$jpDatabase["dbUser"] = "[DBUSER]";
$jpDatabase["dbPassword"] = "[DBPASSWORD]";
$jpDatabase["dbDatabase"] = "[DBDATABASE]";
// connect to the db
$dbLink = mysql_connect($jpDatabase["dbServer"],
$jpDatabase["dbUser"],
$jpDatabase["dbPassword"]);
mysql_select_db($jpDatabase["dbDatabase"], $dbLink);
// issue the query to get the region records
$sql = "SELECT description FROM region ORDER BY region_ID ";
$result = mysql_query($sql, $dbLink);
// construct the xlabels parameter
$xlabels = "";
while ( $row = mysql_fetch_array($result,MYSQL_ASSOC) ) {
$xlabels .= $row["description"]."|";
}
// write out the xlabels parameter
print "xlabels: ".$xlabels."\n";
// close the db connection
mysql_close($dbLink);
?>

View File

@@ -0,0 +1,79 @@
width: 700
height: 400
3d: true
depth3d: 30
quality: very high
ndecplaces: 0
thousandseparator: ,
backgroundcolor: #ffffff
barspacing: 5
barwidth: 80
displaybarvalues: false
gradientfill: true
vspace: 50
ylabelpre: $
series1: #0000AA|Blue Robots|left
series2: #44AA00|Green Robots|left
series3: #AA2800|Red Robots|left
series4: #AA9200|Yellow Robots|left
<!-- Legend Information -->
legend: true
legendfont: arial
legendfontsize: 11
legendfontbold: false
legendfontitalic: false
legendposition: -1,40
legendtitle:
legendbgcolor: #FFFFFF
legendbordercolor: #DDDDDD
legendtextcolor: #202020
legendstyle: horizontal
xlabelorientation: up angle
xlabelcolor: #000000
xlabelfont: arial
xlabelfontsize: 10
xlabelfontbold: false
xlabelfontitalic: false
<?php
// Dynamically get the X axis labels from the region table
// Database Login Info
$jpDatabase["dbServer"] = "[DBSERVER]";
$jpDatabase["dbUser"] = "[DBUSER]";
$jpDatabase["dbPassword"] = "[DBPASSWORD]";
$jpDatabase["dbDatabase"] = "[DBDATABASE]";
// connect to the db
$dbLink = mysql_connect($jpDatabase["dbServer"],
$jpDatabase["dbUser"],
$jpDatabase["dbPassword"]);
mysql_select_db($jpDatabase["dbDatabase"], $dbLink);
// issue the query to get the region records
$sql = "SELECT description FROM region ORDER BY region_ID ";
$result = mysql_query($sql, $dbLink);
// construct the xlabels parameter
$xlabels = "";
while ( $row = mysql_fetch_array($result,MYSQL_ASSOC) ) {
$xlabels .= $row["description"]."|";
}
// write out the xlabels parameter
print "xlabels: ".$xlabels."\n";
// close the db connection
mysql_close($dbLink);
?>

View File

@@ -0,0 +1,148 @@
<?php
class Database
{
var $dbLink;
var $dbServer;
var $dbUser;
var $dbPassword;
var $dbDatabase;
var $result;
var $lastRow;
var $errorState;
var $errorMessage;
/**
* Constructor
*/
function Database($dbServer = "",
$dbUser = "",
$dbPassword = "",
$dbDatabase = "") {
$this->dbServer = $dbServer;
$this->dbUser = $dbUser;
$this->dbPassword = $dbPassword;
$this->dbDatabase = $dbDatabase;
$this->errorState = false;
$this->dbLink = mysql_connect($this->dbServer,
$this->dbUser,
$this->dbPassword);
if (!$this->dbLink) {
$this->errorState = true;
$this->errorMessage = 'Could not connect: '.mysql_error();
return false;
}
if (!mysql_select_db($this->dbDatabase, $this->dbLink)) {
$this->errorState = true;
$this->errorMessage = 'Could not select database: '.mysql_error();
return false;
}
return true;
}
/**
* Opens a connection to the database
*/
function connect() {
$this->dbLink = mysql_connect($this->dbServer,
$this->dbUser,
$this->dbPassword);
if (!$this->dbLink) {
$this->errorState = true;
$this->errorMessage = 'Could not connect: '.mysql_error();
return false;
}
if (!mysql_select_db($this->dbDatabase, $this->dbLink)) {
$this->errorState = true;
$this->errorMessage = 'Could not select database: '.mysql_error();
return false;
}
return true;
}
/**
* Queries the database for a specific SQL query
*/
function query($sql) {
if (!$this->result = mysql_query($sql, $this->dbLink)) {
$this->errorState = true;
$this->errorMessage = 'Query Error: '.mysql_error();
}
return $this->result;
}
/**
* Fetches a row from a result set
*/
function fetch(&$result) {
return mysql_fetch_array($result,MYSQL_ASSOC);
}
/**
* Returns an associative array of all rows
*/
function fetchAll(&$result) {
$resultArr = array();
if ($result) {
$resultArr = array();
while ($row = $this->fetch($result)) {
$resultArr[] = $row;
}
}
return $resultArr;
}
function freeResult(&$result) {
if ($result != true && $result != false) {
mysql_free_result($result);
}
unset($result);
}
function getLastError() {
return mysql_error();
}
function getNumRows(&$result) {
$numRows = mysql_num_rows($result);
return $numRows;
}
// return the error state
function getErrorState() {
return $this->errorState;
}
// set the error state
function setErrorState($errorState) {
$this->errorState = $errorState;
}
/**
* disconnect
*/
function close() {
mysql_close($this->dbLink);
}
}
?>

View File

@@ -0,0 +1,119 @@
<?php
$dbTable = array(
"CREATE TABLE `salesDetail` (
`salesDetail_ID` INT(11) NOT NULL auto_increment,
`region_ID` INT(11) NOT NULL default '0',
`product_ID` VARCHAR(255) NOT NULL,
`saledate` timestamp NOT NULL default '0000-00-00 00:00:00',
`amount` REAL NOT NULL default '0.0',
PRIMARY KEY (`salesDetail_ID`),
KEY `region_ID` (`region_ID`),
KEY `product_ID` (`product_ID`)
) ",
"CREATE TABLE `salesByMonth` (
`salesByMonth_ID` INT(11) NOT NULL auto_increment,
`region_ID` INT(11) NOT NULL default '0',
`product_ID` VARCHAR(255) NOT NULL,
`saleMonth` INT NOT NULL default '0',
`saleYear` INT NOT NULL default '0',
`amount` REAL NOT NULL default '0.0',
PRIMARY KEY (`salesByMonth_ID`),
KEY `region_ID` (`region_ID`),
KEY `product_ID` (`product_ID`)
) ",
"CREATE TABLE `product` (
`product_ID` INT(11) NOT NULL auto_increment,
`description` VARCHAR(255) NOT NULL,
`productCode` VARCHAR(255) NOT NULL,
PRIMARY KEY (`product_ID`)
) ",
"CREATE TABLE `region` (
`region_ID` INT(11) NOT NULL auto_increment,
`description` VARCHAR(255) NOT NULL,
PRIMARY KEY (`region_ID`)
) "
);
// Region Data
$dbRegionData = array(
"Europe",
"North America",
"South America",
"Asia",
"Australasia",
"Africa"
);
// Product Data
$dbProductData = array(
array("description"=>"Blue Robots" ,"productCode"=>"robo1"),
array("description"=>"Green Robots" ,"productCode"=>"robo2"),
array("description"=>"Red Robots" ,"productCode"=>"robo3"),
array("description"=>"Yellow Robots" ,"productCode"=>"robo4")
);
// Generate some sales data
$dbSalesDetailData = array();
$dbSalesByMonthData = array();
for ($productID=1;$productID<5;$productID++) {
for ($year=2007;$year<2009;$year++) {
for ($month=1;$month<13;$month++) {
for ($regionID=1;$regionID<7;$regionID++) {
$dbSalesByMonthData[$regionID][$productID][$month][$year] = 0.0;
}
}
}
}
for ($productID=1;$productID<5;$productID++) {
$productPrice = 10;
switch ($productID) {
case 1: $productPrice = 7; break;
case 2: $productPrice = 5; break;
case 3: $productPrice = 5; break;
case 4: $productPrice = 10; break;
case 5: $productPrice = 2; break;
default: $productPrice = 10; break;
}
for ($year=2007;$year<2009;$year++) {
for ($month=1;$month<13;$month++) {
for ($regionID=1;$regionID<7;$regionID++) {
$nsales = rand(1,4);
for ($i=0;$i<$nsales;$i++) {
$day = rand(1,28);
$datetime = mktime(10,30,15,$month,$day,$year);
$saleDate = date("Y-m-d H:i:s",$datetime);
$amount = $productPrice * rand(10000,90000) / 100;
$dbSalesDetailData[] = array("productID"=>$productID,
"regionID"=>$regionID,
"saleDate"=>$saleDate,
"amount"=>$amount
);
$dbSalesByMonthData[$regionID][$productID][$month][$year] += $amount;
}
}
}
}
}
?>

View File

@@ -0,0 +1,310 @@
<?php
$dbFiles = array(
"./dataQueries/dbConfig.php",
"./dataQueries/dataInterfaceScript.php",
"./dataQueries/homePagedbConfig.php",
"./dataQueries/salesByMonthDB.php",
"./dataQueries/salesByRegionDB.php",
"./graphConfig/salesByRegionConfig.php",
"./graphConfig/salesByRegionStackedConfig.php"
);
function testConnection(&$jpDatabase) {
$error["allOk"] = false;
$error["messages"] = "";
$dbLink = @mysql_connect($jpDatabase["dbServer"],
$jpDatabase["dbUser"],
$jpDatabase["dbPassword"]);
if (!$dbLink) {
$error["messages"] .= "Error: Unable to connect to the database server ! <br>\n";
$error["messages"] .= "Double check the connection details and try again. <br>\n";
$error["messages"] .= mysql_error()." <br>\n";
}
else {
$error["allOk"] = true;
mysql_close($dbLink);
}
return $error;
}
function performSetUp(&$jpDatabase) {
global $dbSalesDetailData;
global $dbSalesByMonthData;
global $dbProductData;
global $dbRegionData;
global $dbTable;
$error["allOk"] = false;
$error["messages"] = "";
// connect and create the database
$dbLink = @mysql_connect($jpDatabase["dbServer"],
$jpDatabase["dbUser"],
$jpDatabase["dbPassword"]);
if (!$dbLink) {
$error["messages"] .= "Error: Unable to connect to the database server ! <br>\n";
$error["messages"] .= "Double check the connection details and try again. <br>\n";
$error["messages"] .= mysql_error()." <br>\n";
return getPage("setUpError.html",$error);
}
$sql = "DROP DATABASE ".$jpDatabase["dbDatabase"]." ";
mysql_query($sql, $dbLink);
$sql = "CREATE DATABASE ".$jpDatabase["dbDatabase"]." ";
if (!$result = mysql_query($sql, $dbLink)) {
$error["messages"] .= "Error: Unable to create database ".$jpDatabase["dbDatabase"]." ! <br>\n";
$error["messages"] .= mysql_error()." <br>\n";
mysql_close($dbLink);
return getPage("setUpError.html",$error);
}
// create and set up the JPSAMPLEsalesDB ready for use by the
// sample application
$dbObj = new Database($jpDatabase["dbServer"],
$jpDatabase["dbUser"],
$jpDatabase["dbPassword"],
$jpDatabase["dbDatabase"]);
if (!$dbObj) {
$error["messages"] .= "Error: Unable to connect to the database server ! <br>\n";
$error["messages"] .= "Double check the connection details and try again. <br>\n";
$error["messages"] .= mysql_error()." <br>\n";
mysql_close($dbLink);
return getPage("setUpError.html",$error);
}
// create the database tables
foreach ($dbTable as $sql) {
$result = $dbObj->query($sql);
if (!$result) {
$error["messages"] .= "Error: Unable to create database table ! <br>\n";
$error["messages"] .= $sql." <br>\n";
$error["messages"] .= $dbObj->getLastError()." <br>\n";
$dbObj->close();
return getPage("setUpError.html",$error);
}
}
// Populate Region Data
foreach ($dbRegionData as $region) {
$sql = "INSERT INTO region (region_ID,description)
VALUES (0,'".$region."') ";
$result = $dbObj->query($sql);
if (!$result) {
$error["messages"] .= "Error: Unable to Insert Region Data ! <br>\n";
$error["messages"] .= $sql." <br>\n";
$error["messages"] .= $dbObj->getLastError()." <br>\n";
$dbObj->close();
return getPage("setUpError.html",$error);
}
}
// Populate Product Data
foreach ($dbProductData as $product) {
$sql = "INSERT INTO product (product_ID,description,productCode)
VALUES (0,'".$product["description"]."','".$product["productCode"]."') ";
$result = $dbObj->query($sql);
if (!$result) {
$error["messages"] .= "Error: Unable to Insert Product Data ! <br>\n";
$error["messages"] .= $sql." <br>\n";
$error["messages"] .= $dbObj->getLastError()." <br>\n";
$dbObj->close();
return getPage("setUpError.html",$error);
}
}
// populate the sales detail table
foreach ($dbSalesDetailData as $salesDetail) {
$sql = "INSERT INTO salesDetail (salesDetail_ID,region_ID,product_ID,saledate,amount)
VALUES (0,".$salesDetail["regionID"].",'".$salesDetail["productID"]."','".$salesDetail["saleDate"]."',".$salesDetail["amount"].") ";
$result = $dbObj->query($sql);
if (!$result) {
$error["messages"] .= "Error: Unable to Insert Sales Detail Data ! <br>\n";
$error["messages"] .= $sql." <br>\n";
$error["messages"] .= $dbObj->getLastError()." <br>\n";
$dbObj->close();
return getPage("setUpError.html",$error);
}
}
// Populate Sales By Month Table
for ($productID=1;$productID<5;$productID++) {
for ($year=2007;$year<2009;$year++) {
for ($month=1;$month<13;$month++) {
for ($regionID=1;$regionID<7;$regionID++) {
$sql = "INSERT INTO salesByMonth (salesByMonth_ID,region_ID,product_ID,saleMonth,saleYear,amount)
VALUES (0,".$regionID.",'".$productID."',".$month.",".$year.",".$dbSalesByMonthData[$regionID][$productID][$month][$year].") ";
$result = $dbObj->query($sql);
if (!$result) {
$error["messages"] .= "Error: Unable to Insert Sales Detail Data ! <br>\n";
$error["messages"] .= $sql." <br>\n";
$error["messages"] .= $dbObj->getLastError()." <br>\n";
$dbObj->close();
return getPage("setUpError.html",$error);
}
}
}
}
}
$error["allOk"] = true;
$error["messages"] = "";
$dbObj->close();
$error = updateDBinfo($jpDatabase);
if (!$error["allOk"]) {
return getPage("setUpError.html",$error);
}
else {
// update the flag in index.php
$output = get_File_As_String("index.php");
$search = array("setupDone = false;", "setupDone = FALSE;");
$replace = array("setupDone = TRUE;", "setupDone = TRUE;");
$output = str_replace($search,$replace,$output);
put_File_Content("index.php",$output);
return getPage("setUpComplete.html",$error);
}
}
function getPage($pageFile,$error) {
$output = get_File_As_String("./pageTemplates/".$pageFile);
$search = array("[ERRORS]");
$replace = array($error["messages"]);
$output = str_replace($search,$replace,$output);
return $output;
}
function updateDBinfo(&$jpDatabase) {
global $dbFiles;
$error["allOk"] = true;
$error["messages"] = "";
foreach ($dbFiles as $dbFile) {
$output = get_File_As_String($dbFile);
$search = array("[DBSERVER]","[DBUSER]","[DBPASSWORD]","[DBDATABASE]");
$replace = array($jpDatabase["dbServer"],$jpDatabase["dbUser"],$jpDatabase["dbPassword"],$jpDatabase["dbDatabase"]);
$output = str_replace($search,$replace,$output);
if (!put_File_Content($dbFile,$output)) {
$error["messages"] .= "Error: Unable to update database access information in the data files ! <br>\n";
$error["messages"] .= "Double check file permission on the ./dataQueries/ directory and all files in this directory. <br>\n";
$error["allOk"] = false;
}
}
return $error;
}
function doSetUp() {
$jpDatabase["dbServer"] = "localhost:3306";
$jpDatabase["dbUser"] = "";
$jpDatabase["dbPassword"] = "";
$jpDatabase["dbDatabase"] = "JPSAMPLEsalesDB";
$valuesEntered = false;
if (isset($_REQUEST["dbServer"])) {$jpDatabase["dbServer"] = $_REQUEST["dbServer"];$valuesEntered = true;}
if (isset($_REQUEST["dbUser"])) {$jpDatabase["dbUser"] = $_REQUEST["dbUser"];$valuesEntered = true;}
if (isset($_REQUEST["dbPassword"])) {$jpDatabase["dbPassword"] = $_REQUEST["dbPassword"];$valuesEntered = true;}
// test the db connection
$valuesOK = false;
$error["allOk"] = false;
$error["messages"] = "";
if ($valuesEntered) {
$error = testConnection($jpDatabase);
if ($error["allOk"]) {
$valuesOK = true;
}
}
if ($valuesOK) {
$output = performSetUp($jpDatabase);
print $output;
exit(0);
}
else {
// return the set up page
$output = get_File_As_String("./pageTemplates/setup.html");
$search = array("[DBSERVER]","[DBUSER]","[DBPASSWORD]","[ERRORS]");
$replace = array($jpDatabase["dbServer"],$jpDatabase["dbUser"],$jpDatabase["dbPassword"],$error["messages"]);
$output = str_replace($search,$replace,$output);
print $output;
exit(0);
}
return true;
}
function get_File_As_String($filename) {
$contents = "";
$lines = file($filename);
$contents = implode("\n",$lines);
return $contents;
}
function put_File_Content($filename,$contents) {
if (is_array($contents)) {
$contents = implode("\n",$contents);
}
if (!$handle = fopen($filename, "w+")) {
return false;
}
fwrite($handle, $contents);
fclose($handle);
return true;
}
?>

View File

@@ -0,0 +1,60 @@
<?php
$setupDone = false;
require "./includes/setUpUtils.php";
require "./includes/DBMySQL.class.php";
require "./includes/dbTableCreateStatements.php";
if (!$setupDone) {
doSetUp();
$jpDatabase["dbServer"] = "localhost:3306";
$jpDatabase["dbUser"] = "";
$jpDatabase["dbPassword"] = "";
$jpDatabase["dbDatabase"] = "JPSAMPLEsalesDB";
$valuesEntered = false;
if (isset($_REQUEST["dbServer"])) {$jpDatabase["dbServer"] = $_REQUEST["dbServer"];$valuesEntered = true;}
if (isset($_REQUEST["dbUser"])) {$jpDatabase["dbUser"] = $_REQUEST["dbUser"];$valuesEntered = true;}
if (isset($_REQUEST["dbPassword"])) {$jpDatabase["dbPassword"] = $_REQUEST["dbPassword"];$valuesEntered = true;}
// test the db connection
$valuesOK = false;
$error["allOk"] = false;
$error["messages"] = "";
if ($valuesEntered) {
$error = testConnection($jpDatabase);
if ($error["allOk"]) {
$valuesOK = true;
}
}
if ($valuesOK) {
$output = performSetUp($jpDatabase);
print $output;
exit(0);
}
else {
// return the set up page
$output = get_File_As_String("./pageTemplates/setup.html");
$search = array("[DBSERVER]","[DBUSER]","[DBPASSWORD]","[ERRORS]");
$replace = array($jpDatabase["dbServer"],$jpDatabase["dbUser"],$jpDatabase["dbPassword"],$error["messages"]);
$output = str_replace($search,$replace,$output);
print $output;
exit(0);
}
}
/**
* Begin the Sample Application Here
**/
$output = get_File_As_String("./pageTemplates/index.html");
print $output;
exit(0);
?>

View File

@@ -0,0 +1,89 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Set Up Page</title>
<LINK REL=STYLESHEET TYPE="text/css" HREF="./pageTemplates/sampleApplication.css">
</head>
<body>
<h1>Robot Corporation</h1>
<h3>Sample Sales Reporting Application</h3>
<p></p>
<!-- NOTE: the dbinfo and config file paths are relative to the graph code not the page -->
<!--
<img src="../graph/vertical-bar-graph.php?
dbinfo=../sampleApplication/dataQueries/homePagedbConfig.php&
config=../sampleApplication/graphConfig/homePageVbar.txt"
width="550"
height="400">
-->
<!-- NOTE: the dbinfo and config file paths are relative to the graph code not the page -->
<img src="../graph/pie-chart.php?
dbinfo=../sampleApplication/dataQueries/homePagedbConfig.php&
config=../sampleApplication/graphConfig/homePagePieChart.txt"
width="550"
height="400">
<div class="linkArea">
<p>The chart above shows the total sales during 2008 for each product type.</p>
<a href="salesByMonth.html">Sales by Month &raquo;</a><br>
<a href="salesByMonthStacked.html">Sales by Month - Stacked Bars &raquo;</a><br>
<a href="salesByRegion.html">Sales by Region &raquo;</a><br>
<a href="salesByRegionStacked.html">Sales by Region - Stacked Cylinders &raquo;</a><br>
</div>
<div class="codeInfoBlock">
<h2>Page Notes</h2>
<p>The graph above is produced using the "Database Info" method with the following IMG tag:-<br>
<textarea>
<img src="../graph/pie-chart.php?
dbinfo=../sampleApplication/dataQueries/homePagedbConfig.php&
config=../sampleApplication/graphConfig/homePagePieChart.txt"
width="550"
height="400">
</textarea>
</p>
<p>The graph data is read directly from the database using the information contained in the file:-<br>
<textarea style="height: 20px;">
/sampleApplication/dataQueries/homePagedbConfig.php
</textarea>
</p>
<p>The settings and styles are set from the information contained in the file:-<br>
<textarea style="height: 20px;">
/sampleApplication/graphConfig/homePagePieChart.txt
</textarea>
</p>
</div>
<div style="width: 700px; padding: 8px; background-color: #FFE57F; border-width: 1px; border-color: #544E38; border-style: solid; margin: 4px;">
<h2>Next Steps</h2>
<h4>Documentation Contents</h4>
<a href="http://www.jpowered.com/php-scripts/adv-graph-chart/documentation/index.htm">Documentation &raquo;</a><br>
<a href="http://www.jpowered.com/php-scripts/adv-graph-chart/documentation/addingGraphsToPages.htm">Adding Graphs to Web Pages &raquo;</a><br>
<a href="http://www.jpowered.com/php-scripts/adv-graph-chart/documentation/configurationOptions.htm">Configuration Options and Parameters &raquo;</a><br>
<a href="http://www.jpowered.com/php-scripts/adv-graph-chart/documentation/graphData.htm">Supplying the Graph with Data &raquo;</a><br>
<h4>Database Connections</h4>
<a href="http://www.jpowered.com/php-scripts/adv-graph-chart/documentation/databaseInformationFile.htm">Database Information method &raquo;</a><br>
<a href="http://www.jpowered.com/php-scripts/adv-graph-chart/documentation/customDataFunction.htm">Custom Data Function &raquo;</a><br>
<h4>Also see:-</h4>
<a href="http://www.jpowered.com/php-scripts/adv-graph-chart/tutorials/">Online Tutorials &raquo;</a><br>
<a href="http://www.jpowered.com/php-scripts/adv-graph-chart/documentation/">Online Documentation &raquo;</a><br>
If you encounter any problems then please feel free to contact <a href="http://www.jpowered.com/support.htm">JPowered Support &raquo;</a>.
</div>
</body>
</html>

View File

@@ -0,0 +1,37 @@
body {background-color: #FFF;font-family: Arial, Helvetica, sans-serif;color: #000000;font-size: 11px; padding: 20px;}
H1 { color: #320099; font-size: 18px; font-family: Arial,Helvetica, sans-serif;font-weight:bold; margin:5px;}
H2 { color: #000000; font-size: 16px; font-family: Arial,Helvetica, sans-serif;font-style:italic; margin:5px;}
H4 { color: #000000; font-size: 12px; font-family: Arial,Helvetica, sans-serif;font-style: none; margin: 10px 4px 2px 4px;}
p {margin:5px;}
a, a:active, a:link, a:visited {font-weight: bold;color:#0000FF;text-decoration: none;font-size:11px;}
a:hover {font-weight: bold;color:#FF0000;text-decoration: none;}
.codeInfoBlock {
background-color: #FFE57F;
border: #654C99;
font-size: 12px;
border-style: solid;
border-width: 1px;
color: #000;
width: 700px;
padding: 10px;
}
.codeInfoBlock textarea {
width: 680px;
height: 100px;
background-color: #654C99;
color: #fff;
border-color: #17131E;
border-width: 1px;
border-style: solid;
padding: 4px;
}
.linkArea {
margin: 10px;
padding: 10px;
font-size: 12px;
}

View File

@@ -0,0 +1,18 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Set Up Page</title>
<LINK REL=STYLESHEET TYPE="text/css" HREF="./pageTemplates/sampleApplication.css">
</head>
<body>
<h1>Sample Sales Reporting Application - Set Up Procedure</h1>
<p>[ERRORS]</p>
<p>Sample Application Set Up Complete.</p>
<p><a href="index.php">view Sample Application</a></p>
</body>
</html>

View File

@@ -0,0 +1,18 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Set Up Page</title>
<LINK REL=STYLESHEET TYPE="text/css" HREF="./pageTemplates/sampleApplication.css">
</head>
<body>
<h1>Sample Sales Reporting Application - Set Up Procedure</h1>
<p>[ERRORS]</p>
<p>Unfortunately an error occurred the set up process.</p>
<p><a href="index.php">return and try again.</a></p>
</body>
</html>

View File

@@ -0,0 +1,40 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Set Up Page</title>
<LINK REL=STYLESHEET TYPE="text/css" HREF="./pageTemplates/sampleApplication.css">
</head>
<body>
<h1>Sample Sales Reporting Application - Set Up Procedure</h1>
<p>[ERRORS]</p>
Enter the Database Login information here:-
<form id="FORM_setup" name="FORM_setup" method="post" action="index.php">
<table>
<tr>
<td>Server</td>
<td><input style="width: 400px;" name="dbServer" type="text" value="[DBSERVER]"></td>
</tr>
<tr>
<td>User</td>
<td><input style="width: 400px;" name="dbUser" type="text" value="[DBUSER]"></td>
</tr>
<tr>
<td>Password</td>
<td><input style="width: 400px;" name="dbPassword" type="password" value="[DBPASSWORD]"></td>
</tr>
<tr>
<td></td>
<td><input name="submit" value="Begin SetUp" type="submit"></td>
</tr>
</table>
</form>
</body>
</html>

View File

@@ -0,0 +1,80 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Set Up Page</title>
<LINK REL=STYLESHEET TYPE="text/css" HREF="./pageTemplates/sampleApplication.css">
</head>
<body>
<h1>Robot Corporation</h1>
<h3>Sample Sales Reporting Application</h3>
<!-- NOTE: the dbinfo and config file paths are relative to the graph code not the page -->
<img src="../graph/vertical-bar-graph.php?
dbinfo=../sampleApplication/dataQueries/salesByMonthDB.php&
config=../sampleApplication/graphConfig/salesByMonthConfig.txt"
width="700"
height="400">
<div class="linkArea">
<p>The chart above shows the total sales during 2008 for each product type.</p>
<a href="index.php">&laquo; back to Index</a><br><br>
<a href="salesByMonth.html">Sales by Month &raquo;</a><br>
<a href="salesByMonthStacked.html">Sales by Month - Stacked Bars &raquo;</a><br>
<a href="salesByRegion.html">Sales by Region &raquo;</a><br>
<a href="salesByRegionStacked.html">Sales by Region - Stacked Cylinders &raquo;</a><br>
</div>
<div class="codeInfoBlock">
<h2>Page Notes</h2>
<p>The graph above is produced using the "Database Info" method with the following IMG tag:-<br>
<textarea>
<img src="../graph/vertical-bar-graph.php?
dbinfo=../sampleApplication/dataQueries/salesByMonthDB.php&
config=../sampleApplication/graphConfig/salesByMonthConfig.txt"
width="700"
height="400">
</textarea>
</p>
<p>The graph data is read directly from the database using the information contained in the file:-<br>
<textarea style="height: 20px;">
/sampleApplication/dataQueries/salesByMonthDB.php
</textarea>
</p>
<p>The settings and styles are set from the information contained in the file:-<br>
<textarea style="height: 20px;">
/sampleApplication/graphConfig/salesByMonthConfig.txt
</textarea>
</p>
</div>
<div style="width: 700px; padding: 8px; background-color: #FFE57F; border-width: 1px; border-color: #544E38; border-style: solid; margin: 4px;">
<h2>Next Steps</h2>
<h4>Documentation Contents</h4>
<a href="http://www.jpowered.com/php-scripts/adv-graph-chart/documentation/index.htm">Documentation &raquo;</a><br>
<a href="http://www.jpowered.com/php-scripts/adv-graph-chart/documentation/addingGraphsToPages.htm">Adding Graphs to Web Pages &raquo;</a><br>
<a href="http://www.jpowered.com/php-scripts/adv-graph-chart/documentation/configurationOptions.htm">Configuration Options and Parameters &raquo;</a><br>
<a href="http://www.jpowered.com/php-scripts/adv-graph-chart/documentation/graphData.htm">Supplying the Graph with Data &raquo;</a><br>
<h4>Database Connections</h4>
<a href="http://www.jpowered.com/php-scripts/adv-graph-chart/documentation/databaseInformationFile.htm">Database Information method &raquo;</a><br>
<a href="http://www.jpowered.com/php-scripts/adv-graph-chart/documentation/customDataFunction.htm">Custom Data Function &raquo;</a><br>
<h4>Also see:-</h4>
<a href="http://www.jpowered.com/php-scripts/adv-graph-chart/tutorials/">Online Tutorials &raquo;</a><br>
<a href="http://www.jpowered.com/php-scripts/adv-graph-chart/documentation/">Online Documentation &raquo;</a><br>
If you encounter any problems then please feel free to contact <a href="http://www.jpowered.com/support.htm">JPowered Support &raquo;</a>.
</div>
</body>
</html>

View File

@@ -0,0 +1,87 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Set Up Page</title>
<LINK REL=STYLESHEET TYPE="text/css" HREF="./pageTemplates/sampleApplication.css">
</head>
<body>
<h1>Robot Corporation</h1>
<h3>Sample Sales Reporting Application</h3>
<!-- NOTE: the dbinfo and config file paths are relative to the graph code not the page -->
<img src="../graph/stacked-vertical-bar-graph.php?
dbinfo=../sampleApplication/dataQueries/salesByMonthDB.php&
config=../sampleApplication/graphConfig/salesByMonthStackedConfig.txt"
width="700"
height="400">
<div class="linkArea">
<p>The chart above shows the total sales during 2008 for each product type.</p>
<a href="index.php">&laquo; back to Index</a><br><br>
<a href="salesByMonth.html">Sales by Month &raquo;</a><br>
<a href="salesByMonthStacked.html">Sales by Month - Stacked Bars &raquo;</a><br>
<a href="salesByRegion.html">Sales by Region &raquo;</a><br>
<a href="salesByRegionStacked.html">Sales by Region - Stacked Cylinders &raquo;</a><br>
</div>
<div class="codeInfoBlock">
<h2>Page Notes</h2>
<p>The graph above is produced using the "Database Info" method with the following IMG tag:-<br>
<textarea>
<img src="../graph/stacked-vertical-cylinder-graph.php?
dbinfo=../sampleApplication/dataQueries/salesByMonthDB.php&
config=../sampleApplication/graphConfig/salesByMonthStackedConfig.txt"
width="700"
height="400">
</textarea>
</p>
<p>The graph data is read directly from the database using the information contained in the file:-<br>
<textarea style="height: 20px;">
/sampleApplication/dataQueries/salesByMonthDB.php
</textarea>
</p>
<p>The settings and styles are set from the information contained in the file:-<br>
<textarea style="height: 20px;">
/sampleApplication/graphConfig/salesByMonthStackedConfig.txt
</textarea>
</p>
</div>
<div style="width: 700px; padding: 8px; background-color: #FFE57F; border-width: 1px; border-color: #544E38; border-style: solid; margin: 4px;">
<h2>Next Steps</h2>
<h4>Documentation Contents</h4>
<a href="http://www.jpowered.com/php-scripts/adv-graph-chart/documentation/index.htm">Documentation &raquo;</a><br>
<a href="http://www.jpowered.com/php-scripts/adv-graph-chart/documentation/addingGraphsToPages.htm">Adding Graphs to Web Pages &raquo;</a><br>
<a href="http://www.jpowered.com/php-scripts/adv-graph-chart/documentation/configurationOptions.htm">Configuration Options and Parameters &raquo;</a><br>
<a href="http://www.jpowered.com/php-scripts/adv-graph-chart/documentation/graphData.htm">Supplying the Graph with Data &raquo;</a><br>
<h4>Database Connections</h4>
<a href="http://www.jpowered.com/php-scripts/adv-graph-chart/documentation/databaseInformationFile.htm">Database Information method &raquo;</a><br>
<a href="http://www.jpowered.com/php-scripts/adv-graph-chart/documentation/customDataFunction.htm">Custom Data Function &raquo;</a><br>
<h4>Also see:-</h4>
<a href="http://www.jpowered.com/php-scripts/adv-graph-chart/tutorials/">Online Tutorials &raquo;</a><br>
<a href="http://www.jpowered.com/php-scripts/adv-graph-chart/documentation/">Online Documentation &raquo;</a><br>
If you encounter any problems then please feel free to contact <a href="http://www.jpowered.com/support.htm">JPowered Support &raquo;</a>.
</div>
</body>
</html>

View File

@@ -0,0 +1,81 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Set Up Page</title>
<LINK REL=STYLESHEET TYPE="text/css" HREF="./pageTemplates/sampleApplication.css">
</head>
<body>
<h1>Robot Corporation</h1>
<h3>Sample Sales Reporting Application</h3>
<!-- NOTE: the dbinfo and config file paths are relative to the graph code not the page -->
<img src="../graph/vertical-bar-graph.php?
dbinfo=../sampleApplication/dataQueries/salesByRegionDB.php&
config=../sampleApplication/graphConfig/salesByRegionConfig.php"
width="700"
height="400">
<div class="linkArea">
<p>The chart above shows the total sales during 2008 for each product type.</p>
<a href="index.php">&laquo; back to Index</a><br><br>
<a href="salesByMonth.html">Sales by Month &raquo;</a><br>
<a href="salesByMonthStacked.html">Sales by Month - Stacked Bars &raquo;</a><br>
<a href="salesByRegion.html">Sales by Region &raquo;</a><br>
<a href="salesByRegionStacked.html">Sales by Region - Stacked Cylinders &raquo;</a><br>
</div>
<div class="codeInfoBlock">
<h2>Page Notes</h2>
<p>The graph above is produced using the "Database Info" method with the following IMG tag:-<br>
<textarea>
<img src="../graph/vertical-bar-graph.php?
dbinfo=../sampleApplication/dataQueries/salesByRegionDB.php&
config=../sampleApplication/graphConfig/salesByRegionConfig.php"
width="700"
height="400">
</textarea>
</p>
<p>The graph data is read directly from the database using the information contained in the file:-<br>
<textarea style="height: 20px;">
/sampleApplication/dataQueries/salesByRegionDB.php
</textarea>
</p>
<p>The settings and styles are set from the information output by the script:-<br>
<textarea style="height: 20px;">
/sampleApplication/graphConfig/salesByRegionConfig.php
</textarea>
<br><b>NOTE:</b> This script dynamically calculates the X-axis labels by reading information from the database.
</p>
</div>
<div style="width: 700px; padding: 8px; background-color: #FFE57F; border-width: 1px; border-color: #544E38; border-style: solid; margin: 4px;">
<h2>Next Steps</h2>
<h4>Documentation Contents</h4>
<a href="http://www.jpowered.com/php-scripts/adv-graph-chart/documentation/index.htm">Documentation &raquo;</a><br>
<a href="http://www.jpowered.com/php-scripts/adv-graph-chart/documentation/addingGraphsToPages.htm">Adding Graphs to Web Pages &raquo;</a><br>
<a href="http://www.jpowered.com/php-scripts/adv-graph-chart/documentation/configurationOptions.htm">Configuration Options and Parameters &raquo;</a><br>
<a href="http://www.jpowered.com/php-scripts/adv-graph-chart/documentation/graphData.htm">Supplying the Graph with Data &raquo;</a><br>
<h4>Database Connections</h4>
<a href="http://www.jpowered.com/php-scripts/adv-graph-chart/documentation/databaseInformationFile.htm">Database Information method &raquo;</a><br>
<a href="http://www.jpowered.com/php-scripts/adv-graph-chart/documentation/customDataFunction.htm">Custom Data Function &raquo;</a><br>
<h4>Also see:-</h4>
<a href="http://www.jpowered.com/php-scripts/adv-graph-chart/tutorials/">Online Tutorials &raquo;</a><br>
<a href="http://www.jpowered.com/php-scripts/adv-graph-chart/documentation/">Online Documentation &raquo;</a><br>
If you encounter any problems then please feel free to contact <a href="http://www.jpowered.com/support.htm">JPowered Support &raquo;</a>.
</div>
</body>
</html>

View File

@@ -0,0 +1,81 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Set Up Page</title>
<LINK REL=STYLESHEET TYPE="text/css" HREF="./pageTemplates/sampleApplication.css">
</head>
<body>
<h1>Robot Corporation</h1>
<h3>Sample Sales Reporting Application</h3>
<!-- NOTE: the dbinfo and config file paths are relative to the graph code not the page -->
<img src="../graph/stacked-vertical-cylinder-graph.php?
dbinfo=../sampleApplication/dataQueries/salesByRegionDB.php&
config=../sampleApplication/graphConfig/salesByRegionStackedConfig.php"
width="700"
height="400">
<div class="linkArea">
<p>The chart above shows the total sales during 2008 for each product type.</p>
<a href="index.php">&laquo; back to Index</a><br><br>
<a href="salesByMonth.html">Sales by Month &raquo;</a><br>
<a href="salesByMonthStacked.html">Sales by Month - Stacked Bars &raquo;</a><br>
<a href="salesByRegion.html">Sales by Region &raquo;</a><br>
<a href="salesByRegionStacked.html">Sales by Region - Stacked Cylinders &raquo;</a><br>
</div>
<div class="codeInfoBlock">
<h2>Page Notes</h2>
<p>The graph above is produced using the "Database Info" method with the following IMG tag:-<br>
<textarea>
<img src="../graph/stacked-vertical-cylinder-graph.php?
dbinfo=../sampleApplication/dataQueries/salesByRegionDB.php&
config=../sampleApplication/graphConfig/salesByRegionStackedConfig.php"
width="700"
height="400">
</textarea>
</p>
<p>The graph data is read directly from the database using the information contained in the file:-<br>
<textarea style="height: 20px;">
/sampleApplication/dataQueries/salesByRegionDB.php
</textarea>
</p>
<p>The settings and styles are set from the information output by the script:-<br>
<textarea style="height: 20px;">
/sampleApplication/graphConfig/salesByRegionStackedConfig.php
</textarea>
<br><b>NOTE:</b> This script dynamically calculates the X-axis labels by reading information from the database.
</p>
</div>
<div style="width: 700px; padding: 8px; background-color: #FFE57F; border-width: 1px; border-color: #544E38; border-style: solid; margin: 4px;">
<h2>Next Steps</h2>
<h4>Documentation Contents</h4>
<a href="http://www.jpowered.com/php-scripts/adv-graph-chart/documentation/index.htm">Documentation &raquo;</a><br>
<a href="http://www.jpowered.com/php-scripts/adv-graph-chart/documentation/addingGraphsToPages.htm">Adding Graphs to Web Pages &raquo;</a><br>
<a href="http://www.jpowered.com/php-scripts/adv-graph-chart/documentation/configurationOptions.htm">Configuration Options and Parameters &raquo;</a><br>
<a href="http://www.jpowered.com/php-scripts/adv-graph-chart/documentation/graphData.htm">Supplying the Graph with Data &raquo;</a><br>
<h4>Database Connections</h4>
<a href="http://www.jpowered.com/php-scripts/adv-graph-chart/documentation/databaseInformationFile.htm">Database Information method &raquo;</a><br>
<a href="http://www.jpowered.com/php-scripts/adv-graph-chart/documentation/customDataFunction.htm">Custom Data Function &raquo;</a><br>
<h4>Also see:-</h4>
<a href="http://www.jpowered.com/php-scripts/adv-graph-chart/tutorials/">Online Tutorials &raquo;</a><br>
<a href="http://www.jpowered.com/php-scripts/adv-graph-chart/documentation/">Online Documentation &raquo;</a><br>
If you encounter any problems then please feel free to contact <a href="http://www.jpowered.com/support.htm">JPowered Support &raquo;</a>.
</div>
</body>
</html>