%Joseph Hess
%TJHSST
%Class of 2003
%Computer Systems Research Laboratory
%Period 1

\documentclass[12pt]{article}
\usepackage{doublespace, fullpage}
\usepackage{epsfig}
\usepackage{wrapfig}
\begin{document}
\title{An Online User Interface for Tracking Stock Portfolios}
\author{Joseph B. Hess}
\date{12 June 2003}
\maketitle
\begin{abstract}
Currently, an abundance of websites offer online services to track the
performance of stock portfolios.  However, the most comprehensive options to
this effect may
require a fee and usually do not provide advice tailored to the investor. 
Additionally, the online environment is often subjected to undesired amounts of
clutter and advertising, distracting users from their main purpose and
unnecessarily complicating the online experience.  An
online user interface offers wide-ranging analysis of stock performance and
counsel on managing the portfolio based on a concurrent study in technical
analysis and other strategies used to predict stock movements.  This project
represents the confluence of the convenience of other online interfaces, the
personalized
guidance typically reserved for other media, the efficiency of data storage in
databases manipulated by simple query languages, and basic principles of the
design of
user interfaces in order to create a single destination
for viewing past performance, current conditions, and future possibilities.
\end{abstract}

\section{Introduction}
An online interface that obtains information through a relational database
accessed and modified by MySQL is used to track stock movements and related
data.  Pricing
data (current price and daily change in dollars and in percent), technical data
(Price/Earnings ratio and P/E-to-growth ratio), market information (the market on which the stock is
traded, the levels of the major American indices, market capitalization daily
volume, and average daily volume), and a variety of charts are available to the
user, who is able to select scales, frames of time,
and other variables and settings.
\par
The presentation of advice specific to the investor and analysis
is based on the results of the simultaneous project regarding the performance of
various strategies in predicting stock movements.  As more patterns emerge from
this project, the level of advice is elevated to include the newest conclusions
on managing a portfolio.  Although the program incorporates a view to large profits
in the short term and hot stocks, the primary focus is based on a long period
of investment and solid, reliable performers.
\par
This document will often refer to the capabilities of the final version of the
product intended to be created.  However, the author was unable to include all
desired features in the currently available version of the interface, given the
need for extensive research on a variety of topics, the need to learn new
programming languages in order to code the interface, and the ambitious nature
of the ultimate goal of the project.  Details on work performed in the Computer
Systems Laboratory are included in the Development section.  Also, the
Conclusion sections discusses the project in terms of accomplishments to date.

\section{Purpose}
The purpose of this project is to increase technical knowledge of Internet
languages and simple query languages---for the design on user interfaces and
database organization and management, respectively---and financial knowledge of
investment by combining the various fields of endeavor in
order to create a informationally comprehensive, aesthetically pleasing
interface that allows users to examine past performance of the stocks in their
portfolio, assess their current condition, and consider future investments. 
Research in the aforementioned areas will culminate in the creation of a product
reflecting the newly acquired knowledge.

\section{Research}
This project combines the application of databases and the concept of an
interface.  Accordingly, a variety of topics were researched in order to
gain an appreciation for accomplishments in these fields.  Database organization
and management are key topics for ensuring the accuracy of data provided in the
interface and providing easy access to needed information.  The art of creating
visually appealing interfaces that do not
detract from the actual content of the product is another issue with high
priority in this project.
\subsection{Database}
A database is a tool for structuring available data in a logical form. 
Specialized software allowing users to manage considerable information is found
in a database management system.  Database management systems are characterized
by several features---lasting and flexible storage of vast amounts of data, the
ability to access and
modify data through the interface of a simple query language (SQL), and the
ability to handle a variety and large quantity of "transactions" performed on
the data without subjecting the data to the pitfalls of multiple points of
access.
\par
Three
main types of databases exist---the object-oriented model, in which the
database is composed of
objects with given properties; the entity-relationship model, in which diagrams
showing the relationships between entities comprise the database; and the
relational model, a single table that separates logical, external elements from
physical, internal elements and is derived from a design in one of the other
models.
\par
The relational model is the preferred model for databases for a number of
reasons.  Implementations of databases such as SQL are based on this method of
structuring data.  The simplicity of the relational model---requiring a single
table---is another justification for its widespread use for databases. 
Additionally, of the models presented, the relational model best approximates
human thought, making it a convenient method for programmers.
\par
Database modeling is the process of structuring the database before its
creation, beginning with thought on the relationships, properties, and
limitations needed to be embodied by the database.  This process yields a
database in object-oriented or entity-relationship form.  The attributes of such
a system must be converted to relations---and, possibly, modified subsequently
in order to provide for optimal effectiveness---prior to implementation.
\par
In this project, a series of relational MySQL databases was created for processing by PHP
functions in order
to provide the content of the interface.  A set of users---Mr. Latimer and
Yosemite Sam---are assigned passwords.  For each user, tables containing the
ticker symbols of their holdings and the corresponding quantities were created.
\par
The information for portfolio is shown in the following MySQL command and
response:
\par
\begin{verbatim}
mysql> select * from portfolio;
+--------------+----------+
| name         | password |
+--------------+----------+
| Mr. Latimer  | compsys  |
| Yosemite Sam | boots    |
+--------------+----------+
2 rows in set (0.00 sec)
\end{verbatim}
\par
The information for the accounts of Mr. Latimer and Yosemite Sam, respectively,
is shown below:
\par
\begin{verbatim}
mysql> select * from latimer;
+-------+------+
| stock | qty  |
+-------+------+
| MSFT  |  100 |
| DELL  |  100 |
+-------+------+
2 rows in set (0.00 sec)
\end{verbatim}
\par
\begin{verbatim}
mysql> select * from sam;
+-------+------+
| stock | qty  |
+-------+------+
| CSCO  |  100 |
| KO    |  100 |
+-------+------+
2 rows in set (0.00 sec)
\end{verbatim}

\subsection{Interface}
Joel Spolsky, who runs Fog Creek Software, is an expert in the design of user
interfaces.  A substantial portion of his book on the subject, {\it User
Interface Design for Programmers}, appears on his personal website.  His
precepts in the
field of design form the basis of this project.  At the core of his designing
philosophy is the dictum, "A user interface is well-designed when the program
behaves exactly how the user thought it would."  Accordingly, the online
interface created in this project attempts to meet expectations for electronic
portrayal of a portfolio and to make self-explanatory navigation on the
interface.
\par
Spolsky stresses that the design of user interfaces is, at essence, an
enterprise that is best undertaken with rational, methodical thought.  No
special creative or artistic talents are needed to design a user interface of
quality.  Instead, he advises, simplicity and consideration for the potential
needs and desires of the user are the ingredients for creating a useful
interface.  Viewing the user as a logical person who expects the interface's
responses to his actions to match his expectations and act in accordance with
his intuition.  The interface, in Spolsky's view, is to remain unobtrustive {\it
and} responsive to the user.
\par
Although not all of the content in {\it User Interface Design for Programmers}
pertained to this project, given the nature of
this interface and guidance related to Microsoft products, much of his material
was useful in the construction of the interface.  Spolsky's emphasis on
simplicity and ease of use was the driving factor behind the final version of
the interface, which uses four colors---white, green, gold, and blue (for the
background)---and remains uncluttered by superfluous elements.

