File: /home/ednermusika/ednergranados.com/admin/Nueva carpeta/clientes_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_clientes = "SELECT cli_consecutivo, usu_consecutivo, cli_nombre, DATE_FORMAT(cli_fecha, '%d/%m/%Y' ) as cli_fecha, cli_rutalogo, CASE cli_activo WHEN 1 THEN 'SI' WHEN 0 THEN 'NO' END as cli_activo FROM clientes ORDER BY cli_fecha DESC";
$clientes = mysql_query($query_clientes, $con_edner) or die(mysql_error());
$row_clientes = mysql_fetch_assoc($clientes);
$totalRows_clientes = mysql_num_rows($clientes);
?>
<?php
$suc_consecutivo = 1;
?>
<!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>Clientes</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>Clientes</h1></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><a href="clientes_altas.php" class="ligas_menu_principal">« Nuevo Cliente »</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="0" cellpadding="0">
<tr>
<td width="18%" height="20"><h4>Cliente</h4></td>
<td width="28%"><h4>Logotipo</h4></td>
<td width="18%"><h4>Fecha</h4></td>
<td width="11%"><h4>Activo</h4></td>
<td width="8%"> </td>
<td width="7%"> </td>
<td width="10%"> </td>
</tr>
<tr>
<td colspan="7"><hr class="hr_principal" /></td>
</tr>
<?php do { ?>
<?php if ($totalRows_clientes > 0) { // Show if recordset not empty ?>
<tr>
<td><p><?php echo $row_clientes['cli_nombre']; ?></p></td>
<td><img src="../<?php echo $row_clientes['cli_ruta'].$row_clientes['cli_rutalogo']; ?>" border="1" /></td>
<td><p><?php echo $row_clientes['cli_fecha']; ?></p></td>
<td><p><?php echo $row_clientes['cli_activo']; ?></p></td>
<td><a href="clientes_cambios.php?cli_consecutivo=<?php echo $row_clientes['cli_consecutivo']; ?>" class="ligas_menu_interiores">« Modificar »</a></td>
<td><a href="clientes_bajas.php?cli_consecutivo=<?php echo $row_clientes['cli_consecutivo']; ?>" class="ligas_ajustes">« Eliminar »</a></td>
</tr>
<?php } // Show if recordset not empty ?>
<tr>
<td colspan="7"> </td>
</tr>
<tr>
<td colspan="7"><hr width="100%" size="1" class="hr_renglones" /></td>
</tr>
<?php } while ($row_clientes = mysql_fetch_assoc($clientes)); ?>
</table>
</blockquote>
</body>
</html>
<?php
mysql_free_result($clientes);
?>