<?php
if (isset($_SESSION['usuario'])){
$user=$_SESSION['usuario'];
}
else{
?>
<script>
location.href="index.php?errorusuario=3";
</script>
<?php }
?>
<!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>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
-->
</style>
<link href="ucaestilos.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.Estilo1 {font-size: 14px}
-->
</style>
</head>

<body>
  <table width="950" border="0" align="center">
    <tr>
      <td><p class="style10">Proveedores</p>
      </td>
    </tr>
    <tr>
      <td><table width="100%" height="0" border="0" cellpadding="0" cellspacing="5">
          <tr>
            <td width="8%" valign="top"><form id="form2" name="form2" method="post" action="main.php?a=71">
                <input name="Submit2" type="submit" class="boton2" value="Nuevo">
            </form></td>
            <td width="92%" valign="top">&nbsp;</td>
          </tr>
          <tr>
            <td colspan="3" align="center" valign="top"><hr width="100%" size="1" noshade="noshade" color="#0D3356"></td>
          </tr>
      </table></td>
    </tr>
  </table>
  <table width="950" border="0" align="center">
    <tr>
      <td>
	  <?php
echo "<table align='center' cellpadding='2' class='tablaBordes'>";
echo "<tr class='tablaCabecera' align='center'>";

echo "<td>ID</td>";


echo "<td>Nombre</td>";
echo "<td>Contacto</td>";
echo "<td>Direcci&oacute;n</td>";
echo "<td>Tel&eacute;fono</td>";
echo "<td>Correo</td>";
echo "<td>Editar</td>";
echo "<td>Eliminar</td>";

echo "</tr>";
include ("conexion.php");
$cons="SELECT idProveedor,nombre,contacto,direccion,telefono,correo FROM proveedor ORDER BY nombre ASC" ;
$res=mysql_query($cons,$conex) or die ("No se realizo con exito la consulta de proveedor");
$numero_filas=mysql_num_rows($res);
$numero_campos= mysql_num_fields($res);
    while ($fila=mysql_fetch_row($res)){				  
         
echo "<tr>";
 for ($i=0;$i< $numero_campos;$i++){

echo "<td class='style1'>";
echo $fila[$i];
echo "</td>";

}

//Editar
echo "<td class='style4'>";
echo "<a href='main.php?a=72&idProv="; echo $fila[0]; echo "'> <img src='img/icon_edit.jpg' border='0' ALT='Editar proveedor'> </a>";
echo "</td>";
//Eliminar
echo "<td class='style4'>";
echo "<a href='deleteproveedor2.php?idProv="; echo $fila[0]; echo "'> <img src='img/icon_delete.jpg' border='0' ALT='Eliminar proveedor'> </a>";
echo "</td>";
echo "</tr>";
}
echo "</table>";
mysql_free_result($res);

?></td>
    </tr>
  </table>
  <p align="center">
    <input name="Submit" type="button" class="boton2" onClick="javascript:print()" value="Imprimir">
  </p>
</body>
</html>
