este es el listado de productos
listado_productos.php
Código PHP:
<?php require_once('Connections/listproduc.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
mysql_select_db($database_listproduc, $listproduc);
$query_Recordset1 = "SELECT * FROM categoria";
$Recordset1 = mysql_query($query_Recordset1, $listproduc) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?><!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>Untitled Document</title>
</head>
<body>
<?php do { ?>
<table width="61%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="5%"> </td>
<td colspan="2"><?php
echo $row_Recordset1['nombre']; ?> </td>
</tr>
<?php mysql_select_db($database_listproduc, $listproduc);
$query_Recordset2 = "SELECT * FROM producto WHERE PKIDCAT =".$row_Recordset1['PKID'];
$Recordset2 = mysql_query($query_Recordset2, $listproduc) or die(mysql_error());
$totalRows_Recordset2 = mysql_num_rows($Recordset2);
while($prod=mysql_fetch_assoc($Recordset2)){?>
<tr>
<td> </td>
<td> </td>
<td>
<a href="ficha.php?PKID=<?php echo $prod['PKID']; ?>"><?php echo $prod['nombre']; }?>
</a></td>
</tr>
</table>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
<? } ?>
</body>
</html>
<?php
mysql_free_result($Recordset1);
mysql_free_result($Recordset2);
?>
ficha.php
Código PHP:
<?php require_once('Connections/listproduc.php');
$date=date('Y-n-d G:i:s');
@$PKID=$_REQUEST['PKID'];
$sql="SELECT * FROM producto WHERE PKID= $PKID";
$sql_exec=mysql_query($sql);
while($row=mysql_fetch_assoc($sql_exec)){
$PKID = $row['PKID'];
$PKIDCAT = $row['PKIDCAT'];
$nombre = $row['nombre'];
$descripcion = $row['descripcion'];
$imagen = $row['imagen'];
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- saved from url=(0014)about:internet -->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>.. // O C E A N P L A S T // ..</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
td img {display: block;}body {
background-color: #010101;
}
.style1 { font-family: Tahoma;
font-size: 10px;
color: #B9CBD9;
}
.style2 {color: #FAFAF8}
.style4 {color: #B4C7D6}
</style>
<!--Fireworks CS3 Dreamweaver CS3 target. Created Mon Sep 17 15:30:44 GMT-0400 2007-->
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
<link href="css/estilos.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
<!-- fwtable fwsrc="layout2.png" fwpage="quienes somos" fwbase="quienes.jpg" fwstyle="Dreamweaver" fwdocid = "857149810" fwnested="0" -->
<tr>
<td><img src="images/spacer.gif" width="112" height="1" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="113" height="1" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="9" height="1" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="88" height="1" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="26" height="1" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="79" height="1" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="13" height="1" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="101" height="1" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="10" height="1" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="96" height="1" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="113" height="1" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="1" height="1" border="0" alt="" /></td>
</tr>
<tr>
<td colspan="11" rowspan="3" align="left" valign="top"><table width="760" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#FFFFFF"><table width="760" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="167" valign="top"><script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','167','height','388','src','menu','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','menu' ); //end AC code
</script><noscript><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="167" height="388">
<param name="movie" value="menu.swf" />
<param name="quality" value="high" />
<embed src="menu.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="167" height="388"></embed>
</object></noscript></td>
<td width="593" align="left" valign="top"><table width="593" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="103" align="left" valign="top"><table width="593" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="317" height="103" rowspan="2"><img src="images/producto.jpg" width="317" height="103" /></td>
<td width="276" align="left" valign="top"><img src="images/productoinicio.jpg" width="276" height="30" /></td>
</tr>
<tr>
<td align="left" valign="top"><img src="images/productofon1.jpg" width="276" height="73" /></td>
</tr>
</table></td>
</tr>
<tr>
<td align="left" valign="top" bgcolor="#000000"><table width="586" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="images/productoinfoA.jpg" width="586" height="20" /></td>
</tr>
<tr>
<td><img src="images/productoinfoB.jpg" width="586" height="9" /></td>
</tr>
<tr>
<td><table width="586" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="30" height="194" background="images/productointe1.jpg"> </td>
<td bgcolor="#D7E2E6"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><?=$nombre?></td>
<td rowspan="2"><img src="<?=$imagen?>" width="150" height="150" alt="" /></td>
</tr>
<tr>
<td><?=$descripcion?></td>