Database Systems Final Project

Dr. Liyang Yu

CS 3153

By: Erin Flowers, Bradley Shedd, and James Carmichael

          Date: December 8, 2011

 

 

 

 

 

 

 

 

 

 

Table of Contents

Cover Sheet…………………………………………………………………………………………………..page 1

Table of Contents………………………………………………………........................................................2, 3

E/R Diagram..................................................................................................………………………………...4

Relational Schema (3NF)……………………………….…………………………………………....……………5

Page Flow Diagram……………………………….…………………………………………………..……………6

SQL Source Code………….…………………………………………..............................................................7

1.0    SQL Source Code……………………………………………………………………………………………...7

2.0    CREATE TABLES……………………………………………………………………………………...….....7

2.1    Houses……………………………………………………………...………………………………...7

2.2    House History………………………………………………………………………………………..7

2.3    School…………………………………………...……………………………………………………7

2.4    User…………………………………………………………………….…………………………….7

2.4.1           Agent……………………………………………………………….………………...........7

2.4.2           Buyer……………………………………………………………….……………………...7

2.5    Appointment…………………………………………………………………………………………7

2.6    Offer……………………………………………………………………………………………….....8

3.0    INSERT INTO……………………………………………………………………………………………...….8

3.1    Houses………………………………………………………………………………………………..8

3.2    House History………………………………………………………………………………………..8

3.3    School………………………………………………………………………………………………...9

3.4    Appointment………………………………………………………………….………………………9

3.5    Offer……………………………………………………………………………………………...…10

4.0    Select * From……………………………………………………………………………………....................10

4.1    All the Mansions………………………………………………………………………...…….……10

4.1.1           Villain’s Mansions……………………………………………………………………….10

4.1.2           Hero’s Mansions…………………………………………………………………………10

4.1.3           Number of Beds…………………………………………………………………….……10

4.1.4           Number of Baths……………………………………………………………………..…..10

4.1.5           Acres……………………………………………………………………………………..10

4.1.6           Area within Zip…………………………………………………………………………..10

4.2    History………………………………………………………………………………………………10

4.2.1           Oldest Year Built………………………………………………………………………...11

4.2.2           Newest Year Built………………………………………………………………………..11

4.3    Schools near mansion……………………………………………………………………………….11

4.4    View By…………………………………………………………………………………………….11

4.4.1           Price Ascending………………………………………………………………………….11

4.4.2           Year Built Ascending………………………………………………………………….…11

5.0    Table Dump……………………………………………………………………………………......................11

5.1    Appointment………………………………………………………………………………………...11

5.2    Offer………………………………………………………………………………………………...11

Web Site Screenshots…………….……………………………………………………………………………...12

6.0    Home Page ………………………………………………………………………………………………...…12

6.1    home.html……………………........................................................................................................…13

 

7.0    Agent Log In………………………………………………………………………………………………..…15

7.1     createAcctAgent.html…………………………………………………………………………………16

7.2    createAgent.php………………………………………………………………………………...……16

8.0    Buyer Log In……………………………………………………………………………………………..……17

8.1     createAcctBuyer.html…………………………………………………………………………………18

8.2     createAcctBuyer.php(------fix add to winSCP) ………………………………………………………..…18

9.0    Returning Users………………………………………………………………………………………………19

9.1     Login.html……………………………………………………………………………………………20

9.2     Login.php(--------fix add to winSCP) ……………………………………………………………………20

10.0 All Houses……………………………………………………………………………………………………21

10.1 showEverything2.php……………………………………………………………………………...…21

11.0 Villian Mansions …………………………………………………………………………………………..…24

11.1 showVill.php…………………………………………………………………………………………24

12.0 Hero Mansions…………………………………………………………………………………………….…27

12.1 showHero.php…………………………………………………………………………………….…27

13.0 Energy Star Mansions……………………………………………………………………………………..…29

13.1 showE.php………………………………………………………………………………………...…29

14.0 Remodeled Mansions……………………………………………………………………………………..…31

14.1 showR.php…………………………………………………………………………………………..32

15.0 Brick Mansions…………………………………………………………………………………………….…34

15.1 showBrick.php…………………………………………………………………………………….…34

16.0 Stone Mansions…………………………………………………………………………………………...…36

16.1 showStone.php………………………………………………………………………………………37

17.0 Newest Mansions……………………………………………………………………………………………39

17.1 showNew.php………………………………………………………………………………………..39

18.0 Oldest Mansions……………………………………………………………………………………………..41

18.1 showOld.php………………………………………………………………………………………...41

19.0 Schools Near Mansion……………………………………………………………………………………….43

19.1 showSchool.php……………………………………………………………………………………...43

20.0 List Lowest to Highest Price………………………………………………………………………………….46

20.1 showPrice.php……………………………………………………………………………………….46

21.0 Search by Number of Beds…………………………………………………………………………………..48

21.1 queryByBed.html…………………………………………………………………………………….48

21.2 queryByBed.php……………………………………………………………………………………...49

22.0 Search by Number of Baths………………………………………………………………………………….50

22.1   queryByBath.html……………………………………………………………………………………50

22.2   queryByBath.php…………………………………………………………………………………….51

23.0 Search by Lot Size……………………………………………………………………………………………52

23.1   queryByLot.html……………………………………………………………………………………..52

23.2   queryByLot.php………………………………………………………………………………………53

24.0 Search by Zip…………………………………………………………………………………………………54

24.1   queryByZip.html……………………………………………………………………………………...54

24.2  queryByZip2.php……………………………………………………………………………………...55

25.0 Search by Year Built………………………………………………………………………………………….56

25.1   queryByYear.html…………………………………………………………………………………….57

25.2   queryByYear.php……………………………………………………………………………………..57

 

 

 

 

 

 

 

 

Page Flow Diagram

 

 

 

1.0 SQL Source Code

 

CREATE TABLE houses1 (

mls NUMERIC(3) PRIMARY KEY,

agent VARCHAR(40)NOT NULL,

county VARCHAR(25) NOT NULL,                      

city VARCHAR(25) NOT NULL,

zip CHAR(5)NOT NULL,

list_price NUMERIC(8) NOT NULL,

type CHAR(1) DEFAULT ‘H’ CHECK (type = ‘H’ OR type = ‘V’)

);

 

CREATE TABLE info (

id NUMERIC(3) PRIMARY KEY REFERENCES Houses1 (mls),

year_built Numeric(4) NOT NULL,

remolded CHAR(1) NOT NULL DEFAULT ‘N’ CHECK (remolded = ‘N’ OR remolded = ‘Y’),                      

estar CHAR(1) NOT NULL DEFAULT ‘N’ CHECK (estar = ‘N’ OR estar = ‘Y’),

mat CHAR(1)NOT NULL CHECK (mat = ‘B’ OR mat = ‘S’),

beds INTEGER NOT NULL,

baths INTEGER NOT NULL,

acres INTEGER NOT NULL

);

 

CREATE TABLE school (

id NUMERIC(3) PRIMARY KEY REFERENCES Houses1 (mls),

e_name VARCHAR(40),

m_name VARCHAR(40),

h_name VARCHAR(40)

);

 

CREATE TABLE user1 (

name VARCHAR(30) PRIMARY KEY,

password VARCHAR(4)NOT NULL,

email VARCHAR(25) NOT NULL

        CHECK (email LIKE '%@%.%'),                     

phone NUMERIC (10) ,

type CHAR(1) DEFAULT ‘B’ CHECK (type = ‘A’ OR type = ‘B’)

);

 

 

CREATE TABLE appoint1 (

id INTEGER PRIMARY KEY,

mls NUMERIC(3) NOT NULL,

email VARCHAR(25) NOT NULL CHECK (email LIKE '%@%.%'),

date VARCHAR(10) NOT NULL CHECK (date LIKE '%/%/%'),

time VARCHAR(25) NOT NULL CHECK (time LIKE ’%:%),

agent VARCHAR(40) NOT NULL,

buyer VARCHAR(40) NOT NULL);

 

CREATE TABLE offer1  (

id INTEGER PRIMARY KEY,

mls NUMERIC(3) NOT NULL,

date  VARCHAR(10) NOT NULL,

price NUMERIC(8) NOT NULL,

cond VARCHAR(100) ,

agent VARCHAR(40) NOT NULL,

buyer VARCHAR(40) NOT NULL);

 

INSERT INTO houses1 (mls, agent, county, city, zip, list_price, type)

 VALUES (101, ‘GreenLantern’, ‘Henry’, ‘Stockbridge’, 30252, 3155000,‘H’);

 

INSERT INTO houses1 (mls, agent, county, city, zip, list_price, type)

 VALUES (102, ‘Iceman’, ‘Gwinnett’, ‘Duluth’, 30095, 5368000,‘V’);

 

INSERT INTO houses1 (mls, agent, county, city, zip, list_price, type)

 VALUES (103, ‘Diabolical Brad’, ‘Polk’, ‘Cedar Town’, 30095, 2268000,‘V’);

 

INSERT INTO houses1 (mls, agent, county, city, zip, list_price, type)

 VALUES (104, ‘Dr. Yu’, ‘Chatam’, ‘Savannah’, 31164, 7100000,‘V’);

 

INSERT INTO houses1 (mls, agent, county, city, zip, list_price, type)

 VALUES (105, ‘Wiz Khalifa’, ‘Hall’, ’Smokerville’, 30420, 3200000,‘H’);

 

INSERT INTO houses1 (mls, agent, county, city, zip, list_price, type)

 VALUES (106,  ‘Juiceman J’, ‘Henry’, ’Kellytown’, 30252, 1000000,‘V’);

 

INSERT INTO houses1 (mls, agent, county, city, zip, list_price, type)

 VALUES (107, ‘Chuck Norris’, ‘Henry’, ’Ola’, 30252, 4500000,‘H’);

 

INSERT INTO info (id, year_built, remolded, estar, mat, beds, baths, acres)

 VALUES (101, 2010, ‘N’, ‘Y’, ‘S’, 8, 7, 10);

 

