incubator-stonehenge-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shan...@apache.org
Subject svn commit: r741193 [1/2] - in /incubator/stonehenge/trunk/stocktrader/php/trader_client: ./ images/ wsdl/
Date Thu, 05 Feb 2009 17:24:54 GMT
Author: shankar
Date: Thu Feb  5 17:24:53 2009
New Revision: 741193

URL: http://svn.apache.org/viewvc?rev=741193&view=rev
Log:
php trader client added

Added:
    incubator/stonehenge/trunk/stocktrader/php/trader_client/
    incubator/stonehenge/trunk/stocktrader/php/trader_client/account.php
    incubator/stonehenge/trunk/stocktrader/php/trader_client/config.php
    incubator/stonehenge/trunk/stocktrader/php/trader_client/confirmation.php
    incubator/stonehenge/trunk/stocktrader/php/trader_client/glossary.php
    incubator/stonehenge/trunk/stocktrader/php/trader_client/home.php
    incubator/stonehenge/trunk/stocktrader/php/trader_client/images/
    incubator/stonehenge/trunk/stocktrader/php/trader_client/images/bg.gif   (with props)
    incubator/stonehenge/trunk/stocktrader/php/trader_client/images/button-bg.gif   (with props)
    incubator/stonehenge/trunk/stocktrader/php/trader_client/images/footer-bg.gif   (with props)
    incubator/stonehenge/trunk/stocktrader/php/trader_client/images/green-arrow.gif   (with props)
    incubator/stonehenge/trunk/stocktrader/php/trader_client/images/header-bg.gif   (with props)
    incubator/stonehenge/trunk/stocktrader/php/trader_client/images/header-link-bg-hover.gif   (with props)
    incubator/stonehenge/trunk/stocktrader/php/trader_client/images/header-link-bg.gif   (with props)
    incubator/stonehenge/trunk/stocktrader/php/trader_client/images/header-links-bg.gif   (with props)
    incubator/stonehenge/trunk/stocktrader/php/trader_client/images/logo.gif   (with props)
    incubator/stonehenge/trunk/stocktrader/php/trader_client/images/middle-bg.gif   (with props)
    incubator/stonehenge/trunk/stocktrader/php/trader_client/images/powered-by-logo.gif   (with props)
    incubator/stonehenge/trunk/stocktrader/php/trader_client/images/red-arrow.gif   (with props)
    incubator/stonehenge/trunk/stocktrader/php/trader_client/index.php
    incubator/stonehenge/trunk/stocktrader/php/trader_client/login.php
    incubator/stonehenge/trunk/stocktrader/php/trader_client/portfolio.php
    incubator/stonehenge/trunk/stocktrader/php/trader_client/quotes.php
    incubator/stonehenge/trunk/stocktrader/php/trader_client/register.php
    incubator/stonehenge/trunk/stocktrader/php/trader_client/style.css
    incubator/stonehenge/trunk/stocktrader/php/trader_client/wsdl/
    incubator/stonehenge/trunk/stocktrader/php/trader_client/wsdl/TradeServiceWcf.svc.wsdl
    incubator/stonehenge/trunk/stocktrader/php/trader_client/wsdl/TradeServiceWcf.svc.wsdl0
    incubator/stonehenge/trunk/stocktrader/php/trader_client/wsdl/TradeServiceWcf.svc.xsd0
    incubator/stonehenge/trunk/stocktrader/php/trader_client/wsdl/TradeServiceWcf.svc.xsd1
    incubator/stonehenge/trunk/stocktrader/php/trader_client/wsdl/config_svc.wsdl

