Me enrede completamente con este codigo y no puedo solucionar el error. Me dice:
Parse error: syntax error, unexpected $end in /home/disenore/public_html/cuentas/stgo_listar_pagos.php on line 181
Codigo:
<?php require_once('Connections/MySQL_BD.php'); ?>
<?php
$rodrigo =0 ; $gonzalo = 0; $rodrigo_debe = 0; $gonzalo_debe = 0;
$para_gonzalo = 0; $para_rodrigo = 0;
mysql_select_db($database_MySQL_BD, $MySQL_BD);
$query_pend = "SELECT * FROM servicios WHERE pago = 'PEND'";
$pend = mysql_query($query_pend, $MySQL_BD) or die(mysql_error());
$row_pend = mysql_fetch_assoc($pend);
$totalRows_pend = mysql_num_rows($pend);
mysql_select_db($database_MySQL_BD, $MySQL_BD);
$query_ok = "SELECT * FROM pago_servicios";
$ok = mysql_query($query_ok, $MySQL_BD) or die(mysql_error());
$row_ok = mysql_fetch_assoc($ok);
$totalRows_ok = mysql_num_rows($ok);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Documento sin título</title>
<link href="CSS/Texto.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body,td,th {
font-family: Arial, Helvetica, sans-serif;
font-size: 11px;
color: #333333;
}
-->
</style>
<link href="CSS/Tablas.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
a:link {
color: #00CC00;
font-weight: bold;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #00CC00;
}
a:hover {
text-decoration: underline;
color: #00CC00;
}
a:active {
text-decoration: none;
color: #00CC00;
}
-->
</style></head>
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="2" bordercolor="#003366" class="form_bordes">
<tr>
<td><div align="center" class="Estilo2"><strong>Pagos pendientes </strong></div></td>
</tr>
</table>
<br>
<table width="100%" border="0" align="left" cellpadding="0" cellspacing="2" bordercolor="#003366" class="form_bordes">
<tr>
<td width="202"><strong>Producto</strong></td>
<td width="668"><strong>Descripcion</strong></td>
<td width="91"><p><strong>Monto</strong></p> </td>
<td width="96"><strong>Estado </strong></td>
<td width="110"> </td>
</tr>
<tr>
<td colspan="5" background="IMG/sombra_tile.png"><img src="IMG/sombra_tile.png" width="1" height="6"></td>
</tr>
<?php do { ?>
<tr>
<td class="Estilo2"><?php echo $row_pend['producto']; ?></td>
<td class="Estilo3"><?php echo $row_pend['descripcion']; ?></td>
<td>$<?php echo $row_pend['valor']; ?></td>
<td class="Estilo2"><?php echo $row_pend['pago']; ?></td>
<td><a href="stgo_realizar_pago.php?id=<?php echo $row_pend['cod_servicio']; ?>">> Realizar pago </a></td>
</tr>
<?php } while ($row_pend = mysql_fetch_assoc($pend)); ?>
</table>
<p> </p>
<p> </p>
<table width="100%" border="0" cellpadding="0" cellspacing="2" bordercolor="#003366" class="form_bordes">
<tr>
<td class="Texto"><div align="center" class="Estilo2"><strong>Registro de pagos </strong></div></td>
</tr>
</table>
<br>
<table width="100%" border="0" cellpadding="0" cellspacing="2" bordercolor="#003366" class="form_bordes">
<tr>
<td width="139" bgcolor="#CCCCCC"><strong>Monto</strong></td>
<td width="208" bgcolor="#CCCCCC"><strong>Empresa</strong></td>
<td width="617" bgcolor="#CCCCCC"><strong>Descripcion</strong></td>
<td width="102" bgcolor="#CCCCCC"><strong>Fecha</strong></td>
<td width="101" bgcolor="#CCCCCC"><strong>Pagado a </strong></td>
</tr>
<?php do { ?>
<tr>
<td>$<?php echo $row_ok['monto']; ?></td>
<td class="Estilo2"><?php echo $row_ok['empresa']; ?></td>
<td class="Estilo3"><?php echo $row_ok['descripcion']; ?></td>
<td><?php echo $row_ok['fecha']; ?></td>
<td><?php echo $row_ok['pagado_a'];
If ($row_ok['empresa'] != 'EGRESO')
{
$total_monto = $total_monto + $row_ok['monto'];
if ($row_ok['pagado_a'] == 'RODRIGO') {
$rodrigo = $rodrigo + $row_ok['monto'];
}
if ($row_ok['pagado_a'] == 'GONZALO') {
$gonzalo = $gonzalo + $row_ok['monto'];
}
$para_gonzalo = $para_gonzalo + $row_ok['para_gonzalo'];
$para_rodrigo = $para_rodrigo + $row_ok['para_rodrigo'];
?></td>
</tr>
<tr>
<td colspan="5" background="IMG/sombra_tile.png"><img src="IMG/sombra_tile.png" width="1" height="6"></td>
</tr>
<?php } while ($row_ok = mysql_fetch_assoc($ok));
printf("para gonzalo vale: %s", $para_gonzalo);
printf("-para rodrigo vale: %s", $para_rodrigo);
if ( $gonzalo > $para_gonzalo ) {
$gonzalo_debe = $gonzalo - $para_gonzalo;
$rodrigo_debe = 0;
}
if ($rodrigo > $para_rodrigo) {
$rodrigo_debe = $rodrigo - $para_rodrigo;
$gonzalo_debe = 0;
}
if ($row_ok['empresa'] == 'EGRESO')
{
$para_gonzalo = $para_gonzalo - $row_ok['para_gonzalo'];
$para_rodrigo = $para_rodrigo - $row_ok['para_rodrigo'];
if ( $gonzalo > $para_gonzalo ) {
$gonzalo_debe = $gonzalo - $para_gonzalo;
$rodrigo_debe = 0;
}
if ($rodrigo > $para_rodrigo) {
$rodrigo_debe = $rodrigo - $para_rodrigo;
$gonzalo_debe = 0;
}
}
?>
</table>
<table width="600" border="0" cellpadding="0" cellspacing="2" bgcolor="#CCCCCC" class="form_bordes">
<tr>
<td class="Texto"><strong>Total Montos: $ <?php echo $total_monto; ?></strong></td>
<td class="Texto"><strong>Rodrigo recibio: $<?php echo $rodrigo; ?> </strong></td>
<td class="Texto"><strong>Gonzalo recibio: $<?php echo $gonzalo; ?></strong></td>
</tr>
<tr>
<td width="207" class="Texto"> </td>
<td width="204" class="Estilo2"><strong>Rodrigo debe: $ <?php echo $rodrigo_debe; ?></strong></td>
<td width="207" class="Estilo2"><strong>Gonzalo debe: $<?php echo $gonzalo_debe; ?></strong></td>
</tr>
</table>
</body>
</html>
<?php
mysql_free_result($pend);
mysql_free_result($ok);
?>
Seguro es una tontera.
gracias.