INSERT INTO info (id, year_built, remolded, estar, mat, beds, baths, acres)

 VALUES (102, 2008, ‘N’, ‘Y’, ‘B’, 12, 10, 25);

 

INSERT INTO info (id, year_built, remolded, estar, mat, beds, baths, acres)

 VALUES (103, 1988, ‘Y’, ‘Y’, ‘B’, 10, 12, 30);

 

INSERT INTO info (id, year_built, remolded, estar, mat, beds, baths, acres)

 VALUES (104, 1990, ‘N’, ‘N’, ‘S’, 6, 5, 200);

 

INSERT INTO info (id, year_built, remolded, estar, mat, beds, baths, acres)

 VALUES (105, 1979, ‘Y’, ‘N’, ‘S’, 10, 12, 18);

 

INSERT INTO info (id, year_built, remolded, estar, mat, beds, baths, acres)

 VALUES (106, 2005, ‘N’, ‘Y’, ‘B’, 8, 7, 10);

 

INSERT INTO info (id, year_built, remolded, estar, mat, beds, baths, acres)

 VALUES (107, 1999, ‘N’, ‘N’, ‘B’, 9, 15, 22);

 

INSERT INTO school (id, e_name, m_name, h_name)

 VALUES (101, ‘East Lake’, ‘Union Grove’, ‘Union Grove’);

 

INSERT INTO school (id, e_name, m_name, h_name)

 VALUES (102, ‘North Gate’, ‘Middle Winter’, ‘East Windsor’);

 

INSERT INTO school (id, e_name, m_name, h_name)

 VALUES (103, ‘Hogwarts’, ‘Hogpimple’, ‘HogCorn’);

 

INSERT INTO school (id, e_name, m_name, h_name)

 VALUES (104, ‘Hickory Flat’, ‘Eagles Landing’, ‘Hillboro’);

 

 

INSERT INTO school (id, e_name, m_name, h_name)

 VALUES (105, ‘Oak Hill’, ‘Maldor’, ‘South Castle’);

 

 

INSERT INTO school (id, e_name, m_name, h_name)

 VALUES (106, ‘Timberridge’, ‘Union Grove’, ‘Union Grove’);

 

INSERT INTO school (id, e_name, m_name, h_name)

 VALUES (107, ‘Tussahaw’, ‘West Ola’, ‘Middle Earth’);

 

 

 

INSERT INTO appoint (id, mls, email, date, time, agent, buyer)

 VALUES (1, 104, ‘jamesc@gmail.com’, ‘01/20/2012’, ‘2:15pm’, ‘Dr. YU’, ‘James C’);

 

INSERT INTO appoint (id, mls, email, date, time, agent, buyer)

 VALUES (2, 107, ‘billyb@gmail.com’, ‘01/15/2012’, ‘3:30pm’, ‘Chuck Norris’, ‘Billy B’);

 

 

INSERT INTO appoint (id, mls, email, date, time, agent, buyer)

 VALUES (3, 101, ‘jamesc@gmail.com’, ‘02/05/2012’, ‘3:30pm’, ‘Green Lantern’, ‘James C’);

 

INSERT INTO appoint (id, mls, email, date, time, agent, buyer)

 VALUES (4, 102, ‘janej@yahoo.com’, ‘03/01/2012’, ‘5:00pm’, ‘Iceman’, ‘Jane J’);

 

INSERT INTO appoint (id, mls, email, date, time, agent, buyer)

 VALUES (5, 102, ‘mikem@yesman.com’, ‘03/12/2012’, ‘1:50pm’, ‘Iceman’, ‘Mike M’);

 

INSERT INTO offer1 (id, mls, date, price, cond, agent, buyer)

 VALUES (1, 102, ‘02/10/2011’, 5000000,’new carpet’, ‘Iceman’, ‘Mike M’);

 

INSERT INTO offer1 (id, mls, date, price, cond, agent, buyer)

 VALUES (2, 107, ‘03/20/2011’, 8000000,’new carpet’, ‘Chuck Norris’, ‘Billy B’);

 

INSERT INTO offer1 (id, mls, date, price, cond, agent, buyer)

 VALUES (3, 101, ‘01/25/2011’, 7000000,’new carpet’, ‘Green Lantern’, ‘James C’);

 

INSERT INTO offer1 (id, mls, date, price, cond, agent, buyer)

 VALUES (4, 104, ‘02/08/2011’, 9000000,’new carpet’, ‘Dr Yu’, ‘James C’);

 

INSERT INTO offer1 (id, mls, date, price, cond, agent, buyer)

 VALUES (5, 102, ‘02/10/2011’, 5000000,’new carpet’, ‘Iceman’, ‘Cindy S’);

 

 

select * from houses1 h, info i, school s where h.mls=i.id and h.mls=s.id;

 

select * from houses1 h, info i, school s  where h.type='V' and h.mls=i.id and h.mls=s.id;

 

select * from houses1 h, info i, school s  where h.type='H' and h.mls=i.id and h.mls=s.id

 

select * from houses1 h, info i, school s  where i.beds<=$1 and h.mls=i.id and h.mls=s.id

 

select * from houses1 h, info i, school s  where i.baths<=$1 and h.mls=i.id and h.mls=s.id

 

 

select * from houses1 h, info i, school s  where i.acres<=$1 and h.mls=i.id and h.mls=s.id

 

 

select * from houses1 h, info i, school s  where h.zip=’$1’ and h.mls=i.id and h.mls=s.id;

 

 

select * from info i, houses1 h, school s where i.year_built >= all (select year_built from info) and i.id=h.mls and i.id=s.id;

 

select * from info i, houses1 h, school s where i.year_built <= all (select year_built from info) and i.id=h.mls and i.id=s.id;

 

select *  from school s right outer join houses1 h on (s.id=h.mls) right outer join info I on (h.mls=i.id);

 

select* from houses1 h, info I, school s where h.mls=i.id and h.mls=s.id order by h.list_price asc;

 

 

select * from houses1 h, info i, school s  where i.year_built>=$1 and h.mls=i.id and h.mls=s.id order by i.year_built asc;

 

 

Appointment:

 id | mls |           email                 |    date            |     time    |          agent       |   buyer 

-+----+------------------+-------------+-----------------+----------+-------------+--------

  1 | 104 | jamesc@gmail.com   | 01/20/2012    | 2:15pm   | Dr. YU            | James C

  2 | 107 | billyb@gmail.com     | 01/15/2012    | 3:30pm   | Chuck Norris  | Billy B

  3 | 101 | jamesc@gmail.com   | 02/05/2012    | 3:30pm   | Green Lantern | James C

  4 | 102 | janej@yahoo.com      | 03/01/2012    | 5:00pm   | Iceman            | Jane J

  5 | 102 | mikem@yesman.com | 03/12/2012   | 1:50pm   | Iceman            | Mike M

 

 

 

Offer:

  id| mls |         date    |      price  |        cond    |     agent            |   buyer 

------+----------+-------------+-------------+------------+---------------+-------

  1 | 102 | 02/10/2011 | 5000000 | new carpet | Iceman             | Mike M

  2 | 107 | 03/20/2011 | 8000000 | new carpet | Chuck Norris   | Billy B

  3 | 101 | 01/25/2011 | 7000000 | new carpet | Green Lantern | James C

  4 | 104 | 02/08/2011 | 9000000 | new carpet | Dr Yu              | James C

  5 | 102 | 02/10/2011 | 5000000 | new carpet | Iceman            | Cindy S

 

 

 

Home Page

 

 

Home Page (home.html)

 

 

   <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >

    <head>

        <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />

        <title>Arkham City Real Estate</title>

        <link rel="stylesheet" type="text/css" href="main.css" />

       <style type="text/css">

       <padding: 0px;>

</style>

    </head>

    <body>

<img src = "logo.jpg" alt = "Company Logo"

        height = "427" width = "935" style = "float: right;

         margin-left: 20px; margin-bottom: 20px;" />

<br>

<br>

</div>

</div>    

<ul>

       <li> <a href="createAcctAgent.html">Agent Login</a> </li>

       <li> <a href="createAcctBuyer.html">Buyer Login</a></li>

       <li> <a href="login.html">Returning Users</a></li>

<p> Please use the search descriptions below to help select your new mansion. </p> 

       <li><a href="showEverything2.php">all mansions</a>

       <li><a href="showVill.php">Villian mansions</a>

       <li><a href="showHero.php">Hero mansions</a>

       <li><a href="showE.php">Energy Star mansions</a>

       <li><a href="showR.php">Remodeled mansions</a>

       <li><a href="showBrick.php">Brick mansions</a>

       <li><a href="showStone.php"> Stone mansions</a>

       <li><a href="showNew.php"> Newest mansions</a>

       <li><a href="showOld.php"> Oldest mansions</a>

       <li><a href="showSchool.php"> Schools near mansion</a>

       <li><a href="showPrice.php"> Lowest to Highest Price</a> 

       <li>Search by <a href="queryByBed.html">number of bedrooms</a>

       <li>Search by <a href="queryByBath.html">number of bathrooms</a>

       <li>Search by <a href="queryByLot.html">lot size</a>

       <li>Search by <a href="queryByZip.html">zip</a>

       <li>Search by <a href="queryByYear.html">year build</a>

</ul>

 

<br>

<br>

<br>

<div align="left">

<div id="intro">

<div align="left">

      

              <div id="pageHeader">

                     <h1 style="text-align: left" >Arkham City Real Estate</h1>

                     <h2><span>The Best of DC suites on the East Coast</span></h2>

              </div>

              <div id="quickSummary">

                     <p class="p1"><span></span></p>

              </div>

              <div id="preamble">

                     <h3><span>About Us</span></h3>

                     <p class="p1"><span>Thank you for stopping by Arkham City Real Estate.  Where mansion listings are always up to date and just one click away.  In today's changing real estate market, timing is everything.  Here at Arkham Real Estate, we will place you in a mansion with satisfaction that has lasted over 32 years, and happiness for a lifetime.</p>

                     <p class="p2"><span>Your information will not be directed or transferred to any third party members and all information is for the Arkham Real Estate database records.</span></p>

                     <p class="p3"><span></span></p>

              </div>

       </div>

       <div id="supportingText">

              <div id="explanation">

                     <h3><span>About the Website</span></h3>

                     <p class="p1"><span>Feel free to take your time and browse our site ( - best in Arkham City by far) and when you’re ready there are agents on call to contact that will be happy to assist you with all transactions. </span></p>

