You are on page 1of 61

CHAPTER-4

SYSTEM IMPLEMENTATION , TESTING


4.1 SYSTEM IMPLEMENTATION
CODING:
4.1.1 Index.php
<?phpsession_start(); ?>
<html>
<head>
<?php
include("include/head.inc.php");
?>
</head>
<body>
<div id="container">
<div id='cssmenu'>
<?php
include("include/menu.inc.php");
?>
</div>
<div id="logo-wrap">
<div id="logo">
<?php
include("include/logo.inc.php");
?>
</div>
<div id="header">
<div id="special_offers">
<!--flash image -->
</div>
</div><!-- end of header -->
<div id="content">
39

<div id="content_left">
<div class="content_left_section">
<!-- start sidebar -->
<div id="sidebar">
<?php
include("include/search.inc.php");
?>
</div>
<!-- end sidebar -->
</div></div>
</div>
<div id="content_right">
<div id="content_right1">
<div id="page">
<!-- start content -->
<div class="post">
<div class="login_box1">
<h1 class="title"><font color="black">Welcome to
<?php
if(isset($_SESSION['status']))
{
echo $_SESSION['unm'];
}
else
{
echo 'Bookstore';
}
?>
</h1>
<div class="entry">
<br>
<p>
The Book Den is a venture of WebTech Inc. <a href="developer.php"><font
color="purple">Laksh Pasricha</font></a> founded Webtech Inc. over a decade ago
40

and today it is a leading on-line marketplace solution for the consumer products and
business-to-business categories.
WebTech has operated primarily in the online book market and has successfully
transformed in an enterprise comprising of an Online Division, Wholesale Division
and Retail Division. WebTech has grown from a company of one man with a vision to
an enterprise poised to redefine the online marketplace for books, other consumer
products and beyond. WebTech is currently New in marketplace sellers but due to its
dynamic and proprietary pricing engine, fulfillment, distribution, inventory
assortment and depth, value pricing and management team It is growing
consistently.
</p><br>
<object width="550" height="400">
<!--<param name="movie" value="somefilename.swf">-->
<embed src="images/Hot.gif" width="550" height="400">
</embed>
</object>
<br><br>
<p>
The BookDen.com was started as an on-line bookseller for consumers in the INDIA.
Currently The BookDen.com, the INDIA website, operates in the consumer trade and
the mass-market book trade. The Book Den Books.com has positioned itself as a
leader in book assortment, inventory depth, fulfillment, distribution and value pricing.
It boasts over 1 million titles from leading publishers and distributors. Every title in
the TheBookworld Books.com assortment is priced utilizing The Book Den Books'
dynamic and proprietary pricing engine, which enables The Book Den Books.com to
aggressively discount prices while maintaining competitive gross margins.
</p>
</div></div></div>
<!-- end content -->
</div>
<!-- start footer -->
<div id="footer-wrap">
<?php
41

include("include/footer.inc.php");
?>
</div>
</body>
</html>

42

4.1.2 Login.php :
<?phpsession_start(); ?>
<html>
<head>
<?php
include("include/head.inc.php");
?>
</head>
<body>
<div id="container">
<div id='cssmenu'>
<?php
include("include/menu.inc.php");
?>
</div>
<div id="logo-wrap">
<div id="logo">
<?php
include("include/logo.inc.php");
?>
</div>
<div id="header">
<div id="special_offers">
<!--flash image -->
</div>
</div><!-- end of header -->
<div id="content">
<div id="content_left">
<div class="content_left_section">
<!-- start sidebar -->
<div id="sidebar">
43

<?php
include("include/search.inc.php");
?>
</div>
<!-- end sidebar -->
</div>
</div>
</div>
<div id="content_right">
<div id="content_right1">
<div id="page">
<!-- start content -->
<div class="post">
<div class="login_box1">
<h1 class="title"><font color="black">Welcome to
<?php
if(isset($_SESSION['status']))
{
echo $_SESSION['unm'];
}
else
{
echo 'Bookstore';
}
?>
</h1>
<div class="entry">
<br>
<p>
The Book Den is a venture of WebTech Inc.
<a href="developer.php"><font color="purple">Laksh Pasricha </font></a> founded
WebTech Inc. over a decade ago and today it is a leading on-line marketplace solution
for the consumer products and business-to-business categories.

44

WebTech has operated primarily in the online book market and has successfully
transformed in an enterprise comprising of an Online Division, Wholesale Division
and Retail Division. WebTech has grown from a company of one man with a vision to
an enterprise poised to redefine the online marketplace for books, other consumer
products and beyond. WebTech is currently New in marketplace sellers but due to its
dynamic and proprietary pricing engine, fulfillment, distribution, inventory
assortment and depth, value pricing and management team It is growing consistently.
</p>
<br>
<object width="550" height="400">
<!--<param name="movie" value="somefilename.swf">-->
<embed src="images/Hot.gif" width="550" height="400">
</embed>
</object>
<br>
<br>
<p>
The BookDen.com was started as an on-line bookseller for consumers in the INDIA.
Currently The BookDen.com, the INDIA website, operates in the consumer trade and
the mass-market book trade. The Book Den Books.com has positioned itself as a
leader in book assortment, inventory depth, fulfillment, distribution and value pricing.
It boasts over 1 million titles from leading publishers and distributors. Every title in
the The Book world Books.com assortment is priced utilizing The Book Den Books'
dynamic and proprietary pricing engine, which enables The Book Den Books.com to
aggressively discount prices while maintaining competitive gross margins.
</p>
</div>
</div>
</div>
<!-- end content -->
</div>
<!-- start footer -->
<div id="footer-wrap">
<?php
45

