Ver Mensaje Individual
  #1 (permalink)  
Antiguo 26/01/2013, 22:54
Avatar de Simon_Echecopar
Simon_Echecopar
 
Fecha de Ingreso: marzo-2012
Mensajes: 96
Antigüedad: 12 años, 1 mes
Puntos: 0
Presentacion de datos

Tengo un codigo que me obtiene informacion de una BD de MySQL pero no muestra la informacion despues de la busqueda, no veo donde esta el problema y me falta hacer que responde al UPDATE que todavia no hago:
Código PHP:
<?php
 $count
=0;
include 
"conexion.php";
$idvendedor             $_GET["idvendedor"];

$sql "SELECT e.idvendedor,e.llavesocio, e.nombrevend, e.telvend, e.celvend, e.emailvend, e.FecAlta, e.fecbaja FROM cat_vendedores AS e";

if(!empty(
$idvendedor))
{
 
$sql .= " WHERE e.idvendedor = ".$idvendedor;
 
}
if(isset(
$_REQUEST["Busqueda"]))
{

 
$vUsuario      $_POST["vUsuario"];
 
$vNombre        $_POST["vNombre"];
 
$vTelefono        $_POST["vTelefono"];
 
$vCelular        $_POST["vCelular"];
 
$vEmail        $_POST["vEmail"];
 
$vNomArea        $_POST["vNomArea"];
 
$vBaja            $_POST["vBaja"];
 
$vAlta            $_POST["vAlta"];
 
$count=0;
 
$sql .= " WHERE ";
 if(!empty(
$vUsuario))
 {
  
$count++;
  if(
$count>1)
   
$sql .= "AND ";
  
$sql .= " cvesocio LIKE '".$vUsuario."'";
  
//echo $sql."<br>";
 
}
 
 if(!empty(
$vNombre))
 {
  
$count++;
  if(
$count>1)
   
$sql .= " AND ";
  
$sql .= " nombrevend LIKE '".$vNombre."'";
  
//echo $sql."<br>";
 
}
 
 if(!empty(
$vTelefono))
 {
  
$count++;
  if(
$count>1)
   
$sql .= " AND ";
  
$sql .= "telvend = ".$vTelefono;
  
//echo $sql."<br>";
 
}
 
 if(!empty(
$vCelular))
 {
  
$count++;
  if(
$count>1)
   
$sql .= " AND ";
  
$sql .= "celvend = ".$vCelular;
  
//echo $sql."<br>";
 
}
 
 if(!empty(
$vEmail))
 {
  
$count++;
  if(
$count>1)
   
$sql .= " AND ";
  
$sql .= "emailvend = '".$vEmail."'";
  
//echo $sql."<br>";
 
}

 if(!empty(
$vNomArea))
 {
  
$count++;
  
$sAre "SELECT id_area FROM areas WHERE desc_area LIKE '".$vNomArea."'";
  
$reAre mysql_query($sAre);
  
$roAre mysql_fetch_row($reAre);
  
//var_dump($roAre[0]);
  //echo $sql."<br>";
  
if($count>1)
   
$sql .= " AND ";
  
$sql .= "idarea = ".$roAre[0];
 }

 if(!empty(
$vBaja))
 {
  
$count++;
  if(
$count>1)
   
$sql .= " AND ";
  
$sql .= "fecbaja = '".$vBaja."'";
  
//echo $sql."<br>";
 
}
 if(!empty(
$vAlta))
 {
  
$count++;
  if(
$count>1)
   
$sql .= " AND ";
  
$sql .= "FecAlta = '".$vAlta."'";
  
//echo $sql."<br>";
 
}
 echo 
$sql;
 
//echo  $count;
}
$resultado mysql_query($sql,$link);
?>
<?PHP 
include ("seguridad.php");?>
<?PHP 
require ("clase_mysql.inc.php"); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
  <meta http-equiv="content-type" content="text/html; charset=UTF8" />
  <!--<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />-->
  <link rel="stylesheet" type="text/css" media="screen,projection,print" href="./css/layout1a_setup.css" />
  <link rel="stylesheet" type="text/css" media="screen,projection,print" href="./css/layout1a_text.css" />
  <title>S&iacute;stema de Facturaci&oacute;n Asgui </title>