</div>

       </div>

       <div id="supportingText">

              <div id="explanation">

                     <h3><span>Requirements</span></h3>

                     <p class="p1"><span>From this main page, anyone can view and search for mansions. Toward the top of the home page, a new customer can create an account as a dedicated buyer in the mansion market.

Please, follow the links above to reach your desired location and start the mansion buying process. Returning real estate agents can log in and view reports,

create new mansions for sell, view appointments set by buyers, and review offers on mansions for sell. Once a buyer has made an offer for a particular mansion,

the mansion's agent will be notified. </span></p>

</div>

       </div>

       <div id="supportingText">

              <div id="explanation">

                     <h3><span>Mansions for Sale</span></h3>

                     <p class="p1"><span>Any user can view the mansions listed within this website. Each mansion is identified by a Multiple Listing Service (MLS). The working search options listed above will find mansions by date added,

location (zip) code, style (brick or stone), number of bedrooms and baths, history of previous owner (villian or hero) and remodeling work, year mansion was built, size of lot in acres. You will find out that the newest mansions

are Energy Star Equipped for saving natural resources in the economy and saving the home owner's money. Every mansion that is posted will be located near an early childhood, middle, or high school. Please be sure to visit the

webpage that will have all mansions sorted from lowest to highest price.</span></p>

 

      

                <tr id="infobar"><td colspan="2">All Proceeds Go To the Brad Shedd Foundation</td></tr>

            </table>

        </div>

    </body>

   

</html>

 

 

 

Agent Login

 

 

 

 

createAcctAgent.html

 

<HTML>

<HEAD>

  <TITLE>Create Seller Login </TITLE>

</HEAD>

 

<BODY>

 

<h1>Welcome to the Sellers Login Creation Page</h1>

<p>Seller's can create their login here</p>

 

 

<form action="createAgent.php">

<p>Username:

   <input type="text"  

          name="username"></p>

<p>Password:

   <input type="password"           

          password="password"></p>

<p>Email:

    <input type="text"  

          email="email"></p>

<p>Phone:

    <input type="text"  

          phone="phone"></p>

<input type="submit"

       value="Create">

</form>

<img src = "logo.jpg" alt = "Company Logo"

        height = "427" width = "935" style = "float: right;

         margin-left: 20px; margin-bottom: 20px;" />

click <a href="home.html">here</a> to go back to the home page.

 

</BODY>

</HTML>

 

creatAgent.php

 

<head>

    <title> login </title>

</head>

<body>

 

<?php

      

        $name=$_GET['name'];

        $password=$_GET['password'];

        $email=$_GET['email'];

        $phone=$_GET['phone'];

        $conn=pg_connect("host=127.0.0.1 user=bshedd password=********");

        $query="INSERT INTO user1(name,password,email,phone)

              VALUES ($1,$2,$3,$4,)"; 

       pg_query_params($query,

                      array($name,$password,$email,$phone,$type));

       echo"Congrats";      

?>

go back to <a href="home.html">project homepage</a>.               

</body>

</html>

Buyer Login

 

 

 

createAcctBuyer.html

 

<HTML>

<HEAD>

  <TITLE>Buyer's Login Create </TITLE>

</HEAD>

 

<BODY>

 

<h1>Welcome to the Buyers Login Creation Page</h1>

<p>Buyer's can create login here</p>

 

<form method="POST"   

action="http://cs.spsu.edu/ex.php">

<p>Username:

   <input type="text"  

          name="username"></p>

<p>Password:

   <input type="password"           

          name="password"></p>

<p>Email:

    <input type="text"  

          name="email"></p>

<p>Phone:

    <input type="text"  

          name="phone"></p>

<input type="submit"

       value="Create">

</form>

<img src = "logo.jpg" alt = "Company Logo"

        height = "427" width = "935" style = "float: right;

         margin-left: 20px; margin-bottom: 20px;" />

click <a href="home.html">here</a> to go back to the home page.

 

</BODY>

</HTML>

 

createBuyer.php

<head>

    <title> login </title>

</head>

<body>

 

<?php

      

        $name=$_GET['name'];

        $password=$_GET['password'];

        $email=$_GET['email'];

        $phone=$_GET['phone'];

        $conn=pg_connect("host=127.0.0.1 user=bshedd password=********");

        $query="INSERT INTO user1(name,password,email,phone)

              VALUES ($1,$2,$3,$4,)"; 

       pg_query_params($query,

                      array($name,$password,$email,$phone,$type));

       echo"Congrats";      

?>

go back to <a href="home.html">project homepage</a>.               

</body>

</html>

 

Returning Users

 

 

Login.html

<HTML>

<HEAD>

  <TITLE>User Login Page </TITLE>

</HEAD>

 

<BODY>

 

<h1>Welcome to the Login Page</h1>

<p>login here</p>

 

<form method="POST"   

action="http://cs.spsu.edu/ex.php">

<p>Username:

   <input type="text"  

          name="username"></p>

<p>Password:

   <input type="password"            

          name="password"></p>

<input type="submit"

       value="Login">

</form>

<img src = "logo.jpg" alt = "Company Logo"

        height = "427" width = "935" style = "float: right;

         margin-left: 20px; margin-bottom: 20px;" />

click <a href="home.html">here</a> to go back to the home page.

 

</BODY>

</HTML>

 

Login.php

 

<head>

    <title> login </title>

</head>

<body>

 

<?php

      

        $name=$_GET['name'];

        $password=$_GET['password'];

        $email=$_GET['email'];

        $phone=$_GET['phone'];

        $conn=pg_connect("host=127.0.0.1 user=bshedd password=********");

        $query="INSERT INTO user1(name,password,email,phone)

              VALUES ($1,$2,$3,$4,)"; 

       pg_query_params($query,

                      array($name,$password,$email,$phone,$type));

       echo"Congrats";      

?>

go back to <a href="home.html">project homepage</a>.               

</body>

</html>

 

 

All Mansions

 

showEverything2.php

<HTML>

<HEAD>

    <TITLE> ALL HOUSES</TITLE>

        <meta http-equiv="content-type" content="text/html;charset=UTF-8" />

        <title>Main Page</title>

        <link rel="stylesheet" type="text/css" href="bghero.css" />

</HEAD>

<BODY>

<title>Villain's and Hero's Houses</title>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<meta http-equiv="Content-Style-Type" content="text/css" />

<link rel="shortcut icon" href="http://webdev.spsu.edu/favicon.ico" type="image/x-icon" />

<meta name="robots" content="none" />

</head>

<body bgcolor="#F4F4F4">

<h1 style="text-align:center">Arkham's Best</h1>

<h2 style="text-align:center">Top notch mansions are for sell now!</h2>

<p>You have just found the best mansions for Arkham on sell at a low price.</p>

 

<p>

<br />

<img src="bats.jpg" height="248" width="364" style="float:left;" alt = "Miter_Box_Saw"/>

</p>

<p style="clear: left;">

Evangical Erin

</p>

<p>

<br />

<img src="iron.jpg" height="248" width="364" style="float:right;" alt = "Garden_Hoe"/>

</p>

 

<p style="text-align: right; clear: right;">Batman

</p>

 

<p>

<br />

 

<img src="nightwing.jpg" height="248" width="364" style="float:left;" alt = "Planer"/>

</p>

<p style="clear: left;">

Nightwing

</p>

 

<p>

<br />

<img src="luthor.jpg" height="248" width="364" style="float:right;" alt = "Garden_Hoe"$

</p>

 

<p style="text-align: right; clear: right;">

Lex Luthor</p>

<p>

<br />

 

<img src="cats.JPG" height="248" width="364" style="float:left;" alt = "Planer"/>

</p>

<p style="clear: left;">

 

Diabolical Brad</p>

 

<p>

<br />

<img src="freeze.jpg" height="248" width="364" style="float:right;" alt = "Garden_Hoe"$

</p>

 

<p style="text-align: right; clear: right;">

Dr. Yu</p>

<p>

<br />

 

<img src="luthor2.jpg" height="248" width="364" style="float:left;" alt = "Planer"/>

</p>

<p style="clear: left;">

 

Juiceman J</p>

 

<p>

<br />

</p>

 

<p style="text-align: right; clear: right;">

.</p>

<p>

<br />

 

</p>

<p style="clear: left;">

 

.</p>

 

<p>

<br />

</p>

 

<p style="text-align: right; clear: right;">

.</p>

 

<p>

<br />

<br />

</p>

 

<h2>ARKHAM'S FINEST HOMES:</h2>

<?php

        $conn=pg_connect("host=127.0.0.1 user=jcarmich password=jrcc5757");

        if ( $conn == null ) {

           echo "cannot connect to db!<p>";

           echo pg_last_error();

        } else {

           echo "<p>";}

 

        $query="select * from houses1 h, info i, school s where h.mls=i.id and h.mls=s.id";

        $res=pg_query($conn,$query);

         echo "<table border=\"2\">\n";

          echo "<tr><th>MLS</th> <th>Agent</th> <th>County</th> <th>City</th> <th>ZIP</th> <th>Price</th> <th>Villain/Hero</th>

                 <th>Year Built</th> <th>Remodeled</th> <th>Energy Star</th> <th>Brick/Stone</th> <th>Beds</th> <th>Baths</th> <th>Acres</th>

                        <th>Elementary School</th> <th>Middle School</th> <th>High School</th></tr>\n";

        for($i=0; $i<pg_numrows($res);++$i) {

                $obj=pg_fetch_object($res,$i);

                echo "<tr><td>$obj->mls</td>

                        <td>$obj->agent</td>

                        <td>$obj->county</td>

                        <td>$obj->city</td>

                        <td>$obj->zip</td>

                        <td>$$obj->list_price</td>

                        <td>$obj->type</td>

                        <td>$obj->year_built</td>

                        <td>$obj->remolded</td>

                        <td>$obj->estar</td>

                        <td>$obj->mat</td>

                        <td>$obj->beds</td>

                        <td>$obj->baths</td>

                        <td>$obj->acres</td>

                        <td>$obj->e_name</td>

                        <td>$obj->m_name</td>

                        <td>$obj->h_name</td>";

                        }

                        echo"</tr></table>\n";