\section{Development}
This project, which primarily
uses PHP and MySQL, consists of four main phases.  The first major step is
extensive research of online user interfaces, database organization, and data
retrieval.  Following this preparatory period, the interface is created with a
basic level of functionality.  Next, advice and analysis are combined with a
refined interface that is marked by thoroughness and ease of use.  Finally, all
features are further enhanced to incorporate additional conclusions of the
related project in a final testing of sample portfolios.
\par
The aforementioned work is conducted through the iterative process of planning,
designing, coding, and testing incrementally to create ultimately the final
product.  Described below are the iterations, completed and scheduled, for this
project, organized by quarter.
\par
\subsection{Research}
Quarter I:  Research of Internet languages and online interfaces.  The
first phase of this project entailed determining an area to research, beginning
the portfolio for recording progress on the project, and attaining the coding
proficiency necessary to write programs for research.
 \begin{itemize}
 \item Iteration I:  Planning and creation of website.  The website serves as a
 portfolio containing all work related to the project.  Included in this element
 of the project are journals, reports on iterations, various assignments,
 technical research, and code. 
 \item Iteration II:  Java and PHP.  The languages of Java and PHP were explored
 with small, sample programs and assorted reading in order to determine the
 language necessary for the project.  PHP offered the ability to extract data
 from other websites and its ease of use in conjunction with MySQL underscored
 its usefulness.
 \item Iteration III:  Proposal and completion of requirements for
 Quarter I.  Among the a dministrative requirements for the end of the quarter
 was producing a formal proposal for the project and making an oral report of
 work completed to date.
 \end{itemize}
\subsection{Prelude to the Interface}
Quarter II:  Obtaining pertinent data.  The second step in this project
involved extracting desired data regarding the major American indices and listings on
those indices from Yahoo! Finance
(finance.yahoo.com) as desired by the user, as a prelude to constructing the interface. 
 \begin{itemize}
 \item Iteration IV:  Retrieval of current value of major indices using PHP. 
 The values of the Dow Jones Industrial, NASDAQ, and Standard and Poor's 500, in
 addition to the daily changes in those values (in terms of points and percent)
 were obtained as the initial exercise for later use in the interface.
 \item Iteration V:  Retrieval of technical data for listings on the major
 indices.  The code used in Iteration IV was expanded substantially in order to
 obtain data for listings on the major indices, including market capital (in
 dollars),
 price-to-earnings ratio (P/E), P/E-to-growth ratio (PEG), daily volume, and
 average daily volume.  A PHP form allowed users to enter a ticker symbol
 through which they obtained the aforementioned information regarding the stock.
 \item Iteration VI:  Digital version of poster.  In preparation for a paper
 version of the poster, an online edition was created using nested tables to
 show an abstract, an introduction, a methodology, the result, visual aids
 to comprehension, and other related items.  Following the completion of the
 online draft, the project was presented in paper form.  Also included in this
 iteration were the final administrative requirements for Quarter II.
 \end{itemize}
\subsection{Preliminary Interface}
Quarter III:  Displaying data in a preliminary interface.  The third round
of work on the interface was to create an initial
version of the interface using the findings of previous work to gradually expand
the capabilities of the interface.  In addition to obtaining a basic level of
functionality, the interface was to represent adherence to the fundamental
precepts of the design of user interfaces.
 \begin{itemize}
 \item Iteration VII:  Comprehensive analysis of progress and goals.  During
 Iteration VII, a comprehensive review of progress to date and
future plans was performed.  The description of the project
provides a summary of the methodology and intended results for this project,
including information on visual display
of the results.  The scientific method applied to this
project is unique in its concentration on research of many subject and on
ultimately obtaining a product, as opposed to
theoretical exploration.  However, the scientific method is still valid for An
Online User Interface for Tracking Stock Portfolios.  Version 3.1 of the
interface is depicted in the form available at the end of Quarter II. 
Included in these documents are information regarding the features of Version
3.1, goals for the subsequent iterations, and the ultimate aims of this project.
 \item Iteration VIII:  Creation of initial interface.  Relying on MySQL tables
 to provide information regarding sample accounts and Yahoo! Finance for data
 regarding the holdings of the accounts, the initial interface was created,
 allowing users entering the correct password to view the prices of their
 individual holdings, the changes of those holdings on the day (in dollars and
 in percent), and the levels of the major American indices.  New functions for
 displaying data were created in order to achieve the proper format, given the
 guidelines of the design of user interface asserted by Joel Spolsky.  The
 product of Iteration VIII represented the first combination of the studies in
 data retrieval and interface design.
 \item Iteration IX:  Documentation for Quarter III.  Administrative tasks for
 the end of the quarter, including a draft of the technical paper, were
 completed.
 \end{itemize}
\subsection{Enhancing the Interface}
Quarter IV:  Completing and enhancing the interface.  In the fourth and
final part of this project, the capabilities of the interface were to be
expanded as much as possible, including introducing technical data to the
display.  Modifications to the design and the format of the output were expected
in order to maintain the principles of the design of user interfaces in the
final product.
 \begin{itemize}
 \item Iteration X:  Expanding functionality of interface.  The technical data
 first displayed in Iteration V were added to the interface.  The format of
 these additions and of the previously included information was changed in order
 to increase the clarity of the interface and to display all data in a manner
 that would not detract from the content.
 \item Iteration XI:  Adding advice to interface.  Due to the extensive
 requirements in research required for the concurrent study of portfolio
 management, this stage of the project was canceled.
 \item Iteration XII:  Final adminstrative requirements.  The technical paper,
 research of other technical papers, and other assignments for the end of the
 course were completed.
 \end{itemize}

\section{Results}
The final result is an online
financial manager that provides detailed analysis of stock movements and
personalized advice, presented according to the aesthetic preferences of the
user.  Thorough research in the technical, visual, and financial aspects of the
project allows the combination of the online user interface, supported by the
underlying database, and the analytical program to
give users reliable suggestions and ease of use in the uncertain world of
portfolio management.

