Ver Mensaje Individual
  #4 (permalink)  
Antiguo 04/11/2015, 18:04
bouake2
 
Fecha de Ingreso: noviembre-2015
Ubicación: Neptunia, Canelones
Mensajes: 12
Antigüedad: 8 años, 6 meses
Puntos: 0
Respuesta: Página Web con envío de datos por Dreamweaver

aquí va el código de la pág catalogo:

<?php require_once('Connections/empresa.php'); ?>
<?php
//initialize the session
if (!isset($_SESSION)) {
session_start();
}

// ** Logout the current user. **
$logoutAction = $_SERVER['PHP_SELF']."?doLogout=true";
if ((isset($_SERVER['QUERY_STRING'])) && ($_SERVER['QUERY_STRING'] != "")){
$logoutAction .="&". htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_GET['doLogout'])) &&($_GET['doLogout']=="true")){
//to fully log out a visitor we need to clear the session varialbles
$_SESSION['MM_Username'] = NULL;
$_SESSION['MM_UserGroup'] = NULL;
$_SESSION['PrevUrl'] = NULL;
unset($_SESSION['MM_Username']);
unset($_SESSION['MM_UserGroup']);
unset($_SESSION['PrevUrl']);

$logoutGoTo = "index.php";
if ($logoutGoTo) {
header("Location: $logoutGoTo");
exit;
}
}
?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$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;
}
}

$currentPage = $_SERVER["PHP_SELF"];

$maxRows_empresa = 1;
$pageNum_empresa = 0;
if (isset($_GET['pageNum_empresa'])) {
$pageNum_empresa = $_GET['pageNum_empresa'];
}
$startRow_empresa = $pageNum_empresa * $maxRows_empresa;

mysql_select_db($database_empresa, $empresa);
$query_empresa = "SELECT * FROM productos";
$query_limit_empresa = sprintf("%s LIMIT %d, %d", $query_empresa, $startRow_empresa, $maxRows_empresa);
$empresa = mysql_query($query_limit_empresa, $empresa) or die(mysql_error());
$row_empresa = mysql_fetch_assoc($empresa);

if (isset($_GET['totalRows_empresa'])) {
$totalRows_empresa = $_GET['totalRows_empresa'];
} else {
$all_empresa = mysql_query($query_empresa);
$totalRows_empresa = mysql_num_rows($all_empresa);
}
$totalPages_empresa = ceil($totalRows_empresa/$maxRows_empresa)-1;

$queryString_empresa = "";
if (!empty($_SERVER['QUERY_STRING'])) {
$params = explode("&", $_SERVER['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_empresa") == false &&
stristr($param, "totalRows_empresa") == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_empresa = "&" . htmlentities(implode("&", $newParams));
}
}
$queryString_empresa = sprintf("&totalRows_empresa=%d%s", $totalRows_empresa, $queryString_empresa);
?>
<!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>Documento sin título</title>
<style type="text/css">
.Estilo1 { font-family: Verdana, Arial, Helvetica, sans-serif;
font-weight: bold;
font-style: italic;
color: #0000FF;
}
.Estilo2 { font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 24px;
font-weight: bold;
font-style: italic;
color: #FF0000;
}
.Estilo3 { color: #FFFFFF;
font-style: italic;
font-weight: bold;
font-family: Arial, Helvetica, sans-serif;
}
.Anterior {
color: #F00;
}
.Siguiente {
color: #F00;
}
</style>
<script type="text/javascript">
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
</script>
</head>

<body onload="MM_preloadImages('button1_2.gif','button2_ 2.gif','button3_2.gif','button4_2.gif','button5_2. gif','button7_2.gif','button6_2.gif')">
<table width="931" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="357" rowspan="2"><img src="fastimport.jpg" alt="fastimport" width="368" height="137" /></td>
<td width="109" height="94"><div align="center"><a href="index.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image4','','button1_2.g if',1)"><img src="button1.gif" width="99" height="21" id="Image4" /></a> </div></td>
<td width="117"><div align="center"><a href="catalogo.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image5','','button2_2.g if',1)"><img src="button2.gif" width="103" height="30" id="Image5" /></a> </div></td>
<td width="116"><div align="center"><a href="ingreso_clientes.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image6','','button3_2.g if',1)"><img src="button3.gif" width="103" height="30" id="Image6" /></a> </div></td>
<td width="117"><div align="center"><a href="login.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image7','','button4_2.g if',1)"><img src="button4.gif" width="103" height="30" id="Image7" /></a> </div></td>
<td width="115"><div align="center"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image8','','button5_2.g if',1)"><img src="button5.gif" width="103" height="30" id="Image8" /></a> </div></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><em><strong>USUARIO:</strong></em></td>
<td><?php
if(isset($_SESSION['MM_Username'])){
echo $_SESSION['MM_Username'];
}
?>&nbsp;</td>
<td><a href="<?php echo $logoutAction ?>" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image9','','button7_2.g if',1)"><img src="button7.gif" width="99" height="21" id="Image9" /></a></td>
</tr>
</table>
<table width="931" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td bgcolor="#0000CC">&nbsp;</td>
</tr>
</table>
<p>&nbsp;</p>
<div align="center">
<?php do { ?>
<table width="490" border="0" align="center">
<tr>
<td width="179"><strong>Número ID:</strong></td>
<td width="301"><?php echo $row_empresa['Id']; ?></td>
</tr>
<tr>
<td><strong>Foto:</strong></td>
<td><img src="<?php echo $row_empresa['Foto']; ?>" alt="foto" /></td>
</tr>
<tr>
<td><strong>Nombre:</strong></td>
<td><?php echo $row_empresa['Nombre']; ?></td>
</tr>
<tr>
<td><strong>Descripción:</strong></td>
<td><?php echo $row_empresa['Descripcion']; ?></td>
</tr>
<tr>
<td><strong>Precio:</strong></td>
<td><?php echo $row_empresa['Precio']; ?></td>
</tr>
<tr>
<td><strong>Fecha de ingreso:</strong></td>
<td><?php echo $row_empresa['Fecha']; ?></td>
</tr>
<tr>
<td><strong>Stock:</strong></td>
<td><?php echo $row_empresa['Stock']; ?></td>
</tr>
<tr>
<td><div align="center">
<?php if ($pageNum_empresa > 0) { // Show if not first page ?>
<strong class="Anterior"><em><a href="<?php printf("%s?pageNum_empresa=%d%s", $currentPage, max(0, $pageNum_empresa - 1), $queryString_empresa); ?>">&lt;&lt; Anterior</a></em></strong>
<?php } // Show if not first page ?>
</div></td>
<td><div align="center">
<?php if ($pageNum_empresa < $totalPages_empresa) { // Show if not last page ?>
<strong class="Siguiente"><em><a href="<?php printf("%s?pageNum_empresa=%d%s", $currentPage, min($totalPages_empresa, $pageNum_empresa + 1), $queryString_empresa); ?>">Siguiente &gt;&gt;</a></em></strong>
<?php } // Show if not last page ?>
</div></td>
</tr>
</table>
<?php } while ($row_empresa = mysql_fetch_assoc($empresa)); ?>
</div>
<p align="center"><a href="ventas.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image9','','button6_2.g if',1)"><img src="button6.gif" width="103" height="30" id="Image" /></a> </p>
<p>&nbsp; </p>
</body>
</html>
<?php
mysql_free_result($empresa);
?>