?>

Go back to <a href="home.html">project homepage</a>.

<center><img src="bottombanner.jpg" alt="cityline" height="198" width="1932"></center>

</BODY>

</HTML>

 

 

 

Villain Mansions

 

showVill.php

 

<HTML>

 

 

 

 

<HEAD>

    <TITLE>VILLAIN Mansions</TITLE>

        <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />

        <title>Arkham City Real Estate</title>

        <link rel="stylesheet" type="text/css" href="bgvillain.css" />

 

 

 

 

</HEAD>

<BODY>

<title>Villian's Mansions</title>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<meta http-equiv="Content-Style-Type" content="text/css" />

<link rel="shortcut icon" href="http://webdev.spsu.edu/favicon.ico" type="image/x-icon" />

<meta name="robots" content="none" />

</head>

<body bgcolor="#F4F4F4">

<center><img src = "thevillains.png" alt = "Villains"

        height = "427" width = "935" style = "center";

         margin-left: 20px; margin-bottom: 20px;" /></center>

<h1 style="text-align:center">Villian's Mansions</h1>

<h2 style="text-align:center">Four Villian's Mansions were returned!</h2>

<p></p>

 

<p>

<br />

</p>

<p style="clear: left;">

.

</p>

<p>

<br />

</p>

 

<p style="text-align: right; clear: right;">

</p>

 

<p>

<br />

 

</p>

<p style="clear: left;">

 

</p>

 

<p>

<br />

<img src="luthor.jpg" height="248" width="364" style="float:right;" alt = "Garden_Hoe"$

</p>

 

<p style="text-align: right; clear: right;">

Lex Luthor</p>

<p>

<br />

 

<img src="cats.JPG" height="248" width="364" style="float:left;" alt = "Planer"/>

</p>

<p style="clear: left;">

 

Diabolical Brad</p>

 

<p>

<br />

<img src="freeze.jpg" height="248" width="364" style="float:right;" alt = "Garden_Hoe"$

</p>

 

<p style="text-align: right; clear: right;">

Dr. Yu</p>

<p>

<br />

 

<img src="luthor2.jpg" height="248" width="364" style="float:left;" alt = "Planer"/>

</p>

<p style="clear: left;">

 

Juiceman J</p>

 

<p>

<br />

</p>

 

 

 

<p style="text-align: right; clear: right;">

</p>

 

<p>

<br />

<br />

</p>

<h2>ARKHAM'S VILLAIN'S BEST MANSIONS:</h2>

<?php

        $conn=pg_connect("host=127.0.0.1 user=jcarmich password=jrcc5757");

        if ( $conn == null ) {

           echo "cannot connect to db!<p>";

           echo pg_last_error();

 

 

 

      } else {

           echo "<p>";}

      

        $query="select * from houses1 h, info i, school s  where h.type='V' and h.mls=i.id and h.mls=s.id;";

        $res=pg_query($conn,$query);

        echo "<table border=\"2\">\n";        

        echo "<tr><th>MLS</th> <th>Agent</th> <th>County</th> <th>City</th> <th>ZIP</th> <th>Price</th> <th>Villain/Hero</th>

               <th>Year Built</th> <th>Remodeled</th> <th>Energy Star</th> <th>Brick/Stone</th> <th>Beds</th> <th>Baths</th> <th>Acres</th>

                     <th>Elementary School</th> <th>Middle School</th> <th>High School</th></tr>\n";

        for($i=0; $i<pg_numrows($res);++$i) {

                $obj=pg_fetch_object($res,$i);

                     echo "<tr><td>$obj->mls</td>

                     <td>$obj->agent</td>

                     <td>$obj->county</td>

                     <td>$obj->city</td>

                     <td>$obj->zip</td>

                     <td>$$obj->list_price</td>

                     <td>$obj->type</td>

                     <td>$obj->year_built</td>

                     <td>$obj->remolded</td>

                     <td>$obj->estar</td>

                     <td>$obj->mat</td>

                     <td>$obj->beds</td>

                     <td>$obj->baths</td>

                     <td>$obj->acres</td>

                     <td>$obj->e_name</td>

                     <td>$obj->m_name</td>

                     <td>$obj->h_name</td>";       

                     }

                     echo"</tr></table>\n";

?>

Go back to <a href="home.html">project homepage</a>.

<center><img src="bottombanner.jpg" alt="cityline" height="198" width="1932"></center>

</BODY>

</HTML>

 

 

Hero Mansions

 

 

showHero.php

 

 

<HTML>

<HEAD>

    <TITLE>HERO Mansions</TITLE>

        <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />

        <title>Arkham City Real Estate</title>

        <link rel="stylesheet" type="text/css" href="http://okaram.spsu.edu/~bshedd/bghero.css" />

</HEAD>

<BODY>

<title>Villian's Mansions</title>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<meta http-equiv="Content-Style-Type" content="text/css" />

<link rel="shortcut icon" href="http://webdev.spsu.edu/favicon.ico" type="image/x-icon" />

<meta name="robots" content="none" />

</head>

<body bgcolor="#F4F4F4">

 

</div>

<center><img src="theheroes.jpg" alt="Heroes" height="353" width="512"></center>

 

 

<h1 style="text-align:center">Heroes Mansions</h1>

<h2 style="text-align:center">Three Heroes Mansions were returned!</h2>

<p></p>

 

 

 

<p>

<br />

<img src="nightwing.jpg" height="248" width="364" style="float:right;" alt = "Garden_Hoe"$

</p>

 

<p style="text-align: right; clear: right;">

Nightwing</p>

<p>

<br />

 

<img src="bats.jpg" height="248" width="364" style="float:left;" alt = "Planer"/>

</p>

<p style="clear: left;">

 

Evangical Erin</p>

 

<p>

<br />

<img src="iron.jpg" height="248" width="364" style="float:right;" alt = "Garden_Hoe"$

</p>

 

 

</p>

<p style="text-align: right clear: right;">

</p>

 

<p>

<br />

</p>

 

<p style="text-align: right; clear: right;">

Batman</p>

 

<p>

<br />

<br />

</p>

<h2>ARKHAM'S HEROS FINEST MANSIONS:</h2>

<?php

        $conn=pg_connect("host=127.0.0.1 user=jcarmich password=jrcc5757");

        if ( $conn == null ) {

           echo "cannot connect to db!<p>";

           echo pg_last_error();

        } else {

           echo "<p>";}

      

        $query="select * from houses1 h, info i, school s  where h.type='H' and h.mls=i.id and h.mls=s.id;";

        $res=pg_query($conn,$query);

        echo "<table border=\"2\">\n";       

        echo "<tr><th>MLS</th> <th>Agent</th> <th>County</th> <th>City</th> <th>ZIP</th> <th>Price</th> <th>Villain/Hero</th>

               <th>Year Built</th> <th>Remodeled</th> <th>Energy Star</th> <th>Brick/Stone</th> <th>Beds</th> <th>Baths</th> <th>Acres</th>

                     <th>Elementary School</th> <th>Middle School</th> <th>High School</th></tr>\n";

        for($i=0; $i<pg_numrows($res);++$i) {

                $obj=pg_fetch_object($res,$i);

                     echo "<tr><td>$obj->mls</td>

                     <td>$obj->agent</td>

                     <td>$obj->county</td>

                     <td>$obj->city</td>

                     <td>$obj->zip</td>

                     <td>$$obj->list_price</td>

                     <td>$obj->type</td>

                     <td>$obj->year_built</td>

                     <td>$obj->remolded</td>

                     <td>$obj->estar</td>

                     <td>$obj->mat</td>

                     <td>$obj->beds</td>

                     <td>$obj->baths</td>

                     <td>$obj->acres</td>

                     <td>$obj->e_name</td>

                     <td>$obj->m_name</td>

                     <td>$obj->h_name</td>";       

                     }

                     echo"</tr></table>\n";

?>

Go back to <a href="home.html">project homepage</a>.

<center><img src="bottombanner.jpg" alt="cityline" height="198" width="1932"></center>

 

</BODY>

</HTML>

 

Energy Star Equipped Mansions

 

showE.php

<HTML>

<HEAD>

    <TITLE> ENERGY STAR MANSIONS</TITLE>

        <meta http-equiv="content-type" content="text/html;charset=UTF-8" />

        <title>Main Page</title>

        <link rel="stylesheet" type="text/css" href="bghero.css" />

</HEAD>

<BODY>

<title>Energy Star Mansions</title>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

 

<meta http-equiv="Content-Style-Type" content="text/css" />

<link rel="shortcut icon" href="http://webdev.spsu.edu/favicon.ico" type="image/x-icon" />

<meta name="robots" content="none" />

</head>

<body bgcolor="#F4F4F4">

<h1 style="text-align:center">Arkham Real Estate</h1>

<h2 style="text-align:center">Four energy star mansions were returned!</h2>

 

<p>

<br />

<img src="bats.jpg" height="248" width="364" style="float:right;" alt = "NightWing"$

</p>

 

<p style="text-align: right; clear: right;">

Evangical Erin</p>

<p>

<br />

 

<p>

<br />

<img src="luthor.jpg" height="248" width="364" style="float:right;" alt = "Luthor Corp."$

</p>

 

<p style="text-align: right; clear: right;">

Lex Luthor</p>

<p>

<br />

 

<img src="cats.JPG" height="248" width="364" style="float:left;" alt = "Brad"/>

</p>

<p style="clear: left;">

 

Diabolical Brad</p>

<img src="luthor2.jpg" height="248" width="364" style="float:left;" alt = "JuiceJ"/>

</p>

<p style="clear: left;">

 

Juiceman J</p>

 

<p>

<br />

</p>

 

 

 

<p style="text-align: right; clear: right;">

