<?php
include("includes/site_info.php");
include('session_handler.inc');

$WUserID = $_SESSION['Sess_UserId'];
$WUserType = $_SESSION['Sess_UserType'];
$WUserLastVisit = $_SESSION['Sess_LastVisit'];
$WUsername = $_SESSION['Sess_UserName'];
$result=mysql_query("SELECT * FROM members LEFT JOIN adverts ON (mem_userid=adv_userid) WHERE mem_userid=$WUserID",$link);
$sql_array = mysql_fetch_object($result);


?>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="white_back_t_xb p5">
                  <tr>
                    <td colspan="2" class="grey_12 orange_row_back solid_line_separator">
                      <div style="background-color:#0000FF; width:10px; height:10px; float:left; margin-top:3px; margin-right:5px;"><img src="images/spacer.gif" width="10" height="10"></div> 
                    Basic Information                   </td>
  </tr>
                  <tr>
                    <td width="10">&nbsp;</td>
                    <td><table width="100%" border="0" cellspacing="0" cellpadding="5" class="white_back_t_xb p5">
                      <tr>
                        <td valign="baseline">Profile Title </td>
                        <td><strong>
                        <?=$sql_array->adv_title?>
                        </strong></td>
                      </tr>
                      <tr>
                        <td width="150" valign="baseline">Gender</td>
                        <td><strong>
                        <?php if('M'==$sql_array->mem_sex) {echo "Male";}
                                  if('F'==$sql_array->mem_sex) {echo "Female";}
                                  if('C'==$sql_array->mem_sex) {echo "Couple";}?>
                        </strong> </td>
                      </tr>
                      <tr>
                        <td valign="baseline">Date of Birth</td>
                        <td><strong>
                        <?=$sql_array->mem_dob?>
                        </strong></td>
                      </tr>
                      <tr>
                        <td valign="baseline">City/Town</td>
                        <td><strong>
                        <?=$sql_array->mem_city?>
                        </strong></td>
                      </tr>
                      <tr>
                        <td valign="baseline">State</td>
                        <td><strong>
                        <?=$sql_array->mem_state?>
                        </strong></td>
                      </tr>
                      <tr>
                        <td valign="baseline">Country</td>
                        <td><strong>
                        <?php
						$countryr=mysql_query("select * from Geo_Countries where CountryId='$sql_array->mem_country'");
						while($rst= mysql_fetch_array($countryr))
						{
						echo $rst["Country"];
						}
						?>
                        </strong> </td>
                      </tr>
                      <tr>
                        <td valign="baseline">Postcode/Zipcode</td>
                        <td><strong>
                        <?=$sql_array->adv_zipcode?>
                        </strong></td>
                      </tr>
                      <tr>
                        <td valign="baseline">Relationship Status</td>
                        <td><strong>
                        <?php
						$maritalr=mysql_query("select * from dropvalue where drop_name='marital' and drop_active='Y' and drop_id='$sql_array->adv_marital'");
						while($rst= mysql_fetch_array($maritalr))
						{
						echo $rst["drop_value"];
						}
						?>
                        </strong> </td>
                      </tr>
                      <tr>
                        <td valign="baseline">I'm looking for</td>
                        <td>
                          <strong>
                          <?php
						  $seeking_value=explode("|",$sql_array->adv_seeking);
						  foreach ($seeking_value as $j){ 
						  $seekingr=mysql_query("select drop_value from dropvalue where drop_name='seeking' and drop_active='Y' and drop_id='$j'");
						  while($rst= mysql_fetch_array($seekingr))
						  {
						  $adv_seeking[] = $rst['drop_value'];
						  }
						  }
						  echo implode (', ', $adv_seeking);
						  ?>
                          </strong> </td>
                      </tr>
                      <tr>
                        <td valign="baseline">Religious Views</td>
                        <td><strong>
                        <?php
						$religiousr=mysql_query("select * from dropvalue where drop_name='religious' and drop_active='Y' and drop_id='$sql_array->adv_religious'");
						while($rst= mysql_fetch_array($religiousr))
						{
						echo $rst["drop_value"];
						}
						?>
                        </strong> </td>
                      </tr>
                      <tr>
                        <td valign="baseline">Political Views</td>
                        <td><strong>
                        <?=$sql_array->adv_politicalview?>
                        </strong></td>
                      </tr>
                    </table></td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td align="right"><input name="Button" type="button" class="button" value="Edit Changes" onclick="callpage('profile_basic')"/></td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                  </tr>
</table>