include("include/footer.inc.php");
?>
</div>
</body>
</html>

46

4.1.3 Register.php:
<?phpsession_start(); ?>
<html>
<head>
<?php
include("include/head.inc.php");
?>
</head>
<body>
<div id="container">
<div id='cssmenu'>
<?php
include("include/menu.inc.php");
?>
</div>
<div id="logo-wrap">
<div id="logo">
<?php
include("include/logo.inc.php");
?>
</div>
<div id="header">
<div id="special_offers">
<!--flash image -->
</div>
</div><!-- end of header -->
<div id="content">
<div id="content_left">
<div class="content_left_section">
<!-- start sidebar -->
<div id="sidebar">
<?php
include("include/search.inc.php");
47

?>
</div>
<!-- end sidebar -->
<div id="content_right">
<form action="process_register.php" method="POST">
<h1 class="title" align="center"><font color="black">Welcome to
Registeration</h1>
<div class="entry">
<?php
if(isset($_GET['error']))
{
echo '<font color="red">'.$_GET['error'].'</font>';
echo '<br><br>';
}
if(isset($_GET['ok']))
{
echo '<font color="blue">You are successfully Registered..</font>';
echo '<br><br>';
}
?>
<table>
<tr>
<td><b><font color="black">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Full Name &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs
p;&nbsp;
:</b>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td><input type='text' size="70" maxlength="30" name='fnm'></td>
48

</tr>
<tr><td>&nbsp;</tr>
<tr>
<td><b>
<font color="black">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
User Name
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
:</b>&nbsp;&nbsp;
</td>
<td><input type='text' size="70" maxlength="30" name='unm'></td>
<td>&nbsp;</td>
</tr>
<tr><td>&nbsp;</tr>
<tr>
<td><b><font color="black">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Password &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs
p;&nbsp;
:</b>&nbsp;&nbsp;</td>
<td><input type='password' name='pwd' size="70"></td>
</tr>
<tr><td>&nbsp;</tr>
<tr>
<td><b><font color="black">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Confirm Password
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
:</b>&nbsp;&nbsp;</td>
49

<td><input type='password' name='cpwd' size="70"></td>


</tr>
<tr><td>&nbsp;</tr>
<tr>
<td><b><font color="black">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Gender
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n
bsp;
:</b>&nbsp;&nbsp;</td>
<td>
<input type="radio" value="Male" name="gender" id='m'>
<font color="black"> Male
<input type="radio" value="Female" name="gender" id='f'>
<font color="black">Female
<input type="radio" value="Other" name="gender" id='o'>
<font color="black">Other</td>
</tr>
<tr><td>&nbsp;</tr>
<tr>
<td><b><font color="black">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
E-mail Address
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs
p;
:</b>&nbsp;&nbsp;</td>
<td><input type='text' name='mail' size="70"></td>
</tr>
<tr><td>&nbsp;</tr>
<tr>
<td><b><font color="black">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Contact No
50

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
:</b>&nbsp;&nbsp;</td>
<td><input type='text' name='contact' size="70"></td>
</tr>
<tr><td>&nbsp;</tr>
<tr>
<td><b><font color="black">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; City
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</b>&nbsp;&nbsp;</td>
<td>
<select style="width: 445px;" name="city">
<option>Select City</option>
<option>Ahmedabad
<option>Baroda
<option>Jamnagar
<option>New Delh
<option>punjab
<option>Rajkot
<option>Porbandar
<option>Anand
<option>Surat
<option>Surendranagar
<option>Jamnagar
<option>Junagadh
<option>Amreli
<option>Bhavnagar
<option>Mehsana
</select>
</tr>
<tr><td>&nbsp;</tr>
51

<tr>
<td colspan='2' align='center'>
<input type='submit' value=" OK ">
</td>
</tr>
</form>
</table>
</div></div></div></div></div></div></div></div>
<!-- start footer -->
<div id="footer5-wrap">
<?php
include("include/footer.inc.php");
?>
</div>
</body>
</html>

52

4.1.4 Booklist.php
<?phpsession_start();
$link=mysql_connect("localhost","root","")or die("Can't Connect...");
mysql_select_db("shop",$link) or die("Can't Connect to Database...");
$cat=$_GET['subcatid'];
$totalq="select count(*) \"total\" from book where b_subcat='$cat'";
$totalres=mysql_query($totalq,$link) or die("Can't Execute Query...");
$totalrow=mysql_fetch_assoc($totalres);
$page_per_page=6;
$page_total_rec=$totalrow['total'];
$page_total_page=ceil($page_total_rec/$page_per_page);
if(!isset($_GET['page']))
{
$page_current_page=1;
}
else
{
$page_current_page=$_GET['page'];
}
?>
<html>
<head>
<title>Book Store</title>
<link href="style2.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="container">
<div id='cssmenu'>
<ul>
<li><a href='index.php'><span>Home</span></a></li>
<li><a href='aboutus.php'><span>About</span></a></li>
<li class='last'><a href='contact.php'><span>Contact</span></a></li>
53

<li><a href='viewcart.php'><span>View Cart</span></a></li>


<?php
if(isset($_SESSION['status']))
{
echo '<li><a href="logout.php">Logout</a></li>';
}
else
{
echo '<li><a href="login.php">Login</a></li>';
}
?>
</ul>
</div>
<div id="header">
<div id="special_offers">
<!--flash image -->
</div>
</div><!-- end of header -->
<div id="content">
<div id="content_left">
<div class="content_left_section">
<div id="sidebar">
<?php
if(isset($_SESSION['status']))
{
echo '<h2>Hello : '.$_SESSION['unm'].'</h2>';
}
?><br><br><br>
<ul>
<li>
<h1>Categories</h1>
<ul>
<!-<li><a href="#">Economics</a></li>
54