Added: incubator/stonehenge/trunk/stocktrader/php/trader_client/account.php
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/php/trader_client/account.php?rev=741193&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/php/trader_client/account.php (added)
+++ incubator/stonehenge/trunk/stocktrader/php/trader_client/account.php Thu Feb  5 17:24:53 2009
@@ -0,0 +1,277 @@
+<?php
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+require_once("request_processor.php");
+if(!IsLoggedIn())
+{
+	header("Location: login.php");
+}
+else
+{
+	/*If the user requested to update his profile information*/
+	if ($_POST['UPDATEUSERPROFILE'])
+	{
+		$userID = GetUserFromCookie();
+		$password = $_POST['PASSWORD'];
+		$fullName = $_POST['FULLNAME'];
+		$address = $_POST['ADDRESS'];
+		$email = $_POST['EMAIL'];
+		$creditCard = $_POST['CREDITCARD'];
+
+		UpdateAccountProfile($userID, 
+			$fullName, $email, $address, $creditCard, $password);
+	}
+	$ordersReturn = GetOrders(GetUserFromCookie())->getOrdersReturn;
+	$accountSummary = GetUserAccountSummary($ordersReturn);
+	$userAccountDataReturn = 
+		GetAccountData(GetUserFromCookie())->getAccountDataReturn;
+	$userAccountProfileDataReturn = 
+		GetAccountProfileData(GetUserFromCookie())->getAccountProfileDataReturn;
+}
+?>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+	<head>
+		<meta http-equiv="content-type" content="text/html;charset=utf-8" />
+		<meta name="generator" content="Adobe GoLive" />
+		<title>WSF/PHP StockTrader Welcome</title>
+		<link href="style.css" rel="stylesheet" type="text/css" media="all" />
+	</head>
+
+	<body>
+		<div id="content">
+			<div id="header">
+				<div class="logo"><img src="images/logo.gif"></div>
+			</div>
+			<div id="header-links">
+				<table>
+					<tr>
+					<td>
+						<a href="index.php">Welcome</a>
+					</td>
+					<td>
+						<a href="home.php">Home</a>
+					</td>
+					<td>
+						<a href="account.php">Account</a>
+					</td>
+					<td>
+						<a href="portfolio.php">Portfolio</a>
+					</td>
+					<td>
+						<a href="quotes.php">Quotes/Trade</a>
+					</td>
+					<td>
+						<a href="glossary.php">Glossary</a>
+					</td>
+					<td>
+						<a href="config.php">Config</a>
+					</td>
+					<td>
+						<a href="login.php">Login/Logout</a>
+					</td>
+					</tr>
+				</table>
+			</div>
+			<div id="middle">
+
+			<?php
+				$getClosedOrdersReturn = GetClosedOrders();
+
+				/*Checking whether there is new status change happened in the 
+				related to a particular order.*/
+				if ($getClosedOrdersReturn)
+				{
+					print ("<p style=\"color: red\" align=\"center\">Trade Alert: 
+						The following orders have completed.</p>");
+					print("<table class=\"table-outer\" 
+						cellspacing=\"0\" align=\"center\"><thead>
+						<tr><th>Order ID</th><th>Order Status</th>
+						<th>Creation Date</th><th>Completion Date</th>
+						<th>Txn Fee</th><th>Type</th><th>Symbol</th>
+						<th>Quantity</th></tr></thead><tbody>");
+
+					$index = 0;
+					while ($getClosedOrdersReturn->OrderDataBean[$index])
+					{
+						$openDate = new DateTime($getClosedOrdersReturn->OrderDataBean[$index]->openDate);
+						$completionDate =new DateTime( $getClosedOrdersReturn->OrderDataBean[$index]->completionDate);
+						print ("<tr><td>".$getClosedOrdersReturn->OrderDataBean[$index]->orderID."</td>
+							<td>".$getClosedOrdersReturn->OrderDataBean[$index]->orderStatus."</td>
+							<td>".$openDate->format("m/d/Y h:i:s A")."</td>
+							<td>".$completionDate->format("m/d/Y h:i:s A")."</td>
+							<td>$".$getClosedOrdersReturn->OrderDataBean[$index]->orderFee."</td>
+							<td>".$getClosedOrdersReturn->OrderDataBean[$index]->orderType."</td>
+							<td>".$getClosedOrdersReturn->OrderDataBean[$index]->symbol."</td>
+							<td>".$getClosedOrdersReturn->OrderDataBean[$index]->quantity."</td></tr>");
+						$index ++;
+					}
+					print("</tbody></table><br/><br/>");
+				}
+
+				/*Display the account summary information of a particular user.*/
+				if ($accountSummary)
+				{	
+					print ("<div class=\"main-title\"><h1>Account Information
+						</h1><script type=\"text/javascript\">var thisdate = new Date();
+					document.writeln(thisdate.toLocaleString());</script></div>");
+
+					print ("<table class=\"table-outer\" cellspacing=\"0\" align=\"center\">
+						<thead><tr><th>Subtotal Buys</th><th>Subtotal Sells</th><th>Subtotal Fees
+						</th><th>Net Impact Cash Balance</th></tr></thead><tbody><tr>");
+
+					printf("<td class=\"currency\">$%.2f</td>", $accountSummary->totalBuys);
+					printf("<td class=\"currency\">$%.2f</td>", $accountSummary->totalSells);
+					printf("<td class=\"currency\">$%.2f</td>", $accountSummary->totalTax);
+					printf("<td class=\"currency\">");
+
+					if ($accountSummary->totalImpact > 0)
+					{
+						printf("<span class=\"price-loss\">$%.2f</span>", $accountSummary->totalImpact);
+					}
+					else if ($accountSummary->totalImpact < 0)
+					{
+						printf("<span class=\"price-gain\">$%.2f</span>", $accountSummary->totalImpact);
+					}
+					else
+					{
+						printf("<span>($%.2f)</span>", $accountSummary->totalImpact);
+					}
+					printf("</td></tr></tbody></table>");
+				}
+
+				/*Display the orders a particular user is associated with.*/
+				if ($ordersReturn)
+				{
+					print("<div><p><b>Total Orders Shown</b></p></div>");
+					print("<table class=\"table-outer\" cellspacing=\"0\" align=\"center\"><thead><tr>");
+					print("<th>Order ID</th><th>Order Status</th><th>Creation Date</th><th>Completion Date
+						</th><th>Txn Fee</th><th>Type</th><th>Symbol</th><th>Quantity</th><th>Price
+						</th><th>Total</th></tr></thead><tbody>");
+					
+					$index = 0;
+					while ($ordersReturn->OrderDataBean[$index])
+					{
+						$openDate = new DateTime($ordersReturn->OrderDataBean[$index]->openDate);
+						$completionDate = new DateTime($ordersReturn->OrderDataBean[$index]->completionDate);
+						print ("<tr><td>".$ordersReturn->OrderDataBean[$index]->orderID."</td>
+							<td>".$ordersReturn->OrderDataBean[$index]->orderStatus."</td>
+							<td>".$openDate->format("m/d/Y h:i:s A")."
+							</td><td>".$completionDate->format("m/d/Y h:i:s A")."</td>
+							<td class=\"currency\">$".$ordersReturn->OrderDataBean[$index]->orderFee."</td>
+							<td>".$ordersReturn->OrderDataBean[$index]->orderType."</td>");
+							
+						print ("<td><form action = \"quotes.php\" method = \"post\">
+							<input type=\"hidden\" name=\"SYMBOLS\" value=\"".
+							$ordersReturn->OrderDataBean[$index]->symbol."\"/>
+							<input type=\"submit\" name=\"GETQUOTE\" value=\"".
+							$ordersReturn->OrderDataBean[$index]->symbol."\"/></form></td>");
+
+						print ("<td class=\"currency\">".$ordersReturn->OrderDataBean[$index]->quantity."</td>
+							<td class=\"currency\">$".$ordersReturn->OrderDataBean[$index]->price."</td>
+							<td class=\"currency\">$".(($ordersReturn->OrderDataBean[$index]->price * 
+							$ordersReturn->OrderDataBean[$index]->quantity) + 
+							$ordersReturn->OrderDataBean[$index]->orderFee)."</td></tr>");
+
+						$index ++;
+					}
+					print ("</tbody></table>");
+				}
+				
+				/*Display the account profile information associted to a 
+				the user.*/
+				if ($userAccountProfileDataReturn)
+				{
+					print ("<form action = \"account.php\"  method =\"post\">
+						<table class=\"profile\" cellspacing=\"0\" width=\"100%\"><thead><tr>
+						<th>Update Account Profile:".GetUserFromCookie()."</th></tr></thead><tbody><tr><td>");
+					print ("<table cellspacing=\"0\" align=\"center\">");
+					print ("<tr><td>Full Name:</td><td><input name=\"FULLNAME\" type=\"text\" value=\"".
+						$userAccountProfileDataReturn->fullName."\" id=\"\" size=\"25\"/>
+						</td><td>Email Address:</td><td><input name=\"EMAIL\" type=\"text\" value=\"".
+						$userAccountProfileDataReturn->email."\" id=\"\" size=\"25\"/></td></tr>");
+					print ("<tr><td>Address:</td><td><input name=\"ADDRESS\" type=\"text\" value=\"".
+						$userAccountProfileDataReturn->address."\" id=\"\" size=\"25\"/></td>
+						<td>Password:</td><td><input type=\"password\" name=\"PASSWORD\" type=\"text\" value=\"".
+						$userAccountProfileDataReturn->password."\" id=\"\" size=\"25\"/></td></tr>");
+					print ("<tr><td>Credit Card:</td><td><input name=\"CREDITCARD\" type=\"text\" value=\"".
+						$userAccountProfileDataReturn->creditCard."\" id=\"\" size=\"25\"/></td>
+						<td>Confirm Password:</td><td><input type=\"password\" name=\"PASSWORD\" type=\"text\" value=\"".
+						$userAccountProfileDataReturn->password."\" id=\"\" size=\"25\"/></td></tr>");
+					print ("<tr><td colspan=\"4\" class=\"button\"><input type=\"submit\" 
+						name=\"UPDATEUSERPROFILE\"value=\"Update\" class=\"button\"/></td></tr>");
+					print ("</table></form");
+
+					/*Display the account information of a the user*/
+					if ($userAccountDataReturn)	
+					{
+						$creationDate = new DateTime($userAccountDataReturn->creationDate);
+						$lastLogin = new DateTime($userAccountDataReturn->lastLogin);
+						print("<table align=\"center\" class=\"profile-content\" cellspacing=\"0\"><tbody>");
+						print ("<tr><td class=\"left\">Account ID:</td>
+							<td>".$userAccountDataReturn->accountID."</td><td class=\"left\">
+							Account Created</td><td>".$creationDate->format("m/d/Y h:i:s A")."</td></tr>");
+						print ("<tr><td class=\"left\">User ID:</td>
+							<td>".$userAccountDataReturn->profileID."</td><td class=\"left\">
+							Last Login:</td><td>".$lastLogin->format("m/d/Y h:i:s A")."</td></tr>");
+						print ("<tr><td class=\"left\">Opening Balance:</td>
+							<td>".$userAccountDataReturn->openBalance."</td>
+							<td class=\"left\">Total Logins:</td>
+							<td>".$userAccountDataReturn->loginCount."</td></tr>");
+						print("<tr><td class=\"left\">Cash Balance:</td>");
+							
+						if ($userAccountDataReturn->balance > 0)
+						{
+							print("<td><span class=\"price-gain\">$".
+								$userAccountDataReturn->balance."</span></td>");
+						}
+						else if($userAccountDataReturn->balance < 0)
+						{
+							print("<td><span class=\"price-loss\">$".
+								(-1) * $userAccountDataReturn->balance."</span></td>");
+						}
+						else
+						{
+							print("<td>$".$userAccountDataReturn->balance."</td>");
+						}	
+						print("<td class=\"left\">Total Logous:</td>
+							<td>".$userAccountDataReturn->logoutCount."</td></tr>");
+						print("</tbody></table>");
+					}
+					print("</td></tr></tbody></table>");
+				}
+			?>
+			<div class="bottom">
+			<form method = "post"  action = "quotes.php">
+			<input type="text" value="<?php print ($symbol); ?>" name="SYMBOLS" size="25"/>
+			<input type="submit" value="Get Quote" name="GETQUOTE" class="button"/>
+			</form>
+			</div>
+			</div>
+			<div id="footer">
+				<div style="float:left;">Copyright 2008, WSO2 Inc.</div>
+				<div style="margin-left:432px;float:left;">Powered by 
+				<img align="top" src="images/powered-by-logo.gif" style="margin-top:-3px; margin-left: 0px;"/></div>
+			</div>
+		</div>
+	</body>
+
+</html>

Added: incubator/stonehenge/trunk/stocktrader/php/trader_client/config.php
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/php/trader_client/config.php?rev=741193&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/php/trader_client/config.php (added)
+++ incubator/stonehenge/trunk/stocktrader/php/trader_client/config.php Thu Feb  5 17:24:53 2009
@@ -0,0 +1,113 @@
+<?php
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+require_once ("request_processor.php");
+
+
+if (isset ($_POST['SETENDPOINT']))
+{
+	if (($_POST['ENDPOINT']) != "")
+	{
+		WriteEndpoint($_POST['ENDPOINT']);
+		header("Location: login.php");
+	}
+}
+?>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+	<head>
+		<meta http-equiv="content-type" content="text/html;charset=utf-8" />
+		<meta name="generator" content="Adobe GoLive" />
+		<title>WSF/PHP StockTrader Welcome</title>
+		<link href="style.css" rel="stylesheet" type="text/css" media="all" />
+	</head>
+
+	<body>
+
+	<form method = "post"  action = "config.php">
+
+		<div id="content">
+		<div id="header">
+			<div class="logo"><img src="images/logo.gif"></div>
+		</div>
+
+		<div id="header-links">
+		<table>
+			<tr>
+			<td>
+			<a href="index.php">Welcome</a>
+			</td>
+			<td>
+			<a href="home.php">Home</a>
+			</td>
+			<td>
+			<a href="account.php">Account</a>
+			</td>
+			<td>
+			<a href="portfolio.php">Portfolio</a>
+			</td>
+			<td>
+			<a href="quotes.php">Quotes/Trade</a>
+			</td>
+			<td>
+			<a href="glossary.php">Glossary</a>
+			</td>
+			<td>
+			<a href="config.php">Config</a>
+			</td>
+			<td>
+			<a href="login.php">Login/Logout</a>
+			</td>
+			</tr>
+		</table>
+		</div>
+
+		<div id="middle">
+
+		<div class="main-title">
+		<h1>Config</h1>
+		<script type=\"text/javascript\">
+			var thisdate = new Date();
+			document.writeln(thisdate.toLocaleString());
+		</script>
+		</div>
+
+		<div class="login">
+		<table>
+		<tr>
+		<td>Configuration Service</td>
+		<td><input type="text" name = "ENDPOINT" value = <?php if (GetEndpoint() == "") print ("http://localhost:8080/config_service/config_svc.php"); else print(GetEndpoint());?> size = "75"/></td>
+		</tr>
+		<tr>
+		<td></td>
+		<td><input type = "submit" name = "SETENDPOINT" value = "Set" class="button"/></td>
+		</tr>
+		</table>
+		</div>
+		</div>
+		<div id="footer">
+			<div style="float:left;">Copyright 2008, WSO2 Inc.</div>
+			<div style="margin-left:432px;float:left;">Powered by 
+			<img align="top" src="images/powered-by-logo.gif" style="margin-top:-3px; margin-left: 0px;"/></div>
+	</div>
+
+		</div>
+		</form>
+	</body>
+</html>

Added: incubator/stonehenge/trunk/stocktrader/php/trader_client/confirmation.php
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/php/trader_client/confirmation.php?rev=741193&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/php/trader_client/confirmation.php (added)
+++ incubator/stonehenge/trunk/stocktrader/php/trader_client/confirmation.php Thu Feb  5 17:24:53 2009
@@ -0,0 +1,150 @@
+<?php
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+require_once("request_processor.php");
+if(!IsLoggedIn())
+{
+	header("Location: login.php");
+}
+else
+{
+	if ($_POST['SELL'])
+	{
+		$isSell = $_POST['SELL'];
+		$holdingID = $_POST['HOLDINGID'];
+		$quantity = $_POST['QUANTITY'];
+		$symbol = $_POST['SYMBOL'];
+	}
+	else if ($_POST['BUY'])
+	{
+		$quantity = $_POST['QUANTITY'];
+		$symbol = $_POST['SYMBOL'];
+		$price = $_POST['PRICE'];
+		$isBuy = $_POST['BUY'];
+	}
+	else
+	{
+		print ("This is not buy or sell.");
+	}
+}
+?>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+	<head>
+		<meta http-equiv="content-type" content="text/html;charset=utf-8" />
+		<meta name="generator" content="Adobe GoLive" />
+		<title>WSF/PHP StockTrader Welcome</title>
+		<link href="style.css" rel="stylesheet" type="text/css" media="all" />
+	</head>
+
+	<body>
+		<div id="content">
+			<div id="header">
+				<div class="logo"><img src="images/logo.gif"></div>
+			</div>
+			<div id="header-links">
+				<table>
+					<tr>
+					<td>
+						<a href="index.php">Welcome</a>
+					</td>
+					<td>
+						<a href="home.php">Home</a>
+					</td>
+					<td>
+						<a href="account.php">Account</a>
+					</td>
+					<td>
+						<a href="portfolio.php">Portfolio</a>
+					</td>
+					<td>
+						<a href="quotes.php">Quotes/Trade</a>
+					</td>
+					<td>
+						<a href="glossary.php">Glossary</a>
+					</td>
+					<td>
+						<a href="config.php">Config</a>
+					</td>
+					<td>
+						<a href="login.php">Login/Logout</a>
+					</td>
+					</tr>
+				</table>
+			</div>
+			<div id="middle">
+				<div class="main-title">
+					<h1>Trade</h1>
+					<script type=\"text/javascript\">
+						var thisdate = new Date();
+						document.writeln(thisdate.toLocaleString());
+					</script>
+				</div>
+				
+				<div id="confirm">
+				<h2>Trade Confirmation</h2>
+				<div class="confirm-content">
+					<form action="quotes.php" method="post">
+					<?php
+
+						if ($isSell)
+						{
+							print("<p>You have requested to sell all or part of your holding ".$holdingID.". 
+									This holding has a total of ".$quantity." shares of stock ".$symbol.". 
+									Please indicate how many share to sell.</p>");
+
+							print("<nobr>Number of Shares: <input type=\"text\" name=\"QUANTITY\" value=\"".$quantity."\" id=\"\" size=\"10\"/>");
+							print ("<input type=\"hidden\" name=\"HOLDINGID\" value=\"".$holdingID."\"></input>");
+							print ("<input type=\"submit\" name=\"SELL\" value=\"Sell\" class=\"button\"/>");
+						}
+						else if ($isBuy)
+						{
+							print("<nobr>Number of Shares: <input type=\"text\" name=\"QUANTITY\" value=\"".$quantity."\" id=\"\" size=\"10\"/>");
+							print("<p>You have requested to buy shares of ".$symbol." which is currently trading at $".$price.".</p>");
+							print ("<input type=\"hidden\" name=\"SYMBOL\" value=\"".$symbol."\"></input>");
+							print ("<input type=\"submit\" name=\"BUY\" value=\"Buy\" class=\"button\"/>");
+						}
+						else
+						{
+						}
+						print ("<input type=\"submit\" name = \"CANCEL\" value=\"Cancel\" class=\"button\"/></nobr>");
+					?>
+					</form>
+				</div>
+				</div>
+				
+			<div class="bottom">
+			<form method = "post"  action = "quotes.php">
+			<input type="text" value="<?php print ($symbol); ?>" name="SYMBOLS" size="25"/>
+			<input type="submit" value="Get Quote" name="GETQUOTE" class="button"/>
+			</form>
+			</div>
+			</div>
+			<div id="footer">
+				<div style="float:left;">Copyright 2008, WSO2 Inc.</div>
+				<div style="margin-left:432px;float:left;">Powered by 
+				<img align="top" src="images/powered-by-logo.gif" style="margin-top:-3px; margin-left: 0px;"/></div>
+			</div>
+		</div>
+	</body>
+
+</html>

Added: incubator/stonehenge/trunk/stocktrader/php/trader_client/glossary.php
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/php/trader_client/glossary.php?rev=741193&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/php/trader_client/glossary.php (added)
+++ incubator/stonehenge/trunk/stocktrader/php/trader_client/glossary.php Thu Feb  5 17:24:53 2009
@@ -0,0 +1,226 @@
+<?php
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+?>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+	<head>
+		<meta http-equiv="content-type" content="text/html;charset=utf-8" />
+		<meta name="generator" content="Adobe GoLive" />
+		<title>WSF/PHP StockTrader Welcome</title>
+		<link href="style.css" rel="stylesheet" type="text/css" media="all" />
+	</head>
+
+	<body>
+		<div id="content">
+			<div id="header">
+				<div class="logo"><img src="images/logo.gif"></div>
+			</div>
+			<div id="header-links">
+				<table>
+					<tr>
+					<td>
+						<a href="index.php">Welcome</a>
+					</td>
+					<td>
+						<a href="home.php">Home</a>
+					</td>
+					<td>
+						<a href="account.php">Account</a>
+					</td>
+					<td>
+						<a href="portfolio.php">Portfolio</a>
+					</td>
+					<td>
+						<a href="quotes.php">Quotes/Trade</a>
+					</td>
+					<td>
+						<a href="glossary.php">Glossary</a>
+					</td>
+					<td>
+						<a href="config.php">Config</a>
+					</td>
+					<td>
+						<a href="login.php">Login/Logout</a>
+					</td>
+					</tr>
+				</table>
+			</div>
+			<div id="middle">
+				<div class="main-title">
+					<h1>Glossary</h1>
+					<script type="text/javascript">
+						var thisdate = new Date();
+						document.writeln(thisdate.toLocaleString());
+					</script>
+				</div>
+				<table align="center" class="glossary" >
+					<thead>
+						<tr>
+							<th>Term</th>
+							<th>Description</th>
+						</tr>
+					</thead>
+					<tbody>
+						<tr>
+							<td class="left">Account ID</td>
+							<td>A unique Integer based key. Each user is assigned an account ID at account creation time.</td>
+						</tr>
+						<tr>
+							<td class="left">Account Created</td>
+							<td>The time and date the users account was first created.</td>
+						</tr>
+						<tr>
+							<td class="left">Cash Balance</td>
+							<td>The current cash balance in the users account. This does not include current stock holdings.</td>
+						</tr>
+							<td class="left">Company</td>
+							<td>The full company name for an individual stock.</td>
+						</tr>
+							<td class="left">Current Gain/Loss</td>
+							<td>The total gain or loss of this account, computed by substracting the current sum of cash/holdings minus the opening account balance.</td>
+						</tr>
+							<td class="left">Current Price</td>
+							<td>The current trading price for a given stock symbol.</td>
+						</tr>
+							<td class="left">Gain/Loss</td>
+							<td>The current gain or loss of an individual stock holding, computed as (current market value - holding basis).</td>
+						</tr>
+						</tr>
+							<td class="left">Last Login</td>
+							<td>The date and time this user last logged in to Trade.</td>
+						</tr>
+						</tr>
+							<td class="left">Market Value</td>
+							<td>The current total value of a stock holding, computed as (quantity * current price).</td>
+						</tr>
+						</tr>
+							<td class="left">Number of Holdings</td>
+							<td>The total number of stocks currently owned by this account.</td>
+						</tr>
+						</tr>
+							<td class="left">Open Price</td>
+							<td>The price of a given stock at the open of the trading session.</td>
+						</tr>
+						</tr>
+							<td class="left">Order ID</td>
+							<td>A unique Integer based key. Each order is assigned an order ID at order creation time.</td>
+						</tr>
+						</tr>
+							<td class="left">Opening Balance</td>
+							<td>The initial cash balance in this account when it was opened.</td>
+						</tr>
+						</tr>
+							<td class="left">Order Status</td>
+							<td>orders are opened, processed, closed and completed. Order status shows the current stat for this order.</td>
+						</tr>
+						</tr>
+							<td class="left">Price Range</td>
+							<td>The low and high prices for this stock during the current trading session</td>
+						</tr>
+						</tr>
+							<td class="left">Purchase Date</td>
+							<td>The date and time the a stock was purchased.</td>
+						</tr>
+						</tr>
+							<td class="left">Purchase Price</td>
+							<td>The price used when purchasing the stock.</td>
+						</tr>
+						</tr>
+							<td class="left">Purchase Basis</td>
+							<td>The total cost to purchase this holding. This is computed as (quantity * purchase price).</td>
+						</tr>
+						</tr>
+							<td class="left">Quantity</td>
+							<td>The number of stock shares in the order or user holding.</td>
+						</tr>
+						</tr>
+							<td class="left">Session Created</td>
+							<td>An HTTP session is created for each user at during login. Session created shows the time and day when the session was created.</td>
+						</tr>
+						</tr>
+							<td class="left">Sum of Cash/Holdings</td>
+							<td>The total current value of this account. This is the sum of the cash balance along with the value of current stock holdings.</td>
+						</tr>
+						</tr>
+							<td class="left">Symbol</td>
+							<td>The symbol for a Trade stock.</td>
+						</tr>
+						</tr>
+							<td class="left">Total Logins</td>
+							<td>The total number of logins performed by this user.</td>
+						</tr>
+						</tr>
+							<td class="left">Total Logouts</td>
+							<td>The total number of logouts performed by this user.</td>
+						</tr>
+						</tr>
+							<td class="left">Total of Holdings</td>
+							<td>The current total value of all stock holdings in this account given the current valuation of each stock held.</td>
+						</tr>
+						</tr>
+							<td class="left">Top gainers</td>
+							<td>The list of stocks (matching LIKE CLAUSE 's:1__%' per WebSphere Trade 6.1 behavior) gaining the most in price during the current trading session.</td>
+						</tr>
+						</tr>
+							<td class="left">Top Losers</td>
+							<td>The list of stocks (matching LIKE CLAUSE 's:1__%' per WebSphere Trade 6.1 behavior) falling the most in price during the current trading session.</td>
+						</tr>
+						</tr>
+							<td class="left">Trader Stock Index (TSIA)</td>
+							<td>A computed index of the top 20 stocks (matching LIKE CLAUSE 's:1__%' per WebSphere Trade 6.1 behavior) in Trade.</td>
+						</tr>
+						</tr>
+							<td class="left">Trading Volume</td>
+							<td>The total number of shares traded for stocks (matching LIKE CLAUSE 's:1__%' per WebSphere Trade 6.1 behavior) during this trading session.</td>
+						</tr>
+						</tr>
+							<td class="left">Txn Fee</td>
+							<td>The fee charged by the brokerage to process this order.</td>
+						</tr>
+						</tr>
+							<td class="left">Type</td>
+							<td>The order type (buy or sell).</td>
+						</tr>
+						</tr>
+							<td class="left">User ID</td>
+							<td>The unique user ID for the account chosen by the user at account registration.</td>
+						</tr>
+						</tr>
+							<td class="left">Volume</td>
+							<td>The total number of shares traded for this stock.</td>
+						</tr>
+					</tbody>
+				</table>
+								
+				
+				
+			
+			</div>
+			<div id="footer">
+				<div style="float:left;">Copyright 2008, WSO2 Inc.</div>
+				<div style="margin-left:432px;float:left;">Powered by 
+				<img align="top" src="images/powered-by-logo.gif" style="margin-top:-3px; margin-left: 0px;"/></div>
+			</div>
+		</div>
+	</body>
+
+</html>

Added: incubator/stonehenge/trunk/stocktrader/php/trader_client/home.php
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/php/trader_client/home.php?rev=741193&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/php/trader_client/home.php (added)
+++ incubator/stonehenge/trunk/stocktrader/php/trader_client/home.php Thu Feb  5 17:24:53 2009
@@ -0,0 +1,312 @@
+<?php
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+require_once("request_processor.php");
+
+if(!IsLoggedIn())
+{
+	header("Location: login.php");
+}
+else 
+{
+	/*Market data summary.*/
+	$mktSummary = GetMarketSummary();
+	$tsia = round($mktSummary->getMarketSummaryReturn->TSIA, 2);
+	$gain = round($mktSummary->getMarketSummaryReturn->TSIA - $mktSummary->getMarketSummaryReturn->openTSIA, 2);
+	$volume = $mktSummary->getMarketSummaryReturn->volume;
+	$topGainers = $mktSummary->getMarketSummaryReturn->topGainers;
+	$topLosers = $mktSummary->getMarketSummaryReturn->topLosers;
+
+	/*Account information for the user.*/
+	$accountData = GetAccountData(GetUserFromCookie());
+	$accountDataReturn = $accountData->getAccountDataReturn;
+
+	/*Holding information for a particular user*/	
+	$holdings = GetHoldings(GetUserFromCookie());
+	$holdingInfo = GetHoldingInformation($holdings);
+	$noOfHoldings = $holdingInfo->noOfHoldings;
+	$totalHoldings = $holdingInfo->totalHoldings;
+}
+
+?>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+	<head>
+		<meta http-equiv="content-type" content="text/html;charset=utf-8" />
+		<meta name="generator" content="Adobe GoLive" />
+		<title>WSF/PHP StockTrader Welcome</title>
+		<link href="style.css" rel="stylesheet" type="text/css" media="all" />
+	</head>
+
+	<body>
+		<div id="content">
+			<div id="header">
+				<div class="logo"><img src="images/logo.gif"></div>
+			</div>
+			<div id="header-links">
+				<table>
+					<tr>
+					<td>
+						<a href="index.php">Welcome</a>
+					</td>
+					<td>
+						<a href="home.php">Home</a>
+					</td>
+					<td>
+						<a href="account.php">Account</a>
+					</td>
+					<td>
+						<a href="portfolio.php">Portfolio</a>
+					</td>
+					<td>
+						<a href="quotes.php">Quotes/Trade</a>
+					</td>
+					<td>
+						<a href="glossary.php">Glossary</a>
+					</td>
+					<td>
+						<a href="config.php">Config</a>
+					</td>
+					<td>
+						<a href="login.php">Login/Logout</a>
+					</td>
+					</tr>
+				</table>
+			</div>
+			<div id="middle">
+
+			<?php
+				print ("<div class=\"main-title\"><h1>Home</h1><script type=\"text/javascript\">var thisdate = new Date();
+					document.writeln(thisdate.toLocaleString());</script></div>");
+				print ("<h3>Welcome ".GetUserFromCookie()."</h3>");
+			?>
+
+				<table>
+				<tr>
+				<td>
+				<div class="left">
+					<table class="normal">
+						<thead><tr><th colspan="2">User Statistics</th></tr></thead>
+
+						<?php
+							if($accountDataReturn)
+							{
+								$creationDate = new DateTime($accountDataReturn->creationDate);
+								$lastLogin = new DateTime($accountDataReturn->lastLogin);
+								print ("<tbody>");
+								print ("<tr><td class=\"left\">Account ID:</td>
+									<td>".($accountDataReturn->accountID)."</td></tr>");
+								print ("<tr><td class=\"left\">Account Created:</td>
+									<td>".$creationDate->format("m/d/Y h:i:s A")."</td></tr>");
+								print ("<tr><td class=\"left\">Total Logins:</td>
+									<td>".$accountDataReturn->loginCount."</td></tr>");
+								print ("<tr><td class=\"left\">Session Created:</td>
+									<td>".$lastLogin->format("m/d/Y h:i:s A")."</td></tr>");
+								print ("</tbody>");
+							}
+						?>
+
+						<thead><tr><th colspan="2">Summary</th></tr></thead>
+						<?php
+							if (!($holdingInfo == NULL) || ($accountDataReturn == NULL))
+							{
+								print ("<tbody>");
+								print ("<tr><td class=\"left\">Cash Balance:</td>
+									<td>".$accountDataReturn->balance."</td></tr>");
+
+								print ("<tr><td class=\"left\">Number of Holdings:</td>
+									<td>".$noOfHoldings."</td></tr>");
+								
+								print ("<tr><td class=\"left\">Total of Holdings:</td><td>");
+								printf("$ %.2f",$totalHoldings);
+								print ("</td></tr>");
+
+								print ("<tr><td class=\"left\">Sum of Cash and Holdings:</td><td>");
+								printf("$ %.2f",($totalHoldings + ($accountDataReturn->balance)));
+								print ("</td></tr>");
+
+								print ("<tr><td class=\"left\">Opening Balance:</td><td>");
+								printf ("$ %.2f", $accountDataReturn->openBalance);
+								print ("</td></tr>");
+
+								print ("<tr><td class=\"left\">Current Gain/(Loss):</td>
+									<td><span class=\"price\">");
+								$gain =  (($totalHoldings + ($accountDataReturn->balance)) - $accountDataReturn->openBalance);
+								if ($gain < 0)
+								{
+									printf("$ (%.2f)", ((-1) * $gain));
+								}
+								else if ($gain >= 0)
+								{
+									printf("$ %.2f", $gain);
+								}
+								$gainPercent = round((($gain/$accountDataReturn->openBalance) * 100), 2);
+								print ("</span></td></tr>");
+
+
+								print ("<tr><td class=\"left\">%Gain/(Loss):</td><td>");
+
+								if ($gainPercent > 0)
+								{
+									print ("<span class=\"price-gain\">".$gainPercent."%</span>");
+								}
+								else if ($gainPercent < 0)
+								{
+									print ("<span class=\"price-loss\">".$gainPercent."%</span>");
+								}
+								else
+								{
+									print ("<span>".$gainPercent."%</span>");
+								}
+								print ("</td></tr>");
+								print("</tbody>");
+							}
+							?>
+							</table>
+						</td>
+
+						<td>
+						<div class="right">
+						<h3>Market Summary</h3>
+							<p><?php print(date("D, F j, Y, g:i a")); ?></p>
+
+							<table class="table-outer" cellspacing="0">
+							<?php
+							if (!($holdingInfo == NULL) || ($accountDataReturn == NULL))
+							{
+								print ("<tr><td class=\"special\">Trade Stock Index (TSIA)</td><td>");
+								print($tsia);
+								print(" ");
+								print("<span");	
+
+								if ($gain > 0)
+								{
+									print (" class=\"price-gain\">$");
+								}
+								else if ($gain < 0)
+								{
+									print (" class=\"price-loss\">$");
+								}
+								else
+								{
+									print(">");
+								}
+								printf("%.2f</span>", $gain);
+								print ("</td></tr>");
+
+								print ("<tr><td class=\"special\">Trading Volume</td><td>");
+
+								print ($volume);
+								print ("</td></tr>");
+
+								print("<tr><td class=\"special\">Top Gainers</td><td>");
+								print ("<table class=\"table-inner\" cellspacing=\"0\">");
+								print("<thead><tr><th>Symbol</th><th>Price</th><th>Change</th></tr></thead>");
+								print("<tbody>");
+
+								$index = 0;
+								$gainer = $topGainers->QuoteDataBean[$index];
+								while($gainer)
+								{
+									print ("<tr><td><form action = \"quotes.php\" method = \"post\">
+										<input type=\"hidden\" name=\"SYMBOLS\" value=\"".$gainer->symbol."\"/>
+										<input type=\"submit\" name=\"GETQUOTE\" value=\"".$gainer->symbol."\"></input></form></td>");
+
+									printf ("<td>$%.2f</td>", $gainer->price);
+									print ("<td><span");
+
+									if (($gainer->change) > 0)
+									{
+										print ("class=\"price-gain\">$");
+									}
+									else if (($gainer->change) < 0)
+									{
+										print ("class=\"price-loss\">$");
+									}
+									else
+									{
+										print(">$");
+									}
+
+									printf ("%.2f", $gainer->change);
+									print ("</span></td>");	
+									print ("</form></tr>");
+
+									$index++;
+									$gainer = $topGainers->QuoteDataBean[$index];
+								}	
+
+								print ("</tbody></table></td></tr>");
+
+								print ("<tr><td class=\"special\">Top Losers</td><td>
+									<table class=\"table-inner\" cellspacing=\"0\"><thead>
+									<tr><th>Symbol</th><th>Price</th><th>Change</th></tr></thead><tbody>");
+
+								$index = 0;
+								$loser = $topLosers->QuoteDataBean[$index];
+								while($loser)
+								{
+									print ("<tr><td><form action = \"quotes.php\" method = \"post\">
+										<input type=\"submit\" name=\"SYMBOLS\" value=\"".
+										$loser->symbol."\"></input></form></td>");
+
+									printf ("<td>$%.2f</td>", $loser->price);
+									print ("<td><span");
+
+									if (($loser->change) > 0)
+									{
+										print (" class=\"price-gain\">$");
+									}
+									else if (($loser->change) < 0)
+									{
+										print (" class=\"price-loss\">$");
+									}
+									else
+									{
+										print(">$");
+									}	
+									printf ("%.2f", $loser->change);
+									print ("</span></td>");	
+									print ("</tr>");
+
+									$index++;
+									$loser = $topLosers->QuoteDataBean[$index];
+								}
+								print("</tbody></table>");
+								print("</td></tr></table>");
+								print("</div>");
+								print("</td></tr></table>");
+							}
+							?>
+
+			<div class="bottom">
+			<input type="text" value="" id="" size="25"/><input type="button" value="Get Quote" class="button"/>
+			</div>
+			</div>
+			<div id="footer">
+				<div style="float:left;">Copyright 2008, WSO2 Inc.</div>
+				<div style="margin-left:432px;float:left;">Powered by 
+				<img align="top" src="images/powered-by-logo.gif" style="margin-top:-3px; margin-left: 0px;"/></div>
+			</div>
+		</div>
+	</body>
+</html>

Added: incubator/stonehenge/trunk/stocktrader/php/trader_client/images/bg.gif
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/php/trader_client/images/bg.gif?rev=741193&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/stonehenge/trunk/stocktrader/php/trader_client/images/bg.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/stonehenge/trunk/stocktrader/php/trader_client/images/button-bg.gif
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/php/trader_client/images/button-bg.gif?rev=741193&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/stonehenge/trunk/stocktrader/php/trader_client/images/button-bg.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/stonehenge/trunk/stocktrader/php/trader_client/images/footer-bg.gif
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/php/trader_client/images/footer-bg.gif?rev=741193&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/stonehenge/trunk/stocktrader/php/trader_client/images/footer-bg.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/stonehenge/trunk/stocktrader/php/trader_client/images/green-arrow.gif
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/php/trader_client/images/green-arrow.gif?rev=741193&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/stonehenge/trunk/stocktrader/php/trader_client/images/green-arrow.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/stonehenge/trunk/stocktrader/php/trader_client/images/header-bg.gif
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/php/trader_client/images/header-bg.gif?rev=741193&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/stonehenge/trunk/stocktrader/php/trader_client/images/header-bg.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/stonehenge/trunk/stocktrader/php/trader_client/images/header-link-bg-hover.gif
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/php/trader_client/images/header-link-bg-hover.gif?rev=741193&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/stonehenge/trunk/stocktrader/php/trader_client/images/header-link-bg-hover.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/stonehenge/trunk/stocktrader/php/trader_client/images/header-link-bg.gif
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/php/trader_client/images/header-link-bg.gif?rev=741193&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/stonehenge/trunk/stocktrader/php/trader_client/images/header-link-bg.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/stonehenge/trunk/stocktrader/php/trader_client/images/header-links-bg.gif
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/php/trader_client/images/header-links-bg.gif?rev=741193&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/stonehenge/trunk/stocktrader/php/trader_client/images/header-links-bg.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/stonehenge/trunk/stocktrader/php/trader_client/images/logo.gif
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/php/trader_client/images/logo.gif?rev=741193&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/stonehenge/trunk/stocktrader/php/trader_client/images/logo.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/stonehenge/trunk/stocktrader/php/trader_client/images/middle-bg.gif
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/php/trader_client/images/middle-bg.gif?rev=741193&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/stonehenge/trunk/stocktrader/php/trader_client/images/middle-bg.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/stonehenge/trunk/stocktrader/php/trader_client/images/powered-by-logo.gif
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/php/trader_client/images/powered-by-logo.gif?rev=741193&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/stonehenge/trunk/stocktrader/php/trader_client/images/powered-by-logo.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/stonehenge/trunk/stocktrader/php/trader_client/images/red-arrow.gif
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/php/trader_client/images/red-arrow.gif?rev=741193&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/stonehenge/trunk/stocktrader/php/trader_client/images/red-arrow.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/stonehenge/trunk/stocktrader/php/trader_client/index.php
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/php/trader_client/index.php?rev=741193&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/php/trader_client/index.php (added)
+++ incubator/stonehenge/trunk/stocktrader/php/trader_client/index.php Thu Feb  5 17:24:53 2009
@@ -0,0 +1,115 @@
+<?php 
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+?>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+	<head>
+		<meta http-equiv="content-type" content="text/html;charset=utf-8" />
+		<meta name="generator" content="Adobe GoLive" />
+		<title>WSF/PHP StockTrader Welcome</title>
+		<link href="style.css" rel="stylesheet" type="text/css" media="all" />
+	</head>
+
+	<body>
+		<div id="content">
+		<div id="header">
+			<div class="logo"><img src="images/logo.gif"></div>
+		</div>
+		<div id="header-links">
+		<table>
+			<tr>
+			<td>
+			<a href="index.php">Welcome</a>
+			</td>
+			<td>
+			<a href="home.php">Home</a>
+			</td>
+			<td>
+			<a href="account.php">Account</a>
+			</td>
+			<td>
+			<a href="portfolio.php">Portfolio</a>
+			</td>
+			<td>
+			<a href="quotes.php">Quotes/Trade</a>
+			</td>
+			<td>
+			<a href="glossary.php">Glossary</a>
+			</td>
+			<td>
+			<a href="config.php">Config</a>
+			</td>
+			<td>
+			<a href="login.php">Login/Logout</a>
+			</td>
+			</tr>
+		</table>
+		</div>
+		<div id="middle">
+				<div class="main-title">
+		<h1>Welcome!</h1>
+		<script type=\"text/javascript\">
+			var thisdate = new Date();
+			document.writeln(thisdate.toLocaleString());
+		</script>
+		</div>
+		<table>
+		<tr>
+		<td>
+		<div class="left">
+				<p> The design of WSO2 StockTrader sample application is based on an online stock trading scenario with the functionality of the application equivalent to the  <a href="http://msdn.microsoft.com/stocktrader">Microsoft .NET Stock Trader </a> sample benchmark application and <a href="https://www14.software.ibm.com/webapp/iwm/web/preLogin.do?source=trade6">IBM WebSphere's Trade 6.1 </a> sample application. WSO2 StockTrader sample application is powered by <a href="http://wso2.org/projects/wsf/php">WSO2 WSF/PHP</a> and <a href="http://wso2.org/projects/wsas/java">WSO2 WSAS</a>. It serves to illustrate interoperability between PHP Java and .NET in deploying high-performance, scalable service oriented applications. </p>
+
+<p>For more details, check <a href="http://wso2.org/interop/stocktrader">WSO2 Stock Trader home page</a>. </p>
+
+		</div>
+		</td>
+		<td>	
+		<div class="right">
+						<h3>Sample of Technologies Demonstrated</h3>
+						<table>
+							<tbody>
+								<tr>
+									<td>
+										<ul>
+											<li>Service-oriented, n-tier design with PHP, Java and .NET</li>
+											<li>Clean separation of UI, business services and DB access</li>
+											<li>WSO2 Web Services Framework For PHP</li>
+											<li>WSO2 Web Services Application Server</li>
+											<li>Interoperability with .NET</li>
+											<li>Loosely-coupled, message-oriented design</li>
+										</ul>
+									</td>
+								</tr>
+							</tbody>
+						</table>
+					</div>
+				</tr>	
+			</table>
+		</div>
+		<div id="footer">
+			<div style="float:left;">Copyright 2008, WSO2 Inc.</div>
+			<div style="margin-left:432px;float:left;">Powered by 
+			<img align="top" src="images/powered-by-logo.gif" style="margin-top:-3px; margin-left: 0px;"/></div>
+		</div>
+		</div>
+	</body>
+
+</html>

Added: incubator/stonehenge/trunk/stocktrader/php/trader_client/login.php
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/php/trader_client/login.php?rev=741193&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/php/trader_client/login.php (added)
+++ incubator/stonehenge/trunk/stocktrader/php/trader_client/login.php Thu Feb  5 17:24:53 2009
@@ -0,0 +1,139 @@
+<?php
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+require_once ("request_processor.php");
+
+if (IsLoggedIn())
+{
+	/*By deleting the cookie the user is logged off*/
+	LogoutUser(GetUserFromCookie());
+	header("Location: login.php");
+}
+
+if (isset ($_POST['LOGINREQUEST']))
+{
+	if (!isset ($_POST['USERNAME']) || !isset($_POST['PASSWORD']))
+	{
+		/*Username or password has left blank*/
+	}
+	else
+	{
+		if(Login($_POST['USERNAME'], $_POST['PASSWORD']))
+		{
+			/*successful login, write the cookie and go to account page.*/
+			WriteCookie($_POST['USERNAME']);
+			header("Location: account.php");
+		}
+		else
+		{
+			/*Unsuccessful login, go to login page.*/
+		}
+	}
+}
+?>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+	<head>
+		<meta http-equiv="content-type" content="text/html;charset=utf-8" />
+		<meta name="generator" content="Adobe GoLive" />
+		<title>WSF/PHP StockTrader Welcome</title>
+		<link href="style.css" rel="stylesheet" type="text/css" media="all" />
+	</head>
+
+	<body>
+
+	<div id="content">
+		<div id="header">
+			<div class="logo"><img src="images/logo.gif"></div>
+		</div>
+
+		<div id="header-links">
+		<table>
+			<tr>
+			<td>
+			<a href="index.php">Welcome</a>
+			</td>
+			<td>
+			<a href="home.php">Home</a>
+			</td>
+			<td>
+			<a href="account.php">Account</a>
+			</td>
+			<td>
+			<a href="portfolio.php">Portfolio</a>
+			</td>
+			<td>
+			<a href="quotes.php">Quotes/Trade</a>
+			</td>
+			<td>
+			<a href="glossary.php">Glossary</a>
+			</td>
+			<td>
+			<a href="config.php">Config</a>
+			</td>
+			<td>
+			<a href="login.php">Login/Logout</a>
+			</td>
+			</tr>
+		</table>
+		</div>
+
+		<div id="middle">
+	
+			<div class="main-title">
+			<h1>Login</h1>
+			<script type="text/javascript">
+				var thisdate = new Date();
+				document.writeln(thisdate.toLocaleString());
+			</script>
+			</div>
+		
+			<div class="login">
+				<form method="post"  action="login.php">
+					<table>
+					<tr>
+					<td>Username</td>
+					<td><input name = "USERNAME" size = "25"/></td>
+					</tr>
+					<tr>
+					<td>Password</td>
+					<td><input type="password" name = "PASSWORD" size = "25"/></td>
+					</tr>
+					<tr>
+					<td></td>
+					<td><input type = "submit" name = "LOGINREQUEST" value = "Login" class="button"/></td>
+					</tr>
+					</table>
+				</form>
+		
+				<p>Try password "xxx" for user "uid:0" to access the stock trader web application.</p>
+				<p class="new-user">
+				<a href="register.php">First time user?</a>
+				</p>
+			</div>	
+		</div>
+			<div id="footer">
+				<div style="float:left;">Copyright 2008, WSO2 Inc.</div>
+				<div style="margin-left:432px;float:left;">Powered by 
+				<img align="top" src="images/powered-by-logo.gif" style="margin-top:-3px; margin-left: 0px;"/></div>
+			</div>
+		</div>
+	
+	</body>
+</html>

Added: incubator/stonehenge/trunk/stocktrader/php/trader_client/portfolio.php
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/php/trader_client/portfolio.php?rev=741193&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/php/trader_client/portfolio.php (added)
+++ incubator/stonehenge/trunk/stocktrader/php/trader_client/portfolio.php Thu Feb  5 17:24:53 2009
@@ -0,0 +1,206 @@
+<?php
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+require_once("request_processor.php");
+if(!IsLoggedIn())
+{
+	header("Location: login.php");
+}
+else
+{
+	$holdings = GetHoldings(GetUserFromCookie());
+	if ($holdings)
+	{
+		$holdingsReturn = $holdings->getHoldingsReturn;
+	}
+}
+?>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+	<head>
+		<meta http-equiv="content-type" content="text/html;charset=utf-8" />
+		<meta name="generator" content="Adobe GoLive" />
+		<title>WSF/PHP StockTrader Welcome</title>
+		<link href="style.css" rel="stylesheet" type="text/css" media="all" />
+	</head>
+
+	<body>
+		<div id="content">
+			<div id="header">
+				<div class="logo"><img src="images/logo.gif"></div>
+			</div>
+			<div id="header-links">
+				<table>
+					<tr>
+					<td>
+						<a href="index.php">Welcome</a>
+					</td>
+					<td>
+						<a href="home.php">Home</a>
+					</td>
+					<td>
+						<a href="account.php">Account</a>
+					</td>
+					<td>
+						<a href="portfolio.php">Portfolio</a>
+					</td>
+					<td>
+						<a href="quotes.php">Quotes/Trade</a>
+					</td>
+					<td>
+						<a href="glossary.php">Glossary</a>
+					</td>
+					<td>
+						<a href="config.php">Config</a>
+					</td>
+					<td>
+						<a href="login.php">Login/Logout</a>
+					</td>
+					</tr>
+				</table>
+			</div>
+			<div id="middle">
+
+			<?php
+				$getClosedOrdersReturn = GetClosedOrders();
+				if ($getClosedOrdersReturn)
+				{
+					print ("<p style=\"color: red\" align=\"center\">Trade Alert: The following orders have completed.</p>");
+					print("<table class=\"table-outer\" cellspacing=\"0\" align=\"center\"><thead>
+						<tr><th>Order ID</th><th>Order Status</th><th>Creation Date</th><th>Completion Date</th>
+						<th>Txn Fee</th><th>Type</th><th>Symbol</th><th>Quantity</th></tr></thead><tbody>");
+
+					$index = 0;
+					while ($getClosedOrdersReturn->OrderDataBean[$index])
+					{
+						$openDate = new DateTime($getClosedOrdersReturn->OrderDataBean[$index]->openDate);
+						$completionDate = new DateTime($getClosedOrdersReturn->OrderDataBean[$index]->completionDate);
+						print ("<tr><td>".$getClosedOrdersReturn->OrderDataBean[$index]->orderID."</td>
+							<td>".$getClosedOrdersReturn->OrderDataBean[$index]->orderStatus."</td>
+							<td>".$openDate->format("m/d/Y h:i:s A")."</td>
+							<td>".$completionDate->format("m/d/Y h:i:s A")."</td>
+							<td>$".$getClosedOrdersReturn->OrderDataBean[$index]->orderFee."</td>
+							<td>".$getClosedOrdersReturn->OrderDataBean[$index]->orderType."</td>
+							<td>".$getClosedOrdersReturn->OrderDataBean[$index]->symbol."</td>
+							<td>".$getClosedOrdersReturn->OrderDataBean[$index]->quantity."</td></tr>");
+						$index ++;
+					}
+					print("</tbody></table><br/><br/>");
+				}
+
+				if ($holdingsReturn)
+				{
+					print ("<div class=\"main-title\">
+						<h1>Portfolio Information</h1><script type=\"text/javascript\">var thisdate = new Date();
+					document.writeln(thisdate.toLocaleString());</script></div>");
+
+					print ("<table class=\"table-outer\" cellspacing=\"0\" align=\"center\">
+						<thead><tr><th>Holding ID</th><th>Purchase Date</th><th>Symbol</th>
+						<th>Quantity</th><th>Purchase Price</th><th>Current Price</th>
+						<th>Purchase Basis</th><th>Market Value</th><th>Gain(Loss)</th>
+						<th>Trade</th></tr></thead><tbody>");
+
+					$index = 0;
+					$purchaseBasis = 0;
+					$marketValue = 0;
+					$gain = 0;
+
+					while ($holdingsReturn->HoldingDataBean[$index])
+					{
+						$bean = $holdingsReturn->HoldingDataBean[$index];
+
+						if (!$quoteInfo[$bean->quoteID])
+						{
+							$quotes = GetQuote($bean->quoteID);
+							if ($quotes)
+								$quotesReturn = $quotes->getQuoteReturn;
+							$quoteInfo[$bean->quoteID] = $quotesReturn->price;
+						}
+
+						$purchaseBasis = $purchaseBasis + ($bean->purchasePrice) * ($bean->quantity);
+						$marketValue = $marketValue + ($quoteInfo[$bean->quoteID]) * ($bean->quantity); 
+						$gain = ($quoteInfo[$bean->quoteID] - $bean->purchasePrice) * ($bean->quantity);
+
+						$dateTime = new DateTime($bean->purchaseDate);
+						print("<tr><td>".$bean->holdingID."</td><td><nobr>".$dateTime->format("m/d/Y h:i:s A")."</nobr></td><td>
+							<form action=\"quotes.php\" method=\"post\">
+							<input type=\"hidden\" name=\"SYMBOLS\" value=\"".$bean->quoteID."\"/>	
+							<input type=\"submit\" name=\"GETQUOTE\" value=\"".$bean->quoteID."\"></input>
+							</form></td>
+							<td class=\"currency\">".$bean->quantity."</td><td class=\"currency\">$"
+							.$bean->purchasePrice."</td><td class=\"currency\">$".$quoteInfo[$bean->quoteID]."</td><td class=\"currency\">$".
+							(($bean->purchasePrice) * ($bean->quantity))."</td><td class=\"currency\">$".($quoteInfo[$bean->quoteID] * ($bean->quantity)).
+							"</td><td class=\"currency\">");
+
+						if ($gain > 0)
+						{
+							print ("<span class=\"price-gain\">".$gain."</span>");
+						}
+						else if ($gain < 0)
+						{
+							print ("<span class=\"price-loss\">".$gain."</span>");
+						}
+						else
+						{
+							print ("<span>".$gain."</span>");
+						}
+						print("</td><td class=\"currency\">");
+						print("<form action = \"confirmation.php\" method = \"post\">");
+						print("<input type=\"hidden\" name=\"HOLDINGID\" value=\"".$bean->holdingID."\"></input>");
+						print("<input type=\"hidden\" name=\"QUANTITY\" value=\"".$bean->quantity."\"></input>");
+						print("<input type=\"hidden\" name=\"SYMBOL\" value=\"".$bean->quoteID."\"></input>");
+						print("<input type=\"submit\" value = \"Sell\" name=\"SELL\">");
+						print("</input></td></tr></form>");
+
+						$index ++;
+					}
+					print ("<tr class=\"total\"><td colspan=\"6\">Totals</td><td class=\"currency\">$".$purchaseBasis.
+						"</td><td class=\"currency\">$".$marketValue."</td><td>");
+
+					$gain = $marketValue - $purchaseBasis;
+					if ($gain < 0)
+					{
+						print ("<span class=\"price-loss\">$".$gain."</span></td><td></td></tr>");
+					}
+					else if ($gain > 0)
+					{
+						print ("<span class=\"price-gain\">$".$gain."</span></td><td></td></tr>");
+					}		
+					else
+					{
+						print ("<span>$".$gain."</span></td><td></td></tr>");
+					}
+					print ("</tbody></table>");
+				}
+			?>
+			<div class="bottom">
+			<form action = "quotes.php" method = "post">
+			<input type="text" value="" name="SYMBOLS" id="" size="25"/><input type="submit" name="GETQUOTE" value="Get Quote" class="button"/>
+			</form>
+			</div>
+			</div>
+			<div id="footer">
+				<div style="float:left;">Copyright 2008, WSO2 Inc.</div>
+				<div style="margin-left:432px;float:left;">Powered by 
+				<img align="top" src="images/powered-by-logo.gif" style="margin-top:-3px; margin-left: 0px;"/></div>
+			</div>
+		</div>
+	</body>
+</html>

Added: incubator/stonehenge/trunk/stocktrader/php/trader_client/quotes.php
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/php/trader_client/quotes.php?rev=741193&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/php/trader_client/quotes.php (added)
+++ incubator/stonehenge/trunk/stocktrader/php/trader_client/quotes.php Thu Feb  5 17:24:53 2009
@@ -0,0 +1,311 @@
+<?php
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+require_once("request_processor.php");
+
+if(!IsLoggedIn())
+{
+	header("Location: login.php");
+}
+else if($_POST['GETQUOTE'])
+{
+	/*This is a request to get quote information for a particular symbol*/
+	$symbol = $_POST['SYMBOLS'];
+	if ($symbol)
+	{
+		$quotes = GetQuote($symbol);
+		if ($quotes)
+			$quotesReturn = $quotes->getQuoteReturn;
+	}
+}
+else if ($_POST['BUY'] || $_POST['SELL'])
+{
+	/*This is a buy or sell request*/
+	$quantity = $_POST['QUANTITY'];
+	$userID = GetUserFromCookie();
+	$isBuy = FALSE;
+	$isSell = FALSE;
+
+	if ($_POST['BUY'])
+	{
+		$mode = 0;
+		$isBuy = TRUE;
+		$symbol = $_POST['SYMBOL'];
+		$response = Buy($userID, $symbol, $quantity, $mode);
+		if ($response->buyReturn->orderID)
+		{
+			$buyReturn = $response->buyReturn;
+			$isReply = TRUE;
+		}
+		else
+		{
+			$response = NULL;
+		}
+	}
+	else if($_POST['SELL'])
+	{
+		$isSell = TRUE;
+		$holdingID = $_POST['HOLDINGID'];
+		$response = SellEnhanced($userID, $holdingID, $quantity);
+		if ($response->sellEnhancedReturn->orderID)
+		{
+			$sellEnhancedReturn = $response->sellEnhancedReturn;
+			$isReply = TRUE;
+		}
+		else
+		{
+			$response = NULL;
+		}
+	}
+}
+else
+{
+	/*If not above, the user has just wanted to
+	visit the quote page*/
+	$quotesInitialPage = TRUE;
+}
+?>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+	<head>
+		<meta http-equiv="content-type" content="text/html;charset=utf-8" />
+		<meta name="generator" content="Adobe GoLive" />
+		<title>WSF/PHP StockTrader Welcome</title>
+		<link href="style.css" rel="stylesheet" type="text/css" media="all" />
+	</head>
+
+	<body>
+		<div id="content">
+			<div id="header">
+				<div class="logo"><img src="images/logo.gif"></div>
+			</div>
+			<div id="header-links">
+				<table>
+					<tr>
+					<td>
+						<a href="index.php">Welcome</a>
+					</td>
+					<td>
+						<a href="home.php">Home</a>
+					</td>
+					<td>
+						<a href="account.php">Account</a>
+					</td>
+					<td>
+						<a href="portfolio.php">Portfolio</a>
+					</td>
+					<td>
+						<a href="quotes.php">Quotes/Trade</a>
+					</td>
+					<td>
+						<a href="glossary.php">Glossary</a>
+					</td>
+					<td>
+						<a href="config.php">Config</a>
+					</td>
+					<td>
+						<a href="login.php">Login/Logout</a>
+					</td>
+					</tr>
+				</table>
+			</div>
+			<div id="middle">
+
+			<?php
+				$getClosedOrdersReturn = GetClosedOrders();
+				if ($getClosedOrdersReturn)
+				{
+					/*Checking whether there is new status change happened in the 
+					related to a particular order.*/
+					print ("<p style=\"color: red\" align=\"center\">Trade Alert: The following orders have completed.</p>");
+					print("<table class=\"table-outer\" cellspacing=\"0\" align=\"center\"><thead>
+						<tr><th>Order ID</th><th>Order Status</th><th>Creation Date</th><th>Completion Date</th>
+						<th>Txn Fee</th><th>Type</th><th>Symbol</th><th>Quantity</th></tr></thead><tbody>");
+
+					$index = 0;
+					while ($getClosedOrdersReturn->OrderDataBean[$index])
+					{
+						$openDate = new DateTime($getClosedOrdersReturn->OrderDataBean[$index]->openDate);
+						$completionDate = new DateTime($getClosedOrdersReturn->OrderDataBean[$index]->completionDate);
+						print ("<tr><td>".$getClosedOrdersReturn->OrderDataBean[$index]->orderID."</td>
+							<td>".$getClosedOrdersReturn->OrderDataBean[$index]->orderStatus."</td>
+							<td>".$openDate->format("m/d/Y h:i:s A")."</td>
+							<td>".$completionDate->format("m/d/Y h:i:s A")."</td>
+							<td>$".$getClosedOrdersReturn->OrderDataBean[$index]->orderFee."</td>
+							<td>".$getClosedOrdersReturn->OrderDataBean[$index]->orderType."</td>
+							<td>".$getClosedOrdersReturn->OrderDataBean[$index]->symbol."</td>
+							<td>".$getClosedOrdersReturn->OrderDataBean[$index]->quantity."</td></tr>");
+						$index ++;
+					}
+					print("</tbody></table><br/><br/>");
+				}
+
+				if ($isReply == TRUE)
+				{
+					/*Check whether the user has requested to buy or sell some quote.*/
+					print ("<div class=\"main-title\"><h1>New Order</h1>
+						<script type=\"text/javascript\">var thisdate = new Date();
+					document.writeln(thisdate.toLocaleString());</script></div>");
+					print ("<p align=\"center\">Order ".$buyReturn->orderID." to 
+						".(($buyReturn->quantity) ? "buy ".($buyReturn->quantity):
+						"sell ".($sellReturn->quantity))." shares of s:0 has been submitted for processing.</p>");
+					print ("<p align=\"center\">Order Details:</p>");
+					print ("<table class=\"table-outer\" cellspacing=\"0\" align=\"center\"><thead><tr>
+						<th>Order ID</th><th>Order Status</th><th>Creation Date</th>
+						<th>Completion Date</th><th>Txn Fee</th><th>Type</th><th>Symbol</th>
+							<th>Quantity</th></tr></thead>
+							<tbody>");
+
+					if ($isBuy == TRUE)
+					{
+						$dateTime = new DateTime($buyReturn->openDate);
+						print ("<tr><td>".$buyReturn->orderID."</td><td>".$buyReturn->orderStatus.
+							"</td><td>".$dateTime->format("m/d/Y h:i:s A")."</td><td>Pending".
+							"</td><td>$".$buyReturn->orderFee."</td><td>".$buyReturn->orderType.
+							"</td><td>".$buyReturn->symbol."</td><td>".$buyReturn->quantity."</td></tr>");
+					}
+					else if ($isSell == TRUE)
+					{
+						$dateTime = new DateTime($sellEnhancedReturn->openDate);
+						print ("<tr><td>".$sellEnhancedReturn->orderID."</td><td>".$sellEnhancedReturn->orderStatus.
+							"</td><td>".$dateTime->format("m/d/Y h:i:s A")."</td><td>Pending".
+							"</td><td>$".$sellEnhancedReturn->orderFee."</td><td>".$sellEnhancedReturn->orderType.
+							"</td><td>".$sellEnhancedReturn->symbol."</td><td>".$sellEnhancedReturn->quantity."</td></tr>");
+					}
+					print ("</tbody></table>");
+				}
+
+				else if ($_POST['GETQUOTE'])
+				{
+					print("<div class=\"main-title\"><h1>Stock Quotes</h1>");
+					print("<script type=\"text/javascript\">var thisdate = new Date();
+					document.writeln(thisdate.toLocaleString());</script>"); 
+					print("</div>");
+					print("<table class=\"table-outer\" cellspacing=\"0\" align=\"center\"><thead>
+						<tr><th>Symbol</th><th>Company</th><th>Volume</th><th>Price Range</th>
+						<th>Open Price</th><th>Current Price</th><th>Gain(Loss)</th><th>Trade</th></tr></thead><tbody>");
+
+					if ($quotesReturn->symbol)
+					{
+						print ("<tr><td>".$quotesReturn->symbol."</td><td>".$quotesReturn->companyName.
+							"</td><td>".$quotesReturn->volume."</td><td>$".$quotesReturn->low."-$".
+							$quotesReturn->high."</td><td>$".$quotesReturn->open."</td>
+							<td>$".$quotesReturn->price."</td><td>");
+
+						if ($quotesReturn->change > 0)
+						{
+							print ("<span class=\"price-gain\">$".$quotesReturn->change."</span>");
+						}
+						else if ($quotesReturn->change < 0)
+						{
+							print ("<span class=\"price-loss\">$".$quotesReturn->change."</span>");
+						}
+						else
+						{
+							print ("<span>$".$quotesReturn->change."</span>");
+						}
+						print("</td><td><form action=\"confirmation.php\" method=\"post\">
+							<input type=\"hidden\" name=\"QUANTITY\" value=\"".$quotesReturn->volume."\">
+							<input type=\"hidden\" name=\"SYMBOL\" value=\"".$quotesReturn->symbol."\">
+							<input type=\"hidden\" name=\"PRICE\" value=\"".$quotesReturn->price."\">
+							<input type=\"submit\" name=\"BUY\" value=\"Buy\"></input></form></td></tr>");
+					}
+					print("</tbody></table>");
+				}
+				else if($quotesInitialPage == TRUE)
+				{
+					print("<div class=\"main-title\"><h1>Stock Quotes</h1>");
+					print("<script type=\"text/javascript\">var thisdate = new Date();
+					document.writeln(thisdate.toLocaleString());</script>"); 
+					print("</div>");
+					print("<table class=\"table-outer\" cellspacing=\"0\" align=\"center\"><thead>
+						<tr><th>Symbol</th><th>Company</th><th>Volume</th><th>Price Range</th>
+						<th>Open Price</th><th>Current Price</th><th>Gain(Loss)</th><th>Trade</th></tr></thead><tbody>");
+
+					$symbolCount = 0;
+					while($symbolCount < 5)
+					{
+						$quotes = GetQuote("s:".$symbolCount);
+
+						if ($quotes)
+						{
+							$quotesReturn = $quotes->getQuoteReturn;
+
+							if ($quotesReturn->symbol)
+							{
+								print ("<tr><td>".$quotesReturn->symbol."</td><td>".$quotesReturn->companyName.
+									"</td><td>".$quotesReturn->volume."</td><td>$".$quotesReturn->low."-$".
+									$quotesReturn->high."</td><td>$".$quotesReturn->open."</td>
+									<td>$".$quotesReturn->price."</td><td>");
+
+								if ($quotesReturn->change > 0)
+								{
+									print ("<span class=\"price-gain\">$".$quotesReturn->change."</span>");
+								}
+								else if ($quotesReturn->change < 0)
+								{
+									print ("<span class=\"price-loss\">$".$quotesReturn->change."</span>");
+								}
+								else
+								{
+									print ("<span>$".$quotesReturn->change."</span>");
+								}
+								print("</td><td><form action=\"confirmation.php\" method=\"post\">
+									<input type=\"hidden\" name=\"QUANTITY\" value=\"".$quotesReturn->volume."\">
+									<input type=\"hidden\" name=\"SYMBOL\" value=\"".$quotesReturn->symbol."\">
+									<input type=\"hidden\" name=\"PRICE\" value=\"".$quotesReturn->price."\">
+									<input type=\"submit\" name=\"BUY\" value=\"Buy\"></input></form></td></tr>");
+							}
+						}
+						$symbolCount ++;
+					}
+					print("</tbody></table>");
+
+				}
+
+				else
+				{
+					print("<div class=\"main-title\"><h1>Stock Quotes</h1>");
+					print("<script type=\"text/javascript\">var thisdate = new Date();
+					document.writeln(thisdate.toLocaleString());</script>"); 
+					print("</div>");
+				}
+
+			?>
+				
+			<div class="bottom">
+
+			<form method = "post"  action = "quotes.php">
+			<input type="text" value="<?php print ($symbol); ?>" name="SYMBOLS" size="25"/>
+			<input type="submit" value="Get Quote" name="GETQUOTE" class="button"/>
+			</form>
+
+			</div>
+			</div>
+			<div id="footer">
+				<div style="float:left;">Copyright 2008, WSO2 Inc.</div>
+				<div style="margin-left:432px;float:left;">Powered by 
+				<img align="top" src="images/powered-by-logo.gif" style="margin-top:-3px; margin-left: 0px;"/></div>
+			</div>
+		</div>
+	</body>
+
+</html>

Added: incubator/stonehenge/trunk/stocktrader/php/trader_client/register.php
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/php/trader_client/register.php?rev=741193&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/php/trader_client/register.php (added)
+++ incubator/stonehenge/trunk/stocktrader/php/trader_client/register.php Thu Feb  5 17:24:53 2009
@@ -0,0 +1,187 @@
+<?php
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+?>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<?php
+require_once ("request_processor.php");
+
+if ($_POST['REGISTERUSER'])
+{
+	/*New user registration*/
+	$userID = $_POST['REQUESTEDID'];
+	$openBalance = $_POST['OPENBALANCE'];
+	$fullname = $_POST['FULLNAME'];
+	$email = $_POST['EMAIL'];
+	$address = $_POST['ADDRESS'];
+	$password = $_POST['PASSWORD'];
+	$creditcard = $_POST['CREDITCARD'];
+	$confpassword = $_POST['CONFIRMATIONPASSWORD'];
+
+	if ($userID == NULL || $password != $confpassword)
+	{
+		$invalidInformation = TRUE;
+	}
+	else
+	{
+		$response = RegisterUser($userID, $password, $fullname, 
+			$address, $email, $creditcard, $openBalance);
+		if ($response)
+		{
+			$successfulRegistration = TRUE;
+		}
+		else
+		{
+			$invalidInformation = TRUE;
+		}
+	}
+}
+?>
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+	<head>
+		<meta http-equiv="content-type" content="text/html;charset=utf-8" />
+		<meta name="generator" content="Adobe GoLive" />
+		<title>WSF/PHP StockTrader Welcome</title>
+		<link href="style.css" rel="stylesheet" type="text/css" media="all" />
+	</head>
+
+	<body>
+		<div id="content">
+			<div id="header">
+				<div class="logo"><img src="images/logo.gif"></div>
+			</div>
+			<div id="header-links">
+				<table>
+					<tr>
+					<td>
+						<a href="index.php">Welcome</a>
+					</td>
+					<td>
+						<a href="home.php">Home</a>
+					</td>
+					<td>
+						<a href="account.php">Account</a>
+					</td>
+					<td>
+						<a href="portfolio.php">Portfolio</a>
+					</td>
+					<td>
+						<a href="quotes.php">Quotes/Trade</a>
+					</td>
+					<td>
+						<a href="glossary.php">Glossary</a>
+					</td>
+					<td>
+						<a href="config.php">Config</a>
+					</td>
+					<td>
+						<a href="login.php">Login/Logout</a>
+					</td>
+					</tr>
+				</table>
+			</div>
+			<div id="middle">
+				<div class="main-title">
+					<h1>Register</h1>
+					<script type="text/javascript">
+						var thisdate = new Date();
+						document.writeln(thisdate.toLocaleString());
+					</script>
+				</div>
+
+				<?php
+				if ($successfulRegistration)
+				{
+					print("<p style=\"color: red\" align=\"center\">
+						Registration was successful, please <a href =\"login.php\">login</a>.</p>");
+				}
+
+				else
+				{
+					if ($invalidInformation)
+					{
+						print("<p style=\"color: red\" align=\"center\">Please enter valid information.</p>");
+					}
+					print ("<table class=\"profile\" cellspacing=\"0\" width=\"100%\">
+					<thead>
+					<tr>
+					<th>
+					Create Account Profile:
+					</th>
+					</tr>
+					</thead>
+					<tbody>
+					<tr>
+						<td>
+							<form action=\"register.php\" method=\"post\">
+							<table cellspacing=\"0\" align=\"center\">
+								<tr>
+									<td colspan=\"4\" >
+										&nbsp;
+									</td>
+								</tr>
+								<tr>
+									<td>Requested ID:</td>
+									<td><input name=\"REQUESTEDID\" type=\"text\" id=\"\" size=\"25\"/></td>
+									<td>Opening Balance:</td>
+									<td><input type=\"text\" name=\"OPENBALANCE\" value=\"100000\" id=\"\" size=\"25\"/></td>
+								</tr>
+								<tr>
+									<td>Full Name:</td>
+									<td><input type=\"text\" name=\"FULLNAME\" id=\"\" size=\"25\"/></td>
+									<td>Email Address:</td>
+									<td><input type=\"text\" name=\"EMAIL\" id=\"\" size=\"25\"/></td>
+								</tr>
+								<tr>
+									<td>Address:</td>
+									<td><input name=\"ADDRESS\" type=\"text\" id=\"\" size=\"25\"/></td>
+									<td>Password:</td>
+									<td><input name=\"PASSWORD\" type=\"password\" id=\"\" size=\"25\"/></td>
+								</tr>
+								<tr>
+									<td>Credit Card:</td>
+									<td><input name=\"CREDITCARD\" type=\"text\" id=\"\" size=\"25\"/></td>
+									<td>Confirm Password:</td>
+									<td><input name=\"CONFIRMATIONPASSWORD\" type=\"password\" id=\"\" size=\"25\"/></td>
+								</tr>
+								<tr>
+									<td colspan=\"4\" class=\"button\">
+										<input type=\"submit\" name=\"REGISTERUSER\" value=\"Register\" class=\"button\"/>
+									</td>
+								</tr>
+							</table>
+							</form>	
+						</td>
+					</tr>
+					</tbody>
+					</table>");
+				}
+			?>
+			</div>
+			<div id="footer">
+				<div style="float:left;">Copyright 2008, WSO2 Inc.</div>
+				<div style="margin-left:432px;float:left;">Powered by 
+				<img align="top" src="images/powered-by-logo.gif" style="margin-top:-3px; margin-left: 0px;"/></div>
+			</div>
+		</div>
+	</body>
+
+</html>



Mime
View raw message