
<HTML>
<HEAD>
<TITLE> formulario de election de un MENSAGE</TITLE>
</HEAD>
<BODY>
<?php
$conn=pg_pconnect("dbname=emecmistica user=postgres");
include ("tete.php3");
?>


<form method =post action="/mistica/bdadmin/upform.php3">

<H3>QUE MENSAJE DESEA MODIFICAR?</H3>
<br>
<INPUT TYPE=text NAME=id_mensajes VALUE=<? echo $id_mensaje?>><BR>
<SELECT NAME="id_mensaje" size=10> 

<?php
$querymes = pg_exec($conn,"select id_mensaje, apellido_miembro, nombre_miembro, titulo_es, titulo_en, titulo_fr, titulo_po, fecha from
 mensajes, communidad where mensajes.id_creador=communidad.id_miembro and mensajes.web='1' order by id_mensaje DESC");  
$v=0;
while ($v<pg_numrows($querymes)) {
$rem= pg_fetch_row ($querymes,$v);
$rem[1]=stripslashes($rem[1]);
$rem[1]=ucwords($rem[1]);
$rem[2]=stripslashes($rem[2]);
$rem[2]=ucwords($rem[2]);
$len_es=strlen($rem[3]);
$len_en=strlen($rem[4]);
$len_fr=strlen($rem[5]);
$len_po=strlen($rem[6]);

if ($len_es !=0) {
$titori=stripslashes($rem[3]);
}
elseif ($len_en !=0) {
$titori=stripslashes($rem[4]);
}
elseif ($len_fr !=0) {
$titori=stripslashes($rem[5]);
}
elseif ($len_po !=0) {
$titori=stripslashes($rem[6]);
}
$rem[7]=date("d/m/Y", $rem[7]); 


echo "<option value=\"$rem[0]\">$rem[0] &nbsp; $rem[1] &nbsp; $rem[2] &nbsp; $titori; $rem[7]</option>"; 
$v++;
} 
?>
</SELECT><br> 
 <br>
<input type="Submit" name="submit" value="Modificar este mensaje">
<input type="Submit" name="suprimir" value="Sacar este mensaje del Web">
</form>
</BODY>
</HTML>
<?
if ($suprimir) {
if ($id_mensajes) {
$id_mensaje=$id_mensajes;
}
$conn=pg_pconnect("dbname=emecmistica user=postgres");
$qpregunta=pg_exec($conn, "update mensajes set web='f' where id_mensaje='$id_mensaje'");
echo "<H3> El mensaje $id_mensaje fue sacado del Web</H3><br><a href=\"/mistica/bdadmin/premier.html\"><H3>Volver a la pagina principal</H3></a>";
}
if ($submit) {
if ($id_mensajes) {
$id_mensaje=$id_mensajes;
}
$conn=pg_pconnect("dbname=emecmistica user=postgres");
$qcategorie=pg_exec($conn, "select id_categoria from mensajes where id_mensaje='$id_mensaje'");
$getcath=pg_fetch_row($qcategorie, 0);
$cat=$getcath[0];
if ($cat !="C2") {
?>
<H2>Que desea modificar?</H2>
<table width="640">
<tr><td width="70%">
<H5>
- La Categoria<br>
- El contenido del mensaje<br>
- El Autor<br>
- El idioma original del Mensaje<br>
</H5>
</td>
<td width="30%">
<a href="/mistica/bdadmin/formu1.php3/id/<?echo $id_mensaje?>">Formulario 1</a>
</td>
</tr>
<tr><td width="70%">
<H5>
- Las Palabras Claves<br>
- El tema<br>
- La fuente<br>
- El Reply<br>
- El numero de la Sintesis<br>
</H5>
</td>
<td width="30%">
<a href="/mistica/bdadmin/formu2.php3/id/<?echo $id_mensaje?>">Formulario 2</a>
</td>
</tr>
<tr><td width="70%">
<H5>
- Uno de los titulos<br>
- una sintesis<br>
</H5>
</td>
<td width="30%">
<a href="/mistica/bdadmin/formu3.php3/id/<?echo $id_mensaje?>">Formulario 3</a>
</td>
</tr>
<tr><td width="70%">
<H5>
- Un documento atachado
</H5>
</td>
<td width="30%">
<a href="/mistica/bdadmin/formu4.php3/id/<?echo $id_mensaje?>">Formulario 4</a>
</td>
</tr>
</table>

<?
}
if ($cat =="C2") {
?>
<H2>Que desea modificar?</H2>

<table width="640">
<tr><td width="70%">
<H5>
- La Categoria<br>
- El contenido del mensaje<br>
- El Autor<br>
- El idioma original del Mensaje<br>
</H5>
</td>
<td width="30%">
<a href="/mistica/bdadmin/formu1.php3/id/<?echo $id_mensaje?>">Formulario 1</a>
</td>
</tr>
<tr><td width="70%">
<H5>
- El titulo original<br>
- Notas del mensaje
</H5>
</td>
<td width="30%">
<a href="/mistica/bdadmin/formu6.php3/id/<?echo $id_mensaje?>">Formulario 6</a>
</td>
</tr>
<tr><td width="70%">
<H5>
- Un documento atachado
</H5>
</td>
<td width="30%">
<a href="/mistica/bdadmin/formu4.php3/id/<?echo $id_mensaje?>">Formulario 4</a>
</td>
</tr>
</table>
 <br>

<?
}
}

/*
if ($submit) {
if ($id_mensajes) {
$id_mensaje=$id_mensajes;
}
$conn=pg_pconnect("dbname=emecmistica user=postgres");
$qcategorie=pg_exec($conn, "select id_categoria from mensajes where id_mensaje='$id_mensaje'");
$getcath=pg_fetch_row($qcategorie, 0);
$cat=$getcath[0];
if ($cat !="C2") {
?>
<H3>Que desea modificar?</H3>
<form action="upformix.php3" method=post>
<INPUT TYPE=hidden NAME=id_mensaje VALUE=<? echo $id_mensaje?>><BR>
<table width="640">
<tr><td width="70%">
<H5>
- La Categoria<br>
- El contenido del mensaje<br>
- El Autor<br>
- El idioma original del Mensaje<br>
</H5>
</td>
<td width="30%">
<a href="/bdadmin/formu1.php3/id/<?echo $id_mensaje?>">Formulario 1</a>
</td>
</tr>
<tr><td width="70%">
<H5>
- Las Palabras Claves<br>
- El tema<br>
- La fuente<br>
- El Reply<br>
- El numero de la Sintesis<br>
</H5>
</td>
<td width="30%">
<a href="/bdadmin/formu2.php3/id/<?echo $id_mensaje?>">Formulario 2</a>
</td>
</tr>
<tr><td width="70%">
<H5>
- Uno de los titulos<br>
- una sintesis<br>
</H5>
</td>
<td width="30%">
<a href="/bdadmin/formu3.php3/id/<?echo $id_mensaje?>">Formulario 3</a>
</td>
</tr>
<tr><td width="70%">
<H5>
- Un documento attachado
</H5>
</td>
<td width="30%">
<a href="/bdadmin/formu4.php3/id/<?echo $id_mensaje?>">Formulario 4</a>
</td>
</tr>
</table>
</form>
<?
}
if ($cat =="C2") {
?>
<H1>Que desea modificar?</H1>
<form action="upformix.php3" method=post>
<INPUT TYPE=hidden NAME=id_mensaje VALUE=<? echo $id_mensaje?>><BR>

<table width="640">
<tr><td width="70%">
<H5>
- La Categoria<br>
- El contenido del mensaje<br>
- El Autor<br>
- El idioma original del Mensaje<br>
</H5>
</td>
<td width="30%">
<a href="/bdadmin/formu1.php3/id/<?echo $id_mensaje?>">Formulario 1</a>
</td>
</tr>
<tr><td width="70%">
<H5>
- El titulo original<br>
- Notas del mensaje
</H5>
</td>
<td width="30%">
<a href="/bdadmin/formu6.php3/id/<?echo $id_mensaje?>">Formulario 6</a>
</td>
</tr>
<tr><td width="70%">
<H5>
- Un documento attachado
</H5>
</td>
<td width="30%">
<a href="/bdadmin/formu4.php3/id/<?echo $id_mensaje?>">Formulario 4</a>
</td>
</tr>
</table>
 <br>
</form>
<?
}
}
*/
?>
</BODY>
</HTML>