</p>

 

<p>

<br />

<br />

</p>

 

<h2>ARKHAM'S ENERGY STAR MANSIONS:</h2>

 

<?php

        $conn=pg_connect("host=127.0.0.1 user=jcarmich password=jrcc5757");

        if ( $conn == null ) {

           echo "cannot connect to db!<p>";

           echo pg_last_error();

        } else {

           echo "<p>";}

      

        $query="select * from houses1 h, info i, school s  where i.estar='Y' and h.mls=i.id and h.mls=s.id;";

        $res=pg_query($conn,$query);

        echo "<table border=\"2\">\n";       

        echo "<tr><th>MLS</th> <th>Agent</th> <th>County</th> <th>City</th> <th>ZIP</th> <th>Price</th> <th>Villain/Hero</th>

               <th>Year Built</th> <th>Remodeled</th> <th>Energy Star</th> <th>Brick/Stone</th> <th>Beds</th> <th>Baths</th> <th>Acres</th>

                     <th>Elementary School</th> <th>Middle School</th> <th>High School</th></tr>\n";

        for($i=0; $i<pg_numrows($res);++$i) {

                $obj=pg_fetch_object($res,$i);

                     echo "<tr><td>$obj->mls</td>

                     <td>$obj->agent</td>

                     <td>$obj->county</td>

                     <td>$obj->city</td>

                     <td>$obj->zip</td>

                     <td>$$obj->list_price</td>

                     <td>$obj->type</td>

                     <td>$obj->year_built</td>

                     <td>$obj->remolded</td>

                     <td>$obj->estar</td>

                     <td>$obj->mat</td>

                     <td>$obj->beds</td>

                     <td>$obj->baths</td>

                     <td>$obj->acres</td>

                     <td>$obj->e_name</td>

                     <td>$obj->m_name</td>

                     <td>$obj->h_name</td>";       

                     }

                     echo"</tr></table>\n";

?>

Go back to <a href="home.html">project homepage</a>.

<center><img src="bottombanner.jpg" alt="cityline" height="198" width="1932"></center>

 

</BODY>

</HTML>

 

Remodeled Mansions

 

 

 

 

showR.php

<HTML>

<HEAD>

    <TITLE> REMODELED MANSIONS</TITLE>

        <meta http-equiv="content-type" content="text/html;charset=UTF-8" />

        <title>Main Page</title>

        <link rel="stylesheet" type="text/css" href="bghero.css" />

</HEAD>

<BODY>

<title>Remodeled Mansions</title>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

 

<meta http-equiv="Content-Style-Type" content="text/css" />

<link rel="shortcut icon" href="http://webdev.spsu.edu/favicon.ico" type="image/x-icon" />

<meta name="robots" content="none" />

</head>

<body bgcolor="#F4F4F4">

<h1 style="text-align:center">Arkham Real Estate</h1>

<h2 style="text-align:center">Two remodeled mansions were returned!</h2>

<p>

<br />

</p>

 

<p style="text-align: right; clear: right;">

</p>

<p>

<br />

 

<img src="cats.JPG" height="248" width="364" style="float:left;" alt = "Planer"/>

</p>

<p style="clear: left;">

 

Diabolical Brad</p>

 

 

<p>

<br />

<img src="iron.jpg" height="248" width="364" style="float:right;" alt = "Garden_Hoe"$

</p>

 

<p style="text-align: right; clear: right;">

Batman</p>

<p>

<br />

 

</p>

<p style="clear: left;">

 

 

<p>

<br />

</p>

 

 

 

<p style="text-align: right; clear: right;">

</p>

 

<p>

<br />

<br />

</p>

 

 

<h2>ARKHAM'S REMODELED HOMES:</h2>

<?php

        $conn=pg_connect("host=127.0.0.1 user=jcarmich password=jrcc5757");

        if ( $conn == null ) {

           echo "cannot connect to db!<p>";

           echo pg_last_error();

        } else {

           echo "<p>";}

      

        $query="select * from houses1 h, info i, school s  where i.remolded='Y' and h.mls=i.id and h.mls=s.id;";

        $res=pg_query($conn,$query);

        echo "<table border=\"2\">\n";       

        echo "<tr><th>MLS</th> <th>Agent</th> <th>County</th> <th>City</th> <th>ZIP</th> <th>Price</th> <th>Villain/Hero</th>

               <th>Year Built</th> <th>Remodeled</th> <th>Energy Star</th> <th>Brick/Stone</th> <th>Beds</th> <th>Baths</th> <th>Acres</th>

                     <th>Elementary School</th> <th>Middle School</th> <th>High School</th></tr>\n";

        for($i=0; $i<pg_numrows($res);++$i) {

                $obj=pg_fetch_object($res,$i);

                     echo "<tr><td>$obj->mls</td>

                     <td>$obj->agent</td>

                     <td>$obj->county</td>

                     <td>$obj->city</td>

                     <td>$obj->zip</td>

                     <td>$$obj->list_price</td>

                     <td>$obj->type</td>

                     <td>$obj->year_built</td>

                     <td>$obj->remolded</td>

                     <td>$obj->estar</td>

                     <td>$obj->mat</td>

                     <td>$obj->beds</td>

                     <td>$obj->baths</td>

                     <td>$obj->acres</td>

                     <td>$obj->e_name</td>

                     <td>$obj->m_name</td>

                     <td>$obj->h_name</td>";       

                     }

                     echo"</tr></table>\n";

?>

Go back to <a href="home.html">project homepage</a>.

<center><img src="bottombanner.jpg" alt="cityline" height="198" width="1932"></center>

 

</BODY>

</HTML>

 

 

 

Brick Mansions

 

showBrick.php

<HTML>

<HEAD>

    <TITLE> BRICK HOUSES</TITLE>

        <meta http-equiv="content-type" content="text/html;charset=UTF-8" />

        <title>Main Page</title>

        <link rel="stylesheet" type="text/css" href="bghero.css" />

</HEAD>

<BODY>

<title>Brick Houses</title>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

 

<meta http-equiv="Content-Style-Type" content="text/css" />

<link rel="shortcut icon" href="http://webdev.spsu.edu/favicon.ico" type="image/x-icon" />

<meta name="robots" content="none" />

</head>

<body bgcolor="#F4F4F4">

<h1 style="text-align:center">Arkham Real Estate</h1>

<h2 style="text-align:center">Four brick mansions were returned!</h2>

 

<p>

<br />

<img src="nightwing.jpg" height="248" width="364" style="float:right;" alt = "Garden_Hoe"$

</p>

 

<p style="text-align: right; clear: right;">

Nightwing</p>

<p>

<br />

 

<img src="cats.JPG" height="248" width="364" style="float:left;" alt = "Planer"/>

</p>

<p style="clear: left;">

 

Diabolical Brad</p>

 

 

<p>

<br />

<img src="iron.jpg" height="248" width="364" style="float:right;" alt = "Garden_Hoe"$

</p>

 

<p style="text-align: right; clear: right;">

Batman</p>

<p>

<br />

 

<img src="bats.jpg" height="248" width="364" style="float:left;" alt = "Planer"/>

</p>

<p style="clear: left;">

 

Evangical Erin</p>

 

<p>

<br />

</p>

 

 

 

<p style="text-align: right; clear: right;">

</p>

 

<p>

<br />

<br />

</p>

 

<h2>ARKHAM'S BRICK MANSIONS:</h2>

<?php

        $conn=pg_connect("host=127.0.0.1 user=jcarmich password=jrcc5757");

        if ( $conn == null ) {

           echo "cannot connect to db!<p>";

           echo pg_last_error();

        } else {

           echo "<p>";}

      

        $query="select * from houses1 h, info i, school s  where i.mat='B' and h.mls=i.id and h.mls=s.id;";

        $res=pg_query($conn,$query);

        echo "<table border=\"2\">\n";        

        echo "<tr><th>MLS</th> <th>Agent</th> <th>County</th> <th>City</th> <th>ZIP</th> <th>Price</th> <th>Villain/Hero</th>

               <th>Year Built</th> <th>Remodeled</th> <th>Energy Star</th> <th>Brick/Stone</th> <th>Beds</th> <th>Baths</th> <th>Acres</th>

                     <th>Elementary School</th> <th>Middle School</th> <th>High School</th></tr>\n";

        for($i=0; $i<pg_numrows($res);++$i) {

                $obj=pg_fetch_object($res,$i);

                     echo "<tr><td>$obj->mls</td>

                     <td>$obj->agent</td>

                     <td>$obj->county</td>

                     <td>$obj->city</td>

                     <td>$obj->zip</td>

                     <td>$$obj->list_price</td>

                     <td>$obj->type</td>

                     <td>$obj->year_built</td>

                     <td>$obj->remolded</td>

                     <td>$obj->estar</td>

                     <td>$obj->mat</td>

                     <td>$obj->beds</td>

                     <td>$obj->baths</td>

                     <td>$obj->acres</td>

                     <td>$obj->e_name</td>

                     <td>$obj->m_name</td>

                     <td>$obj->h_name</td>";       

                     }

                     echo"</tr></table>\n";

?>

Go back to <a href="home.html">project homepage</a>.

<center><img src="bottombanner.jpg" alt="cityline" height="198" width="1932"></center>

</BODY>

</HTML>

 

 

 

Stone Mansions

 

 

 

 

showStone.php

 

 

 

<HTML>

 

<HEAD>

    <TITLE> STONE MANSIONS</TITLE>

        <meta http-equiv="content-type" content="text/html;charset=UTF-8" />

        <title>Main Page</title>

        <link rel="stylesheet" type="text/css" href="bghero.css" />

 

 

</HEAD>

 

<BODY>

<title>Stone Mansions</title>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

 

<meta http-equiv="Content-Style-Type" content="text/css" />

<link rel="shortcut icon" href="http://webdev.spsu.edu/favicon.ico" type="image/x-icon" />

<meta name="robots" content="none" />

</head>

<body bgcolor="#F4F4F4">

<h1 style="text-align:center">Arkham Real Estate</h1>

<h2 style="text-align:center">Three stone mansions were returned!</h2>

 

