SlideShare a Scribd company logo
1 of 17
Code:
Index.php
<?php include_once("header.php"); ?>
<link href="pagecss.css" rel="stylesheet" type="text/css" />
<tr>
<td align="left" valign="top" style="padding-right:8px; padding-
left:8px;"><table width="100%" border="0" align="center"
cellpadding="0" cellspacing=" 0">
<tr>
<td width="22%" height="495" align="left" valign="top"><?php
include_once("categories.php"); ?></td>
<td width="53%" align="left" valign="top"><table width="99%"
border="0" align="center" cellpadding="0" cellspacing=" 0">
<tr>
<td height="45" colspan="3" align="left" valign="middle"
style="padding-left:10px;" class="header12">Featured Products</td>
</tr>
<?php $tbl_name="products"; //your table name
// How many adjacent pages should be shown on each side?
$adjacents = 2;
$query = "SELECT COUNT(*) as num from
$tbl_name where feature=1 and parent_id=0";
$total_pages = mysql_fetch_array(mysql_query($query));
$total_pages = $total_pages[num];
/* Setup vars for query. */
$targetpage = "index.php"; //your file name (the name of this file)
$limit = 12;
/*echo $_GET['page'];
exit(); */ //how many
items to show per page
$page = $_GET['page'];
if($page)
$start = ($page - 1) * $limit; //first item to display
on this page
else
$start = 0;
//if no page var is given, set start to 0
/* Get data. */
$pro = "SELECT * FROM $tbl_name where feature=1 and parent_id=0
order by pid DESC LIMIT $start, $limit";
$prores = mysql_query($pro);
/* Setup page vars for display. */
if ($page == 0) $page = 1; //if no page var
is given, default to 1.
$prev = $page - 1;
//previous page is page - 1
$next = $page + 1; //next
page is page + 1
$lastpage = ceil($total_pages/$limit); //lastpage is = total
pages / items per page, rounded up.
$lpm1 = $lastpage - 1; //last
page minus 1
/*
Now we apply our rules and draw the pagination object.
We're actually saving the code to a variable in case we want to
draw it more than once.
*/
$pagination = "";
if($lastpage > 1)
{
$pagination .= "<div class="pagination">";
//previous button
if ($page > 1)
$pagination.= "<a href="$targetpage?page=$prev">«
previous</a>";
else
$pagination.= "<span class="disabled">«
previous</span>";
//pages
if ($lastpage < 7 + ($adjacents * 2)) //not enough pages to bother
breaking it up
{
for ($counter = 1; $counter <= $lastpage; $counter++)
{
if ($counter == $page)
$pagination.= "<span
class="current">$counter</span>";
else
$pagination.= "<a
href="$targetpage?page=$counter">$counter</a>";
}
}
elseif($lastpage > 5 + ($adjacents * 2)) //enough pages to hide
some
{
//close to beginning; only hide later pages
if($page < 1 + ($adjacents * 2))
{
for ($counter = 1; $counter < 4 + ($adjacents * 2);
$counter++)
{
if ($counter == $page)
$pagination.= "<span
class="current">$counter</span>";
else
$pagination.= "<a
href="$targetpage?page=$counter">$counter</a>";
}
$pagination.= "...";
$pagination.= "<a
href="$targetpage?page=$lpm1">$lpm1</a>";
$pagination.= "<a
href="$targetpage?page=$lastpage">$lastpage</a>";
}
//in middle; hide some front and some back
elseif($lastpage - ($adjacents * 2) > $page && $page >
($adjacents * 2))
{
$pagination.= "<a
href="$targetpage?page=1">1</a>";
$pagination.= "<a
href="$targetpage?page=2">2</a>";
$pagination.= "...";
for ($counter = $page - $adjacents; $counter <=
$page + $adjacents; $counter++)
{
if ($counter == $page)
$pagination.= "<span
class="current">$counter</span>";
else
$pagination.= "<a
href="$targetpage?page=$counter">$counter</a>";
}
$pagination.= "...";
$pagination.= "<a
href="$targetpage?page=$lpm1">$lpm1</a>";
$pagination.= "<a
href="$targetpage?page=$lastpage">$lastpage</a>";
}
//close to end; only hide early pages
else
{
$pagination.= "<a
href="$targetpage?page=1">1</a>";
$pagination.= "<a
href="$targetpage?page=2">2</a>";
$pagination.= "...";
for ($counter = $lastpage - (2 + ($adjacents * 2));
$counter <= $lastpage; $counter++)
{
if ($counter == $page)
$pagination.= "<span
class="current">$counter</span>";
else
$pagination.= "<a
href="$targetpage?page=$counter">$counter</a>";
}
}
}
//next button
if ($page < $counter - 1)
$pagination.= "<a href="$targetpage?page=$next">next
»</a>";
else
$pagination.= "<span class="disabled">next »</span>";
$pagination.= "</div>n";
} if($total_pages<=0)
{ ?>
<tr>
<td align="left" valign="top">&nbsp;</td>
</tr>
<tr>
<td align="center" valign="top"><strong>There Are No
Featured Products</strong> </td>
</tr>
<tr>
<td align="left" valign="top">&nbsp;</td>
</tr>
<?php } else {
$cnt=0;
while($prorow=mysql_fetch_array($prores)) {
$cnt++;
if($cnt%1==1)
{
echo "<tr>";
}
if($cnt%3==1)
{
echo "</tr><tr><td align="right" colspan="3">&nbsp;</td></tr><tr>";
}
?>
<form action="addtocart.php" name="formno<?php echo
$prorow['pid']; ?>" method="post">
</form>
<td align="left" valign="top"><table width="165" border="0"
align="left" cellpadding="0" cellspacing=" 0">
<tr>
<td align="left" valign="top" style="border:#CCCCCC
solid 1px;"><table width="95%" border="0" align="center"
cellpadding="0" cellspacing=" 0">
<tr>
<td height="20" colspan="2" align="center"
valign="middle"><a href="detailspage.php?productid=<?php echo
$prorow['pid']; ?>&category_id=<?php echo $prorow['cat_id']; ?>"
class="menu7"> <?php echo $prorow['pname'] ?></a></td>
</tr>
<tr>
<td colspan="2" align="center" valign="middle"><img
src="images/products/detail/<?php echo $prorow['pid']; ?>.jpg"
width="100" height="137" /></td>
</tr>
<tr>
<td height="25" align="center" valign="middle"
class="text_2" colspan="2">&nbsp;</td>
</tr>
<tr>
<td height="25" align="center" valign="middle"
class="text_2" colspan="2"><a href="detailspage.php?productid=<?php
echo $prorow['pid']; ?>&category_id=<?php echo $prorow['cat_id'];
?>"><img src="images/details.gif" width="64" height="21" border="0"
/></a></td>
</tr>
<tr>
<td height="8" colspan="2" align="center"
valign="middle"><input type="hidden" name="prodid" value="<?php
echo $prorow['pid']; ?>" />
<input type="hidden" name="prodprice"
value="<?php echo $prorow['oprice'] ?> " />
<input type="hidden" name="prodname"
value="<?php echo $prorow['pname']; ?>" />
<input id="qty" size="1" name="qty" type="hidden"
value="1" />
</td>
</tr>
</table></td>
</tr>
</table></td>
<?php } }?>
<tr>
<td align="right" colspan="3">&nbsp;</td>
</tr>
<tr>
<td align="right" colspan="3"><?php=$pagination?></td>
</tr>
</table></td>
<td width="25%" align="left" valign="top"><?php
include_once("rightside.php"); ?>
<form name="form1" method="post" action="">
<p>&nbsp;</p>
<p>&nbsp; </p>
</form></td>
</tr>
</table></td>
</tr>
<?php include_once("footer.php"); ?>
Header.php
<?php session_start();
ob_start();
include_once("dbconnect.php");
?>
<link rel="shortcut icon" href="images/images.jpeg" />
<!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>Welcome to Furniture Showroom</title>
<style type="text/css">
<!--
body,td,th {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
color: #333333;
}
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
-->
</style>
<link href="css.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/quenty.js"></script>
<script>
function searchvalid()
{
var d=document.king;
if(d.keyword.value=="")
{
alert("Please Enter Keyword For Search");
d.keyword.focus();
return false;
}
return true;
}
</script>
</head>
<body>
<table width="980" border="0" align="center" cellpadding="0"
cellspacing=" 0">
<tr>
<td height="1034" align="left" valign="top"><table width="100%"
border="0" cellspacing=" 0" cellpadding="0">
<tr>
<td height="70" align="left" valign="middle"><table width="100%"
border="0" cellspacing=" 0" cellpadding="0">
<tr>
<td width="69%" height="110" rowspan="2" align="left"
valign="middle"><img src="images/logo3.jpg" width="640"
height="100" /></td>
<td height="64" colspan="2" align="left" valign="middle"><table
width="60%" border="0" align="center" cellpadding="0" cellspacing="
0">
<tr>
<td width="19%" rowspan="2" align="center"
valign="middle"><img src="images/shopping-cart.gif" width="13"
height="11" /></td>
<td width="81%" height="25" align="left" valign="middle"
class="spacer"> Shopping Cart:</td>
</tr>
<tr>
<td align="left" valign="top">now in your cart<a
href="shoppingcart.php" class="menu1"><strong> <?php echo
$_SESSION['count']; ?> items</strong></a></td>
</tr>
</table></td>
</tr>
<tr>
<form action="search.php" method="get" name="king">
<td width="24%" align="left" valign="middle" style="padding-
left:20px;"><strong>Search :</strong>
<input type="text" name="keyword" value="<?php echo
$_GET['keyword'];?>" /></td>
<td width="7%" align="left" valign="middle"><input
type="image" src="images/go_botton.gif" width="50" height="23"
onClick="return searchvalid();" /></td>
</form>
</tr>
</table></td>
</tr>
<tr> <?php if($_SESSION['compuserid']=="") { ?>
<a href="contactus.php" class="menu7">Contact
us </a>
<?php } else { ?>
<a href="logout.php" class="menu7">Logout </a>
<?php } ?>
</td>
</tr>
</table>
<a href="contactus.php" class="menu7"> </a> </td>
</tr>
<tr>
<td align="left" valign="top" style="padding-top:10px;"><table
width="100%" border="0" cellspacing=" 0" cellpadding="0">
<tr>
<td width="75%" align="left" valign="top"><table width="129%"
border="0" align="center" cellpadding="0" cellspacing=" 0">
<tr>
<td width="1%" align="left" valign="top"><img
src="images/flash_td_top_left.gif" width="6" height="6" /></td>
<td width="98%" align="left" valign="top"
background="images/flash_td_top_spacer.gif"> </td>
<td width="1%" align="left" valign="top"><img
src="images/flash_td_top_right.gif" width="6" height="6" /></td>
</tr>
<tr>
<td align="left" valign="top"
background="images/flash_td_left_spacer.gif"> </td>
<td align="left" valign="top"></td>
<td align="left" valign="top"
background="images/flash_td_right_spacer.gif"> </td>
</tr>
<tr>
<td align="left" valign="top"><img
src="images/flash_td_bottom_left.gif" width="6" height="6" /></td>
<td align="left" valign="top"
background="images/flash_td_bottom_spacer.gif"></td>
<td align="left" valign="top"><img
src="images/flash_td_bottom_right.gif" width="6" height="6" /></td>
</tr>
</table></td>
<td width="25%" align="left" valign="top"><table width="100%"
border="0" cellspacing=" 0" cellpadding="0">
<tr>
<td align="center" valign="middle"><a href="#"></a></td>
</tr>
<tr>
<td height="5" align="center" valign="middle"> </td>
</tr>
<tr>
<td align="center" valign="middle"><a href="#"></a></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
Coding part

