<?php

if ($submito) {
include "foo.php3";
$conn=pg_pconnect("dbname=emec2 user=postgres"); 
$email=trim($email);
$ape=trim($ape);
$nom=trim($nom);
$ape=strtolower($ape);
$nom=strtolower($nom);
$comments=trim($comments);
$longmail=strlen($email);
$lonape=strlen($ape);
$longnom=strlen($nom);
$longcomments=strlen($comments);
if (($longcomments !=0)&& (($longmail !=0) || ($longape !=0))) {

if ($longmail !=0) {
$querymail=pg_exec($conn, "select id_miembro from communidad where e_mail_miembro like '%$email%' or e_mail_otros like '%$email%'");
if (pg_numrows($querymail) !=0) {
for ($w=0; $w<pg_numrows($querymail); $w++) {
$getaut=pg_fetch_row($querymail, $w);
$numero=$getaut[0];
}
}
}
if (($longmail==.0) || (pg_numrows($querymail)==0)){
$queryaut=pg_exec($conn, "select id_miembro from communidad where apellido_miembro like '$ape%'");
if (pg_numrows($queryaut) >1) {
$queryaut=pg_exec($conn, "select id_miembro from communidad where apellido_miembro='$ape' and nombre_miembro'$nom'");
}
if (pg_numrows($queryaut) !=0) {
for ($t=0; $t<pg_numrows($queryaut); $t++) {
$getauti=pg_wfetch_row($queryaut, $t);
$numero=$getauti[0];
}
}
}
if ($numero) {
$comments="$comments\n Puede acceder a la pagina de modificación del estatudo de un miembro : \n http://funredes.org/mistica/bdadmin/upcom.php3/id/$numero";
}
}
//m=mail("c1@funredes.org", "Modificacion del estatudo de un miembro", $comments";
include "gracias.php3";
}