</head>
<!-- Global IE fix to avoid layout crash when single word size wider than column width -->
<!--[if IE]><style type="text/css"> body {word-wrap: break-word;}</style><![endif]-->
<body>
 <center>
  <!-- Main Page Container -->
  <div class="page-container">
    <!-- For alternative headers START PASTE here -->
    <!-- A. HEADER -->      
    <div class="header">
      <!-- A.2 HEADER MIDDLE -->
      <div class="header-middle">    
        <!-- Site message -->
      </div>
      <!-- A.3 HEADER BOTTOM -->
      <div class="header-bottom">
        <!-- Navigation Level 2 (Drop-down menus) -->
        <div class="nav2">
            <p align="right">Usuario: <b><? echo $_SESSION["nombresocio"];?></b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
            <? include 'barramenu.php'?>  
        </div>
      </div>
    </div>
    <!-- For alternative headers END PASTE here -->
    <!-- B. MAIN -->
    <div class="main">
      <!-- B.1 MAIN CONTENT -->
      <div class="main-content">
        <hr class="clear-contentunit" />
        <h1 class="block"><center>Usuarios del Sistema</center></h1> 
        <!-- Comienza código -->
     <form method="POST" action="abcEmpleado.php"> 
      <input type="hidden" name="idarea1" value="<?php print $idarea1?>">
      <input type="hidden" name="idvendedor" value="<?php print $idvendedor ?>">
      <table border=0>
       <tr>
        <th class="top" scope="col" width="90">Usuario</th>
        <th><input type="text" name="vUsuario" value = "<?php print $vUsuario ?>" size="100"></td>
       </tr>
       <tr>
        <th class="top" scope="col" width="90">Nombre</th>
        <th><input type="text" name="vNombre" value = "<?php print $vNombre ?>" size="100"></td>
       </tr>
       <tr>
        <th class="top" scope="col" width="90">Telefono</th>
        <th><input type="text" name="vTelefono" value = "<?php print $vTelefono ?>" size="100"></td> 
       </tr>
       <tr>
        <th class="top" scope="col" width="90">Celular</th>
        <th><input type="text" name="vCelular" value = "<?php print $vCelular ?>" size="100"></td>
       </tr>
       <tr>
        <th class="top" scope="col" width="90">e-mail</th>
        <th><input type="text" name="vEmail" value = "<?php print $vEmail ?>" size="100"></td>
       </tr>
       <tr>
        <th class="top" scope="col" width="90">Nombre de Area</th>
        <th><input type="text" name="vNomArea" value = "<?php print $vNomArea ?>" size="100"></td>
       </tr>
       <tr>
        <th class="top" scope="col" width="90">Fecha Alta</th>
        <th><input type="text" name="vAlta" value = "<?php print $vAlta ?>" size="100"></td>
       </tr>
       <tr>
        <th class="top" scope="col" width="90">Fecha Baja</th>
        <th><input type="text" name="vBaja" value = "<?php print $vBaja ?>" size="100"></td>
       </tr>
       <tr>
        <th></td>
        <td align=right><input type="submit" id="Busqueda" name="Busqueda" value="<?php if(!empty($idvendedor)) print "Modificar"; else print "Buscar";?>"></td>
       </tr>
      </table>
     </form>
     <form method="GET" action="abcEmpleado.php">
     <table>
      <tr>
        <th class="top" scope="col" width="25">ID:</th>
        <th class="hpedidotit" scope="col" width="60">Usuario</th>
        <th class="hpedidotit" scope="col" width="60">Nombre</th>
        <th class="hpedidotit" scope="col" width="60">Telefono</th>
        <th class="hpedidotit" scope="col" width="70">Celular</th>
        <th class="hpedidotit" scope="col" width="130">Email</th>
        <th class="hpedidotit" scope="col" width="80">Area</th>
        <th class="hpedidotit" scope="col" width="90">Acciones</th>
        <th class="hpedidotit" scope="col" width="60">Fecha de Alta</th>
        <th class="hpedidotit" scope="col" width="60">Fecha de Baja</th>
      </tr>
      <?PHP
        
//var_dump($row=mysql_fetch_row($resultado));
      
        
while ($row=mysql_fetch_row($resultado)) // recorre los clientes uno por uno hasta el fin de la tabla
        
{
          
$SQLnomArea 'SELECT desc_area FROM areas WHERE id_area = (SELECT idarea FROM cat_vendedores WHERE idvendedor = '.$row[0].')';
          
$resultado2 mysql_query($SQLnomArea,$link);
          
$fila2=mysql_fetch_row($resultado2); 
          print 
'<tr><td class="'.$clase_celda.'"><a href="abcEmpleado.php?idvendedor='.$row[0].'">'.$row[0].'</a></td>';
          print 
'<td class="'.$clase_celda.'" >'.$row[1].'</td>';
          print 
'<td class="'.$clase_celda.'" >'.$row[2].'</td>';
          print 
'<td class="'.$clase_celda.'" >'.$row[3].'</td>';
          print 
'<td class="'.$clase_celda.'" >'.$row[4].'</td>';
          print 
'<td class="'.$clase_celda.'" >'.$row[5].'</td>';
          print 
'<td class="'.$clase_celda.'" >'.$fila2[0].'</td>';
          print 
'<td class="'.$clase_celda.'" >'.''.'</td>';
          print 
'<td class="'.$clase_celda.'" >'.$row[6].'</td>';
          print 
'<td class="'.$clase_celda.'" >'.$row[7].'</td>';
         }
//*/
?>

     </table>
     </form>
   </div>
  </div>
  </center>
 </body>
</html>
<?php 
@mysql_free_result($resultado);
@
mysql_free_result($resultado2);
@
mysql_free_result($reAre);
?>