<p>

<br />

<img src="freeze.jpg" height="248" width="364" style="float:right;" alt = "Garden_Hoe"$

</p>

 

<p style="text-align: right; clear: right;">

Dr. Yu</p>

<p>

<br />

 

<img src="luthor.jpg" height="248" width="364" style="float:left;" alt = "Planer"/>

</p>

<p style="clear: left;">

 

Lex Luthor</p>

 

 

<p>

<br />

<img src="luthor2.jpg" height="248" width="364" style="float:right;" alt = "Garden_Hoe"$

</p>

 

<p style="text-align: right; clear: right;">

Juiceman J</p>

<p>

<br />

 

 

<p style="text-align: right; clear: right;">

</p>

 

<p>

<br />

<br />

</p>

 

<h2>ARKHAM'S STONE MANSIONS:</h2>

 

<?php

        $conn=pg_connect("host=127.0.0.1 user=jcarmich password=jrcc5757");

        if ( $conn == null ) {

           echo "cannot connect to db!<p>";

           echo pg_last_error();

        } else {

           echo "<p>";}

      

        $query="select * from houses1 h, info i, school s  where i.mat='S' and h.mls=i.id and h.mls=s.id;";

        $res=pg_query($conn,$query);

        echo "<table border=\"2\">\n";       

        echo "<tr><th>MLS</th> <th>Agent</th> <th>County</th> <th>City</th> <th>ZIP</th> <th>Price</th> <th>Villain/Hero</th>

               <th>Year Built</th> <th>Remodeled</th> <th>Energy Star</th> <th>Brick/Stone</th> <th>Beds</th> <th>Baths</th> <th>Acres</th>

                     <th>Elementary School</th> <th>Middle School</th> <th>High School</th></tr>\n";

        for($i=0; $i<pg_numrows($res);++$i) {

                $obj=pg_fetch_object($res,$i);

                     echo "<tr><td>$obj->mls</td>

                     <td>$obj->agent</td>

                     <td>$obj->county</td>

                     <td>$obj->city</td>

                     <td>$obj->zip</td>

                     <td>$$obj->list_price</td>

                     <td>$obj->type</td>

                     <td>$obj->year_built</td>

                     <td>$obj->remolded</td>

                     <td>$obj->estar</td>

                     <td>$obj->mat</td>

                     <td>$obj->beds</td>

                     <td>$obj->baths</td>

                     <td>$obj->acres</td>

                     <td>$obj->e_name</td>

                     <td>$obj->m_name</td>

                     <td>$obj->h_name</td>";       

                     }

                     echo"</tr></table>\n";

?>

Go back to <a href="home.html">project homepage</a>.

<center><img src="bottombanner.jpg" alt="cityline" height="198" width="1932"></center>

</BODY>

</HTML>

 

 

Newest Mansions

 

showNew.php

 

<HTML>

<HEAD>

    <TITLE> NEW MANSIONS</TITLE>

        <meta http-equiv="content-type" content="text/html;charset=UTF-8" />

        <title>Main Page</title>

        <link rel="stylesheet" type="text/css" href="bghero.css" />

</HEAD>

<BODY>

<title>New Mansions</title>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

 

<meta http-equiv="Content-Style-Type" content="text/css" />

<link rel="shortcut icon" href="http://webdev.spsu.edu/favicon.ico" type="image/x-icon" />

<meta name="robots" content="none" />

</head>

<body bgcolor="#F4F4F4">

<h1 style="text-align:center">Arkham Real Estate</h1>

<h2 style="text-align:center">One new mansion was returned!</h2>

 

 

<p style="text-align: right; clear: right;">

</p>

<p>

<br />

 

<img src="bats.jpg" height="248" width="364" style="float:left;" alt = "Planer"/>

</p>

<p style="clear: left;">

 

Evangical Erin</p>

 

<p>

<br />

</p>

 

 

 

<p style="text-align: right; clear: right;">

</p>

 

<p>

<br />

<br />

</p>

 

<h2>ARKHAM'S NEW MANSIONS:</h2>

<?php

        $conn=pg_connect("host=127.0.0.1 user=jcarmich password=jrcc5757");

        if ( $conn == null ) {

           echo "cannot connect to db!<p>";

           echo pg_last_error();

        } else {

           echo "<p>";}

 

        $query="select * from info i, houses1 h, school s where i.year_built >= all (select year_built from info) and i.id=h.mls and i.id=s.id";

        $res=pg_query($conn,$query);

         echo "<table border=\"2\">\n";

          echo "<tr><th>MLS</th> <th>Agent</th> <th>County</th> <th>City</th> <th>ZIP</th> <th>Price</th> <th>Villain/Hero</th>

                 <th>Year Built</th> <th>Remodeled</th> <th>Energy Star</th> <th>Brick/Stone</th> <th>Beds</th> <th>Baths</th> <th>Acres</th>

                        <th>Elementary School</th> <th>Middle School</th> <th>High School</th></tr>\n";

        for($i=0; $i<pg_numrows($res);++$i) {

                $obj=pg_fetch_object($res,$i);

                echo "<tr><td>$obj->mls</td>

                        <td>$obj->agent</td>

                        <td>$obj->county</td>

                        <td>$obj->city</td>

                        <td>$obj->zip</td>

                        <td>$$obj->list_price</td>

                        <td>$obj->type</td>

                        <td>$obj->year_built</td>

                        <td>$obj->remolded</td>

                        <td>$obj->estar</td>

                        <td>$obj->mat</td>

                        <td>$obj->beds</td>

                        <td>$obj->baths</td>

                        <td>$obj->acres</td>

                        <td>$obj->e_name</td>

                        <td>$obj->m_name</td>

                        <td>$obj->h_name</td>";

                        }

                        echo"</tr></table>\n";

?>

Go back to <a href="home.html">project homepage</a>.

<center><img src="bottombanner.jpg" alt="cityline" height="198" width="1932"></center>

</BODY>

</HTML>

 

 

 

Oldest Mansions

 

 

showOld.php

 

 

<HTML>

<HEAD>

    <TITLE> OLD MANSIONS</TITLE>

        <meta http-equiv="content-type" content="text/html;charset=UTF-8" />

        <title>Main Page</title>

        <link rel="stylesheet" type="text/css" href="bghero.css" />

</HEAD>

<BODY>

<title>New Mansions</title>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

 

<meta http-equiv="Content-Style-Type" content="text/css" />

<link rel="shortcut icon" href="http://webdev.spsu.edu/favicon.ico" type="image/x-icon" />

<meta name="robots" content="none" />

</head>

<body bgcolor="#F4F4F4">

<h1 style="text-align:center">Arkham Real Estate</h1>

<h2 style="text-align:center">One old mansion was returned!</h2>

 

 

<p style="text-align: right; clear: right;">

</p>

<p>

<br />

 

<img src="iron.jpg" height="248" width="364" style="float:left;" alt = "Planer"/>

</p>

<p style="clear: left;">

 

Batman</p>

<p>

<br />

</p>

 

<p style="text-align: right; clear: right;">

</p>

 

<p>

<br />

<br />

</p>

 

<h2>ARKHAM'S OLD MANSIONS:</h2>

<?php

        $conn=pg_connect("host=127.0.0.1 user=jcarmich password=jrcc5757");

        if ( $conn == null ) {

           echo "cannot connect to db!<p>";

           echo pg_last_error();

        } else {

           echo "<p>";}

 

        $query="select * from info i, houses1 h, school s where i.year_built <= all (select year_built from info) and i.id=h.mls and i.id=s.id";

        $res=pg_query($conn,$query);

         echo "<table border=\"2\">\n";

          echo "<tr><th>MLS</th> <th>Agent</th> <th>County</th> <th>City</th> <th>ZIP</th> <th>Price</th> <th>Villain/Hero</th>

                 <th>Year Built</th> <th>Remodeled</th> <th>Energy Star</th> <th>Brick/Stone</th> <th>Beds</th> <th>Baths</th> <th>Acres</th>

                        <th>Elementary School</th> <th>Middle School</th> <th>High School</th></tr>\n";

        for($i=0; $i<pg_numrows($res);++$i) {

                $obj=pg_fetch_object($res,$i);

                echo "<tr><td>$obj->mls</td>

                        <td>$obj->agent</td>

                        <td>$obj->county</td>

                        <td>$obj->city</td>

                        <td>$obj->zip</td>

                        <td>$$obj->list_price</td>

                        <td>$obj->type</td>

                        <td>$obj->year_built</td>

                        <td>$obj->remolded</td>

                        <td>$obj->estar</td>

                        <td>$obj->mat</td>

                        <td>$obj->beds</td>

                        <td>$obj->baths</td>

                        <td>$obj->acres</td>

                        <td>$obj->e_name</td>

                        <td>$obj->m_name</td>

                        <td>$obj->h_name</td>";

                        }

                        echo"</tr></table>\n";

?>

Go back to <a href="home.html">project homepage</a>.

<center><img src="bottombanner.jpg" alt="cityline" height="198" width="1932"></center>

</BODY>

</HTML>

 

Schools near Mansions

 

 

showSchool.php

 

<HTML>

<HEAD>

    <TITLE> SCHOOLS NEAR MANSIONS</TITLE>

        <meta http-equiv="content-type" content="text/html;charset=UTF-8" />

        <title>Main Page</title>

        <link rel="stylesheet" type="text/css" href="bghero.css" />

</HEAD>

<BODY>

<title>Schools Near Mansions</title>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<meta http-equiv="Content-Style-Type" content="text/css" />

<link rel="shortcut icon" href="http://webdev.spsu.edu/favicon.ico" type="image/x-icon" />

<meta name="robots" content="none" />

</head>

<body bgcolor="#F4F4F4">

<h1 style="text-align:center">Mansions Near Schools</h1>

<h2 style="text-align:center">Seven mansions are near schools!</h2>

 

<p>

<br />

<img src="bats.jpg" height="248" width="364" style="float:left;" alt = "Miter_Box_Saw"/>

</p>

<p style="clear: left;">

Evangical Erin

</p>

<p>

<br />