<li><a href="#">Fiction</a></li>
<li><a href="#">Forestry &WildLife</a></li>
<li><a href="#">Health & Physics</a></li>
<li><a href="#">Historical</a></li>
<li><a href="#">Social</a></li>
<li><a href="#">Sports & Physical Education</a></li>
<li><a href="#">Terrorism</a></li>
<li><a href="#">Tourism</a></li>
<li><a href="#">Tracking </a></li>
<li><a href="#">Yoga</a></li>
-->
<?php
$link=mysql_connect("localhost","root","")or die("Can't Connect...");
mysql_select_db("shop",$link) or die("Can't Connect to Database...");
$query="select * from category ";
$res=mysql_query($query,$link);
while($row=mysql_fetch_assoc($res))
{
echo'<li><a href="subcat.php?cat='.$row['cat_id'].'&catnm='.$row["cat_nm"].'">'.
$row["cat_nm"].'</a></li>';
//pass catid not catnm
}
?><br>
</ul>
</li>
</ul>
</div></div>
</div>
<div id="content_right">
<div class="login_box0">
<font color="black">
<table align="center">
<tdalign="center"><b><font color="black"><?php echo $_GET['subcatnm'];?
></b></td>
55

</tr></table></div>
<div class="login_box2">

<div class="login_box3">

<table width="100%" cellspacing="10" border=1 bgcolor="black">


<?php
$k=($page_current_page-1)*$page_per_page;
$query="select *from book where b_subcat='$cat' LIMIT ".$k .",".$page_per_page;
$res=mysql_query($query,$link) or die("Can't Execute Query...");
$count=0;
while($row=mysql_fetch_assoc($res))
{
echo '<tr>';
echo '<td valign="top" width="20%" align="center">
<a href="detail.php?id='.$row['b_id'].'&cat='.$_GET['subcatnm'].'">
<imgsrc="'.$row['b_img'].'" width="80" height="100">
<br>'.$row['b_nm'].'</a>
</td>';
echo '</tr>';
}
?>
</table>
</div>
</div>
</div>
</div>
</div>
<!-- end content -->
<!-- start footer -->
<div id="footer-wrap">
<?php
include("include/footer.inc.php");
?>
</div>
</body>

56

</html>

57

4.1.5 Detail.php
<?phpsession_start();
$link=mysql_connect("localhost","root","")or die("Can't Connect...");
mysql_select_db("shop",$link) or die("Can't Connect to Database...");
$id=$_GET['id'];
$q="select * from book where b_id=$id";
$res=mysql_query($q,$link) or die("Can't Execute Query..");
$row=mysql_fetch_assoc($res);
?>
<html>
<head>
<link rel="stylesheet" href="lightbox.css" type="text/css" media="screen" />
<script src="js/prototype.js" type="text/javascript"></script>
<script src="js/scriptaculous.js?load=effects" type="text/javascript"></script>
<script src="js/lightbox.js" type="text/javascript"></script>
<script type="text/javascript" src="js/java.js"></script>
<?php
include("include/head.inc.php");
?>
</head>
<body>
<div id="container">
<div id='cssmenu'>
<?php
include("include/menu.inc.php");
?>
</div>
<div id="logo-wrap">
<div id="logo">
<?php
58

include("include/logo.inc.php");
?>
</div>
</div>
<!-- end header --><div id="header">
<div id="special_offers">
<!--flash image -->
</div>
</div><!-- end of header -->
<div id="content">
<div id="content_right">
<div id="content_right1">
<div id="page">
<!-- start content -->
<div class="post">
<div class="login_box1">
<h1 class="title"><font color="black"><?php echo $row['b_nm'];?></h1>
<div class="entry">
<?php
echo ' <hr color="purple">
Item Details
<hr color="purple">
<table bgcolor="#black">
<tr>
<td width="10%" rowspan="2">
<imgsrc="'.$row['b_img'].'" width="140" height="170">
</td>
</tr>
59

<tr>
<td width="50%" height="80%">
<table border="0" width="100%" height="100%">
<trvalign="top">
<td align="right" width="10%"><font color="black">NAME</td>
<td width="2%"> :</td>
<td align="left"><font color="black">'.$row['b_nm'].'</td>
</tr>
<tr>
<td align="right"><font color="black">ISBN:</td>
<td>: </td>
<td align="left"><font color="black">'.$row['b_isbn'].'</td>
</tr>
<tr>
<td align="right"><font color="black">Publisher </td>
<td>: </td>
<td align="left"><font color="black">'.$row['b_publisher'].'</td>
</tr>
<tr>
<td align="right"><font color="black"> Edition</td>
<td>: </td>
<td align="left"><font color="black">'.$row['b_edition'].'</td>
</tr>
<tr>
<td align="right"><font color="black">PAGES</td>
<td>: </td>
<td align="left"><font color="black">'.$row['b_page'].'</td>
</tr>
<tr>
<td align="right"><font color="black">PRICE</td>
<td>: </td>
<td align="left"><font color="black">'.$row['b_price'].'</td>
</tr>
</table>
60