More Related Content

What's hot

What's hot (20)

Emmet cheat-sheet
Emmet cheat-sheetEmmet cheat-sheet
Emmet cheat-sheet
 
Your Custom WordPress Admin Pages Suck
Your Custom WordPress Admin Pages SuckYour Custom WordPress Admin Pages Suck
Your Custom WordPress Admin Pages Suck
 
Html
HtmlHtml
Html
 
FamilySearch Reference Client
FamilySearch Reference ClientFamilySearch Reference Client
FamilySearch Reference Client
 
Date difference[1]
Date difference[1]Date difference[1]
Date difference[1]
 
Stole16
Stole16Stole16
Stole16
 
SULTHAN's - PHP MySQL programs
SULTHAN's - PHP MySQL programsSULTHAN's - PHP MySQL programs
SULTHAN's - PHP MySQL programs
 
Earn money with banner and text ads for Clickbank
Earn money with banner and text ads for ClickbankEarn money with banner and text ads for Clickbank
Earn money with banner and text ads for Clickbank
 
Defenders quest cheat.dfq
Defenders quest cheat.dfqDefenders quest cheat.dfq
Defenders quest cheat.dfq
 
DiplomadoIABMex_Equipo6
DiplomadoIABMex_Equipo6DiplomadoIABMex_Equipo6
DiplomadoIABMex_Equipo6
 