\section{Conclusion}
Although the interface is not nearly complete, much was learned in the process
of researching databases and interfaces and in coding the early versions of the
interface.  The basic principles of database organization and management and
those of the design of user interfaces were employed in the version currently
available---a crisply presented, informative display of the current status of
the portfolio.  The online user interface for tracking stock portfolios does not
include features regarding previous movements of listings in question.  Nor does
the version reached in the Computer Systems Laboratory comprise capabilities for
advice regarding future investment behavior.  Despite the inability to attain
all of the objectives set at the beginning of the project---an ambitious agenda,
to be sure---the project successfully demonstrates the product of combining the
lessons of databases and interfaces with respect to the financial world.
\subsection{Limitations}
The extensive research required to attain competence in the myriad skills and
vast background knowledge
required for this project required the devotion of considerable time to this
singularly important task.  This process, though accomplished in many ways, is a
continuous process that leaves limited time for applying the lessons learned
during the research to the more concrete task of creating the interface and the
requisite databases.  However, given the author's initial inexperience in
virtually all areas of this endeavor, much was accomplished despite the severely
restricted opportunities for programming.
\subsection{Future Work}
Although it is unlikely that the author will continue working on this particular
project after completing his work in the Computer Systems Laboratory, he
intends to earn a major computer science or computer engineering, a
commitment in which his knowledge of databases and user interfaces gained
through this project likely will
serve him well.  Future studies may also include work in the field of economics,
a discipline in which the author has some interest.  The author believes that
the focus on computers and finance will result in his obtaining critical skills
for modern life, an age of technology and of an expanding participation in
financial investment.
\subsection{Recommendations}
Future students in the Computer Systems Laboratory are advised that they
undoubtedly will encounter significant obstacles in the development of their
project.  A large amount of research is necessary---and desirable---in this
laboratory.  This requirement will restrict time for coding but will not
restrict the ultimate potential for their work in their chosen aspect of
computer systems.  As is true of much in life, value is found in the journey,
not the destination.  Therefore, an awareness of the opportunity to learn many
skills and ideas and the knowledge of the limited chances to put such learning
into use are critical attitudes to bring to the Computer Systems Laboratory.

\section{Appendix I:  Code}
Users can access their accounts by entering the
correct password on interface.php.  Code on viewer.php will lead to the
resulting page, portfolio.php,
which includes code to obtain the necessary data from the MySQL tables and
Yahoo! Finance and to display them appropriately.  Functions that
manipulate tables will be used to retreive data from the MySQL
account.  The code contained in fn.php includes functions for the proper display
of all data gathered in the process described above.  All told, over 1000 lines
of code were written for this project.
\subsection{interface.php}
\begin{verbatim}
<HTML>
<HEAD>
<TITLE>Enter the interface</TITLE>
</HEAD>
<STYLE>  A {text-decoration: none;} A:hover {color: gold;}
<!--potential formatting for Internet Explorer (MS)
BODY {SCROLLBAR-FACE-COLOR: "";
      SCROLLBAR-HIGHLIGHT-COLOR: "";
      SCROLLBAR-SHADOW-COLOR: "";
      SCROLLBAR-3DLIGHT-COLOR: "";
      SCROLLBAR-ARROW-COLOR: "";
      SCROLLBAR-TRACK-COLOR: "";
      SCROLLBAR-DARKSHADOW-COLOR: "";
     }-->
</STYLE>
<BODY BGCOLOR="#19638c" TEXT="#FFFFFF" LINK="red" ALINK="red" VLINK="red">
<FONT FACE="arial" SIZE=2>
<!-- USER >> -->
<!--user selects from user options
form for user to enter password-->
<FORM ACTION="viewer.php" name="user">
<SELECT NAME = "ViewMethod">
<OPTION> Mr. Latimer
<OPTION> Yosemite Sam
</SELECT><BR>USER<P>
<!-- PASSWORD >> -->
<P><INPUT TYPE="password" NAME="password"><BR>PASSWORD<P>
<INPUT TYPE="submit" value="GO">
</BODY>
</HTML>
\end{verbatim}
\subsection{viewer.php}
\begin{verbatim}
<?

/*connection to MySQL account, selection of database, accessing table of users
and passwords*/

//magnesium.tjhsst.edu is the alias for mysql.tjhsst.edu

$link = mysql_connect("magnesium.tjhsst.edu", "jhess", "939525");
mysql_select_db("jhess", $link);

$query = "select * from portfolio";
$result = mysql_query($query, $link);
$num_rows = mysql_num_rows($result);

//check for correct password
//only users are Mr. Latimer and Yosemite Sam

if ($ViewMethod=="Mr. Latimer")
{
 if ($password=="compsys")
  header("Location: portfolio.php?ViewMethod=$ViewMethod&password=compsys");
 else header ("Location: reject.php");
}

if ($ViewMethod=="Yosemite Sam")
{
 if ($password=="boots")
  header("Location: portfolio.php?ViewMethod=$ViewMethod&password=boots");
 else header ("Location: reject.php");
}

?>
\end{verbatim}
\subsection{portfolio.php}
\begin{verbatim}
<HTML>
<!--Updated every 15 seconds-->
<META HTTP-EQUIV="Refresh" CONTENT="15">
<HEAD><TITLE>Portfolio</TITLE></HEAD>
<STYLE>  A {text-decoration: none;} A:hover {color: gold;}
<!--potential formatting for Internet Explorer (MS)
BODY {SCROLLBAR-FACE-COLOR: "";
      SCROLLBAR-HIGHLIGHT-COLOR: "";
      SCROLLBAR-SHADOW-COLOR: "";
      SCROLLBAR-3DLIGHT-COLOR: "";
      SCROLLBAR-ARROW-COLOR: "";
      SCROLLBAR-TRACK-COLOR: "";
      SCROLLBAR-DARKSHADOW-COLOR: "";
     }-->
</STYLE>
<BODY BGCOLOR="#19638c" TEXT="#FFFFFF" LINK="gold" ALINK="gold" VLINK="gold">
<FONT FACE="arial" SIZE="-1">

<?php

 echo "<B>American Markets</B><BR>";

//Day Date Month Year [Time (24-hour system)]
 print(date("l d F Y"));
 print(" [");
 print(date("H"));
 print(date("i"));
 print("]<P>");

//include fn.php for use below
 $dir='.';
 include($dir.'/fn.php');

//call retrieving function in fn.php for the major indices
//^DJI, ^IXIC, and ^GSPC are Yahoo! Finance designations for the indices
//retrieve obtains current value, change in points, and change in percent
//retrieve also continues printing in table started below

 echo "<TABLE CELLPADDING=0 CELLSPACING=0><TR><TD WIDTH=144>";
 echo "<FONT SIZE=2 FACE=arial>Dow Jones Industrial</FONT></TD>";
 $markets = '^DJI';
 $quotes = retrieve($markets);

 echo "<TR><TD WIDTH=144><FONT SIZE=2 FACE=arial>NASDAQ Composite</FONT></TD>";
 $markets = '^IXIC';
 $quotes = retrieve($markets);

 echo "<TR><TD WIDTH=144><FONT SIZE=2 FACE=arial>";
 echo "Standard & Poor's 500</FONT></TD>";
 $markets = '^GSPC';
 $quotes = retrieve($markets);
 echo "</TABLE><P>";

 echo "<P><FONT COLOR=white><B>Portfolio of $ViewMethod</B><BR>";
 echo "<HR COLOR=FFFFFF>";