</td>
</tr>
</table>
<table border="0" width="100%">
<tr>
<td><hr color="purple"></td>
</tr>
<tr align="center" bgcolor="#EEE9F3">
<td><font color="black">DESCRIPTION</td>
</tr>
<tr>
<td><hr color="purple"></td>
</tr>
</table>
'.$row['b_desc'].'
<tr><td colspan=1><hr color="purple"></td></tr>
<table border="0" width="100%">
<tr align="center">';
if(isset($_SESSION['status']))
{
echo '<td>
<ahref="process_cart.php?nm='.$row['b_nm'].'&cat='.$_GET['cat'].'&rate='.
$row['b_price'].'">
<imgsrc="images/addcart.jpg">
</a></td>';
}
else
{
echo '<td>
<button onclick="myFunction()">
<imgsrc="images/addcart.jpg">
</button>
61

<script>
function myFunction() {
alert("Please Login!!!!");
}
</script>
';
}
echo '</tr></table>';
?>
</div>
</div>
</div></div></div></div></div>
<!-- end content -->
<div id="content">
<div id="content_left">
<div class="content_left_section">
<!-- start sidebar -->
<div id="sidebar">
<?php
include("include/search.inc.php");
?>
</div>
<!-- end sidebar -->
</div></div>
</div>

<!-- end page -->

<!-- start footer -->


<div id="footer4-wrap">
<?php
include("include/footer.inc.php");
?>
</div>
</body>
</html>
62

4.1.6 Viewcart.php
<?phpsession_start();?>
<html>
<head>
<?php
include("include/head.inc.php");
?>
</head>
<body>
<div id="container">
<div id='cssmenu'>
<?php
include("include/menu.inc.php");
?>
</div>
<div id="logo-wrap">
<div id="logo">
<?php
include("include/logo.inc.php");
?>
</div>
<div id="header">
<div id="special_offers">
<!--flash image -->
</div>
</div><!-- end of header -->
<div id="content">
<div id="content_right">
<div id="content_right1">
<div id="page">
<!-- start content -->

63

<div class="post">
<form action="process_cart.php" method="POST">
<h1 class="title"><font color="black">Viewcart</h1>
<div class="entry">
<pre><?php
//

print_r($_SESSION);

?></pre>

<table width="100%" border="0" bgcolor="black">


<tr><td align="right">
<a href="" onclick="window.print()" class="btnbtn-info">
<imgsrc="images/print.jpg" width="40">
<font color="white">PRINT&nbsp&nbsp&nbsp&nbsp&nbsp
</a>

</tr><table width="100%" border="0">


<tr>
<Td><b><font color="black">No
<td><b><font color="black">Category
<td><b><font color="black">Product
<td><b><font color="black">Qty
<td><b><font color="black">Rate
<td><b><font color="black">Price
<td><b><font color="black">Delete
</tr>
<tr><td colspan="7"><hr style="border:1px Solid #a1a1a1;"></tr>
<?php
$tot = 0;
$i = 1;
64

if(isset($_SESSION['cart']))
{
foreach($_SESSION['cart'] as $id=>$x)
{
echo '
<tr>
<Td><font color="black">'.$i.'
<td><font color="black">'.$x['cat'].'
<td><font color="black">'.$x['nm'].'
<td><input type="text" size="2" value="'.$x['qty'].'" name="'.$id.'">
<td><font color="black">'.$x['rate'].'
<td><font color="black">'.($x['qty']*$x['rate']).'
<td><a href="process_cart.php?id='.$id.'"><font color="black">Delete</a>
</tr>
';
$tot = $tot + ($x['qty']*$x['rate']);
$i++;
}
}
?>
<tr><td colspan="7"><hr style="border:1px Solid #a1a1a1;"></tr>
<tr>
<td colspan="6" align="right">
<h4><font color="black">Total:</h4>
</td>
<td><h4><font color="black">Rs.<?php echo $tot; ?></h4></td>
</tr>
<tr><td colspan="7"><hr style="border:1px Solid #a1a1a1;"></tr>

65

<Br>
</table>
<br><br>
<?php
include("include/nbsp.inc.php");
?>
<input type="submit" value=" Re-Calculate " >
<a href="payment.php">
<input type="button" value=" NEXT " >

</a>

</form>
</div></div></div></div></div></div>
<div id="content">
<div id="content_left">
<div class="content_left_section">
<!-- start sidebar -->
<div id="sidebar">
<?php
include("include/search.inc.php");
?>
</div>
<!-- end sidebar -->
</div></div>
</div>

<!-- end page -->

<!-- start footer -->


<!-- start footer -->
<div id="footer4-wrap">
<?php
include("include/footer.inc.php");
?>
66

</div>
</body>
</html>

67

4.1.7 contactus.php
<?phpsession_start(); ?>
<html>
<head>
<?php
include("include/head.inc.php");
?>
</head>
<body>
<div id="container">
<div id='cssmenu'>
<?php
include("include/menu.inc.php");
?>
</div>
<div id="logo-wrap">
<div id="logo">
<?php
include("include/logo.inc.php");
?>
</div>
<div id="header">
<div id="special_offers">
<!--flash image -->
</div>
</div><!-- end of header -->
<div id="content">
<div id="content_left">
<div class="content_left_section">
<!-- start sidebar -->
68

<div id="sidebar">
<?php
include("include/search.inc.php");
?>
</div>
<!-- end sidebar -->
</div></div>
</div>
<div id="content_right">
<div id="content_right1">
<form action="process_contact.php" method="POST">
<h1 class="title" align="center"><font color="black">Contact us</h1>
<div class="entry" >

<br><font color="black">
<b>
&nbsp&nbsp&nbsp&nbsp
Name :
<br>
&nbsp&nbsp&nbsp&nbsp

