Ver Mensaje Individual
  #6 (permalink)  
Antiguo 29/07/2011, 08:45
akura1975
 
Fecha de Ingreso: julio-2011
Mensajes: 3
Antigüedad: 12 años, 9 meses
Puntos: 0
Respuesta: Funcion Date PHP

Les pido disculpas, aqui les coloco el código, esto me pasa en todas las páginas donde hay un form con la fecha.

<?php require_once('Connections/cnResol15.php'); ?>
<?php
$Vendedor_rsPedidos = "0";
$flag = 0;
if (isset($HTTP_POST_VARS['vendedor'])) {
$Vendedor_rsPedidos = (get_magic_quotes_gpc()) ? $HTTP_POST_VARS['vendedor'] : addslashes($HTTP_POST_VARS['vendedor']);
}
$Vendedor_rsPedidos = "NINGUNO";
if (isset($HTTP_POST_VARS['vendedor'])) {
$Vendedor_rsPedidos = (get_magic_quotes_gpc()) ? $HTTP_POST_VARS['vendedor'] : addslashes($HTTP_POST_VARS['vendedor']);
}
$FechaHasta_rsPedidos = "0";
if (isset($HTTP_POST_VARS['FechaHasta'])) {
$FechaHasta_rsPedidos = (get_magic_quotes_gpc()) ? $HTTP_POST_VARS['FechaHasta'] : addslashes($HTTP_POST_VARS['FechaHasta']);
}
$FechaDesde_rsPedidos = "0";
if (isset($HTTP_POST_VARS['FechaDesde'])) {
$FechaDesde_rsPedidos = (get_magic_quotes_gpc()) ? $HTTP_POST_VARS['FechaDesde'] : addslashes($HTTP_POST_VARS['FechaDesde']);
}
mysql_select_db($database_cnResol15, $cnResol15);
$query_rsPedidos = sprintf("SELECT pedidos.idvendedor,pedidos.idpedido,pedidos.fechap edido,(concat(mid(pedidos.RENSPA,1,2),'.',mid(pedi dos.RENSPA,3,3),'.',mid(pedidos.RENSPA,6,1),'.',mi d(pedidos.RENSPA,7,5),'.',mid(pedidos.RENSPA,12,2) ,IF(length(pedidos.renspa) > 13,concat('/',mid(pedidos.RENSPA,14,1)),''))) as RENSPA,clientes.razonsocial,pedidos.productor,pedi dos.cantidad,pedidos.color, concat(if(pedidos.ec=1,'EC-',''),if(pedidos.logos=1,'LOGOS-',''),if(pedidos.barras=1,'C/BARRAS-',''),if(pedidos.adicional=1,'ADICIONAL-',''),if(pedidos.invertido=1,'INVERTIDO-',''),if(pedidos.botonseguridad=1,'B.SEGURIDAD','' )) AS extras, pedidos.estado FROM pedidos INNER JOIN clientes ON clientes.idcliente=pedidos.idcliente WHERE pedidos.fechapedido >= '%s' AND pedidos.fechapedido <= '%s' AND pedidos.idvendedor = '%s' ORDER BY pedidos.fechapedido, pedidos.idpedido", $FechaDesde_rsPedidos,$FechaHasta_rsPedidos,$Vende dor_rsPedidos);
$rsPedidos = mysql_query($query_rsPedidos, $cnResol15) or die(mysql_error());
$row_rsPedidos = mysql_fetch_assoc($rsPedidos);
$totalRows_rsPedidos = mysql_num_rows($rsPedidos);

mysql_select_db($database_cnResol15, $cnResol15);
$query_rsVendedores = "SELECT * FROM vendedores ORDER BY NOMBRE";
$rsVendedores = mysql_query($query_rsVendedores, $cnResol15) or die(mysql_error());
$row_rsVendedores = mysql_fetch_assoc($rsVendedores);
$totalRows_rsVendedores = mysql_num_rows($rsVendedores);
?>
<html><!-- InstanceBegin template="/Templates/base.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<title>Resoluci&oacute;n 15 - VNSA</title>
<!-- InstanceEndEditable -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->
<link href="Resol15.css" rel="stylesheet" type="text/css">
</head>