<img src="iron.jpg" height="248" width="364" style="float:right;" alt = "Garden_Hoe"/>

</p>

 

<p style="text-align: right; clear: right;">Batman

</p>

 

<p>

<br />

 

<img src="nightwing.jpg" height="248" width="364" style="float:left;" alt = "Planer"/>

</p>

<p style="clear: left;">

Nightwing

</p>

 

<p>

<br />

<img src="luthor.jpg" height="248" width="364" style="float:right;" alt = "Garden_Hoe"$

</p>

 

<p style="text-align: right; clear: right;">

Lex Luthor</p>

<p>

<br />

 

<img src="cats.JPG" height="248" width="364" style="float:left;" alt = "Planer"/>

</p>

<p style="clear: left;">

 

Diabolical Brad</p>

 

<p>

<br />

<img src="freeze.jpg" height="248" width="364" style="float:right;" alt = "Garden_Hoe"$

</p>

 

<p style="text-align: right; clear: right;">

Dr. Yu</p>

<p>

<br />

 

<img src="luthor2.jpg" height="248" width="364" style="float:left;" alt = "Planer"/>

</p>

<p style="clear: left;">

 

Juiceman J</p>

 

<p>

<br />

</p>

 

<p style="text-align: right; clear: right;">

.</p>

<p>

<br />

 

</p>

<p style="clear: left;">

 

.</p>

 

<p>

<br />

</p>

 

<p style="text-align: right; clear: right;">

.</p>

 

<p>

<br />

<br />

</p>

 

<h2>ARKHAM'S FINEST HOMES:</h2>

 

<?php

        $conn=pg_connect("host=127.0.0.1 user=jcarmich password=jrcc5757");

        if ( $conn == null ) {

           echo "cannot connect to db!<p>";

           echo pg_last_error();

        } else {

           echo "<p>";}

 

        $query="select *  from school s right outer join houses1 h on (s.id=h.mls) right outer join info I on (h.mls=i.id)";

        $res=pg_query($conn,$query);

         echo "<table border=\"2\">\n";

          echo "<tr><th>Elementary School</th> <th>Middle School</th> <th>High School</th>

                     <th>MLS</th> <th>Agent</th> <th>County</th> <th>City</th> <th>ZIP</th> <th>Price</th> <th>Villain/Hero</th>

                 <th>Year Built</th> <th>Remodeled</th> <th>Energy Star</th> <th>Brick/Stone</th> <th>Beds</th> <th>Baths</th> <th>Acres</th>

                        </tr>\n";

        for($i=0; $i<pg_numrows($res);++$i) {

                $obj=pg_fetch_object($res,$i);

                echo "<tr>

                        <td>$obj->e_name</td>

                        <td>$obj->m_name</td>

                        <td>$obj->h_name</td>

                        <td>$obj->mls</td>

                        <td>$obj->agent</td>

                        <td>$obj->county</td>

                        <td>$obj->city</td>

                        <td>$obj->zip</td>

                        <td>$$obj->list_price</td>

                        <td>$obj->type</td>

                        <td>$obj->year_built</td>

                        <td>$obj->remolded</td>

                        <td>$obj->estar</td>

                        <td>$obj->mat</td>

                        <td>$obj->beds</td>

                        <td>$obj->baths</td>

                        <td>$obj->acres</td>

                        ";

                        }

                        echo"</tr></table>\n";

?>

Go back to <a href="home.html">project homepage</a>.

<center><img src="bottombanner.jpg" alt="cityline" height="198" width="1932"></center>

 

</BODY>

</HTML>

 

 

Mansions Lowest to Highest Price

 

 

 

showPrice.php

 

 

<HTML>

<HEAD>

    <TITLE> BRICK HOUSES</TITLE>

        <meta http-equiv="content-type" content="text/html;charset=UTF-8" />

        <title>Main Page</title>

        <link rel="stylesheet" type="text/css" href="bghero.css" />

</HEAD>

<BODY>

 

<title>Brick Houses</title>

 

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

 

<meta http-equiv="Content-Style-Type" content="text/css" />

 

<link rel="shortcut icon" href="http://webdev.spsu.edu/favicon.ico" type="image/x-icon" />

<meta name="robots" content="none" />

</head>

<body bgcolor="#F4F4F4">

<h1 style="text-align:center">Arkham Real Estate</h1>

 

 

<h2>ARKHAM'S MANSIONS LISTED LOWEST TO HIGHEST PRICE:</h2>

 

 

<?php

        $conn=pg_connect("host=127.0.0.1 user=jcarmich password=jrcc5757");

        if ( $conn == null ) {

           echo "cannot connect to db!<p>";

           echo pg_last_error();

        } else {

           echo "<p>";}

 

 

 

        $query="select* from houses1 h, info I, school s where h.mls=i.id and h.mls=s.id order by h.list_price asc";

        $res=pg_query($conn,$query);

         echo "<table border=\"2\">\n";

          echo "<tr><th>Price</th> <th>MLS</th> <th>Agent</th> <th>County</th> <th>City</th> <th>ZIP</th>  <th>Villain/Hero</th>

                 <th>Year Built</th> <th>Remodeled</th> <th>Energy Star</th> <th>Brick/Stone</th> <th>Beds</th> <th>Baths</th> <th>Acres</th>

                        <th>Elementary School</th> <th>Middle School</th> <th>High School</th></tr>\n";

        for($i=0; $i<pg_numrows($res);++$i) {

                $obj=pg_fetch_object($res,$i);

                echo "<tr>

                        <td>$$obj->list_price</td>

                        <td>$obj->mls</td>

                        <td>$obj->agent</td>

                        <td>$obj->county</td>

                        <td>$obj->city</td>

                        <td>$obj->zip</td>

                        <td>$obj->type</td>

                        <td>$obj->year_built</td>

                        <td>$obj->remolded</td>

                        <td>$obj->estar</td>

                        <td>$obj->mat</td>

                        <td>$obj->beds</td>

                        <td>$obj->baths</td>

                        <td>$obj->acres</td>

                        <td>$obj->e_name</td>

                        <td>$obj->m_name</td>

                        <td>$obj->h_name</td>";

                        }

                        echo"</tr></table>\n";

?>

Go back to <a href="home.html">project homepage</a>.

<center><img src="bottombanner.jpg" alt="cityline" height="198" width="1932"></center>

 

</BODY>

</HTML>

 

 

Search by Number of Bedrooms

 

 

 

queryByBed.html

 

<HTML>

<HEAD>

  <TITLE> Search Bed </TITLE>

</HEAD>

 

<BODY>

<FORM action="queryByBed.php">

  <h2>Number of Bedrooms You Would Like: <input type="text" name="beds"><P></h2>

   <p><h2>Enter a number greater than 5.</h2></p>

  <input type="submit">

</FORM>

<img src = "logo.jpg" alt = "Company Logo"

        height = "427" width = "935" style = "float: right;

         margin-left: 20px; margin-bottom: 20px;" />

<h3>Go back to <a href="home.html">project homepage</a></h3>.

</h3>

</BODY>

</HTML>

queryByBed.php

 

 

<html>

<head>

    <title> Zip </title>

</head>

<h3>Search results returned with bedrooms equal to or less than number requested.</h3>

 

<body>

 

<?php

        $conn=pg_connect("host=127.0.0.1 user=jcarmich password=jrcc5757");

        $zip=$_REQUEST["beds"];

 

        $query="select * from houses1 h, info i, school s  where i.beds<=$1 and h.mls=i.id and h.mls=s.id";

        $res=pg_query_params($query,array($zip));

 

       echo "<table border=\"2\">\n";       

        echo "<tr><th>MLS</th> <th>Agent</th> <th>County</th> <th>City</th> <th>ZIP</th> <th>Price</th> <th>Villain/Hero</th>

               <th>Year Built</th> <th>Remodeled</th> <th>Enery Star</th> <th>Brick/Stone</th> <th>Beds</th> <th>Baths</th> <th>Acres</th>

                     <th>Elementary School</th> <th>Middle School</th> <th>High School</th></tr>\n";

        for($i=0; $i<pg_numrows($res);++$i) {

                $obj=pg_fetch_object($res,$i);

                     echo "<tr><td>$obj->mls</td>

                     <td>$obj->agent</td>

                     <td>$obj->county</td>

                     <td>$obj->city</td>

                     <td>$obj->zip</td>

                     <td>$$obj->list_price</td>

                     <td>$obj->type</td>

                     <td>$obj->year_built</td>

                     <td>$obj->remolded</td>

                     <td>$obj->estar</td>

                     <td>$obj->mat</td>

                     <td>$obj->beds</td>

                     <td>$obj->baths</td>

                     <td>$obj->acres</td>

                     <td>$obj->e_name</td>

                     <td>$obj->m_name</td>

                     <td>$obj->h_name</td>";       

                     }

                     echo"</tr></table>\n";

?>

 

<h3>click <a href="home.html">here</a> to go back to the home page.</h3>

</BODY>

</HTML>

 

 

Search by Number of Bathrooms

 

 

queryByBath.html

 

<HTML>

<HEAD>

  <TITLE> Search Bath </TITLE>

</HEAD>

 

<BODY>

<FORM action="queryByBath.php">

  <h2>Number of Bathrooms You Would Like: <input type="text" name="beds"><P></h2>

  <h3>Enter a number greater than 4.</h3>

  <input type="submit">

 

<img src = "logo.jpg" alt = "Company Logo"

        height = "427" width = "935" style = "float: right;

         margin-left: 20px; margin-bottom: 20px;" />

<h3>click <a href="home.html">here</a> to go back to the home page.</h3>

</FORM>

 

 

 

</BODY>

</HTML>

 

queryByBath.php

 

<html>

 

<head>

    <title> Baths </title>

 

</head>

 

<body>

 

<h3>Search results returned with bathrooms equal to or less than number requested.</h3>

 

 