<input type='text' name='nm' size=15>

<br><br><br>
&nbsp&nbsp&nbsp&nbsp
E-mail ID:<br>&nbsp&nbsp&nbsp&nbsp
<input type='text' name='email' size=35>
<br><br><br>
&nbsp&nbsp&nbsp&nbsp
Query:<br>
&nbsp&nbsp&nbsp&nbsp
<textarea cols="40" rows="10" name='query' ></textarea>
<br><br><br>
69

&nbsp&nbsp&nbsp&nbsp
<input type='submit' name='btn' value=' OK ' >
</form>
</div>
</div></div></div></div>
<!-- end content -->
<!-- start footer -->
<div id="footer3-wrap">
<?php
include("include/footer.inc.php");
?>
</div>
</body>
</html>

70

ADMIN
4.1.8 index.php
<?phpsession_start();
if(!(isset($_SESSION['status'])&& $_SESSION['unm']=="admin"))
{
header("location:../index.php");
}
?>
<html>
<head>
<?php
include("include/head.inc.php");
?>
</head>
<body>
<div id="container">
<div id='cssmenu'>
<?php
include("include/menu.inc.php");
?>
</div>
<div id="header">
<div id="special_offers">
<!--flash image
<div id="logo-wrap">
<div id="logo">
<?php
include("include/logo.inc.php");
?>
</div></div> --></div></div>
71

<div id="content">
<!-- start sidebar -->
</div></div></div>
<!-- start page -->
<div id="content_right">
<form>
<h1 class="title" align="center"><font color="black"> Welcome to Admin .....</h1>
<div class="entry">
<table>
<tr>
<td>
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbs
p
<imgsrc="images/logo/category.png" width="160" height="160">
</td>
<td>
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbs
p
<imgsrc="images/logo/books.jpg" width="160" height="160">
</td>
<td>
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbs
p
<imgsrc="images/logo/contactus.jpg" width="160" height="160">
</td>
<td>
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbs
p
72

<imgsrc="images/logo/user.jpg" width="160" height="160">


</tr>
<tr><td>
<a href="category.php">
<input type="button" name="t1" value="Categories">
</a>
<td><a href="addbook.php">
<input type="button" value="Books">
</a>
<td><a href="contact.php">
<input type="button" value="Contact">
</a>
<td><a href="user.php">
<input type="button" value="Users">
</a></tr></table>
</div></div></div>
<!-- end content -->
<!-- start footer -->
<div id="footer-wrap">
<?php
include("include/footer.inc.php");
?>
</div>
<!-- end footer -->
</body>
</html>

73

4.1.9 Category.php
<?phpsession_start();
if(!(isset($_SESSION['status'])&& $_SESSION['unm']=="admin"))
{
header("location:../index.php");
}
?>
<html>
<head>
<?php
include("include/head.inc.php");
?>
</head>
<body>
<div id="container">
<div id='cssmenu'>
<?php
include("include/menu.inc.php");
?>
</div>
<div id="header">
<div id="special_offers">
<!--flash image
<div id="logo-wrap">
<div id="logo">
<?php
include("include/logo.inc.php");
?>
</div></div> --></div></div>
<div id="content">
74

<!-- start sidebar -->


</div></div></div>
<!-- start page -->
<div id="content_right">
<form>
<h1 class="title" align="center"><font color="black"> Categories</h1>
<div class="entry">
<table>
<tr><td>
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbs
<imgsrc="images/logo/addbook.gif" width="160" height="160">
</td><td>
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbs
<imgsrc="images/logo/delbook.gif" width="160" height="160">
</td></tr><tr>
<td>
<a href="addbookcat.php">
<input type="button" name="t4" value="Add category">
</a>

<td>
<a href="delbook.php">
<input type="button" value="Del Category">
</a>
</tr></table></div></div></div>
<!-- end content -->
<!-- start footer -->
<div id="footer-wrap">
<?php
include("include/footer.inc.php");
75

?>
</div>
<!-- end footer -->
</body>
</html>

76

4.1.10 Addbook.php
<?phpsession_start();?>
<html>
<head>
<?php
include("include/head.inc.php");
?>
</head>
<body>
<div id="container">
<div id='cssmenu'>
<?php
include("include/menu.inc.php");
?>
</div>
<div id="header">
<div id="special_offers">
<!--flash image
<div id="logo-wrap">
<div id="logo">
<?php
include("include/logo.inc.php");
?>
</div></div> --></div></div>
<div id="content">
<!-- start sidebar -->
</div></div></div>
<!-- start page -->
<div id="content_right">

77

<div id="page">
<!-- start content -->
<div id="content">
<form action='process_addbook.php' method='POST' enctype="multipart/formdata">
<h1 class="title" align="center"><font color="black"> BOOK</h1>

&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
<b><font color="black">Book Name:</b><br>
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
<input type='text' name='name' size='40'>
<br><br>
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
<b>Category:</b><br>
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
<select style="width: 200px;" name="cat">
<?php
$link=mysql_connect("localhost","root","")or die("Can't Connect...");
mysql_select_db("shop",$link) or die("Can't Connect to Database...");
$query="select * from category ";
$res=mysql_query($query,$link);
while($row=mysql_fetch_assoc($res))
{
echo "<option disabled>".$row['cat_nm'];
$q2 = "select * from subcat where parent_id = ".$row['cat_id'];
$res2 = mysql_query($q2,$link) or die("Can't Execute Query..");
78

while($row2 = mysql_fetch_assoc($res2))
{
echo '<option value="'.$row2['subcat_id'].'"> ---> '.$row2['subcat_nm'];

}
}
mysql_close($link);
?>
</select>
<br><br>
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
<b>Description:</b><br>
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
<textarea cols="40" rows="6" name='description' ></textarea>
<br><br>
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
<b>Publisher:</b><br>
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
<input type='text' name='publisher' size='40'>
<br><br>
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
<b>Edition:</b><br>
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
<input type='text' name='edition' size='40'>
<br><br>
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
<b>ISBN:</b><br>
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
<input type='text' name='isbn' size='40'>
79