<body leftmargin="0" topmargin="0">
<table width="100%" height="168" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="75"><table width="100%" height="58%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="38%" height="85"><img src="imagenes/Isologotipo%20Villa%20Nueva.jpg" width="283" height="85"></td>
<td width="29%" background="file:///C|/Mis documentos/fondovnsa.jpg"><p align="center"><strong><font color="#000000"><br>
Sistema de Pedidos Online</font></strong><br>
<font size="2">Versi&oacute;n 2.0</font><br>
<br>
</p>
</td>
<td width="33%"><div align="right"><img src="imagenes/logo_allflex.gif" width="122" height="65"><img src="imagenes/spacer.gif" width="10" height="10"></div></td>
</tr>
</table></td>
</tr>
<tr>
<td height="40" valign="top"><table width="100%" height="24" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#CCE8FF">
<tr class="TextoForm">
<td height="1" colspan="6" bgcolor="#006666"></td>
</tr>
<tr class="TextoForm">
<td height="21"><div align="center"><a href="procedimiento.php">PROCEDIMIENTO</a></div></td>
<td><div align="center"><a href="pedidos.php">PEDIDOS</a></div></td>
<td><div align="center"><a href="usuarios.php">USUARIOS</a></div></td>
<td><div align="center"><a href="clientes.php">CLIENTES</a></div></td>
<td><div align="center"><a href="vendedores.php">VENDEDORES</a></div></td>
<td><div align="center"><a href="renspa.php">RENSPA</a></div></td>
</tr>
<tr bgcolor="#006666" class="TextoForm">
<td height="1" colspan="6"></td>
</tr>
</table></td>
</tr>
<tr> <!-- InstanceBeginEditable name="body" -->
<td height="32">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="34">
<div align="center"><font color="#0000FF" size="3" face="Tahoma"><strong>Listado
de Control de Carga</strong></font></div></td>
</tr>
<tr>
<td><form name="form1" method="post" action="">
<span class="TextoForm">Vendedor:
<select name="vendedor" id="vendedor">
<option value="%" <?php if (!(strcmp("%", $row_rsVendedores['IdVendedor']))) {echo "SELECTED";} ?>>Seleccionar...</option>
<?php
do {
?>
<option value="<?php echo $row_rsVendedores['IdVendedor']?>"<?php if (!(strcmp($row_rsVendedores['IdVendedor'], $row_rsVendedores['IdVendedor']))) {echo "SELECTED";} ?>><?php echo $row_rsVendedores['Nombre']?></option>
<?php
} while ($row_rsVendedores = mysql_fetch_assoc($rsVendedores));
$rows = mysql_num_rows($rsVendedores);
if($rows > 0) {
mysql_data_seek($rsVendedores, 0);
$row_rsVendedores = mysql_fetch_assoc($rsVendedores);
}
?>
</select>
Desde Fecha:</span>
<input name="FechaDesde" type="text" id="FechaDesde" value="<?echo Date("Y-n-j") ?>">
<span class="TextoForm">Hasta Fecha: </span>
<input name="FechaHasta" type="text" id="FechaHasta" value="<?echo Date("Y-n-j") ?>">
<input type="submit" name="Submit" value="Buscar">
</form></td>
</tr>
<tr>
<td class="TextoLista">
<p>Informe de sucursal <? echo $row_rsPedidos['idvendedor'];?></p>
<table width="100%" border="0" cellpadding="0" cellspacing="0" background="#CCE8FF">
<tr class="TextoForm">
<td bgcolor="#CCE8FF"><font color="#0000FF"><strong>PEDIDO</strong></font></td>
<td bgcolor="#CCE8FF"><font color="#0000FF"><strong>RENSPA</strong></font></td>
<td bgcolor="#CCE8FF"><font color="#0000FF"><strong>CLIENTE</strong></font></td>
<td bgcolor="#CCE8FF"><font color="#0000FF"><strong>PRODUCTOR</strong></font></td>
<td bgcolor="#CCE8FF"><font color="#0000FF"><strong>FECHA</strong></font></td>
<td bgcolor="#CCE8FF"><font color="#0000FF"><strong>CANTIDAD</strong></font></td>
<td bgcolor="#CCE8FF"><font color="#0000FF"><strong>COLOR</strong></font></td>
<td bgcolor="#CCE8FF"><font color="#0000FF"><strong>EXTRAS</strong></font></td>
<td bgcolor="#CCE8FF"><font color="#0000FF"><strong>ESTADO</strong></font></td>
</tr>
<?php do { ?>
<?php
if ($flag == 0) {
$flag = 1;
print "<tr bgcolor='#FFFFFF' class='TextoLista'>"; }
else {
$flag = 0;
print "<tr bgcolor='#CCCCCC' class='TextoLista'>"; }
?>
<td><?php echo $row_rsPedidos['idpedido']; ?></td>
<td><?php echo $row_rsPedidos['RENSPA']; ?></td>
<td><?php echo $row_rsPedidos['razonsocial']; ?></td>
<td><?php echo $row_rsPedidos['productor']; ?></td>
<td><?php echo $row_rsPedidos['fechapedido']; ?></td>
<td><div align="center"><?php echo $row_rsPedidos['cantidad']; ?></div></td>
<td bgcolor="#CCE8FF"><?php echo $row_rsPedidos['color']; ?></td>
<td><?php echo $row_rsPedidos['extras']; ?></td>
<td>
<?php
switch($row_rsPedidos['estado'])
{
case "0":
print "<font color='#999999'><strong>";
echo "ANULADO";
break;
case "1":
print "<font color='#0033CC'><strong>";
echo "Para Numerar";
break;
case "2":
print "<font color='#0033CC'><strong>";
echo "Numeradas";
break;
case "3":
print "<font color='#339933'><strong>";
echo "En Impresión";
break;
case "4":
print "<font color='#FF0000'><strong>";
echo "Numeradas para Despacho";
break;
case "5":
print "<font color='#FF0000'><strong>";
echo "En Despacho";
break;
case "6":
echo "Entregadas";
break;
}
?>
</font></td>
</tr>
<?php } while ($row_rsPedidos = mysql_fetch_assoc($rsPedidos)); ?>
</table></td>
</tr>
</table></td>
<!-- InstanceEndEditable --></tr>
</table>
</body>
<!-- InstanceEnd --></html>
<?php
mysql_free_result($rsPedidos);

mysql_free_result($rsVendedores);
?>