undefined variable
Publicado por zendi (16 intervenciones) el 15/04/2010 18:19:19
estoy haciendo una pagina y cuando presiono EL boton de busqueda para desplegar unos registros me da el siguiente error: Notice: Undefined variable: articulo in /var/www/intranet/subsistemas/proveeduria/consultaporArticulo.php on line 75. No debiera traer nada ni siquiera el error este. Ademas la idea es NO traer EL CODIGO DE ARTICULO SI ESTA VACIO.
SI ALGUIEN PUDIERA AYUDARME
ESTE ES EL CODIGO COMPLETO:
<?php
require('../../recursos/inicio_sesion.php');
require('../../recursos/datos.php');
$datos=new CDatos('pg','localhost',$_SESSION['usuario'],$_SESSION['clave']);
if ($datos->ExisteError)
exit($datos->MsjCompleto);
?>
<!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>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script language="JavaScript" src="calendario.js"></script>
<script language="JavaScript" src="overlib_mini.js"></script>
</head>
<style type="text/css">
.sr {
background-color: #FFFFCF;
color: #000000;
font-family: Arial;
font-size: 12px;
}
</style>
<body>
<!-- Colocar la fecha para que el usuario la escriba-->
<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>
<form name="form1" action="consultaporArticulo.php" method="post"><fieldset style="width:auto"><LEGEND>Salidas por Artículos</LEGEND>
<TABLE align="center" class="div1">
<TR>
<td>Código del Artículo</td>
<td><input type="text" name="codart" size=10 maxlength=10></td>
</TR>
<tr>
<td><input TYPE="submit" NAME="buscar" VALUE="Buscar">
</TD>
</tr>
</TABLE>
</fieldset><br />
<table border='1' bordercolor='#00CC99' bgcolor='#99CC00'>
<tr class='sr'>
<th width='200'>Código
<th width='200'>Artículo
<th width='200'>Fecha
<th width='200'>Destino
<th width='200'>Despacahada
<th width='200'>Stock
</tr>
<?php
if (isset($_POST['codart']) && isset($_POST['buscar'])):
$codart = $_POST['codart'];
if ($datos->ExisteError)
exit($datos->MsjCompleto);
$kardexs=$datos->Registros('',"SELECT * FROM admon.v_kardex WHERE v_kardex.cod_articulo = '$codart' AND v_kardex.entrada = 'false'",'recurso');
endif;
while ($seleccionado =@pg_fetch_array($kardexs)):
$codigo = $seleccionado['cod_articulo'];
$articulo = $seleccionado['articulo'];
$fecha = $seleccionado['fecha2'];
$destino = $seleccionado['destino'];
$despachada = $seleccionado['despachada'];
$stock = $seleccionado['inv_proveeduria'];
$existencia = $seleccionado['existencia'];
echo"<table border='1' bordercolor='#00CC99' bgcolor='#99CC00'><tr>
<td width='200' align='center'style='font-size:13px;'>$codigo</td>
<td width='200' style='font-size:13px;'>$articulo</td>
<td width='200' align='center'style='font-size:13px;'>$fecha</td>
<td width='200' style='font-size:13px;'>$destino</td>
<td width='200' style='font-size:13px;'>$despachada</td>
<td width='200' style='font-size:13px;'>$stock</td>
</tr>
</table>";
endwhile;
echo "<table align='center'>
<tr>
<td bgcolor='#6699CC' style='font-size:13px;'>Total Existencia de $articulo</td>
<td width='100' bgcolor='#66CCFF' style='font-size:13px;'>$existencia</td>
</tr>
</table>";
?>
</form>
</body>
</html>
SI ALGUIEN PUDIERA AYUDARME
ESTE ES EL CODIGO COMPLETO:
<?php
require('../../recursos/inicio_sesion.php');
require('../../recursos/datos.php');
$datos=new CDatos('pg','localhost',$_SESSION['usuario'],$_SESSION['clave']);
if ($datos->ExisteError)
exit($datos->MsjCompleto);
?>
<!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>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script language="JavaScript" src="calendario.js"></script>
<script language="JavaScript" src="overlib_mini.js"></script>
</head>
<style type="text/css">
.sr {
background-color: #FFFFCF;
color: #000000;
font-family: Arial;
font-size: 12px;
}
</style>
<body>
<!-- Colocar la fecha para que el usuario la escriba-->
<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>
<form name="form1" action="consultaporArticulo.php" method="post"><fieldset style="width:auto"><LEGEND>Salidas por Artículos</LEGEND>
<TABLE align="center" class="div1">
<TR>
<td>Código del Artículo</td>
<td><input type="text" name="codart" size=10 maxlength=10></td>
</TR>
<tr>
<td><input TYPE="submit" NAME="buscar" VALUE="Buscar">
</TD>
</tr>
</TABLE>
</fieldset><br />
<table border='1' bordercolor='#00CC99' bgcolor='#99CC00'>
<tr class='sr'>
<th width='200'>Código
<th width='200'>Artículo
<th width='200'>Fecha
<th width='200'>Destino
<th width='200'>Despacahada
<th width='200'>Stock
</tr>
<?php
if (isset($_POST['codart']) && isset($_POST['buscar'])):
$codart = $_POST['codart'];
if ($datos->ExisteError)
exit($datos->MsjCompleto);
$kardexs=$datos->Registros('',"SELECT * FROM admon.v_kardex WHERE v_kardex.cod_articulo = '$codart' AND v_kardex.entrada = 'false'",'recurso');
endif;
while ($seleccionado =@pg_fetch_array($kardexs)):
$codigo = $seleccionado['cod_articulo'];
$articulo = $seleccionado['articulo'];
$fecha = $seleccionado['fecha2'];
$destino = $seleccionado['destino'];
$despachada = $seleccionado['despachada'];
$stock = $seleccionado['inv_proveeduria'];
$existencia = $seleccionado['existencia'];
echo"<table border='1' bordercolor='#00CC99' bgcolor='#99CC00'><tr>
<td width='200' align='center'style='font-size:13px;'>$codigo</td>
<td width='200' style='font-size:13px;'>$articulo</td>
<td width='200' align='center'style='font-size:13px;'>$fecha</td>
<td width='200' style='font-size:13px;'>$destino</td>
<td width='200' style='font-size:13px;'>$despachada</td>
<td width='200' style='font-size:13px;'>$stock</td>
</tr>
</table>";
endwhile;
echo "<table align='center'>
<tr>
<td bgcolor='#6699CC' style='font-size:13px;'>Total Existencia de $articulo</td>
<td width='100' bgcolor='#66CCFF' style='font-size:13px;'>$existencia</td>
</tr>
</table>";
?>
</form>
</body>
</html>
Valora esta pregunta


0