<br><br>
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
<b>PAGES:</b><br>
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
<input type='text' name='pages' size='40'>
<br><br>
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
<b>PRICE:</b><br>
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
<input type='text' name='price' size='40'>
<br><br>
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
<b>Image:</b><br>
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
<input type='file' name='img' size='35'>
<br><br>
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
<b>E-Book:</b><br>
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
<input type='file' name='ebook' size='35'>
<br><br>
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
<input type='submit' value=' OK ' >
</form>
</div>
</div>
</div>
<!-- end content -->
<!-- start sidebar -->
<!-- end sidebar -->
80

<div style="clear: both;">&nbsp;</div>


</div>
<!-- end page -->
<!-- start footer -->
<div id="footer-wrap">
<?php
include("include/footer.inc.php");
?>
</div>
<!-- end footer -->
</body>
</html>

81

4.1.11 delbook.php
<?phpsession_start();?>
<html>
<head>
<?php
include("include/head.inc.php");
?>
</head>
<body>
<div id="container">
<div id='cssmenu'>
<?php
include("include/menu.inc.php");
?>
</div>
<div id="header">
<div id="special_offers">
<!--flash image
<div id="logo-wrap">
<div id="logo">
<?php
include("include/logo.inc.php");
?>
</div></div> --></div></div>
<div id="content">

<!-- start sidebar -->


</div></div></div>
<!-- start page -->
<div id="content_right">
82

<div id="content">
<form action='process_delcategory.php' method='POST'>
<h1 class="title" align="center"><font color="black"> CATEGORY</h1>
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
<b>DELETE CATEGORY </b>
<br><br>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
<select style="width: 170px;" name="del">
<?php
$link=mysql_connect("localhost","root","")or die("Can't Connect...");
mysql_select_db("shop",$link) or die("Can't Connect to Database...");
$query="select * from category ";
$res=mysql_query($query,$link);
while($row=mysql_fetch_assoc($res))
{
echo "<option>".$row['cat_nm'];
}
mysql_close($link);
?>
</select>
&nbsp&nbsp&nbsp&nbsp
<input type='submit' value=' DELETE '>
<br><br>
<form action='process_delsubcategory.php' method='POST'>
<hr>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
<b>DELETE SUB CATEGORY </b>
<br><br>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
<select style="width: 170px;" name="subcatnm">
<?php
$link=mysql_connect("localhost","root","")or die("Can't Connect...");
mysql_select_db("shop",$link) or die("Can't Connect to Database...");
$query="select * from category ";
83

$res=mysql_query($query,$link);
while($row=mysql_fetch_assoc($res))
{
echo "<option>".$row['cat_nm'];
$qq = "select * from subcat where parent_id=".$row['cat_id'];
$ress = mysql_query($qq,$link) or die("wrong delete subcat query..");
while($roww = mysql_fetch_assoc($ress))
{
echo "<option value='".$roww['subcat_id']."'> ---> ".$roww['subcat_nm'];
}
}
mysql_close($link);
?>
</select>
&nbsp&nbsp&nbsp&nbsp
<input type='submit' value=' DELETE '>
</form>
<br>
<hr>
<imgsrc="images/logo/1.JPG" width="1160" height="460">
</div>
</div>
</div>
<!-- end content -->
84

<!-- start sidebar -->


<!-- end sidebar -->
<div style="clear: both;">&nbsp;</div>
</div>
<!-- end page -->
<!-- start footer -->
<div id="footer-wrap">
<?php
include("include/footer.inc.php");
?>
</div>
<!-- end footer -->
</body>
</html>

85

4.1.12 Contact.php
<?php
session_start();
$link=mysql_connect("localhost","root","")or die("Can't Connect...");
mysql_select_db("shop",$link) or die("Can't Connect to Database...");
$q="select * from contact";
$res=mysql_query($q,$link) or die("Can't Execute Query...");
mysql_close($link);
?>
<html>
<head>
<?php
include("include/head.inc.php");
?>
</head>
<body>
<div id="container">
<div id='cssmenu'>
<?php
include("include/menu.inc.php");
?>
</div>
<div id="header">
<div id="special_offers">
<!--flash image
<div id="logo-wrap">
<div id="logo">
<?php
include("include/logo.inc.php");
86

?>
</div></div> --></div></div>
<div id="content">
<!-- start sidebar -->
</div></div></div>
<!-- start page -->
<div id="content_right">
<div id="content">
<form>
<h1 class="title" align="center"><font color="black">CONTACT</h1>
<div class="entry">
<table border='1' WIDTH='100%' class="a">
<tr>
<td WIDTH='10%'><b><u>NO</u></b>
<TD WIDTH='20%'><b><u>NAME</u></b>
<TD WIDTH='20%'><b><u>EMAIL</u></b>
<TD WIDTH='50%'><b><u>QUERY</u></b>
<TD WIDTH='25%'><b><u>DELETE</u></b>
</tr>
<?php
$count=1;
while($row=mysql_fetch_assoc($res))
{
echo '<tr>
<td>'.$count.'
<td>'.$row['con_nm'].'
<td>'.$row['con_email'].'
<td>'.$row['con_query'].'

87

<td><a href="process_del_contact.php?sid='.
$row['con_id'].'"><imgsrc="images/drop.png" ></a>

</tr>';
$count++;
}
?>
</TABLE></div></div></div>
<div style="clear: both;">&nbsp;</div>
</div>
<div id="footer-wrap">
<?php
include("include/footer.inc.php");
?></div>
</body>
</html>