/*
 echo "&#151;&#151;&#151;&#151;&#151;&#151;&#151;&#151;";
 echo "&#151;&#151;&#151;&#151;&#151;&#151;&#151;&#151;";
 echo "&#151;&#151;&#151;&#151;&#151;&#151;&#151;&#151;";
 echo "&#151;&#151;&#151;&#151;&#151;&#151;&#151;&#151;";
 echo "&#151;&#151;&#151;&#151;&#151;&#151;&#151;&#151;";
 echo "&#151;&#151;&#151;&#151;&#151;&#151;&#151;&#151;";
 echo "&#151;&#151;&#151;&#151;&#151;&#151;&#151;&#151;";
 echo "&#151;&#151;&#151;&#151;&#151;&#151;&#151;&#151;</FONT><BR>";
*/

 $link = mysql_connect("mysql.tjhsst.edu", "jhess", "939525");
 mysql_select_db("jhess", $link);

 if ($ViewMethod=="Mr. Latimer")
  $query = "select * from latimer";
 if ($ViewMethod=="Yosemite Sam")
  $query = "select * from sam";
 $result = mysql_query($query, $link);
 $num_rows = mysql_num_rows($result);

 echo "<TABLE CELLSPACING=0 CELLPADDING=0><TR>";
 echo "<TD WIDTH=60><FONT FACE=arial SIZE=2><B>Stock</B></TD>";
 echo "<TD WIDTH=75><FONT FACE=arial SIZE=2><B>Quantity</B></TD>";
 echo "<TD WIDTH=60><FONT FACE=arial SIZE=2><B>Price</B></TD>";
 echo "<TD WIDTH=75><FONT FACE=arial SIZE=2><B>Change</B></TD>";
 echo "<TD WIDTH=420><FONT FACE=arial SIZE=2><B>Information</B></TD>";
 echo "<TD WIDTH=75><FONT FACE=arial SIZE=2><B>Net Worth</B></TD>";
 echo "</TR></TABLE>";

 echo "<HR COLOR=FFFFFF>";

/*
 echo "<FONT COLOR=white>&#151;&#151;&#151;&#151;&#151;&#151;&#151;&#151;";
 echo "&#151;&#151;&#151;&#151;&#151;&#151;&#151;&#151;";
 echo "&#151;&#151;&#151;&#151;&#151;&#151;&#151;&#151;";
 echo "&#151;&#151;&#151;&#151;&#151;&#151;&#151;&#151;";
 echo "&#151;&#151;&#151;&#151;&#151;&#151;&#151;&#151;";
 echo "&#151;&#151;&#151;&#151;&#151;&#151;&#151;&#151;";
 echo "&#151;&#151;&#151;&#151;&#151;&#151;&#151;&#151;";
 echo "&#151;&#151;&#151;&#151;&#151;&#151;&#151;&#151;</FONT><BR>";
*/

 echo "<TABLE CELLSPACING=0 CELLPADDING=0>";

 for ($c = 0; $c < $num_rows; $c++)
 {
  $row = mysql_fetch_array($result);
  $stock = $row["stock"];
  $qty = $row["qty"];

  //obtain a page containing data regarding $symbols
  $url = "http://finance.yahoo.com/q?s=$stock&d=t";
  if (!($fp = fopen($url, "r")))
  {
   echo "Unable to open page.";
   exit;
  }

  //if opening is successful, read 100000 bytes from opened page
  $contents = fread($fp, 100000);

  //close page
  fclose($fp);

  if (preg_match("/(<b>[0-9]+\.[0-9]+<\/b>)/", $contents, $quote))
   $price = $quote[1];

  if (preg_match("/(Change<br><font color=ff0020>\-[0-9]+\.[0-9]+)/", 
      $contents, $chg))
  {
   $chg[1] = substr($chg[1], 29);
   $change = $chg[1];
   }

  if (preg_match("/(\+[0-9]+\.[0-9]+)/", $contents, $chg))
   $change = $chg[1];
  
  if (preg_match("/(<font face=arial size=-1>0\.00)/", $contents, $chg))
  {
   $chg[1] = substr($chg[1], 25);
   $change = $chg[1];
  }

  if (preg_match("/(\-[0-9]+\.[0-9]+\%)/", $contents, $chgp))
   $changep = $chgp[1];
  if (preg_match("/(\+[0-9]+\.[0-9]+\%)/", $contents, $chgp))
   $changep = $chgp[1];

  $worth = substr_replace($price, '', 5, 1);

  echo "<TR><TD WIDTH=60 VALIGN=TOP><FONT FACE=arial SIZE=2><B>$stock</B></TD>";
  echo "<TD WIDTH=75 VALIGN=TOP><FONT FACE=arial SIZE=2><B>$qty</B></TD>";
  echo "<TD WIDTH=60 VALIGN=TOP><FONT FACE=arial SIZE=2><B>$price</B></TD>";
  if (preg_match("/(\+)/", $chgp[1], $extra))
  {
   echo "<TD WIDTH=75 VALIGN=TOP><FONT FACE=arial SIZE=2 COLOR=00FF00><B>";
   echo "$change<BR>$changep</B></FONT></TD>";
  }
  else 
  {
   echo "<TD WIDTH=75 VALIGN=TOP><FONT FACE=arial SIZE=2 COLOR=FFFFFF><B>";
   echo "$change<BR>$changep</B></FONT></TD>";
  }
  echo "<TD WIDTH=420><FONT FACE=arial SIZE=2><B>";
  data($stock, $c, $num_rows);
  echo"</B></TD>";
  if (strlen($price)==12)
   echo "<TD WIDTH=75 VALIGN=TOP><FONT FACE=arial SIZE=2><B>$worth.00</B></TD>";
  else echo "<TD WIDTH=75 VALIGN=TOP><FONT FACE=arial SIZE=2><B>N/A</B></TD>";

  echo "</TR>";
 }

 echo "</TABLE>";
 echo "<HR COLOR=FFFFFF><P>";

/*
echo "<FONT COLOR=white>&#151;&#151;&#151;&#151;&#151;&#151;&#151;&#151;";
echo "&#151;&#151;&#151;&#151;&#151;&#151;&#151;&#151;";
echo "&#151;&#151;&#151;&#151;&#151;&#151;&#151;&#151;";
echo "&#151;&#151;&#151;&#151;&#151;&#151;&#151;&#151;";
echo "&#151;&#151;&#151;&#151;&#151;&#151;&#151;&#151;";
echo "&#151;&#151;&#151;&#151;&#151;&#151;&#151;&#151;";
echo "&#151;&#151;&#151;&#151;&#151;&#151;&#151;&#151;";
echo "&#151;&#151;&#151;&#151;&#151;&#151;&#151;&#151;</FONT><P>";
*/
?>