Concern of Web Application Security
Concern of Web Application SecurityConcern of Web Application Security
Concern of Web Application Security
 
LessCSS Presentation @ April 2015 GTALUG Meeting
LessCSS Presentation @ April 2015 GTALUG MeetingLessCSS Presentation @ April 2015 GTALUG Meeting
LessCSS Presentation @ April 2015 GTALUG Meeting
 
Anko試食会
Anko試食会Anko試食会
Anko試食会
 
The Benefits of Juicing
The Benefits of JuicingThe Benefits of Juicing
The Benefits of Juicing
 
Who Needs Ruby When You've Got CodeIgniter
Who Needs Ruby When You've Got CodeIgniterWho Needs Ruby When You've Got CodeIgniter
Who Needs Ruby When You've Got CodeIgniter
 
Tmx9
Tmx9Tmx9
Tmx9
 
The provision of the caller to Allah
The provision of the caller to AllahThe provision of the caller to Allah
The provision of the caller to Allah
 
Blog skins396734
Blog skins396734Blog skins396734
Blog skins396734
 
Sencha Touch
Sencha TouchSencha Touch
Sencha Touch
 
[ WrocLoveRb 2012] user perspective testing using ruby
[ WrocLoveRb 2012] user perspective testing using ruby[ WrocLoveRb 2012] user perspective testing using ruby
[ WrocLoveRb 2012] user perspective testing using ruby
 