88

4.2 SYSTEM TESTING


INTRODUCTION:
Software testing is an investigation conducted to provide stakeholders with
information about the quality of the product or service under test. Software testing can
also provide an objective, independent view of the software to allow the business to
appreciate and understand the risks of software implementation. Test techniques
include, but are not limited to the process of executing a program or application with
the intent of finding software bugs (errors or other defects).
Software testing can be stated as the process of validating and verifying that a
computer program/application/product:
1. Meets the requirements that guided its design and development,
Works as expected,
Can be implemented with the same characteristics, and satisfies the needs of
stakeholders.
Testing can never completely identify all the defects within software. Instead, it
furnishes a criticism or comparison that compares the state and behavior of the
product against oraclesprinciples or mechanisms by which someone might
recognize a problem. These oracles may include (but are not limited to)
specifications, contracts, comparable products, past versions of the same product,
inferences about intended or expected purpose, user or customer expectations,
relevant standards, applicable laws, or other criteria.
A primary purpose of testing is to detect software failures so that defects may be
discovered and corrected. Testing cannot establish that a product functions properly
under all conditions but can only establish that it does not function properly under
specific conditions. scope of software testing often includes examination of code as
well as execution of that code in various environments and conditions as well as
examining the aspects of code: does it do what it is supposed to do and do what it
needs to do. In the current culture of software development, a testing organization
may be separate from the development team. There are various roles for testing team
members. Information derived from software testing may be used to correct the
process by which software is developed.
89

A very fundamental problem with software testing is that testing under


all combinations of inputs and preconditions (initial state) is not feasible, even with a
simple product. This means that the number of defects in a software product can be
very large and defects that occur infrequently are difficult to find in testing. More
significantly, non-functional dimensions of quality (how it is supposed to be versus
what it is supposed to do-) usability, reliability, performance, scalability- can be
highly subjective; something that constitutes sufficient value to one person may be
intolerable to another.
4.2.1TYPES OF TESTING
1. Unit Testing
2. System Testing
3. Integration testing

Fig 4.1 (Types of Testing) of Bookstore Management System

90

4.2.1.1 UNIT TESTING


In computer programming, unit testing is a method by which individual units
of source code, sets of one or more computer program modules together with
associated control data, usage procedures, and operating procedures are tested to
determine if they are fit for use. Intuitively, one can view a unit as the smallest
testable part of an application. In procedural, a unit could be an entire module, but is
more commonly an individual function or procedure. In object-oriented programming,
a unit is often an entire interface, such as a class, but could be an individual method.
Unit tests are created by programmers or occasionally by white box testers during the
development process.
Ideally, each test case is independent from the others. Substitutes such as method
stubs, objects, fakes, and test harnesses can be used to assist testing a module in
isolation. Unit tests are typically written and run by software developers to ensure that
code meets its design and behaves as intended. Its implementation can vary from
being very manual (pencil and paper)to being formalized as part of build automation.
Unit testing provides a sort of living documentation of the system. Developers
looking to learn what functionality is provided by a unit and how to use it can look at
the unit tests to gain a basic understanding of the unit's API.
Unit test cases embody characteristics that are critical to the success of the unit. These
characteristics can indicate appropriate/inappropriate use of a unit as well as negative
behaviors that are to be trapped by the unit. A unit test case, in and of itself,
documents these critical characteristics, although many software development
environments do not rely solely upon code to document the product in development.
By contrast, ordinary narrative documentation is more susceptible to drifting from the
implementation of the program and will thus become outdated (e.g., design
changes, feature creep, relaxed practices in keeping documents up-to-date).
he goal of unit testing is to isolate each part of the program and show that the
individual parts are correct. A unit test provides a strict, written contract that the piece
of code must satisfy. As a result, it affords several benefits. Unit testing allows the
programmer to refactor code at a later date, and make sure the module still works
correctly (e.g., in regression testing). The procedure is to write test cases for

91

all functions and methods so that whenever a change causes a fault, it can be quickly
identified.
Readily available unit tests make it easy for the programmer to check whether a piece
of code is still working properly.
In continuous unit testing environments, through the inherent practice of sustained
maintenance, unit tests will continue to accurately reflect the intended use of the
executable and code in the face of any change. Depending upon established
development practices and unit test coverage, up-to-the-second accuracy can be
maintained.

Fig 4.2(Unit Testing) of Bookstore Management System

92

4.2.1.2 SYSTEM TESTING


System testing of software or hardware is testing conducted on a complete, integrated
system to evaluate the system's compliance with its specified requirements. System
testing falls within the scope of black box testing, and as such, should require no
knowledge of the inner design of the code or logic.
As a rule, system testing takes, as its input, all of the "integrated" software
components that have passed integration testing and also the software system itself
integrated with any applicable hardware system(s). The purpose of integration testing
is to detect any inconsistencies between the software units that are integrated together
(called assemblages) or between any of the assemblages and the hardware. System
testing is a more limited type of testing; it seeks to detect defects both within the
"inter-assemblages" and also within the system as a whole.
System testing is performed on the entire system in the context of a Functional
Requirement Specification(s) (FRS) and/or a System Requirement Specification
(SRS). System testing tests not only the design, but also the behavior and even the
believed expectations of the customer. It is also intended to test up to and beyond the
bounds defined in the software/hardware requirements specification(s).
The process of performing a variety of tests on a system to explore functionality or to
identify problems. System testing is usually required before and after a system is put
in place. A series of systematic procedures are referred to while testing is being
performed. These procedures tell the tester how the system should perform and
where common mistakes may be found. Testers usually try to "break the system" by
entering data that

