<?php
//v1.0.4 www.bcoos.net 2006/10 GPL
//v3.1 www.exoops.info 2006/03 
##################################################################################
# Friend Finder for e-xoops  Version 3.02 beta                                 #
#                                                                                #
# Script design  : PhpMeet  :   Copyright 2002 Jeremy Ross-webmaster@phprank.com #
# Created 15/01/02              Last Modified 15/01/02                           #
# Scripts Home              :   http://www.jrscripts.com                         #
#                                                                                #
# Xoops-RC2 French Version  :   jokerman@free.fr                                 #
# Web Home                     :   http://www.webetfric.com                      #
#                                                                                #
# Xoops-RC2 English Version :          Neon@neon.qldgamers.com                   #
# Web Home                  :   http://neon.qldgamers.com                        #
#                                                                                #
#                 Redesigned and new improvemends by                             #
#        eagle81 Manuel Caballero       Manuel@dancepartner.net                  #
#                    http://www.dancepartner.net                                 #
#                             2002-09-12                                         #
##################################################################################
// ORIGINAL FILE INFO
include("../../../mainfile.php");
include(XOOPS_ROOT_PATH."/header.php");
include(XOOPS_ROOT_PATH."/modules/friendfinder/header.php");
include(XOOPS_ROOT_PATH."/modules/friendfinder/cache/config.php");
global $dateformat, $autoactive, $imagesize, $heightunit, $weightunit, $XoopsTheme,$xoopsUser;
$username=$xoopsUser->uname("E");
$xoopsOption['show_rblock'] =1;
        OpenTable();
//************************************************************
if ($page == "update") {
$sql = "UPDATE ".$db->prefix("friendfinder")." SET sex='$sex', name='$name', active='$active',  partner='$partner', category='$category', country='$country', state='$state', city='$city', hobby='$hobby', Description='$Description', height='$height', weight='$weight', birth='$birth' WHERE id = '$id'";
$result = $db->query($sql);
echo ""._TEXTPROFILEUPDATED."<br><br><a href=\"index.php\">"._TEXTADDSEARCH."</a>";
} else {
$sql = "SELECT * FROM ".$db->prefix("friendfinder")."
inner join ".$db->prefix("friendfinder_state")."
on state = cid
inner join ".$db->prefix("friendfinder_sex")."
on sex = sid
inner join ".$db->prefix("friendfinder_category")."
on category = catid WHERE id = '$id'";
$result = $db->query($sql);
while ($i = $db->fetchArray($result)) {
echo"
<center>
  <a href=pic.php?username=".$username.">"._TEXTMEMBERCHANGEPIC."</a>
</center>
<form action=edit.php?id=".$id."&page=update method=post enctype=post>
  <table border=0 cellpadding=1 cellspacing=0 align=center>
    <tr>
      <INPUT TYPE=hidden name=activ value=".$autoactive."></input>
      <td>"._TEXTSEX."</td>
      <td>";
             list($numrows) = $db->fetchRow($db->query("select sid, sextitle from ".$db->prefix("friendfinder_sex").""));
             if ($numrows>0) {
	         $result = $db->query("select sid, sextitle from ".$db->prefix("friendfinder_sex")." order by sextitle");
	         echo "<select class='select' name=\"sex\"><option value=".$i[sid].">".$i[sextitle]."</option>";
	         while(list($sid, $sextitle) = $db->fetchRow($result)) {
	         echo "<option value=".$sid.">$sextitle</option>";
             }
             }
             echo"</td>
      </tr>
      <tr>
      <td>"._TEXTREALNAME."</td>
      <td><input type=text class='text' name=name maxlength=50 value=".$i[name]."></td>
      </tr>
      <tr>
      <td>"._TEXTREGION."</td>
      <td> ";
             list($numrows) = $db->fetchRow($db->query("select cid, title from ".$db->prefix("friendfinder_state").""));
	         if ($numrows>0) {
	         $result = $db->query("select cid, title from ".$db->prefix("friendfinder_state")." order by title");
	         echo "<select class='select' name=\"state\"><option value=".$i[cid].">".$i[title]."</option>";
	         while(list($cid, $title) = $db->fetchRow($result)) {
	         echo "<option value=".$cid.">$title</option>";
             }
             }
	
   echo "</td>
      </tr>
      <tr>
      <td>"._TEXTCOUNTRY."</td>
      <td>"._SELECTCOUNTRY."</td>
      </tr>
      <tr>
      <td>"._TEXTCITY."</td>
      <td><input type=text clas='text' name=city maxlength=99 value=".$i[city]."></td>
      </tr>
      <tr>
      <td>"._TEXTPSEX."</td>
      <td>";
             list($numrows) = $db->fetchRow($db->query("select sid, sextitle from ".$db->prefix("friendfinder_sex").""));
             if ($numrows>0) {
	         $result = $db->query("select sid, sextitle from ".$db->prefix("friendfinder_sex")." order by sextitle");
	         echo "<select class='select' name=\"partner\"><option value=".$i[sid].">".$i[sextitle]."</option>";
	         while(list($sid, $sextitle) = $db->fetchRow($result)) {
	         echo "<option value=".$sid.">$sextitle</option>";
             }
             }
             echo"</td>
      </tr>
      <tr>
      <TD>"._CATEGORY.':'."</td>
      <TD>";
             list($numrows) = $db->fetchRow($db->query("select catid, cattitle from ".$db->prefix("friendfinder_category").""));
             if ($numrows>0) {
	         $result = $db->query("select catid, cattitle from ".$db->prefix("friendfinder_category")." order by cattitle");
	         echo "<select class='select' name=\"category\"><option value=".$i[catid].">".$i[cattitle]."</option>";
	         while(list($catid, $cattitle) = $db->fetchRow($result)) {
	         echo "<option value=".$catid.">$cattitle</option>";
             }
             }
             echo"</td>
      </tr>
      <tr>
      <td>"._TEXTTANZ."</td>
      <td><textarea class='textarea' cols=20 rows=4 name=hobby>".$i[hobby]."</textarea></td>
      </tr>
      <tr>
      <td>"._TEXTDESCRIPTION."</td>
      <td><textarea class='textarea' cols=20 rows=4 name=Description>".$i[Description]."</textarea></td>
      </tr>
      <tr>
      <td>"._TEXTHEIGHT."</td>
      <td><input type=text class='text' name=height maxlength=20 value=".$i[height].">".$heightunit."</td>
      </tr>
      <tr>
      <td>"._TEXTWEIGHT."</td>
      <td><input type=text class='text' name=weight maxlength=20 value=".$i[weight].">".$weightunit."</td>
      <tr>
      <tr>
      <td>"._TEXTBIRTHDAY."</td>
      <td><input type=text class='text' name=birth maxlength=10 value=".$i[birth]."></td>
      <tr>
      <td><input type=submit class='button' value="._TEXTMEMBERBUTTON."></td>
      </tr>
  </table>
</form>";
}
}
//************************************************************
        CloseTable();
include("../../../footer.php");
?>