<FONT SIZE="-1">
Stock data retrieved from <A HREF="http://finance.yahoo.com" TARGET="_new">
Yahoo! Finance</A>
<P>
</FONT>
</BODY>
</HTML>
\end{verbatim}
\subsection{fn.php}
\begin{verbatim}
<?php

//various methods of displaying data for stocks and indices
/*basic information, additional information in column, additional information
for interface*/

//retrieve($symbols) obtains basic data relating to the variable
//$symbols is the symbol for an index or listing on Yahoo! Finance
function retrieve($symbols)
{
//obtain a page containing data regarding $symbols
 $url = "http://finance.yahoo.com/q?s=$symbols&d=t";
 if (!($fp = fopen($url, "r")))
 {
  echo "Unable to open page.";
  exit;
 }

//if opening is successful, read 100000 bytes from opened page
 $contents = fread($fp, 100000);

//close page
 fclose($fp);

//if the value of $symbols is less than 1000 points or dollars
//for indices and listings (companies and corporations in indices, respectively
 if (preg_match("/(<b>[0-9]+\.[0-9]+<\/b>)/", $contents, $quote))
 {
//print value of index or listing
  echo "<TD WIDTH=64 VALIGN=RIGHT><FONT SIZE=2 FACE=arial>$quote[1]</FONT></TD>";

//print change in points or dollars
//green for positive, white for negative
  if (preg_match("/(Change<br><font color=ff0020>\-[0-9]+\.[0-9]+)/", 
      $contents, $quote))
  {
//extra specificity of string searched due to possibility of negative EPS
//and positive change, resulting in two numbers displayed as change
   $quote[1] = substr($quote[1], 29);
   echo "<TD WIDTH=48 VALIGN=RIGHT><FONT SIZE=2 FACE=arial COLOR=FFFFFF>$quote[1]</FONT></TD>";
  }
  if (preg_match("/(\+[0-9]+\.[0-9]+)/", $contents, $quote))
   echo "<TD WIDTH=48 VALIGN=RIGHT><FONT SIZE=2 FACE=arial COLOR=00FF00>$quote[1]</FONT></TD>";

//print change in percent
//green for positve, white for negative
  if (preg_match("/(\-[0-9]+\.[0-9]+\%)/", $contents, $quote))
   echo "<TD WIDTH=64 VALIGN=RIGHT><FONT SIZE=2 FACE=arial COLOR=FFFFFF>$quote[1]</FONT></TD></TR>";
  if (preg_match("/(\+[0-9]+\.[0-9]+\%)/", $contents, $quote))
   echo "<TD WIDTH=64 VALIGN=RIGHT><FONT SIZE=2 FACE=arial COLOR=00FF00>$quote[1]</FONT></TD></TR>";

 }

//if the value of $symbols exceeds 1000 points (indices only)
 else if (preg_match("/(<b>[0-9]+\,[0-9]+\.[0-9]+<\/b>)/", $contents, $quote))
 {
//print value of index
  echo "<TD WIDTH=72 VALIGN=RIGHT><FONT SIZE=2 FACE=arial>$quote[1]</FONT></TD>";

//print chage in points or dollars
//green for positive, white for negative
  if (preg_match("/(\-[0-9]+\.[0-9]+)/", $contents, $quote))
   echo "<TD WIDTH=64 VALIGN=RIGHT><FONT SIZE=2 FACE=arial COLOR=FFFFFF>$quote[1]</FONT></TD>";
  if (preg_match("/(\+[0-9]+\.[0-9]+)/", $contents, $quote))
   echo "<TD WIDTH=64 VALIGN=RIGHT><FONT SIZE=2 FACE=arial COLOR=00FF00>$quote[1]</FONT></TD>";

//print change in percent
//green for positive, white for negative
  if (preg_match("/(\-[0-9]+\.[0-9]+\%)/", $contents, $quote))
   echo "<TD WIDTH=64 VALIGN=RIGHT><FONT SIZE=2 FACE=arial COLOR=FFFFFF>$quote[1]</FONT></TD></TR>";
  if (preg_match("/(\+[0-9]+\.[0-9]+\%)/", $contents, $quote))
   echo "<TD WIDTH=64 VALIGN=RIGHT><FONT SIZE=2 FACE=arial COLOR=00FF00>$quote[1]</FONT></TD></TR>";

 }

//if the value of $symbols cannot be determined
 else
 {
  echo "No quote available.<P>";
 } 
}
//end function retrieve($symbols)

