function validateForm() { if( document.suggest." . $_SESSION['tng_yourname'] . ".value == \"\" ) { alert('$text[entername]'); return false; } if( document.suggest." . $_SESSION['tng_email'] . ".value.length == 0 || document.suggest." . $_SESSION['tng_email'] . ".value.indexOf(\".\") < 1 || document.suggest." . $_SESSION['tng_email'] . ".value.indexOf(\"@\") <= 0 ) { alert('$text[enteremail]'); return false; } if( document.suggest." . $_SESSION['tng_comments'] . ".value == \"\" ) { alert('$text[entercomments]'); return false; } return true; } \n"; if( $enttype == "I" ) { $typestr = "person"; $query = "SELECT firstname, lnprefix, lastname, suffix, sex, nameorder, living, branch, disallowgedcreate, IF(birthdatetr !='0000-00-00',YEAR(birthdatetr),YEAR(altbirthdatetr)) as birth, IF(deathdatetr !='0000-00-00',YEAR(deathdatetr),YEAR(burialdatetr)) as death FROM $people_table, $trees_table WHERE personID = \"$ID\" AND $people_table.gedcom = \"$tree\" AND $people_table.gedcom = $trees_table.gedcom"; $result = mysql_query($query) or die ("$text[cannotexecutequery]: $query"); if( $result ) { $row = mysql_fetch_assoc($result); $rightbranch = checkbranch( $row[branch] ); $row[allow_living] = !$row[living] || $livedefault == 2 || ( $allow_living && $rightbranch ) ? 1 : 0; $disallowgedcreate = $row[disallowgedcreate]; $name = getName( $row ) . " ($ID)"; mysql_free_result($result); } $years = getYears( $row ); } elseif( $enttype == "F" ) { $typestr = "family"; $query = "SELECT familyID, husband, wife, living, marrdate, gedcom, branch FROM $families_table WHERE familyID = \"$ID\" AND gedcom = \"$tree\""; $result = mysql_query($query) or die ("$text[cannotexecutequery]: $query"); $row = mysql_fetch_assoc($result); mysql_free_result($result); $rightbranch = checkbranch( $row[branch] ) ? 1 : 0; $row[allow_living] = !$row[living] || $livedefault == 2 || ( $allow_living && $rightbranch ) ? 1 : 0; $name = "$text[family]: " . getFamilyName( $row ); $years = ""; } elseif( $enttype == "S" ) { $query = "SELECT title FROM $sources_table WHERE sourceID = \"$ID\" AND gedcom = \"$tree\""; $result = mysql_query($query) or die ("$text[cannotexecutequery]: $query"); $row = mysql_fetch_assoc($result); mysql_free_result($result); $query = "SELECT count(personID) as ccount FROM $citations_table, $people_table WHERE $citations_table.sourceID = '$ID' AND $citations_table.persfamID = $people_table.personID AND $citations_table.gedcom = $people_table.gedcom AND living = '1'"; $sresult = mysql_query($query) or die ("$text[cannotexecutequery]: $query"); $srow = mysql_fetch_assoc( $sresult ); $row[living] = $srow[ccount] ? 1 : 0; if( !$row[living] || $livedefault == 2 || ( !$livedefault && $allow_living_db && ( !$assignedtree || $assignedtree == $row[gedcom] ) ) ) $row[allow_living] = 1; else $row[allow_living] = 0; mysql_free_result( $sresult ); $name = "$text[source]: $row[title] ($ID)"; $years = ""; } elseif( $enttype == "R" ) { $query = "SELECT reponame FROM $repositories_table WHERE repoID = \"$ID\" AND gedcom = \"$tree\""; $result = mysql_query($query) or die ("$text[cannotexecutequery]: $query"); $row = mysql_fetch_assoc($result); mysql_free_result($result); $row[living] = 0; $row[allow_living] = 1; $name = "$text[repository]: $row[reponame] ($ID)"; } if( $enttype ) { $flags[tabs] = $tngconfig[tabs]; $headline = "$text[suggestchange]: $name"; $comments = $text[comments]; tng_header( $headline, $flags ); $photostr = showSmallPhoto( $ID, $name, $row[allow_living], 0 ); echo tng_DrawHeading( $photostr, $name, $years ); echo tng_coreicons(); $innermenu = " \n"; echo tng_menu( $enttype, "suggest", $ID, $innermenu ); $buttontext = $text[submitsugg]; } else { $headline = $text[contactus]; $comments = $text[comments2]; tng_header( $headline, $flags ); echo "
$headline
$newmessage
\n"; } if( $enttype ) echo "$headline| : | |
| : | |
| : | |