Vous êtes sur la page 1sur 34

STUDENT NAME-------->MAYANK SRIVASTAV

You can check the running project through the following link---https://w1313623.users.ecs.westminster.ac.uk/home.html
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------file name----->aaa.txt (Comma delimated Text file)

"Property Name",
Visits

"Post Code",

Price,

"Image File",

Product1 ,
src=""image1.jpg"">",

H30001,
2

101,

"<img

Product2,
src=""image2.jpg"">",

H30002,
2

102,

"<img

Product3,
src=""image3.jpg"">",

H30003,
2

103,

"<img

Product4,
src=""image4.jpg"">",

H30004,
3

104,

"<img

Product5,
src=""image5.jpg"">",

H30005,
1

105,

"<img

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

file name----->home.html
features of this project )

(Thats my first/front page .From here you can access all the

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"


"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Home</title>
<script src="source/maxamount.js" type="text/javascript"></script>
<script src="source/search.js" type="text/javascript"></script>
<style type="text/css">
<!-body {
background-color: #FFCCCC;
}
body,td,th {
font-family: Verdana, Arial, Helvetica, sans-serif;
color: #9933CC;
}
h1,h2,h3,h4,h5,h6 {
font-family: Georgia, Times New Roman, Times, serif;
font-weight: bold;
}
h1 {

color: #FF0000;
}
.style1 {
font-family: "Times New Roman", Times, serif;
font-style: italic;
color: #990000;
font-size: 14px;
}
.style2 {font-family: Georgia, "Times New Roman", Times, serif}
.style4 {
font-size: 14px;
color: #990000;
font-family: "Times New Roman", Times, serif;
}
.style5 {
color: #990000;
font-size: 12px;
font-family: "Times New Roman", Times, serif;
font-style: italic;
font-weight: bold;
}
.style6 {
font-family: "Times New Roman", Times, serif;
font-size: 12px;
font-style: italic;
font-weight: bold;
}

-->
</style></head>

<body>
<h1 align="center">HOME 24 X 7
</h1>

<br/>
<div align="center">
<table width="990" height="68" border="0">
<tr>
<td width="843" height="64">
<form id="form1" name="form1" method="post" action="plist.php">
<fieldset>

<legend class="style1">Get Details By property Name</legend>


<div align="center"><span class="style2">Choose the property whose details are
required</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<select name="pname" id="pname">
<option value="Select">Select</option>
<option value="Product1">Product1</option>
<option value="Product2">Product2</option>
<option value="Product3">Product3</option>
<option value="Product4">Product4</option>
<option value="Product5">Product5</option>
</select>
<br/><br/>

<input type="submit" name="submit" id="submit" value="Submit" />


</div>

</fieldset></form></td>
</tr>
</table>
<br/><br/>
<span>
<table width="990" height="68" border="0">
<tr>
<td width="843" height="64">
<form id="form2" name="form2" method="post" action="maximum.php" onsubmit=" return
validateForm()">
<fieldset>

<legend class="style1">Get Details By Product Price </legend>


<div align="center"><p><span class="style2">&nbsp;&nbsp;&nbsp;&nbsp;To get the details of all
the properties, whose price are less than provided, please enter the Maximun Amount<br />
</span><br/>
<span class="style4">Enter Maximun Amount </span><span class="style5">( in thousand )</span>
&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;
<input name = "amount" type="text"/>
<br/><br/>
<input type="submit" name="submit" id="submit" value="Submit" />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="reset" value="Reset" />
</div>

</fieldset></form></td>
</tr>
</table>
</span>

<br/><br/>
<table width="990" height="68" border="0">
<tr>
<td width="843" height="64">
<form id="form3" name="form3" method="post" action="psearch.php" onsubmit=" return
validateForm1()">
<fieldset>

<legend class="style1">Get Product Details By Search </legend>


<div align="center"><p><span class="style2">&nbsp;&nbsp;&nbsp;&nbsp;Here you can search your
property by providing PRODUCT NAME or POST CODE <br />
</span><br/>
<span class="style4">Enter Your Search Here </span>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;
<input name = "search" type="text" />
<br/>
<span class="style5">&nbsp;<br />
Example: product1, product2, H30001, H30002 etc</span><span class="style6">.</span> <br/>
<br/>
<input type="submit" name="submit1" id="submit1" value="Submit" />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input name="reset" type="reset" value="Reset" />

</div>
</fieldset></form></td>
</tr>
</table>
</div>
</body>
</html>

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

file name---->plist.php (It contains all the information of a property)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"


"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Property List</title>
<style type="text/css">
<!-table
{
border-collapse:collapse;
}
body,td,th {

color: #660033;
}
body {
background-color: #FFCCCC;
}
a{
font-family: Times New Roman, Times, serif;
}
h1,h2,h3,h4,h5,h6 {
font-family: Times New Roman, Times, serif;
}
h1 {
font-size: 18px;
color: #FF0000;
}
.style1 {
font-size: 24px;
font-weight: bold;
}
.style3 {color: #990033; font-size: 18px;}
.style4 {font-size: 40px; font-weight: bold; }
.style5 {color: #003300}
.style7 {font-size: 18px}
-->
</style></head>

<body>

<h1 align="center" class="style4">PROPERTY &nbsp;&nbsp;DETAILS</h1>


<p align="center">&nbsp;</p>
<p align="center"><span class="style3">The Product choosen by you is : </span>
<span class="style1">
<?php
$pname = strtoupper($_POST['pname']);
echo " " . $pname . " .";
?></span></p>
<p align="center"><span class="style3">All properties of the chosen product is shown in Table below
:</span></p>
<br/>

<table width="879" height="150" border="5" align="center" bordercolor="#FF0000" bordercollapse="collapse">


<?php
$file = fopen("aaa.csv","r");

while(!feof($file))
{
$arr[] = fgetcsv($file);
}

$row = count($arr,0);
$cols = (count($arr,1)/count($arr,0))-1;
echo "<tr>";
for($k=0;$k<$cols;$k++)

{
echo '<td width="813" height="46" bgcolor="#FF6C6C"><div align="center"><span
class="style5"><span class="style7"><b>';

echo $arr[0][$k];
echo "</span> </div> </td>";
}
echo "</b></tr>";
$k=0;
for($i=1;$i<($row-1);$i++)
{

if ($pname == strtoupper($arr[$i][0]))
{
$k=1;
echo "<tr>";
for($j=0;$j<$cols;$j++)
{
echo '<td width="465" ><div align="center"><span class="style6">';
echo $arr[$i][$j];
echo "</span> </div> </td>";
}
echo "</tr>";
}

if($k==0)
{
for($i=0;$i<$cols;$i++)
{
echo '<td width="465" ><div align="center"><span class="style6">';
echo "XXXXXX";
echo "</span> </div> </td>";
}
}

fclose($file);
?>
</table>
<p><div align="center"><span class="style1">
<?php
if ($k==0)
{
echo "You have not chosen any product";
}
?>
<br/>
<p><div align="center"><span class="style3"><form action="home.html">
<input type="submit" value="Back To Home"/></form></span></div></p>

</body>

</html>

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

filename---->maximum.php (it will display all the properties below the maximum price entered by
the user)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"


"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Maximum</title>
<style type="text/css">
<!-table
{
border-collapse:collapse;
}
body,td,th {
color: #660033;
}

body {
background-color: #FFCCCC;
}
a{
font-family: Times New Roman, Times, serif;
}
h1,h2,h3,h4,h5,h6 {
font-family: Times New Roman, Times, serif;
}
h1 {
font-size: 18px;
color: #FF0000;
}
.style1 {
font-size: 24px;
font-weight: bold;
}
.style3 {color: #990033; font-size: 18px;}
.style4 {font-size: 36px; font-weight: bold; }
.style5 {color: #003300}
.style7 {font-size: 18px}
-->
</style></head>

<body>
<?php
$amt= $_POST['amount'];

?>
<h1 align="center" class="style4">LIST OF PRODUCTS WITH PROPERTIES</h1>
<br/>
<p align="center"><span class="style3">The amount Entered by you is</span>
<span class="style1">
<?php
echo " " . $amt . " ";
?></span><span class="style3">thousand .</span> </p>
<p align="center" class="style3">Taken this as maximum amount, all products with price less than
the amount provided are listed below :- </p>

<br/>
<table width="879" height="300" border="5" align="center" bordercolor="#FF0000" bordercollapse="collapse">
<?php
$file = fopen("aaa.csv","r");
while(!feof($file))
{
$arr[] = fgetcsv($file);
}

$row = count($arr,0);
$cols = (count($arr,1)/count($arr,0))-1;
echo "<tr>";
for($k=0;$k<$cols;$k++)
{
echo '<td width="813" height="60" bgcolor="#FF6C6C"><div align="center"><span
class="style5"><span class="style7"><b>';

echo $arr[0][$k];
echo "</span> </div> </td>";
}
echo "</b></tr>";

$k=0;
for($i=1;$i<($row-1);$i++)
{

if($arr[$i][2] < $amt)


{
$k=1;
echo "<tr>";
for($j=0;$j<$cols;$j++)
{
echo '<td width="465" ><div align="center"><span class="style6">';
echo $arr[$i][$j];
echo "</span> </div> </td>";
}

echo "</tr>";
}
if($k==0)
{
echo '<td width="465" ><div align="center"><span class="style6">';
echo "XXXXXX";

echo "</span> </div> </td>";

fclose($file);
?>
</table>
<p><div align="center"><span class="style3">
<?php
if ($k==0)
{
echo '<span class="style1">';
echo "No property found with price below than provided amount.<br/><br/>Please , try with some
large amount. ";
echo '</span>';
}
else
{
echo '<br/>';
echo '<form method="post" action="available.php"><div align="center">';
echo '<input type="hidden" name="hf" value="' . $amt . '" />';
echo 'To change property VISITS of the above products
&nbsp;&nbsp;&nbsp;
<input type="submit" name="submit" value="Click Here" /></div></form></p>';

?></span></div></p>
<br/>
<p><div align="center"><span class="style3"><form action="home.html">
<input type="submit" value="Back To Home"/></form></span></div></p>
</body>
</html>

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

file name---->available.php (Its a page from where you can add a visit to the property)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"


"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Search Page</title>
<style type="text/css">
<!--

table
{
border-collapse:collapse;
}
body,td,th {
color: #660033;
}
body {
background-color: #FFCCCC;
}
a{
font-family: Times New Roman, Times, serif;
}
h1,h2,h3,h4,h5,h6 {
font-family: Times New Roman, Times, serif;
}
h1 {
font-size: 18px;
color: #FF0000;
}
.style1 {
font-size: 24px;
font-weight: bold;
}
.style3 {color: #990033; font-size: 18px;}
.style4 {font-size: 36px; font-weight: bold; }
.style5 {color: #003300}

.style7 {font-size: 18px}


-->
</style></head>
<body>
<form method="post" action="pchanged.php">
<?php
$amt=$_POST['hf'];
?>
<h1 align="center" class="style4">LIST OF PRODUCTS WITH PROPERTIES</h1>
<p align="center" class="style1">&nbsp;</p>
<p align="center"><span class="style3">Taken </span>
<span class="style1">
<?php
echo " " . $amt . " ";
?> </span><span class="style3">thousand .</span><span class="style3"> as the maximum amount
the products are :-</span> </p>
<p align="center" class="style3">Please select the PRODUCTS whose VISITS property is to be
changed. </p>
<br/>

<table width="879" height="300" border="5" align="center" bordercolor="#FF0000" bordercollapse="collapse">


<?php
$file = fopen("aaa.csv","r");
while(!feof($file))
{
$arr[] = fgetcsv($file);
}

$row = count($arr,0);
$cols = (count($arr,1)/count($arr,0))-1;
echo "<tr>";
for($k=0;$k<$cols;$k++)
{
echo '<td width="813" height="60" bgcolor="#FF6C6C"><div align="center"><span
class="style5"><span class="style7"><b>';
echo $arr[0][$k];
echo "</span> </div> </td>";
}
echo '<td width="813" height="60" bgcolor="#FF6C6C"><div align="center"><span
class="style5"><span class="style7"><b>';
echo 'Select';
echo '</td>';
echo "</b></tr>";
$k=0;
$k=0;
for($i=1;$i<($row-1);$i++)
{

if($arr[$i][2] < $amt)


{
$k=1;
echo "<tr>";
for($j=0;$j<$cols;$j++)
{
echo '<td width="465" ><div align="center"><span class="style6">';

echo $arr[$i][$j];
echo "</span> </div> </td>";
}
echo '<td><div align="center">';

echo "<input type='checkbox' name='chk" . $i . "' />" ;


echo '</div></td>';

echo "</tr>";
}
if($k==0)
{
echo '<td width="465" ><div align="center"><span class="style6">';
echo "XXXXXX";
echo "</span> </div> </td>";

}
}

fclose($file);
?>
</table>
<p align="center" class="style3">
<label>
<input type="submit" name="Submit" value="Continue" />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </label>

<label>
<input name="reset" type="reset" id="reset" value="Reset" />
</label>
</p>
</form>

</body>
</html>

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

file name---->pchange.php
---------Name changed(visit.php)
to the given instruction but its name is pchange.php)

(Its woking like visit.php according

(it will confirm that one visit has been added to the existing one)
visit.php but I have used pchange.php)

(its name should be

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"


"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Property Changed</title>
<style type="text/css">
<!--

table
{
border-collapse:collapse;
}
body,td,th {
color: #660033;
}
body {
background-color: #FFCCCC;
}
a{
font-family: Times New Roman, Times, serif;
}
h1,h2,h3,h4,h5,h6 {
font-family: Times New Roman, Times, serif;
}
h1 {
font-size: 18px;
color: #FF0000;
}
.style1 {
font-size: 24px;
font-weight: bold;
}
.style3 {color: #990033; font-size: 18px;}
.style4 {font-size: 36px; font-weight: bold; }
.style5 {color: #003300}

.style7 {font-size: 18px}


-->
</style></head>
<body>
<h1 align="center" class="style4">VISIT UPDATED</h1>
<p align="center" class="style1">&nbsp;</p>
<p align="center"><span class="style3">The products whose property VISITS is increased by ONE is
mention in table below : </span>
<span class="style1">
<br/>
<br/>

<table width="879" height="300" border="5" align="center" bordercolor="#FF0000" bordercollapse="collapse">


<?php

ini_set( "display_errors", 0);

$file = fopen("aaa.csv","r");
while(!feof($file))
{
$arr[] = fgetcsv($file);
}

$row = count($arr,0);
$cols = (count($arr,1)/count($arr,0))-1;
echo "<tr>";

for($k=0;$k<$cols;$k++)
{
echo '<td width="813" height="60" bgcolor="#FF6C6C"><div align="center"><span
class="style5"><span class="style7"><b>';

echo $arr[0][$k];
echo "</span> </div> </td>";
}
echo "</b></tr>";

$k=0;
for($i=1;$i<($row-1);$i++)
{
if (isset($_POST['chk' . $i]))
{
$k=1;
echo "<tr>";
$arr[$i][4] = ($arr[$i][4] + 1);
$file = fopen("aaa.csv","w");
foreach ($arr as $fields)
{
fputcsv($file, $fields);
}
for($j=0;$j<$cols;$j++)
{
$file = fopen("aaa.csv","r");
echo '<td width="465" ><div align="center"><span class="style6">';
echo $arr[$i][$j];

echo '</span> </div></td>';


}
echo "</tr>";
}

}
if($k==0)
{
for($i=0;$i<$cols;$i++)

{
echo '<td width="465" ><div align="center"><span class="style6">';
echo "XXXXXX";
echo "</span> </div> </td>";
}
}
fclose($file);
?>
</table>
</br>
<p><div align="center"><span class="style3">
<?php
if ($k==0)
{

echo '<span class="style1">';


echo "No product chosen to increase its property VISITS by ONE.<br/>";
echo '</span>';
}
?></span></div></p>
<br/>
<p><div align="center"><span class="style3"><form action="home.html">
<input type="submit" value="Back To Home"/></form></span></div></p>

</body>
</html>

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

file name---->psearch.php (it will show the details of the property which is entered by the user
through search)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"


"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Search Page</title>
<style type="text/css">
<!-table
{
border-collapse:collapse;
}
body,td,th {
color: #660033;
}
body {
background-color: #FFCCCC;
}
a{
font-family: Times New Roman, Times, serif;
}
h1,h2,h3,h4,h5,h6 {
font-family: Times New Roman, Times, serif;
}
h1 {
font-size: 18px;
color: #FF0000;
}

.style1 {
font-size: 24px;
font-weight: bold;
}
.style3 {color: #990033; font-size: 18px;}
.style4 {font-size: 36px; font-weight: bold; }
.style5 {color: #003300}
.style7 {font-size: 18px}
-->
</style></head>

<body>

<h1 align="center" class="style4">LIST OF PROPERTIES MATCHED WITH SEARCH TERM</h1>


<br/>
<p align="center"><span class="style3">The search term given by you is</span>
<span class="style1">
<?php
echo " " . $_POST['search'] . " ";
?></span></p>
<p align="center" class="style3">Taken this search term as PRODUCT NAME or POST CODE the
matched products are listed below :- </p>
<br/>

<table width="879" height="150" border="5" align="center" bordercolor="#FF0000" bordercollapse="collapse">


<?php

$file = fopen("aaa.csv","r");
while(!feof($file))
{
$arr[] = fgetcsv($file);
}

$row = count($arr,0);
$cols = (count($arr,1)/count($arr,0))-1;

echo "<tr>";
for($k=0;$k<$cols;$k++)
{
echo '<td width="813" height="46" bgcolor="#FF6C6C"><div align="center"><span
class="style5"><span class="style7"><b>';

echo $arr[0][$k];
echo "</span> </div> </td>";
}
echo "</b></tr>";
$sr= strtoupper($_POST['search']);
$l=0;

for($i=0;$i<($row-1);$i++)
{
for($j=0;$j<2;$j++)
{

if(strtoupper($arr[$i][$j]) == $sr)
{echo "<tr>";
$l=1;
for($k=0;$k<$cols;$k++)
{
echo '<td width="465" ><div align="center"><span class="style6">';
echo $arr[$i][$k];
echo "</span> </div> </td>";
}
echo "</tr>";
}

}
}

if($l==0)
{
for($i=0;$i<$cols;$i++)
{
echo '<td width="465" ><div align="center"><span class="style6">';
echo "XXXXXX";
echo "</span> </div> </td>";
}
}

fclose($file);
?>
</table>
<p><div align="center"><span class="style1">
<?php
if ($l==0)
{
echo "No Product matched with the search term. <br/><br/> Try another search. ";
}

?></span></div></p>
<br/>
<p><div align="center"><span class="style3"><form action="home.html">
<input type="submit" value="Back To Home"/></form></span></div></p>
</body>
</html>
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------EXTRA ------> file name ---->maxamount.js(java script)
the amount column empty , we have use java script for this)

function validateForm()
{
var t = document.forms["form2"]["amount"].value;

(so that user should not leave

if((t.length < 1) || (isNaN(t)))


{
alert("Enter Valid Amount");
return false;
}

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

EXTRA-------> file name---->search.js(java script)


(so that user should not leave the search
column empty or should enter valid amount. we have use java script)

function validateForm1()
{

var x = document.forms["form3"]["search"].value;

if (x==null || x== "")


{
alert("Please enter valid search term");
return false;

}
------------------------------------------------*****FINISH*****-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Vous aimerez peut-être aussi