//if $symbols is not an index
//display technical data
function techdata($symbols)
{
//obtain a page containing data regarding $symbols
 $url = "http://finance.yahoo.com/q?s=$symbols&d=t";
 if (!($fp = fopen($url, "r")))
 {
  echo "Unable to open page.";
  exit;
 }

//if opening is successful, read 100000 bytes from opened page
 $contents = fread($fp, 100000);

//close page
 fclose($fp);

 if ($symbols != "^DJI" && $symbols != "^IXIC" && $symbols != "^GSPC"
     && $symbols != "^dji" && $symbols != "^ixic" && $symbols != "^gspc")
 {
  echo "<TABLE CELLSPACING=0 CELLPADDING=0>";
//Market
//NYSE - New York Stock Exchange
//NasdaqNM - Nasdaq National Market
//AMEX - American Stock Exchange
  echo "<TR><TD WIDTH=120><FONT FACE=arial SIZE=2>Exchange</TD>";
  if (preg_match("/(NYSE:$symbols)/", $contents, $quote))
   echo "<TD WIDTH=100><FONT FACE=arial SIZE=2>NYSE</TD></TR>";
  if (preg_match("/(NasdaqNM:$symbols)/", $contents, $quote))
   echo "<TD WIDTH=100><FONT FACE=arial SIZE=2>NASDAQ</TD></TR>";
  if (preg_match("/(AMEX:$symbols)/", $contents, $quote))
   echo "<TD WIDTH=100><FONT FACE=arial SIZE=2>American</TD></TR>";
//P/E Ratio - Price to Earnings
  if (preg_match("/(P\/E<br>[0-9]+\.[0-9]+)/", $contents, $quote))
  {
   $quote[1] = substr($quote[1], 7);
   echo "<TR><TD WIDTH=120><FONT FACE=arial SIZE=2>P/E</TD>";
   echo "<TD WIDTH=100><FONT FACE=arial SIZE=2>$quote[1]</TD></TR>";
  }
  else {
   echo "<TR><TD WIDTH=120><FONT FACE=arial SIZE=2>P/E</TD>";
   echo "<TD WIDTH=100><FONT FACE=arial SIZE=2>N/A</TD></TR>";
  }
//PEG - P/E / Growth
  if (preg_match("/(PEG<br>[0-9]+\.[0-9]+)/", $contents, $quote))
  {
   $quote[1] = substr($quote[1], 7);
   echo "<TR><TD WIDTH=120><FONT FACE=arial SIZE=2>PEG</TD>";
   echo "<TD WIDTH=100><FONT FACE=arial SIZE=2>$quote[1]</TD></TR>";
  }
  else {
   echo "<TR><TD WIDTH=120><FONT FACE=arial SIZE=2>PEG</TD>";
   echo "<TD WIDTH=100><FONT FACE=arial SIZE=2>N/A</TD></TR>";
  }
//EPS - Earnings Per Share
/*/
  if (preg_match("/(<small>(ttm)<\/small><br>[0-9]+\.[0-9]+)/",
      $contents, $quote))
  {
   //$quote[1] = substr($quote[1], 11);
   echo "<TR><TD WIDTH=120><FONT FACE=arial SIZE=2>Earnings</TD>";
   echo "<TD WIDTH=100><FONT FACE=arial SIZE=2>$quote</TR>";
  }
  else if (preg_match("/(<small>(ttm)<\/small><br>\-[0-9]+\.[0-9]+)/",
           $contents, $quote))
  {
   //$quote[1] = substr($quote[1], 11);
   echo "<TR><TD WIDTH=120><FONT FACE=arial SIZE=2>Earnings</TD>";
   echo "<TD WIDTH=100><FONT FACE=arial SIZE=2>$quote</TR>";
  }
  else {
   echo "<TR><TD WIDTH=120><FONT FACE=arial SIZE=2>Earnings</TD>";
   echo "<TD WIDTH=100><FONT FACE=arial SIZE=2>N/A</TR>";
  }
/*/
//Market Capitalization
  if (preg_match("/(Mkt Cap<br>[0-9]+\.[0-9]+)/", $contents, $quote))
  {
   $quote[1] = substr($quote[1], 11);
   echo "<TR><TD WIDTH=120><FONT FACE=arial SIZE=2>Market Cap</TD>";
   echo "<TD WIDTH=100><FONT FACE=arial SIZE=2>$$quote[1] ";
   if (preg_match("/(Mkt Cap<br>[0-9]+\.[0-9]+B)/", $contents, $quote))
    echo "Billion</TD></TR>";
   if (preg_match("/(Mkt Cap<br>[0-9]+\.[0-9]+M)/", $contents, $quote))
    echo "Million</TD></TR>";
  }
  else {
   echo "<TR><TD WIDTH=120><FONT FACE=arial SIZE=2>Market Cap</TD>";
   echo "<TD WIDTH=100><FONT FACE=arial SIZE=2>N/A</TD></TR>";  
  }
//Volume - Shares Traded (Daily)
  if (preg_match("/(Volume<br>[0-9]+\,[0-9]+\,[0-9]+)/", $contents, $quote) 
   || preg_match("/(Volume<br>[0-9]+\,[0-9]+)/", $contents, $quote)
   || preg_match("/(Volume<br>[0-9]+)/", $contents, $quote))
  {
   $quote[1] = substr($quote[1], 10);
   echo "<TR><TD WIDTH=120><FONT FACE=arial SIZE=2>Volume</TD>";
   echo "<TD WIDTH=100><FONT FACE=arial SIZE=2>$quote[1]</TD></TR>";
  }
  else {
   echo "<TR><TD WIDTH=120><FONT FACE=arial SIZE=2>Volume</TD>";
   echo "<TD WIDTH=100><FONT FACE=arial SIZE=2>N/A</TD></TR>";
  }
//Volume - Shares Traded (Daily)
  if (preg_match("/(Avg Vol<br>[0-9]+\,[0-9]+\,[0-9]+)/", $contents, $quote)
   || preg_match("/(Avg Vol<br>[0-9]+\,[0-9]+)/", $contents, $quote))
  {
   $quote[1] = substr($quote[1], 11);
   echo "<TR><TD WIDTH=120><FONT FACE=arial SIZE=2>Average Volume</TD>";
   echo "<TD WIDTH=100><FONT FACE=arial SIZE=2>$quote[1]</TD></TR>";
  }
  else {
   echo "<TR><TD WIDTH=120><FONT FACE=arial SIZE=2>Average Volume</TD>";
   echo "<TD WIDTH=100><FONT FACE=arial SIZE=2>N/A</TD></TR>";
  }
  echo "</TABLE><BR>";
 }
}

