No table open in php, image where error:
Can you help me find the prooblema? When I try to open the table, I'll open the code, it does not make it the table I need, which was already working, I just added the $ result query to validate it and it does not come out anymore, they can help me with what it will be the error. Thanks, my friends, programmers.
<?php
require '../../session.php';
include("../../conexion.php");
$con = new conec();
$cnx2 = $con->conectar();
$acreedor=$_POST['acreedor'];
$importe2=$_POST['importe2'];
$tipo = $_POST['tipo'];
$result = pg_query($query = "SELECT SUM(Cast(importe as numeric(15,2))) as Total
FROM cxpgastos
Where acreedor = '1040200'");
if (!$result) {
echo "Ocurrió un error.\n";
exit;
}
while ($row = pg_fetch_row($result)) {
if ($row[0]+$importe2 >= 15000.00)
echo "Supera El Limite De Gasto Anual";
else
echo "Seleccion Gasto No Deducible";
}
if( $tipo == "1" )
$query = "select id_tipogasto, btrim(descripcion) as nombre, deducible from emb_tiposdegasto where deducible = 'S' order by id_tipogasto;";
else
$query = "select id_tipogasto, btrim(descripcion) as nombre, deducible from emb_tiposdegasto where deducible = 'N' order by id_tipogasto;";
$Cat = pg_query($query);
?>
<table id="tbTipos" width="100%" border="0" cellpadding="0" cellspacing="0">
<thead>
<tr>
<th width="5%" scope="col">ID</th>
<th width="10%" scope="col">Descripcion</th>
<th width="5%" scope="col">Deducible</th>
<th width="1%" scope="col" align='center'>Acciones</th>
</tr>
<tr></tr>
</thead>
<tbody>
<?php $id=0;
while ($bancos = pg_fetch_object($Cat))
{
if ($numfila == 0){ $class = "alt"; $numfila = 1; } else { $class = ""; $numfila = 0; }
echo "<tr class'".$class."'>";
echo "<td align='center'>".$bancos->id_tipogasto."</td>";
echo "<td>".$bancos->nombre."</td>";
echo "<td align='center'>".$bancos->deducible."</td>";
//echo "<td align='center'>"."<a href=javascript:datosTipos('".$id."') rel='tipsy' title='Seleccionar'>
//<input type='radio' name='radio'/></a></td>";
echo "<td align='center'>"."<a href=javascript:datosTipos('".$id."') rel='tipsy' title='Seleccionar'>
<img src='../../img/seleccionar.png' id='sel' style='vertical-align: text-top; height: 18px;'/></a> </td>";
echo "</tr>";
$id=$id+1;
}
pg_close();
?>
</tbody>
<tfoot> </tfoot>
</table>
What will be the problem in my code since I can not find the error, that when clicking instead of opening the table I get the code of the tabala, here I leave all my code I hope you help me and thank you very much.