Foros del Web » Programando para Internet » PHP »

Parse error: parse error in

Estas en el tema de Parse error: parse error in en el foro de PHP en Foros del Web. Buenas. tengo un problema al generar un PDF, me aparece este error Parse error: parse error in C:\wamp\www\general\detalle_fac.php on line 66 la línea 66 en ...
  #1 (permalink)  
Antiguo 02/12/2010, 09:56
Avatar de germancerda  
Fecha de Ingreso: mayo-2008
Mensajes: 43
Antigüedad: 15 años, 11 meses
Puntos: 0
Parse error: parse error in

Buenas. tengo un problema al generar un PDF, me aparece este error

Parse error: parse error in C:\wamp\www\general\detalle_fac.php on line 66
la línea 66 en es final "?>"

Este es código que estoy usando, agradezco cualquier ayuda

<?php require_once('Connections/base.php');?>
<?php
require_once('class.ezpdf.php');
$pdf =& new Cezpdf('a4');
$pdf->selectFont('../fonts/courier.afm');
$pdf->ezSetCmMargins(1,1,1.5,1.5);

if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}

$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$colname_result = "-1";
if (isset($_GET['NUM_BUNCH'])) {
$colname_result = $_GET['NUM_BUNCH'];
mysql_select_db($database_base, $base);
$result = mysql_query("SELECT NUM_PACK, COD_VARIE, PRECIO, SUM(NUM_TALLOS) AS TOTAL_TALLOS, sum(precio*num_tallos) as total FROM bunche WHERE NUM_PACK = %s GROUP BY COD_VARIE",GetSQLValueString($result, "int"));
//$result = mysql_query($query_result, $con_mysql) or die(mysql_error());
//$row_result = mysql_fetch_assoc($result);
//$totalRows_result = mysql_num_rows($result);
while($datatmp = mysql_fetch_assoc($result))
{
$data[] = $datatmp;
}
$titles = array('Num_pack'=>'NUM_PACK', 'COD_VARIE'=>'COD_VARIE',
'PRECIO'=>'PRECIO','TOTAL_TALLOS'=>'TOTAL_TALLOS' );
$options = array( 'showHeadings'=>1, 'shadeCol'=>array(0.10,0.10,0.10), 'xOrientation'=>'center','width'=>700 );
$txttitle = "FACTURA "."\n\n\n";
$pdf->ezText($txttitle, 12);
$pdf->ezTable($data,$titles, '', $options);
$pdf->ezText("\n\n\n", 10);
$pdf->ezText("Fecha: ".date("d/m/Y")."\n", 10);
$pdf->ezText("Hora: ".date("H:i:s")."\n\n", 10);
$pdsf->ezStream();
?>
  #2 (permalink)  
Antiguo 02/12/2010, 09:59
 
Fecha de Ingreso: octubre-2009
Ubicación: En el ordenador
Mensajes: 504
Antigüedad: 14 años, 6 meses
Puntos: 10
Respuesta: Parse error: parse error in

if (isset($_GET['NUM_BUNCH'])) {

La llave de esta línea no está cerrada
__________________
Buscando ideas para proyectos....

Esperando a tener 18 años....
  #3 (permalink)  
Antiguo 02/12/2010, 10:44
 
Fecha de Ingreso: septiembre-2004
Mensajes: 324
Antigüedad: 19 años, 7 meses
Puntos: 13
Respuesta: Parse error: parse error in

Supongo que será después del while donde debes cerrarlo
  #4 (permalink)  
Antiguo 02/12/2010, 11:09
Avatar de germancerda  
Fecha de Ingreso: mayo-2008
Mensajes: 43
Antigüedad: 15 años, 11 meses
Puntos: 0
Respuesta: Parse error: parse error in

Si gracias funcionó muy buien y disculpas por molestar con algo tan simple....

Etiquetas: parse
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 10:44.