<?php

        $conn=pg_connect("host=127.0.0.1 user=jcarmich password=jrcc5757");

        $zip=$_REQUEST["beds"];

 

        $query="select * from houses1 h, info i, school s  where i.baths<=$1 and h.mls=i.id and h.mls=s.id";

        $res=pg_query_params($query,array($zip));

 

       echo "<table border=\"2\">\n";       

        echo "<tr><th>MLS</th> <th>Agent</th> <th>County</th> <th>City</th> <th>ZIP</th> <th>Price</th> <th>Villain/Hero</th>

               <th>Year Built</th> <th>Remodeled</th> <th>Enery Star</th> <th>Brick/Stone</th> <th>Beds</th> <th>Baths</th> <th>Acres</th>

                     <th>Elementary School</th> <th>Middle School</th> <th>High School</th></tr>\n";

 

        for($i=0; $i<pg_numrows($res);++$i) {

                $obj=pg_fetch_object($res,$i);

                     echo "<tr><td>$obj->mls</td>

                     <td>$obj->agent</td>

                     <td>$obj->county</td>

                     <td>$obj->city</td>

                     <td>$obj->zip</td>

                     <td>$$obj->list_price</td>

                     <td>$obj->type</td>

                     <td>$obj->year_built</td>

                     <td>$obj->remolded</td>

                     <td>$obj->estar</td>

                     <td>$obj->mat</td>

                     <td>$obj->beds</td>

                     <td>$obj->baths</td>

                     <td>$obj->acres</td>

                     <td>$obj->e_name</td>

                     <td>$obj->m_name</td>

                     <td>$obj->h_name</td>";       

                     }

                     echo"</tr></table>\n";

 

?>

 

<h3>click <a href="home.html">here</a> to go back to the home page.</h3>

 

</BODY>

 

</HTML>

 

Search by Lot Size

 

 

queryByLot.html

 

 

<HEAD>

  <TITLE> Search Lot Size </TITLE>

</HEAD>

 

<BODY>

<FORM action="queryByLot.php">

  Max Number of Acres You Would Like: <input type="text" name="beds"><P>

<h3>Enter a number greater than 9.</h3>

  <input type="submit">

</FORM>

<img src = "logo.jpg" alt = "Company Logo"

        height = "427" width = "935" style = "float: right;

         margin-left: 20px; margin-bottom: 20px;" />

click <a href="home.html">here</a> to go back to the home page.

 

</BODY>

</HTML>

 

queryByLot.php

 

<html>

 

<head>

    <title> Zip </title>

</head>

 

<body>

 

<?php

 

        $conn=pg_connect("host=127.0.0.1 user=jcarmich password=jrcc5757");

        $zip=$_REQUEST["beds"];

 

        $query="select * from houses1 h, info i, school s  where i.acres<=$1 and h.mls=i.id and h.mls=s.id";

        $res=pg_query_params($query,array($zip));

 

       echo "<table border=\"2\">\n";       

         echo "<tr><th>MLS</th> <th>Agent</th> <th>County</th> <th>City</th> <th>ZIP</th> <th>Price</th> <th>Villain/Hero</th>

               <th>Year Built</th> <th>Remodeled</th> <th>Enery Star</th> <th>Brick/Stone</th> <th>Beds</th> <th>Baths</th> <th>Acres</th>

                     <th>Elementary School</th> <th>Middle School</th> <th>High School</th></tr>\n";

 

        for($i=0; $i<pg_numrows($res);++$i) {

                $obj=pg_fetch_object($res,$i);

                     echo "<tr><td>$obj->mls</td>

                     <td>$obj->agent</td>

                     <td>$obj->county</td>

                     <td>$obj->city</td>

                     <td>$obj->zip</td>

                     <td>$$obj->list_price</td>

                     <td>$obj->type</td>

                     <td>$obj->year_built</td>

                     <td>$obj->remolded</td>

                     <td>$obj->estar</td>

                     <td>$obj->mat</td>

                     <td>$obj->beds</td>

                     <td>$obj->baths</td>

                     <td>$obj->acres</td>

                     <td>$obj->e_name</td>

                     <td>$obj->m_name</td>

                     <td>$obj->h_name</td>";       

                     }

                     echo"</tr></table>\n";

 

?>

 

 

go back to <a href="home.html">project homepage</a>.

 

</BODY>

 

</HTML>

 

Search by Zip Code

 

 

queryByZip.html

 

 

<HTML>

 

<HEAD>

  <TITLE> Search Zip </TITLE>

</HEAD>

 

<BODY>

 

<h3> The zip codes on file are: 30252, 30095, 31164, and 30420.</h3>

 

<FORM action="queryByZip2.php">

  Zip: <input type="text" name="zip"><P>

  <input type="submit">

</FORM>

 

<img src = "logo.jpg" alt = "Company Logo"

        height = "427" width = "935" style = "float: right;

         margin-left: 20px; margin-bottom: 20px;" />

 

<h3>Click <a href="home.html">here</a> to go back to the home page.</h3>

 

 

</BODY>

 

</HTML>

 

queryByZip2.php

 

<html>

 

<head>

    <title> Zip </title>

</head>

 

<body>

 

<?php

        $conn=pg_connect("host=127.0.0.1 user=jcarmich password=jrcc5757");

        $zip=$_REQUEST["zip"];

 

        $query="select * from houses1 h, info i, school s  where h.zip=$1 and h.mls=i.id and h.mls=s.id";

        $res=pg_query_params($query,array($zip));

 

       echo "<table border=\"2\">\n";       

        echo "<tr><th>MLS</th> <th>Agent</th> <th>County</th> <th>City</th>

 

<th>ZIP</th> <th>Price</th> <th>Villain/Hero</th>

               <th>Year Built</th> <th>Remodeled</th> <th>Enery Star</th> <th>Brick/Stone</th> <th>Beds</th> <th>Baths</th> <th>Acres</th>

                     <th>Elementary School</th> <th>Middle School</th> <th>High

 

School</th></tr>\n";

        for($i=0; $i<pg_numrows($res);++$i) {

                $obj=pg_fetch_object($res,$i);

                     echo "<tr><td>$obj->mls</td>

                     <td>$obj->agent</td>

                     <td>$obj->county</td>

                     <td>$obj->city</td>

                     <td>$obj->zip</td>

                     <td>$$obj->list_price</td>

                     <td>$obj->type</td>

                     <td>$obj->year_built</td>

                     <td>$obj->remolded</td>

                     <td>$obj->estar</td>

                     <td>$obj->mat</td>

                     <td>$obj->beds</td>

                     <td>$obj->baths</td>

                     <td>$obj->acres</td>

                     <td>$obj->e_name</td>

                     <td>$obj->m_name</td>

                     <td>$obj->h_name</td>";       

                     }

                     echo"</tr></table>\n";

?>

 

<h3>Click <a href="home.html">here</a> to go back to the home page.</h3>

 

</BODY>

 

</HTML>

Search by Year Built

 

 

 

 

 

queryByYear.html

 

<HTML>

<HEAD>

  <TITLE> Search Year </TITLE>

</HEAD>

 

<BODY>

<FORM action="queryByYear.php">

  ENTER THE YEAR BUILT YOU WOULD LIKE: <input type="text" name="zip"><P>

<h3>Note: 2011 is not an option.</h3>

  <input type="submit">

</FORM>

<img src = "logo.jpg" alt = "Company Logo"

        height = "427" width = "935" style = "float: right;

         margin-left: 20px; margin-bottom: 20px;" />

 

 

<h3>click <a href="home.html">here</a> to go back to the home page.</h3>

 

</BODY>

</HTML>

 

queryByYear.php

 

<HTML>

<HEAD>

    <TITLE> YEAR BUILT</TITLE>

        <meta http-equiv="content-type" content="text/html;charset=UTF-8" />

        <title>Main Page</title>

        <link rel="stylesheet" type="text/css" href="bghero.css" />

</HEAD>

<BODY>

<title>Year Mansions Built</title>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

 

<meta http-equiv="Content-Style-Type" content="text/css" />

<link rel="shortcut icon" href="http://webdev.spsu.edu/favicon.ico" type="image/x-icon" />

<meta name="robots" content="none" />

</head>

<body bgcolor="#F4F4F4">

<h1 style="text-align:center">Arkham Real Estate</h1>

 

<h2>RETURNED YOUR REQUEST SORTED BY OLDEST TO NEWEST YEAR BUILT:</h2>

<?php

        $conn=pg_connect("host=127.0.0.1 user=jcarmich password=jrcc5757");

        $zip=$_REQUEST["zip"];

 

        $query="select * from info i, houses1 h, school s  where i.year_built>=$1 and i.id=h.mls and i.id=s.id order by i.year_built asc;";

        $res=pg_query_params($query,array($zip));

 

       echo "<table border=\"2\">\n";       

        echo "<tr><th>Year Built</th> <th>MLS</th> <th>Agent</th> <th>County</th> <th>City</th> <th>ZIP</th> <th>Price</th> <th>Villain/Hero</th>

                <th>Remodeled</th> <th>Enery Star</th> <th>Brick/Stone</th> <th>Beds</th> <th>Baths</th> <th>Acres</th>

                     <th>Elementary School</th> <th>Middle School</th> <th>High School</th></tr>\n";

        for($i=0; $i<pg_numrows($res);++$i) {

                $obj=pg_fetch_object($res,$i);

                     echo "<tr>

                     <td>$obj->year_built</td>

                     <td>$obj->mls</td>

                     <td>$obj->agent</td>

                     <td>$obj->county</td>

                     <td>$obj->city</td>

                     <td>$obj->zip</td>

                     <td>$$obj->list_price</td>

                     <td>$obj->type</td>

                     <td>$obj->remolded</td>

                     <td>$obj->estar</td>

                     <td>$obj->mat</td>

                     <td>$obj->beds</td>

                     <td>$obj->baths</td>

                     <td>$obj->acres</td>

                     <td>$obj->e_name</td>

                     <td>$obj->m_name</td>

                     <td>$obj->h_name</td>";       

                     }

                     echo"</tr></table>\n";

?>

<h3>click <a href="home.html">here</a> to go back to the home page.</h3>

<center><img src="bottombanner.jpg" alt="cityline" height="198" width="1932"></center>

 

</BODY>

</HTML>

 

 

 

Homepage