Similar to Coding part

Practical PHP by example Jan Leth-Kjaer
Practical PHP by example   Jan Leth-KjaerPractical PHP by example   Jan Leth-Kjaer
Practical PHP by example Jan Leth-KjaerCOMMON Europe
 
Ôn tập KTTMDT
Ôn tập KTTMDTÔn tập KTTMDT
Ôn tập KTTMDTmrcoffee282
 
Java.script
Java.scriptJava.script
Java.scriptg Nama
 
Ex[1].3 php db connectivity
Ex[1].3 php db connectivityEx[1].3 php db connectivity
Ex[1].3 php db connectivityMouli Chandira
 
Grok Drupal (7) Theming
Grok Drupal (7) ThemingGrok Drupal (7) Theming
Grok Drupal (7) ThemingPINGV
 
Second raidteam.html
Second raidteam.htmlSecond raidteam.html
Second raidteam.htmlCraig Farish
 
网站无障碍阅读知识
网站无障碍阅读知识网站无障碍阅读知识
网站无障碍阅读知识ppanyong
 
网站无障碍阅读知识
网站无障碍阅读知识网站无障碍阅读知识
网站无障碍阅读知识ppanyong
 
Vaadin Components @ Angular U
Vaadin Components @ Angular UVaadin Components @ Angular U
Vaadin Components @ Angular UJoonas Lehtinen
 
jQuery: Tips, tricks and hints for better development and Performance
jQuery: Tips, tricks and hints for better development and PerformancejQuery: Tips, tricks and hints for better development and Performance
jQuery: Tips, tricks and hints for better development and PerformanceJonas De Smet
 
Facebook.html
Facebook.htmlFacebook.html
Facebook.htmladmin999
 
zynga-online.facebook.html
zynga-online.facebook.htmlzynga-online.facebook.html
zynga-online.facebook.htmladmin999
 

Similar to Coding part (20)

Php
PhpPhp
Php
 
Practical PHP by example Jan Leth-Kjaer
Practical PHP by example   Jan Leth-KjaerPractical PHP by example   Jan Leth-Kjaer
Practical PHP by example Jan Leth-Kjaer
 
php Mailer
php Mailerphp Mailer
php Mailer
 
Ôn tập KTTMDT
Ôn tập KTTMDTÔn tập KTTMDT
Ôn tập KTTMDT
 
Theme
ThemeTheme
Theme
 
shoubox script
shoubox scriptshoubox script
shoubox script
 
