<?
include "tete.php3";
?>
<HTML>
<TITLE> SUPRIMIR CATEGORIA</TITLE>
<body>
<H1><EM>SUPRIMIR UNA CATEGORIA</EM></H1>

ELIJA LA CATEGORIA QUE QUIERE SUPRIMIR:
<FORM ACTION="supcat.php3" METHOD="POST">
<SELECT NAME="id_cat" size=5> 
<?php
$conn=pg_pconnect("dbname=emecmistica user=postgres");
$queryca = pg_exec($conn,"select id_categoria from categoria");  
$m=0;
while ($m<pg_numrows($queryca)) {
$ca= pg_fetch_row ($queryca,$m);
echo "<option value=\"$ca[0]\">$ca[0]</option>"; 
$m++;
} 
?>
</SELECT>
<br>
<br>
<INPUT TYPE="Submit" name="submit" value="Suprimir">
<br>
<br>
</FORM>
</body>
</html>



<?php
if ($submit) {
$conn = pg_pconnect("dbname=emecmistica user=postgres"); 
$query= pg_exec($conn, "select id_categoria, definicion_es, definicion_en, definicion_fr,
definicion_po from categoria where id_categoria='$id_cat'");
$cato=pg_fetch_row($query,0);  
$cato[1]=stripslashes($cato[1]);
$cato[2]=stripslashes($cato[2]);
$cato[3]=stripslashes($cato[3]);
$cato[4]=stripslashes($cato[4]);

?>
<html>
<body>
<?

echo "<table
width=80%><tr><td width=20%>ID</td><td width=20%>$cato[0]</td></tr><tr><td
width=20%>espanol</td><td width=20%>$cato[1]</td></tr><tr><td
width=20%>ingles</td><td>$cato[2]</td></tr><tr><td width=20% font
color=red>frances</font></td><td width=20%>$cato[3]</td></tr><tr><td
width=20%>portugues</td><td width=20%>$cato[4]</td></tr></table>";   
$supp= pg_exec($conn, "delete from categoria where id_categoria = '$cato[0]'");
echo " <H1><STRONG>La categoria fue suprimida
<br></STRONG></H1><br><FORM ACTION=\"/mistica/bdd/categ.php3/idi/es\">
<INPUT TYPE=\"submit\" name=\"lista\" value=\"Consultar la Lista de las 
categorias\"> </FORM>
<FORM action=\"premier.html\">
<INPUT type =\"submit\" name=\"exit\" value=\"Salir\">
</FORM>"; 
}
?>
</body>
</html>