//if $symbols is not an index
//display technical data for final interface
function data($symbols, $c, $r)
{
//obtain a page containing data regarding $symbols
 $url = "http://finance.yahoo.com/q?s=$symbols&d=t";
 if (!($fp = fopen($url, "r")))
 {
  echo "Unable to open page.";
  exit;
 }

//if opening is successful, read 100000 bytes from opened page
 $contents = fread($fp, 100000);

//close page
 fclose($fp);

 if ($symbols != "^DJI" && $symbols != "^IXIC" && $symbols != "^GSPC"
     && $symbols != "^dji" && $symbols != "^ixic" && $symbols != "^gspc")
 {
  echo "<TABLE CELLSPACING=0 CELLPADDING=0>";
//Market
//NYSE - New York Stock Exchange
//NasdaqNM - Nasdaq National Market
//AMEX - American Stock Exchange
  echo "<TR><TD WIDTH=80><FONT FACE=arial SIZE=2>Exchange</TD>";
  if (preg_match("/(NYSE:$symbols)/", $contents, $quote))
   echo "<TD WIDTH=100><FONT FACE=arial SIZE=2>NYSE</TD>";
  if (preg_match("/(NasdaqNM:$symbols)/", $contents, $quote))
   echo "<TD WIDTH=100><FONT FACE=arial SIZE=2>NASDAQ</TD>";
  if (preg_match("/(AMEX:$symbols)/", $contents, $quote))
   echo "<TD WIDTH=100><FONT FACE=arial SIZE=2>American</TD>";
//Market Capitalization
  if (preg_match("/(Mkt Cap<br>[0-9]+\.[0-9]+)/", $contents, $quote))
  {
   $quote[1] = substr($quote[1], 11);
   echo "<TD WIDTH=120><FONT FACE=arial SIZE=2>Market Cap</TD>";
   echo "<TD WIDTH=100><FONT FACE=arial SIZE=2>$$quote[1] ";
   if (preg_match("/(Mkt Cap<br>[0-9]+\.[0-9]+B)/", $contents, $quote))
    echo "Billion</TD></TR>";
   if (preg_match("/(Mkt Cap<br>[0-9]+\.[0-9]+M)/", $contents, $quote))
    echo "Million</TD></TR>";
  }
  else {
   echo "<TD WIDTH=120><FONT FACE=arial SIZE=2>Market Cap</TD>";
   echo "<TD WIDTH=100><FONT FACE=arial SIZE=2>N/A</TD></TR>";  
  }
//P/E Ratio - Price to Earnings
  if (preg_match("/(P\/E<br>[0-9]+\.[0-9]+)/", $contents, $quote))
  {
   $quote[1] = substr($quote[1], 7);
   echo "<TR><TD WIDTH=80><FONT FACE=arial SIZE=2>P/E</TD>";
   echo "<TD WIDTH=100><FONT FACE=arial SIZE=2>$quote[1]</TD>";
  }
  else {
   echo "<TR><TD WIDTH=80><FONT FACE=arial SIZE=2>P/E</TD>";
   echo "<TD WIDTH=100><FONT FACE=arial SIZE=2>N/A</TD>";
  }
//PEG - P/E / Growth
  if (preg_match("/(PEG<br>[0-9]+\.[0-9]+)/", $contents, $quote))
  {
   $quote[1] = substr($quote[1], 7);
   echo "<TD WIDTH=120><FONT FACE=arial SIZE=2>PEG</TD>";
   echo "<TD WIDTH=100><FONT FACE=arial SIZE=2>$quote[1]</TD></TR>";
  }
  else {
   echo "<TD WIDTH=120><FONT FACE=arial SIZE=2>PEG</TD>";
   echo "<TD WIDTH=100><FONT FACE=arial SIZE=2>N/A</TD></TR>";
  }
//EPS - Earnings Per Share
/*/
  if (preg_match("/(<small>(ttm)<\/small><br>[0-9]+\.[0-9]+)/",
      $contents, $quote))
  {
   //$quote[1] = substr($quote[1], 11);
   echo "<TR><TD WIDTH=120><FONT FACE=arial SIZE=2>Earnings</TD>";
   echo "<TD WIDTH=100><FONT FACE=arial SIZE=2>$quote</TR>";
  }
  else if (preg_match("/(<small>(ttm)<\/small><br>\-[0-9]+\.[0-9]+)/",
           $contents, $quote))
  {
   //$quote[1] = substr($quote[1], 11);
   echo "<TR><TD WIDTH=120><FONT FACE=arial SIZE=2>Earnings</TD>";
   echo "<TD WIDTH=100><FONT FACE=arial SIZE=2>$quote</TR>";
  }
  else {
   echo "<TR><TD WIDTH=120><FONT FACE=arial SIZE=2>Earnings</TD>";
   echo "<TD WIDTH=100><FONT FACE=arial SIZE=2>N/A</TR>";
  }
/*/

//Volume - Shares Traded (Daily)
  if (preg_match("/(Volume<br>[0-9]+\,[0-9]+\,[0-9]+)/", $contents, $quote) 
   || preg_match("/(Volume<br>[0-9]+\,[0-9]+)/", $contents, $quote)
   || preg_match("/(Volume<br>[0-9]+)/", $contents, $quote))
  {
   $quote[1] = substr($quote[1], 10);
   echo "<TR><TD WIDTH=80><FONT FACE=arial SIZE=2>Volume</TD>";
   echo "<TD WIDTH=100><FONT FACE=arial SIZE=2>$quote[1]</TD>";
  }
  else {
   echo "<TR><TD WIDTH=80><FONT FACE=arial SIZE=2>Volume</TD>";
   echo "<TD WIDTH=100><FONT FACE=arial SIZE=2>N/A</TD>";
  }
//Volume - Shares Traded (Daily)
  if (preg_match("/(Avg Vol<br>[0-9]+\,[0-9]+\,[0-9]+)/", $contents, $quote)
   || preg_match("/(Avg Vol<br>[0-9]+\,[0-9]+)/", $contents, $quote))
  {
   $quote[1] = substr($quote[1], 11);
   echo "<TD WIDTH=120><FONT FACE=arial SIZE=2>Average Volume</TD>";
   echo "<TD WIDTH=100><FONT FACE=arial SIZE=2>$quote[1]</TD></TR>";
  }
  else {
   echo "<TD WIDTH=120><FONT FACE=arial SIZE=2>Average Volume</TD>";
   echo "<TD WIDTH=100><FONT FACE=arial SIZE=2>N/A</TD></TR>";
  }
  if ($c < $r - 1)
   echo "<TR><TD><BR></TD></TR>";
  echo "</TABLE>";
 }
}

?>
\end{verbatim}
\subsection{reject.php}
\begin{verbatim}
<HTML>
<META HTTP-EQUIV="Refresh" CONTENT="15">
<HEAD><TITLE>Techlab 2002-2003</TITLE></HEAD>
<STYLE>  A {text-decoration: none;} A:hover {color: gold;}
<!--potential formatting for Internet Explorer (MS)
BODY {SCROLLBAR-FACE-COLOR: "";
      SCROLLBAR-HIGHLIGHT-COLOR: "";
      SCROLLBAR-SHADOW-COLOR: "";
      SCROLLBAR-3DLIGHT-COLOR: "";
      SCROLLBAR-ARROW-COLOR: "";
      SCROLLBAR-TRACK-COLOR: "";
      SCROLLBAR-DARKSHADOW-COLOR: "";
     }--><!--AF color 19638c; regular, 000040-->
</STYLE>
<BODY BGCOLOR="#19638c" TEXT="#FFFFFF" LINK="gold" ALINK="gold" VLINK="gold">
<FONT FACE="arial" SIZE="-1">
<CENTER>
<?
print("ERROR: Invalid password.");
?>
<P>
<A HREF="interface.php">Return to Interface</A>
</FONT>
</CENTER>
</BODY>
</HTML>
\end{verbatim}
\subsection{result.php}
This file was developed in the early stages of this project as a prelude to
portfolio.php.  The following code is used to display the results obtained from
entering a ticker symbol on a preceding page (the home page used during this
project).
\begin{verbatim}
<HTML>
<HEAD><TITLE>Techlab 2002-2003</TITLE></HEAD>
<STYLE>  A {text-decoration: none;} A:hover {color: gold;}
BODY {SCROLLBAR-FACE-COLOR: "red";
      SCROLLBAR-HIGHLIGHT-COLOR: "gold";
      SCROLLBAR-SHADOW-COLOR: "gold";
      SCROLLBAR-3DLIGHT-COLOR: "red";
      SCROLLBAR-ARROW-COLOR: "gold";
      SCROLLBAR-TRACK-COLOR: "red";
      SCROLLBAR-DARKSHADOW-COLOR: "red";
     }
</STYLE>
<BODY BGCOLOR="#000040" TEXT="#FFFFFF" LINK="red" ALINK="red" VLINK="red">
<FONT FACE="arial" SIZE="-1">
<CENTER>
<A HREF="index.php">Home</A> 
| 
<A HREF="assign.html">Assignments</A> 
| 
<A HREF="journal.html">Journal</A> 
| 
<A HREF="progress.html">Progress</A> 
| 
<A HREF="proposal.html">Proposal</A> 
| 
<A HREF="techlab.html">Techlab</A>
<P>
<H3>An Online User Interface for<BR>Tracking Stock Portfolios</H3>
<P>
</CENTER>
<B>American Markets</B><BR>
<?php

//Day Date Month Year [Time (24-hour system)]
 print(date("l d F Y"));
 print(" [");
 print(date("H"));
 print(date("i"));
 print("]<P>");