Php (1)
Php (1)Php (1)
Php (1)
 
Java.script
Java.scriptJava.script
Java.script
 
Ex[1].3 php db connectivity
Ex[1].3 php db connectivityEx[1].3 php db connectivity
Ex[1].3 php db connectivity
 
Grok Drupal (7) Theming
Grok Drupal (7) ThemingGrok Drupal (7) Theming
Grok Drupal (7) Theming
 
Second raidteam.html
Second raidteam.htmlSecond raidteam.html
Second raidteam.html
 
网站无障碍阅读知识
网站无障碍阅读知识网站无障碍阅读知识
网站无障碍阅读知识
 
网站无障碍阅读知识
网站无障碍阅读知识网站无障碍阅读知识
网站无障碍阅读知识
 
Send.php
Send.phpSend.php
Send.php
 
Vaadin Components @ Angular U
Vaadin Components @ Angular UVaadin Components @ Angular U
Vaadin Components @ Angular U
 
jQuery: Tips, tricks and hints for better development and Performance
jQuery: Tips, tricks and hints for better development and PerformancejQuery: Tips, tricks and hints for better development and Performance
jQuery: Tips, tricks and hints for better development and Performance
 
Zero to SOLID
Zero to SOLIDZero to SOLID
Zero to SOLID
 
1cst
1cst1cst
1cst
 
Facebook.html
Facebook.htmlFacebook.html
Facebook.html
 
zynga-online.facebook.html
zynga-online.facebook.htmlzynga-online.facebook.html
zynga-online.facebook.html
 

Recently uploaded

WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 

Recently uploaded (20)

WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 

