Ver Mensaje Individual
  #14 (permalink)  
Antiguo 03/09/2011, 14:43
raulfonck24
 
Fecha de Ingreso: septiembre-2011
Mensajes: 5
Antigüedad: 12 años, 7 meses
Puntos: 0
Respuesta: Ventana de confirmación antes de eliminar un registro

echenme a mi tambien una mano p:

les dejo mi codigo

<?php
$connect=mysql_connect("localhost","root","");
$db=mysql_select_db('carrito');
$consulta=mysql_query("SELECT *FROM productos ");
?>
<style type="text/css">
<!--
body {
background-color: #FFFFFF;
}
.Estilo5 {font-size: 12px; color: #FFFFFF; }
.Estilo6 {color: #FFFFFF}
.Estilo12 {
color: #FFFFFF;
font-size: 16px;
font-weight: bold;
}
.Estilo13 {color: #FFFFFF; font-weight: bold; }
a:link {
color: #FFFFFF;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #FFFFFF;
}
a:hover {
text-decoration: none;
color: #FFFFFF;
}
a:active {
text-decoration: none;
color: #FFFFFF;
}
-->
</style>
<div align="center" class="Estilo13">LISTADO DE PRODUCTOS </div>
<table width="800" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<th width="244" scope="col"><strong><span class="Estilo6"><a href="administrativo/administracion.php">Men&uacute;</a></span></strong></th>
<th width="375" valign="top" scope="col"><div align="right"></div></th>
<th width="222" scope="col"><div align="left">
<form id="form1" name="form1" method="post" action="ver_borrar_modifi2.php">
<label></label>
<input name="buscar" type="text" id="busqueda" />
<input type="submit" name="Submit" value="Buscar" />
</form>
</div></th>
</tr>
</table>

<th colspan="6" scope="col"><table width="150" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<th scope="col"><table width="801" border="1" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="119" bgcolor="#002b5e"><div align="center"><strong><span class="Estilo6">Producto</span></strong></div></td>
<td width="119" bgcolor="#002B5E"><div align="center" class="Estilo6"><strong>Imagen</strong></div></td>
<td width="112" bgcolor="#002b5e"><div align="center"><strong><span class="Estilo6">Marca</span></strong></div></td>
<td width="141" bgcolor="#002b5e"><div align="center" class="Estilo12">Descripci&oacute;n</div></td>
<td width="81" bgcolor="#002b5e"><div align="center"><strong><span class="Estilo6">Precio</span></strong></div></td>
<td width="117" bgcolor="#002b5e"><div align="center"><strong><span class="Estilo6">Modificar</span></strong></div></td>
<td width="96" bgcolor="#002b5e"><div align="center"><strong><span class="Estilo6">Eliminar</span></strong></div></td>
</tr>
</table>
<?php

while($mostrar=mysql_fetch_array($consulta))
{
$id=$mostrar['id'];
$nombre=$mostrar['nombre'];
$imagen=$mostrar['imagen'];

$eliminar="<a href='javascript:mi_alerta()'>Eliminar</a>";




?>
<table width="800" border="1" align="center" cellspacing="0">
<tr>
<th width="116" bgcolor="#001837" scope="col">&nbsp;<span class="Estilo5"><?php echo $id ?></span></th>
<th width="116" height="23" bgcolor="#FFFFFF" scope="col"><?php echo '<img src="'.$mostrar['imagen'].'"width="100"/>' ?>&nbsp;
<th width="110" bgcolor="#001837" scope="col">&nbsp;<span class="Estilo5"><?php echo $nombre ?></span></th>
<th width="140" bgcolor="#001837" scope="col">&nbsp;<span class="Estilo5"></span></th>
<th width="78" bgcolor="#001837" scope="col">&nbsp;<span class="Estilo5"></span></th>
<th width="116" bgcolor="#001837" scope="col">&nbsp;</th>
<th width="94" bgcolor="#001837" scope="col">&nbsp;<?php echo $eliminar ?> </th>
</tr>
<?php

}
?>
</table></th>
</tr>
</table></th>

<head>
<script language="Javascript">
function mi_alerta()
{
confirmar=confirm("Esta Usted seguro que desea eliminar este producto");

if (confirmar)
{
location.href='confirmar_eliminacion.php?imagen=$i magen & id_sub=$id_sub';

}


}
</script>
</head>