File: /home/ednermusika/ednergranados.com/admin/testimonios_admin.php
<?php require_once('../Connections/con_edner.php'); ?>
<?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;
}
}
mysql_select_db($database_con_edner, $con_edner);
$query_testimonios = "SELECT tes_consecutivo, usu_consecutivo, tes_descripcion, tes_autor, tes_ruta, tes_imagen, tes_orden, CASE tes_activo WHEN 1 THEN 'SI' WHEN 0 THEN 'NO' END as tes_activo FROM testimonio ORDER BY tes_orden ASC";
$testimonios = mysql_query($query_testimonios, $con_edner) or die(mysql_error());
$row_testimonios = mysql_fetch_assoc($testimonios);
$totalRows_testimonios = mysql_num_rows($testimonios);
?>
<!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>Untitled Document</title>
<link href="css/admin.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><h1>Testimonios</h1></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><a href="testimonios_altas.php" class="ligas_menu_principal">« Nuevo Testimonio »</a></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
<tr>
<td><hr class="hr_principal" /></td>
</tr>
</table>
<blockquote>
<table width="100%" border="0" cellspacing="4" cellpadding="0">
<tr>
<td width="28%" height="20"><h4>Descripción</h4></td>
<td width="21%"><h4>Imagen</h4></td>
<td width="18%"><h4>Autor</h4></td>
<td width="9%"><h4>Orden</h4></td>
<td width="9%"><h4>Activo</h4></td>
<td width="8%"> </td>
<td width="7%"> </td>
</tr>
<tr>
<td colspan="9"><hr class="hr_principal" /></td>
</tr>
<?php do { ?>
<?php if ($totalRows_testimonios > 0) { // Show if recordset not empty ?>
<tr>
<td><p><?php echo $row_testimonios['tes_descripcion']; ?></p></td>
<td><img src="../<?php echo $row_testimonios['tes_ruta'].$row_testimonios['tes_imagen']; ?>" border="1" /></td>
<td><p><?php echo $row_testimonios['tes_autor']; ?></p></td>
<td><p><?php echo $row_testimonios['tes_orden']; ?></p></td>
<td><p><?php echo $row_testimonios['tes_activo']; ?></p></td>
<td><a href="testimonios_cambios.php?tes_consecutivo=<?php echo $row_testimonios['tes_consecutivo']; ?>" class="ligas_menu_interiores">« Modificar »</a></td>
<td><a href="testimonios_bajas.php?tes_consecutivo=<?php echo $row_testimonios['tes_consecutivo']; ?>" class="ligas_ajustes">« Eliminar »</a></td>
</tr>
<?php } // Show if recordset not empty ?>
<tr>
<td colspan="9"> </td>
</tr>
<tr>
<td colspan="9"><hr width="100%" size="1" class="hr_renglones" /></td>
</tr>
<?php } while ($row_testimonios = mysql_fetch_assoc($testimonios)); ?>
</table>
</blockquote>
</body>
</html>
<?php
mysql_free_result($testimonios);
?>