//include fn.php for use below
 $dir='.';
 include($dir.'/fn.php');

// echo "<B>Major Indices</B><BR>";

//call retrieving function in fn.php for the major indices
//^DJI, ^IXIC, and ^GSPC are Yahoo! Finance designations for the indices
//retrieve obtains current value, change in points, and change in percent
//retrieve also continues printing in table started below
 echo "<TABLE CELLPADDING=0 CELLSPACING=0><TR><TD WIDTH=144><FONT SIZE=2 FACE=arial>";
 echo "Dow Jones Industrial</FONT></TD>";
 $markets = '^DJI';
 $quotes = retrieve($markets);

 echo "<TR><TD WIDTH=144><FONT SIZE=2 FACE=arial>NASDAQ Composite</FONT></TD>";
 $markets = '^IXIC';
 $quotes = retrieve($markets);

 echo "<TR><TD WIDTH=144><FONT SIZE=2 FACE=arial>Standard & Poor's 500</FONT></TD>";
 $markets = '^GSPC';
 $quotes = retrieve($markets);
 echo "</TABLE>";

/*
 echo "<P><FONT COLOR=gold>&#151;&#151;&#151;&#151;&#151;&#151;&#151;&#151;";
 echo "&#151;&#151;&#151;&#151;&#151;&#151;&#151;&#151;";
 echo "&#151;&#151;&#151;&#151;&#151;&#151;&#151;&#151;";
 echo "&#151;&#151;&#151;&#151;&#151;&#151;&#151;&#151;</FONT><P>";
*/

/*
//LISTINGS
 echo "<TABLE><TR><TD WIDTH=243><FONT SIZE=2 FACE=arial>";
 echo "<B>Selected Quotes</B></FONT>";

 $markets = 'CSCO';
 echo "<TR><TD WIDTH=243><FONT SIZE=2 FACE=arial>Cisco Systems";
 echo" [$markets, NASDAQ]</FONT></TD>";
 $quotes = retrieve($markets);

 $markets = 'KO';
 echo "<TR><TD WIDTH=243><FONT SIZE=2 FACE=arial>Coca-Cola Company";
 echo " [$markets, NYSE]</TD>";
 $quotes = retrieve($markets);

 $markets = 'MSFT';
 echo "<TR><TD WIDTH=243><FONT SIZE=2 FACE=arial>Microsoft Corporation";
 echo " [$markets, NASDAQ]</TD>";
 $quotes = retrieve($markets);
 echo "</TABLE>";
*/

 echo "<P><FONT COLOR=gold>&#151;&#151;&#151;&#151;&#151;&#151;&#151;&#151;";
 echo "&#151;&#151;&#151;&#151;&#151;&#151;&#151;&#151;";
 echo "&#151;&#151;&#151;&#151;&#151;&#151;&#151;&#151;";
 echo "&#151;&#151;&#151;&#151;&#151;&#151;&#151;&#151;</FONT><P>";

 echo "<TABLE CELLSPACING=0 CELLPADDING=0><TR><TD WIDTH=120><FONT SIZE=2 FACE=arial>$quote</FONT></TD>";
 retrieve ($quote);
 echo "</TABLE>";
 techdata ($quote);
?>
<!--
<FORM NAME="form" METHOD="post" ACTION="result.php">
<INPUT TYPE="text" NAME="quote" SIZE="6" MAXLENGTH="6">
<INPUT TYPE="submit" NAME="retrieve" VALUE="GET QUOTE!">
-->
<?php
 echo "<P><FONT COLOR=gold>&#151;&#151;&#151;&#151;&#151;&#151;&#151;&#151;";
 echo "&#151;&#151;&#151;&#151;&#151;&#151;&#151;&#151;";
 echo "&#151;&#151;&#151;&#151;&#151;&#151;&#151;&#151;";
 echo "&#151;&#151;&#151;&#151;&#151;&#151;&#151;&#151;</FONT><P>";
?>
<P>Joseph Hess<BR>
<A HREF="mailto:jhess@lan.tjhsst.edu">jhess@lan.tjhsst.edu</A>
<P>
<FONT SIZE="-2">
LAST MODIFIED DECEMBER 2002<BR>
STOCK DATA RETRIEVED FROM <A HREF="http://finance.yahoo.com" TARGET="_new">
YAHOO! FINANCE</A><BR>
</BODY>
</HTML>
\end{verbatim}
\subsection{Other Files}
Other files were written throughout the year as the precursors of the interface
were developed these files have features in the intermediate area between
result.php, created for viewing market data and information pertaining to a
single stock, and portfolio.php, the extent of the final project reached in the
Computer Systems Laboratory.  Therefore, these files, which constitute
approximately 200 additional lines of code are not included in this
document.  Additional code was written in order to create the MySQL tables used
in the interface.

\section{Appendix II:  Testing and Visuals}
\includegraphics[height=160mm]{sample.eps}
\par
Figure 1.  Mr. Latimer's portfolio.
\par
\includegraphics[height=160mm]{sample2.eps}
\par
Figure 2.  Mr. Latimer enters the interface.
\par
\includegraphics[height=160mm]{sample3.eps}
\par
Figure 3.  Yosemite Sam's portfolio.
\par
\includegraphics[height=160mm]{sample4.eps}
\par
Figure 4.  Yosemite Sam enters the interface.
\par

\section{References}
The following resources were of aid in this endeavor:
\par
\begin{itemize}
\item Financial Data:  Yahoo! Finance (finance.yahoo.com)
\item Financial Data:  Dow Jones (www.dowjones.com)
\item Financial Data:  NASDAQ (www.nasdaq.com)
\item Financial Data:  Standard and Poor's 500 (www.standardpoor.com)
\item Financial Advice:  {\it 24 Rules for Investment Success} by William O'Neil
\item PHP:  www.php.net
\item PHP:  www.PHPBuilder.com
\item MySQL:  www.mysql.com
\item Databases:  CS462 ("Database Systems") at the University of Virginia (www.cs.virginia.edu/~son/cs462.html)
\item Databases:  CS4604 ("Introduction to
Database Management Systems") at Virginia Polytechnic Institute
(courses.cs.vt.edu/~cs4604/notes.html)
\item Databases:  {\it A First Course in Database Systems} by Jeff Ullman and
Jennifer Widom, available in part online (www-db.stanford.edu/~ullman/fcdb.html)
\item Design of User Interfaces:  {\it User Interface Design for Programmers} by
Joel Spolsky, available in part online
(www.joelonsoftware.com/uibook/chapters/fog0000000057.html)
\item Design of User Interfaces:  Computer-Human Interaction (www.acm.org/sigchi/)

\end{itemize}

\section{Acknowledgements}
The author wishes to extend special thanks to Mr. Latimer and Nicholas Shelly for
their numerous
contributions to this project.  Their patience and helpfulness were essential to
the author's accomplishments in the Computer Systems Laboratory.

\end{document}