Coding part

  • 1. Code: Index.php <?php include_once("header.php"); ?> <link href="pagecss.css" rel="stylesheet" type="text/css" /> <tr> <td align="left" valign="top" style="padding-right:8px; padding- left:8px;"><table width="100%" border="0" align="center" cellpadding="0" cellspacing=" 0"> <tr> <td width="22%" height="495" align="left" valign="top"><?php include_once("categories.php"); ?></td> <td width="53%" align="left" valign="top"><table width="99%" border="0" align="center" cellpadding="0" cellspacing=" 0"> <tr> <td height="45" colspan="3" align="left" valign="middle" style="padding-left:10px;" class="header12">Featured Products</td> </tr> <?php $tbl_name="products"; //your table name // How many adjacent pages should be shown on each side? $adjacents = 2; $query = "SELECT COUNT(*) as num from $tbl_name where feature=1 and parent_id=0"; $total_pages = mysql_fetch_array(mysql_query($query)); $total_pages = $total_pages[num];
  • 2. /* Setup vars for query. */ $targetpage = "index.php"; //your file name (the name of this file) $limit = 12; /*echo $_GET['page']; exit(); */ //how many items to show per page $page = $_GET['page']; if($page) $start = ($page - 1) * $limit; //first item to display on this page else $start = 0; //if no page var is given, set start to 0 /* Get data. */ $pro = "SELECT * FROM $tbl_name where feature=1 and parent_id=0 order by pid DESC LIMIT $start, $limit"; $prores = mysql_query($pro); /* Setup page vars for display. */ if ($page == 0) $page = 1; //if no page var is given, default to 1. $prev = $page - 1; //previous page is page - 1 $next = $page + 1; //next page is page + 1
  • 3. $lastpage = ceil($total_pages/$limit); //lastpage is = total pages / items per page, rounded up. $lpm1 = $lastpage - 1; //last page minus 1 /* Now we apply our rules and draw the pagination object. We're actually saving the code to a variable in case we want to draw it more than once. */ $pagination = ""; if($lastpage > 1) { $pagination .= "<div class="pagination">"; //previous button if ($page > 1) $pagination.= "<a href="$targetpage?page=$prev">« previous</a>"; else $pagination.= "<span class="disabled">« previous</span>"; //pages if ($lastpage < 7 + ($adjacents * 2)) //not enough pages to bother breaking it up { for ($counter = 1; $counter <= $lastpage; $counter++) {
  • 4. if ($counter == $page) $pagination.= "<span class="current">$counter</span>"; else $pagination.= "<a href="$targetpage?page=$counter">$counter</a>"; } } elseif($lastpage > 5 + ($adjacents * 2)) //enough pages to hide some { //close to beginning; only hide later pages if($page < 1 + ($adjacents * 2)) { for ($counter = 1; $counter < 4 + ($adjacents * 2); $counter++) { if ($counter == $page) $pagination.= "<span class="current">$counter</span>"; else $pagination.= "<a href="$targetpage?page=$counter">$counter</a>"; } $pagination.= "...";
  • 5. $pagination.= "<a href="$targetpage?page=$lpm1">$lpm1</a>"; $pagination.= "<a href="$targetpage?page=$lastpage">$lastpage</a>"; } //in middle; hide some front and some back elseif($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2)) { $pagination.= "<a href="$targetpage?page=1">1</a>"; $pagination.= "<a href="$targetpage?page=2">2</a>"; $pagination.= "..."; for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++) { if ($counter == $page) $pagination.= "<span class="current">$counter</span>"; else $pagination.= "<a href="$targetpage?page=$counter">$counter</a>"; } $pagination.= "..."; $pagination.= "<a href="$targetpage?page=$lpm1">$lpm1</a>";
  • 6. $pagination.= "<a href="$targetpage?page=$lastpage">$lastpage</a>"; } //close to end; only hide early pages else { $pagination.= "<a href="$targetpage?page=1">1</a>"; $pagination.= "<a href="$targetpage?page=2">2</a>"; $pagination.= "..."; for ($counter = $lastpage - (2 + ($adjacents * 2)); $counter <= $lastpage; $counter++) { if ($counter == $page) $pagination.= "<span class="current">$counter</span>"; else $pagination.= "<a href="$targetpage?page=$counter">$counter</a>"; } } } //next button if ($page < $counter - 1)
  • 7. $pagination.= "<a href="$targetpage?page=$next">next »</a>"; else $pagination.= "<span class="disabled">next »</span>"; $pagination.= "</div>n"; } if($total_pages<=0) { ?> <tr> <td align="left" valign="top">&nbsp;</td> </tr> <tr> <td align="center" valign="top"><strong>There Are No Featured Products</strong> </td> </tr> <tr> <td align="left" valign="top">&nbsp;</td> </tr> <?php } else { $cnt=0; while($prorow=mysql_fetch_array($prores)) { $cnt++; if($cnt%1==1) { echo "<tr>"; } if($cnt%3==1) {
  • 8. echo "</tr><tr><td align="right" colspan="3">&nbsp;</td></tr><tr>"; } ?> <form action="addtocart.php" name="formno<?php echo $prorow['pid']; ?>" method="post"> </form> <td align="left" valign="top"><table width="165" border="0" align="left" cellpadding="0" cellspacing=" 0"> <tr> <td align="left" valign="top" style="border:#CCCCCC solid 1px;"><table width="95%" border="0" align="center" cellpadding="0" cellspacing=" 0"> <tr> <td height="20" colspan="2" align="center" valign="middle"><a href="detailspage.php?productid=<?php echo $prorow['pid']; ?>&category_id=<?php echo $prorow['cat_id']; ?>" class="menu7"> <?php echo $prorow['pname'] ?></a></td> </tr> <tr> <td colspan="2" align="center" valign="middle"><img src="images/products/detail/<?php echo $prorow['pid']; ?>.jpg" width="100" height="137" /></td> </tr> <tr> <td height="25" align="center" valign="middle" class="text_2" colspan="2">&nbsp;</td> </tr>
  • 9. <tr> <td height="25" align="center" valign="middle" class="text_2" colspan="2"><a href="detailspage.php?productid=<?php echo $prorow['pid']; ?>&category_id=<?php echo $prorow['cat_id']; ?>"><img src="images/details.gif" width="64" height="21" border="0" /></a></td> </tr> <tr> <td height="8" colspan="2" align="center" valign="middle"><input type="hidden" name="prodid" value="<?php echo $prorow['pid']; ?>" /> <input type="hidden" name="prodprice" value="<?php echo $prorow['oprice'] ?> " /> <input type="hidden" name="prodname" value="<?php echo $prorow['pname']; ?>" /> <input id="qty" size="1" name="qty" type="hidden" value="1" /> </td> </tr> </table></td> </tr> </table></td> <?php } }?> <tr> <td align="right" colspan="3">&nbsp;</td> </tr> <tr> <td align="right" colspan="3"><?php=$pagination?></td>
  • 10. </tr> </table></td> <td width="25%" align="left" valign="top"><?php include_once("rightside.php"); ?> <form name="form1" method="post" action=""> <p>&nbsp;</p> <p>&nbsp; </p> </form></td> </tr> </table></td> </tr> <?php include_once("footer.php"); ?> Header.php <?php session_start(); ob_start(); include_once("dbconnect.php"); ?> <link rel="shortcut icon" href="images/images.jpeg" /> <!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>
  • 11. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859- 1" /> <title>Welcome to Furniture Showroom</title> <style type="text/css"> <!-- body,td,th { font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #333333; } body { margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; } --> </style> <link href="css.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="js/quenty.js"></script> <script> function searchvalid() { var d=document.king; if(d.keyword.value=="") { alert("Please Enter Keyword For Search");
  • 12. d.keyword.focus(); return false; } return true; } </script> </head> <body> <table width="980" border="0" align="center" cellpadding="0" cellspacing=" 0"> <tr> <td height="1034" align="left" valign="top"><table width="100%" border="0" cellspacing=" 0" cellpadding="0"> <tr> <td height="70" align="left" valign="middle"><table width="100%" border="0" cellspacing=" 0" cellpadding="0"> <tr> <td width="69%" height="110" rowspan="2" align="left" valign="middle"><img src="images/logo3.jpg" width="640" height="100" /></td> <td height="64" colspan="2" align="left" valign="middle"><table width="60%" border="0" align="center" cellpadding="0" cellspacing=" 0"> <tr>
  • 13. <td width="19%" rowspan="2" align="center" valign="middle"><img src="images/shopping-cart.gif" width="13" height="11" /></td> <td width="81%" height="25" align="left" valign="middle" class="spacer"> Shopping Cart:</td> </tr> <tr> <td align="left" valign="top">now in your cart<a href="shoppingcart.php" class="menu1"><strong> <?php echo $_SESSION['count']; ?> items</strong></a></td> </tr> </table></td> </tr> <tr> <form action="search.php" method="get" name="king"> <td width="24%" align="left" valign="middle" style="padding- left:20px;"><strong>Search :</strong> <input type="text" name="keyword" value="<?php echo $_GET['keyword'];?>" /></td> <td width="7%" align="left" valign="middle"><input type="image" src="images/go_botton.gif" width="50" height="23" onClick="return searchvalid();" /></td> </form> </tr> </table></td> </tr> <tr> <?php if($_SESSION['compuserid']=="") { ?> <a href="contactus.php" class="menu7">Contact
  • 14. us </a> <?php } else { ?> <a href="logout.php" class="menu7">Logout </a> <?php } ?> </td> </tr> </table> <a href="contactus.php" class="menu7"> </a> </td> </tr> <tr> <td align="left" valign="top" style="padding-top:10px;"><table width="100%" border="0" cellspacing=" 0" cellpadding="0"> <tr> <td width="75%" align="left" valign="top"><table width="129%" border="0" align="center" cellpadding="0" cellspacing=" 0"> <tr> <td width="1%" align="left" valign="top"><img src="images/flash_td_top_left.gif" width="6" height="6" /></td> <td width="98%" align="left" valign="top" background="images/flash_td_top_spacer.gif"> </td> <td width="1%" align="left" valign="top"><img src="images/flash_td_top_right.gif" width="6" height="6" /></td> </tr> <tr> <td align="left" valign="top" background="images/flash_td_left_spacer.gif"> </td> <td align="left" valign="top"></td>
  • 15. <td align="left" valign="top" background="images/flash_td_right_spacer.gif"> </td> </tr> <tr> <td align="left" valign="top"><img src="images/flash_td_bottom_left.gif" width="6" height="6" /></td> <td align="left" valign="top" background="images/flash_td_bottom_spacer.gif"></td> <td align="left" valign="top"><img src="images/flash_td_bottom_right.gif" width="6" height="6" /></td> </tr> </table></td> <td width="25%" align="left" valign="top"><table width="100%" border="0" cellspacing=" 0" cellpadding="0"> <tr> <td align="center" valign="middle"><a href="#"></a></td> </tr> <tr> <td height="5" align="center" valign="middle"> </td> </tr> <tr> <td align="center" valign="middle"><a href="#"></a></td> </tr> </table></td> </tr>