2º Formulario (anuncio_usuario.php)
Código PHP:
Ver originalonce('../Connections/contactos.php'); ?>
<?php
}
$MM_authorizedUsers = "";
$MM_donotCheckaccess = "true";
// *** Restrict Access To Page: Grant or deny access to this page
function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {
// For security, start by assuming the visitor is NOT authorized.
$isValid = False;
// When a visitor has logged into this site, the Session variable MM_Username set equal to their username.
// Therefore, we know that a user is NOT logged in if that Session variable is blank.
// Besides being logged in, you may restrict access to only certain users based on an ID established when they login.
// Parse the strings into arrays.
$arrUsers = Explode(",", $strUsers); $arrGroups = Explode(",", $strGroups); $isValid = true;
}
// Or, you may restrict access to only certain users based on their username.
$isValid = true;
}
if (($strUsers == "") && true) {
$isValid = true;
}
}
return $isValid;
}
$MM_restrictGoTo = "usuario.php";
if (!((isset($_SESSION['MM_Username'])) && (isAuthorized
("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) { $MM_qsChar = "?";
$MM_referrer = $_SERVER['PHP_SELF'];
if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&"; $MM_referrer .= "?" . $QUERY_STRING;
$MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer); header("Location: ". $MM_restrictGoTo); }
?>
<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
}
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_usuar = 6;
$pageNum_usuar = 0;
if (isset($_GET['pageNum_usuar'])) { $pageNum_usuar = $_GET['pageNum_usuar'];
}
$startRow_usuar = $pageNum_usuar * $maxRows_usuar;
$colname_usuar = "-1";
if (isset($_SESSION['idempleado'])) { $colname_usuar = $_SESSION['idempleado'];
}
$query_usuar = sprintf("SELECT * FROM contactos WHERE idempleado = %s ORDER BY fechaentrada DESC", GetSQLValueString
($colname_usuar, "int")); $query_limit_usuar = sprintf("%s LIMIT %d, %d", $query_usuar, $startRow_usuar, $maxRows_usuar);
if (isset($_GET['totalRows_usuar'])) { $totalRows_usuar = $_GET['totalRows_usuar'];
} else {
}
$totalPages_usuar = ceil($totalRows_usuar/$maxRows_usuar)-1;
$queryString_usuar = "";
if (!empty($_SERVER['QUERY_STRING'])) { $params = explode("&", $_SERVER['QUERY_STRING']); foreach ($params as $param) {
if (stristr($param, "pageNum_usuar") == false && stristr($param, "totalRows_usuar") == false) { }
}
if (count($newParams) != 0) { }
}
$queryString_usuar = sprintf("&totalRows_usuar=%d%s", $totalRows_usuar, $queryString_usuar); ?>
...
</p>
<p> </p>
</div>
</div>
<div id="mainContent">
<div align="center">
<table width="696" border="0">
<tr>
<td height="28" colspan="2" bgcolor="#006699"><div align="center"><strong>Referencia</strong></div></td>
<td colspan="3" bgcolor="#006699"><div align="left"><strong> Tipo zapato</strong></div></td>
</tr>
<?php do { ?>
<tr>
<td width="57" rowspan="2" bgcolor="#CCCCCC" style="color: #000"><div align="center"><?php echo $row_usuar['idempleado']; ?></div></td>
<td width="46" rowspan="2" bgcolor="#CCCCCC" style="color: #000"><div align="center"><a href="<?php echo $row_usuar['foto1']; ?><? echo $registro['img']; ?>" target="_blank"><img src="<?php echo $row_usuar['foto1']; ?><? echo $registro['img']; ?>" alt="foto usuario" width="37" height="35" border="0" /></a></div></td>
<td colspan="3" bgcolor="#CCCCCC" style="color: #000; font-weight: bold;"><div align="left"> <?php echo $row_usuar['tituloanuncio']; ?></div> <div align="center"></div></td>
</tr>
<tr>
<td width="428" bgcolor="#CCCCCC" style="color: #000"><div align="left" style="font-size: x-small"> Publicado el <?php echo $row_usuar['fechaentrada']; ?></div></td>
<td width="77" bgcolor="#CCCCCC" style="color: #000"><div align="center">modificar</div></td>
<td width="66" bgcolor="#CCCCCC"><div align="center"><a href="anuncio_eliminar_confirmar.php?cod=<?php echo $row_usuar['idempleado']; ?>">eliminar</a></div></td>
</tr>
<tr>
<td colspan="2" style="color: #000"> </td>
<td style="color: #000"> </td>
<td style="color: #000"> </td>
<td> </td>
</tr>
</table>
</div>
<div align="center"></div>
<div align="center">
<div align="center" style="font-size: small">
<p>Registros
<?php echo ($startRow_usuar + 1) ?> a
<?php echo min($startRow_usuar + $maxRows_usuar, $totalRows_usuar) ?> de
<?php echo $totalRows_usuar ?></p>
</div>
<table border="0">
<tr>
<td><?php if ($pageNum_usuar > 0) { // Show if not first page ?>
<a href="<?php printf("%s?pageNum_usuar=%d%s", $currentPage, 0, $queryString_usuar); ?>"><img src="First.gif" border="0" /></a>
<?php } // Show if not first page ?></td>
<td><?php if ($pageNum_usuar > 0) { // Show if not first page ?>
<a href="<?php printf("%s?pageNum_usuar=%d%s", $currentPage, max(0, $pageNum_usuar - 1), $queryString_usuar); ?>"><img src="Previous.gif" border="0" /></a>
<?php } // Show if not first page ?></td>
<td><?php if ($pageNum_usuar < $totalPages_usuar) { // Show if not last page ?>
<a href="<?php printf("%s?pageNum_usuar=%d%s", $currentPage, min($totalPages_usuar, $pageNum_usuar + 1), $queryString_usuar); ?>"><img src="Next.gif" border="0" /></a>
<?php } // Show if not last page ?></td>
<td><?php if ($pageNum_usuar < $totalPages_usuar) { // Show if not last page ?>
<a href="<?php printf("%s?pageNum_usuar=%d%s", $currentPage, $totalPages_usuar, $queryString_usuar); ?>"><img src="Last.gif" border="0" /></a>
<?php } // Show if not last page ?></td>
</tr>
</table>
<p align="right" style="color: #00F; font-weight: bold;"> </p>
</div>
<div align="center"></div>
</div>
</div>
</body>
</html>
<?php
?>