may

cause

the

system

to

malfunction

or return incorrect information. For example, a tester may put in a city in a search
engine designed to only accept states, to see how the system will respond to the
incorrect input.

93

Fig 4.3(System Testing) of Bookstore Management System

94

4.2.1.3 INTEGRATION_TESTING
Integration testing (sometimes called integration and testing, abbreviated I&T) is the
phase in software testing in which individual software modules are combined and
tested as a group. It occurs after unit testing and before validation testing. Integration
testing takes as its input modules that have been unit tested, groups them in larger
aggregates, applies tests defined in an integration test plan to those aggregates, and
delivers as its output the integrated system ready for system testing. The purpose of
integration

testing

is

to

verify

functional,

performance,

and

reliability requirements placed on major design items. These "design items", i.e.
assemblages (or groups of units), are exercised through their interfaces using black
box testing, success and error cases being simulated via appropriate parameter and
data inputs. Simulated usage of shared data areas and inter-process communication is
tested and individual subsystems are exercised through their input interface. Test
cases are constructed to test whether all the components within assemblages interact
correctly, for example across procedure calls or process activations, and this is done
after testing individual modules, i.e. unit testing. The overall idea is a "building block"
approach, in which verified assemblages are added to a verified base which is then
used to support the integration testing of further assemblages.
Some different types of integration testing are big bang, top-down, and bottom-up.
Other Integration Patterns are: Collaboration Integration, Backbone Integration, Layer
Integration, Client/Server Integration, Distributed Services Integration and Highfrequency Integration.
Need for integration testing:1. A Module in general is designed by an individual software developer who
understanding and programming logic may differ from other programmers.
Integration testing becomes necessary to verify the software modules work in
unity
2. At the time of module development, there wide chances of change in
requirements by the clients. These new requirements may not be unit tested and
hence integration testing becomes necessary.
3. Interfaces of the software modules with the database could be erroneous
95

4. External Hardware interfaces, if any, could be erroneous Inadequate exception


handling could cause issues.
4.2.2 TEST CASE:
A test case, in software engineering, is a set of conditions or variables under which a
tester will determine whether an application, software system or one of its features is
working as it was originally established for it to do. The mechanism for determining
whether a software program or system has passed or failed such a test is known as
a test oracle. It may take many test cases to determine that a software program or
system is considered sufficiently scrutinized to be released. Test cases are often
referred to as test scripts, particularly when written - when they are usually collected
into test suites.
4.2.2.1 TEST CASE ID: 1

Table 4.1(Test Id 1) of Bookstore Management System

96

4.2.2.2 Test Case ID: 2

Table 4.2(Test Id 2) of Bookstore Management System

4.3 TESTING STRATEGIES:4.3.1 BLACK BOX TESTING


Black-box testing is a method of software testing that examines the functionality of an
application (e.g. what the software does) without peering into its internal structures or
workings (see white-box testing). This method of test can be applied to virtually every
level of software testing: unit, integration, system and acceptance Test cases are
generally derived from external descriptions of the software, including specifications,
requirements

and

design

parameters.

Although

the

tests

used

are

primarily functional in nature, non-functional tests may also be used. The test
designer selects both valid and invalid inputs and determines the correct output
without any knowledge of the test object's internal structure.
Typical black-box test design techniques include:
Decision table testing
All-pairs testing
State transition tables

97

Equivalence partitioning
4.3.2 WHITE BOX TESTING
White-box testing (also known as clear box testing, glass box testing, transparent box
testing, and structural testing) is a method of testing software that tests internal
structures or workings of an application, as opposed to its functionality (i.e. blackboxtesting). In white-box testing an internal perspective of the system, as well as
programming skills, are used to design test cases. The tester chooses inputs to exercise
paths through the code and determine the appropriate outputs. This is analogous to
testing nodes in a circuit, e.g. in-circuit testing (ICT).
While white-box testing can be applied at the unit, integration and system levels of
the software testing process, it is usually done at the unit level. It can test paths within
a unit, paths between units during integration, and between subsystems during a
systemlevel test. Though this method of test design can uncover many errors or
problems, it might not detect unimplemented parts of the specification or missing
requirements.
White-box test design techniques include:
Control flow testing
Data flow testing
Branch testing
Path testing
Statement coverage
Decision coverage
White-box testing is a method of testing the application at the level of the source
code. The test cases are derived through the use of the design techniques mentioned
above control flow testing, data flow testing, branch testing, path testing, statement
coverage and decision coverage as well as modified condition/decision coverage.
White-box testing is the use of these techniques as guidelines to create an error free
environment by examining any fragile code. These White-box testing techniques are
the building blocks of white-box testing, whose essence is the careful testing of the
application at the source code level to prevent any hidden errors later on. These
different techniques exercise every visible path of the source code to minimize errors
98

and create an error-free environment. The whole point of white-box testing is the
ability to know which line of the code is being executed and being able to identify
what the correct output should be.
Approach adopted:In our minor project i.e. Bookstore Management system we are using BLACK
BOX TESTING. In this testing we will use boundary value analysis and
Equivalence partitioning.

99