<?php
session_start();



include("../includes/site_config.php");

include('../session_handler.inc');

include('../pop_lists.inc');

include('../error.php');

include_once __INCLUDE_CLASS_PATH."/class.DB.php";

$db = new DB();

include('../message.php');

 $mode=$_GET['mode'];

 $edit_mem=$_REQUEST['edit_mem'];

# retrieve the template

$area = 'member';

//echo "<PRE>";
//print_r($_REQUEST);


$Sess_UserType = $_SESSION['Sess_UserType'];

if ($Sess_UserType != "A") {

        exit;

}



function getTemplateByName($name,$data,$lang_ID){

    $mailtemplate =& MTemplateManager::getInstance();

    $m_template = $mailtemplate->Get($name);

    return array($m_template->type,$m_template->Parse($data,$lang_ID));

}

function getDefaultLanguage($mem_id){

    $db =& DB::GetInstance();

    $mem_id = $db->escape($mem_id);

    $query="SELECT lang_id FROM members WHERE mem_userid='$mem_id'";

    return $db->get_var($query);

}



function send_mail  ($to_address,  $from_address,  $subject,  $message, $type, $on_switch, $send_type='outside',$charset='ISO 8859-1')  {



GLOBAL $Sess_UserId;

GLOBAL $Sess_UserName;



    if ($send_type == 'inside' || $send_type == 'inside_hidden'){



        $res = mysql_query("SELECT * FROM members WHERE mem_email='$to_address'");

        echo mysql_error();

        if ($receiver = mysql_fetch_assoc($res)){



	        $tempdate=date("Y/m/d");

	        $message = mysql_escape_string($message);

	        $title = mysql_escape_string($title);

















	        mysql_query("INSERT INTO messages SET

	                msg_senderid    = $Sess_UserId,

	                msg_receiverid  = $receiver[mem_userid],

	                msg_senderhandle= '$Sess_UserName',

	                msg_title   = '$subject',

	                msg_text    = '$message',

	                msg_dateadded = '$tempdate',

	                msg_read = 'U'".(($send_type == 'inside_hidden')?", msg_senderdel = 'Y'":""));

        }

    }elseif($send_type == 'outside'){

            if ($type == "html" || $type == "text/html") {

                $headers = "MIME-Version: 1.0\n";

                $headers .= "Content-Type: text/html; charset=$charset\n";

                $headers .= "Content-Transfer-Encoding: 8bit\n";

                $headers .= "From: $from_address\n";

                $headers .= "Reply-To: $from_address\n";

            } else {

                $headers = "MIME-Version: 1.0\n";

                $headers = "Content-Type: text/plain; charset=$charset\n";

                $headers .= "From: $from_address\n";

                $headers .= "Reply-To: $from_address\n";

            }



            if ($on_switch=='ON')

            {

                $message = stripslashes($message);

                ini_set("sendmail_from",$CONST_MAIL);

                mail($to_address,$subject,$message,$headers);

            }

    }

}






# process an authorisation

if ($mode=='next') {

    $txtComment=$_POST['txtComment'];

    $txtMyComment=$_POST['txtMyComment'];

    $txtTitle=$_POST['txtTitle'];

    $rdoApprove=$_POST['rdoApprove'];

 	$hiddenuserid=$_POST['hiddenuserid'];

    $hiddenname=$_POST['hiddenname'];

    $hiddenemail=$_POST['hiddenemail'];

    $offset=$_POST['offset'];

    $reason=stripslashes($_POST['reason']);

    $txtComment=mysql_escape_string($txtComment);

    $txtTitle=mysql_escape_string($txtTitle);

    if ($rdoApprove=='Approve') {

            # approved will show up in search

           $query="update adverts set adv_title = '$txtTitle', adv_comment = '$txtComment', adv_approved = 1 where adv_userid=$hiddenuserid";
 

            if (!mysql_query($query,$link)) {error_page(mysql_error(),GENERAL_SYSTEM_ERROR);}



           // $query="update mymatch set mym_comment = '$txtMyComment' where mym_userid=$hiddenuserid";

           // if (!mysql_query($query,$link)) {error_page(mysql_error(),GENERAL_SYSTEM_ERROR);}



            $data['ReceiverName'] = $hiddenname;

            $data['CompanyName'] = $CONST_COMPANY;

            $data['Url'] = $CONST_URL;

            $data['SupportEmail'] = $CONST_SUPPMAIL;



            list($type,$message) = getTemplateByName("Approve_Mail",$data,getDefaultLanguage($hiddenuserid));

            send_mail ("$hiddenemail", "$CONST_MAIL", "$CONST_COMPANY ".PRGAUTHADS_APR, $message,$type,"ON");

            $admin_action = 'Y';

            //include("$SITE_ROOT/generate_profile.php");
			
	/*	?>
			<script language="javascript">
window.location='index.php';
   // header("Location: prgpicadmin.php");

   // exit;
</script>
<?php */
   

    } 
	
	
elseif ($rdoApprove=='Reject') {

            # rejected will not show up in search or for approval until user amends

            $query="update adverts set adv_title = '$txtTitle', adv_comment = '$txtComment',adv_approved = 2, adv_rejectreason = '".mysql_escape_string($reason)."' where adv_userid=$hiddenuserid";

            if (!mysql_query($query,$link)) {error_page(mysql_error(),GENERAL_SYSTEM_ERROR);}

            $query="update mymatch set mym_comment = '$txtMyComment' where mym_userid=$hiddenuserid";

            if (!mysql_query($query,$link)) {error_page(mysql_error(),GENERAL_SYSTEM_ERROR);}

            $data['ReceiverName'] = $hiddenname;

            $data['CompanyName'] = $CONST_COMPANY;

            $data['Url'] = $CONST_URL;

            $data['Reason'] = $reason;

            $data['SupportEmail'] = $CONST_SUPPMAIL;



            list($type,$message) = getTemplateByName("Reject_Mail",$data,getDefaultLanguage($hiddenuserid));

            send_mail ("$hiddenemail", "$CONST_MAIL", "$CONST_COMPANY ".PRGAUTHADS_UNAPR, $message,$type,"ON");



    } elseif ($rdoApprove=='Skip') {

        $offset++;

    }

}

# select advert data

//Time operations

$curr_time = time();

$mod_time = $curr_time - BLOCK_PERIOD_AVAILABLE;

$modified_time = date("Y-m-d H:i:s", $mod_time);

//EOF Time operations



if (!$offset) $offset=0;

$blocking = mysql_query("LOCK TABLES adverts WRITE READ"); // Lock table for Read and Write

//$result = mysql_query("SELECT *, mem_email, mem_confirm

//                       FROM adverts

//                           LEFT JOIN members ON (adv_userid=mem_userid)

//                           WHERE block_time<='$modified_time' AND adv_approved=0 AND mem_confirm = 1 LIMIT $offset,1",$link);




if($mode=='EDIT')
{
 $result = mysql_query("SELECT *, mem_email, mem_confirm

                       FROM adverts

                           LEFT JOIN members ON (adv_userid=mem_userid)

                           WHERE adv_userid=$edit_mem LIMIT $offset,1",$link);

 $TOTAL = mysql_num_rows($result);


}
else{

$result = mysql_query("SELECT *, mem_email, mem_confirm

                       FROM adverts

                           LEFT JOIN members ON (adv_userid=mem_userid)

                           WHERE adv_approved=0 AND mem_confirm = 1 LIMIT $offset,1",$link);

$TOTAL = mysql_num_rows($result);
}
# if nothing is returned then show error otherwise get data

if ($TOTAL < 1) {

        //$error_message="<p><a href='$CONST_LINK_ROOT/admin/index.php'>Continue</a></p>";

        //display_page($error_message,PRGAUTHADS_TEXT1);
echo "<script> location.href='$CONST_LINK_ROOT/admin/index.php'</script>";

} else {

        $sql_array = mysql_fetch_object($result);

        $update_blocktime = mysql_query("UPDATE adverts SET block_time = NOW() WHERE adv_userid = '".$sql_array->adv_userid."'");

}

$end_blocking = mysql_query("UNLOCK TABLES"); //Unlock Table

# place advert data into variables for display

$advuser=$sql_array->adv_userid;

$advname=$sql_array->adv_username;

$country=$sql_array->adv_countryid;

$state=$sql_array->adv_stateid;

$city=$sql_array->adv_cityid;

$location=$sql_array->adv_location;

$seeking=$sql_array->adv_seeking;

$bodytype=$sql_array->adv_bodytype;

$marital=$sql_array->adv_marital;

$ethnicity=$sql_array->adv_ethnicity;

$religion=$sql_array->adv_religion;

$children=$sql_array->adv_children;

$smoker=$sql_array->adv_smoker;

$drink=$sql_array->adv_drink;

$eyecolor=$sql_array->adv_eyecolor;

$haircolor=$sql_array->adv_haircolor;

$height=$sql_array->adv_height;

$advtitle=$sql_array->adv_title;

$employment=$sql_array->adv_profession;

$income=$sql_array->adv_income;

$education=$sql_array->adv_education;

$picture=$CONST_LINK_ROOT.$sql_array->adv_picture;

$email=$sql_array->mem_email;

$comment=$sql_array->adv_comment;

$sex=$sql_array->adv_sex;

$comment=stripslashes($comment);

$advtitle=stripslashes($advtitle);

if ($sql_array->adv_seekmen=='Y') {$seekmen='checked';} else {$seekmen='';}

if ($sql_array->adv_seekwmn=='Y') {$seekwmn='checked';} else {$seekwmn='';}

if ($sql_array->adv_seekcpl=='Y') {$seekcpl='checked';} else {$seekcpl='';}

include('../languages/has_profile_EN.inc.php');

$result=mysql_query("SELECT * FROM mymatch WHERE mym_userid=$advuser") or die(mysql_error());

if (mysql_num_rows($result) > 0) $sql_they=mysql_fetch_object($result);

if ($sql_they->mym_gender=='M') $mygender= PRGSTATS_MALES;

elseif ($sql_they->mym_gender=='F') $mygender= PRGSTATS_FEMALES;

elseif ($sql_they->mym_gender=='C') $mygender= PRGSTATS_COUPLE;




$you_count =$db->get_var("SELECT count(*) FROM youtube WHERE you_userid=$advuser");
?>

<script language=javascript>
function getCookie(name){
   var result = null;
   var myCookie = " " + document.cookie + ";";
   var searchName = " " + name + "=";
   var startOfCookie = myCookie.indexOf(searchName);
   var endOfCookie;

   if (startOfCookie != -1){
      startOfCookie += searchName.length;
      endOfCookie = myCookie.indexOf(";",startOfCookie);
      result = unescape(myCookie.substring(startOfCookie,endOfCookie));
   }
   return result;
}
	country = getCookie('WCountry');
	state = getCookie('WState');
	city = getCookie('WCity');
	
	<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0

  window.open(theURL,winName,features);
  return false;
}
//-->

	
	
</script>



<?php 
if(!$edit_mem){
include("include/header.php"); 
}?>




<div class="borderpage"><div class="borderpage2">
  <table align="<?php print("$CONST_TABLE_ALIGN"); ?>" border="0" cellspacing="<?php print("$CONST_TABLE_CELLSPACING"); ?>" cellpadding="<?php print("$CONST_TABLE_CELLPADDING"); ?>">

    <tr>

      
    <td width="421" align="right"><!--DWLayoutEmptyCell-->&nbsp; </td>

    <td width="113" align="right"><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td width="176" align="right"><!--DWLayoutEmptyCell-->&nbsp;</td>
    </tr>

    <tr>



    <td class="titlehead">Edit Profile </td>

    <td class="titlehead">&nbsp;</td>
    <td class="admin-head2"><strong>Edit Media </strong></td>
    </tr>

    <tr><td>

        <table width="100%"  border="0" cellpadding="<?php print("$CONST_SUBTABLE_CELLPADDING"); ?>" cellspacing="<?php print("$CONST_SUBTABLE_CELLSPACING"); ?>">

        <form enctype='multipart/form-data' method='post' action='<?php echo $CONST_LINK_ROOT?>/admin/prgauthads.php<?php print("?PHPSESSID=".session_id()); ?>&mode=next' name="FrmAuthorise">

          <input type="hidden" name="offset" value="<?=$offset?>" />

          <tr>

            <td valign="top" class="admin-head2" colspan="4"><b><?php print("$advname"); ?></b></td>
          </tr>

            <input type='hidden' name="hiddenuserid" value="<?php print("$advuser"); ?>">

            <input type='hidden' name="hiddenemail" value="<?php print("$email"); ?>">

            <input type='hidden' name="hiddenname" value="<?php print("$advname"); ?>">
			

 <? //if($GEOGRAPHY_JAVASCRIPT)
		  //{
		  ?>
          <script language="javascript" src="geography.js"></script>
          <tr class="tdodd" > 
            <td height="24"  align="left"><span class=mandatory>*</span> <?php echo GENERAL_COUNTRY?></td>
            <td width="112" > <select class="input" name="WCountry" id="WCountry" size="1" tabindex="1" onchange="onCountryListChange('FrmAuthorise', 'WCountry', 'WState', 'WCity');">
                <option value="0" selected></option>
              </select> </td>
            <td  align="left"><span class=mandatory>*</span> <?php echo GENERAL_STATE?></td>
            <td > <select class="input" name="WState" id="WState" size="1"  tabindex='14' onChange="onStateListChange('FrmAuthorise', 'WCountry', 'WState', 'WCity');">
                <option value="0" selected></option>
              </select> </td>
          </tr>
          <tr class="tdeven" > 
            <td height="24"  align="left"><span class=mandatory>*</span> <?php echo GENERAL_CITY?></td>
            <td colspan="3" > <select class="input" name="WCity" id="WCity" size="1"   tabindex='15' onChange="onCityListChange('FrmAuthorise', 'WCity');">
                <option value="0" selected></option>
              </select> </td>
          </tr>
          <script language="javascript"> 
                        initialize('FrmAuthorise', 'WCountry', 'WState', 'WCity', new Array('<?=$country?>'), new Array('<?=$state?>'), new Array('<?=$city?>'));
          </script>
		  <?
		  // } 
		  //else
		  // {
		   ?>
		  
		   <?
		   // }
		   ?>	

          <tr class="tdodd">

            <td  align="left"><?php echo OPTION_SEEKING?></td>

            <td > <select name="lstSeeking" size="1" class="input" tabindex="3">

                <?php populate_lists('SKG','base','adv',$seeking); ?>

              </select></td>

            <td  align="left"><?php echo OPTION_BODY_TYPE?></td>

            <td > <select name="lstBodyType" size="1" class="input" tabindex="4">

                <?php populate_lists('BDY','base','adv',$bodytype); ?>

              </select></td>
          </tr>

          <tr class="tdeven">

            <td  align="left"><?php echo ADVERTISE_HEIGHT?></td>

            <td > <select name="lstHeight" size="1" class="input" tabindex="5">

                <option <?php if ($height == "Not stated") { print("selected");} ?> value="Not stated"><?php echo PRGAMENDAD_NOT_STATED?></option>

                <?

                $out = "";

                $prev = "";

                for ($cm=122; $cm<=230; $cm++) {

                    $in_inches = round($cm/2.54);

                    $in_feets = floor($cm/30.48);

                    if ($in_inches-$in_feets*12 == 12) $in_feets++;

                    $cur_i = $in_feets."'".($in_inches-$in_feets*12)."&quot;";

                    $selected = ($cm == $height) ? " SELECTED" : "";

                    if ($prev != $cur_i) $out .= '<option value="'.$cm.'"'.$selected.'>'.$cur_i.'('.$cm.ADVERTISE_CM.')'.'</option><br>';

                    $prev = $cur_i;

                }

                echo $out;

                ?>

                </select></td>

            <td  align="left"><?php echo OPTION_CHILDREN?></td>

            <td > <select name="lstChildren" size="1" class="input" tabindex="6">

                <?php populate_lists('CHL','base','adv',$children); ?>

              </select></td>
          </tr>

          <tr class="tdodd">

            <td  align="left"><?php echo OPTION_SMOKER?></td>

            <td > <select name="lstSmoker" size="1" class="input" tabindex="7">

                <?php populate_lists('SMK','base','adv',$smoker); ?>

              </select></td>

            <td  align="left"><?php echo OPTION_RELIGION?></td>

            <td > <select name="lstReligion" size="1" class="input" tabindex="8">

                <?php populate_lists('RLG','base','adv',$religion); ?>

              </select></td>
          </tr>

          <tr class="tdeven">

            <td  align="left"><?php echo OPTION_MARITAL?></td>

            <td > <select name="lstMarital" size="1" class="input" tabindex="9">

                <?php populate_lists('MRT','base','adv',$marital); ?>

              </select></td>

            <td  align="left"><?php echo OPTION_ETHNICITY?></td>

            <td > <select name="lstEthnicity" size="1" class="input" tabindex="10">


                <?php populate_lists('ETH','base','adv',$ethnicity); ?>

              </select></td>
          </tr>

          <tr class="tdodd">

            <td  align="left"><?php echo OPTION_EDUCATION?></td>

            <td > <select class="input" name="lstEducation" size="1" tabindex="11">

                <?php populate_lists('EDU','base','adv',$education); ?>

              </select></td>

            <td  align="left"><?php echo OPTION_EMPLOYMENT?></td>

            <td > <select class="input" name="lstEmployment" size="1" tabindex="12">

                <?php populate_lists('EMP','base','adv',$employment); ?>

              </select></td>
          </tr>

          <tr class="tdeven">

            <td  align="left"><?php echo OPTION_INCOME?></td>

            <td > <select class="input" name="lstIncome" size="1" tabindex="13">

                <?php populate_lists('INC','base','adv',$income); ?>

              </select></td>

            <td  align="left"><?php echo OPTION_DRINK?></td>

            <td > <select name="lstDrink" size="1" class="input" tabindex="14">

                <?php populate_lists('DNK','base','adv',$drink); ?>

              </select></td>
          </tr>

          <tr class="tdeven">

            <td  align="left"><?php echo OPTION_EYE_COLOR?></td>

            <td > <select class="input" name="lstEyecolor" size="1" tabindex="15">

                <?php populate_lists('EYE','base','adv',$eyecolor); ?>

              </select></td>

            <td  align="left"><?php echo OPTION_HAIR_COLOR?></td>

            <td > <select name="lstHaircolor" size="1" class="input" tabindex="16">

                <?php populate_lists('HAR','base','adv',$haircolor); ?>

              </select></td>
          </tr>
          <tr class="tdeven">
            <td  align="left"><?php echo SEX?></td>
            <td ><span class="tdhead">
              <select name="select" size="1" class="input" >
                <option <?php if ($sex == "M") { print("selected");} ?> value="M"><?php echo SEX_MALE?></option>
                <option <?php if ($sex == "F") { print("selected");} ?> value="F"><?php echo SEX_FEMALE?></option>
              </select>
            </span></td>
            <td  align="left">&nbsp;</td>
            <td >&nbsp;</td>
          </tr>

          <tr>

            <td colspan="4"  align="left" class="tdfoot">&nbsp;</td>
          </tr>

          <tr>

            <td colspan="4"  align="left" class="tdhead"><!--<input type="checkbox" name="chkSeekmen" value="men" tabindex="11" <?php print($seekmen); ?>>

              <?php echo ADVERTISE_SEEK_M?>&nbsp; <input type="checkbox" name="chkSeekwmn" value="wmn" tabindex="12" <?php print($seekwmn); ?>>
              <?php echo ADVERTISE_SEEK_W?>--></td>
          </tr>

         <?php /*?> <tr class="tdodd">

            <td  align="left"><?php echo PRGAMENDAD_MAIN_PICTURE?></td>

            <td colspan="3">

              <?php

						        include_once __INCLUDE_CLASS_PATH."/class.Picture.php";

						        $picture = new Picture();

						        $aPicture=$picture->GetListByMember($advuser);
								
                                foreach ($aPicture as $pic_array) {

	                        $small = $pic_array->GetInfo('');

		                       $full = $pic_array->GetInfo('');

                                    print("<a href='$CONST_LINK_ROOT/includes$full->Path' target='_blank'><img border='0' src='$CONST_LINK_ROOT/includes$small->Path' width='75' height='75'></a>&nbsp;");

                                }

                        ?>

              <?php

                                if ($CONST_VIDEOS == 'Y' || $CONST_AUDIOS == 'Y')

                                        echo '<br>';



                                if ($CONST_VIDEOS == 'Y') {

							        include_once __INCLUDE_CLASS_PATH."/class.Video.php";

							        $video = new Video();

							        $aVideo=$video->GetListByMember($advuser);



							        if (count($aVideo) > 0) {

							            $sql_videos = array_shift($aVideo);

							            $vid_info = $sql_videos->File->getInfo('medium');



							            if ($sql_videos->vid_private == 'N') {

							               print("<a href='$CONST_LINK_ROOT/includes$vid_info->Path'><img src='$CONST_LINK_ROOT/includes/videos/video.jpg' border=0 width=40 height=40></a>");

							            } else {

							               print("<a href='$CONST_LINK_ROOT/includes$vid_info->Path'><img src='$CONST_LINK_ROOT/includes/videos/video.jpg' border=0 width=40 height=40></a>");

							            }

							        }

                                }



                                if ($CONST_AUDIOS == 'Y') {

							        include_once __INCLUDE_CLASS_PATH."/class.Audio.php";

							        $audio = new Audio();


							        $aAudios=$audio->GetListByMember($advuser);

							        if (count($aAudios) > 0) {

							            $sql_audios = array_shift($aAudios);

							            $aud_info = $sql_audios->getInfo();

							            if ($sql_audios->aud_private == 'N') {

							               print("<a href='$CONST_LINK_ROOT/includes$aud_info->Path'><img src='$CONST_LINK_ROOT/includes/audios/audio.jpg' border=0 width=40 height=40></a>");

							            } else {

							               print("<a href='$CONST_LINK_ROOT/includes$aud_info->Path'><img src='$CONST_LINK_ROOT/includes/audios/audio.jpg' border=0 width=40 height=40></a>");

							            }

							        }

                                }

                        ?>

          <? if ($you_count > 0) {?>   <a href="javascript:;" 
onclick="MM_openBrWindow('<?=$CONST_LINK_ROOT?>/youtube.php?user=<?=$advuser?>','','width=435,height=360');"><img src="<?=$SKIN_IMAGE_PATH?>/you-tube.jpg" border="0"  align="absmiddle"></a><? }?></td>
          </tr><?php */?>

          <tr class="tdeven">

            <td  align="left"><?php echo PRGAMENDAD_TITLE?></td>

            <td colspan="3" > <input type="text" class="input" name="txtTitle" size="30" maxlength='30' tabindex="15" value="<?php print("$advtitle"); ?>"></td>
          </tr>

          <tr class="tdodd">

            <td  align="left" ><b><?php echo ADMINMAIL_MESS?></b></td>

            <td colspan="3" > <textarea  class="inputl"rows="10" name="txtComment" cols="59" tabindex="15"><?php print($comment); ?></textarea></td>
          </tr>

          <!--<tr class="tdeven">

            <td colspan="4"  align="left" ><?php print("$personality"); ?></td>

          </tr>-->

          <tr>

            <td colspan="4"  align="left" class="tdfoot"><b><?php //echo PRGRETUSER_MYMATCH?></b></td>
          </tr>

         <!-- <tr>

            <td colspan="4"  align="left" class="tdhead"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
              <input type="checkbox" name="chkSeekmen2" value="men" tabindex="11" <?php print($seekmen); ?>>
              <?php echo ADVERTISE_SEEK_M?>&nbsp;
              <input type="checkbox" name="chkSeekwmn2" value="wmn" tabindex="12" <?php print($seekwmn); ?>>
              <?php echo ADVERTISE_SEEK_W?></td>
          </tr>-->

          <tr class="tdodd">

            <?php /*?><td  align="left"><?php echo PRGRETUSER_GENDER?></td>

            <td ><?php echo $mygender ?></td>

            <td  align="left">

              <?=PRGRETUSER_SMOKER?>

            </td>

            <td ><?php echo $sql_they->mym_smoker ?></td>

          </tr>

          <tr class="tdeven">

            <td  align="left">

              <?=PRGRETUSER_AGES?>

            </td>

            <td ><?php echo $sql_they->mym_agemin?> - <?php echo $sql_they->mym_agemax ?></td>

            <td  align="left">

              <?=PRGRETUSER_BODYTYPE?>

            </td>

            <td ><?php echo $sql_they->mym_bodytype ?></td>

          </tr>

          <tr class="tdodd">

            <td  align="left">


              <?=PRGRETUSER_HEIGHT?>

            </td>

            <td >

              <?php

                              switch ($sql_they->mym_minheight) {

                                      case "121":

                                                $height=mysql_escape_string("4' 0 (121cm)"); break;

                                      case "124":

                                                $height=mysql_escape_string("4' 1 (124cm)"); break;

                                      case "127":

                                                $height=mysql_escape_string("4' 2 (127cm)"); break;

                                      case "130":

                                                $height=mysql_escape_string("4' 3 (130cm)"); break;

                                      case "132":

                                                $height=mysql_escape_string("4' 4 (132cm)"); break;

                                      case "135":

                                                $height=mysql_escape_string("4' 5 (135cm)"); break;

                                      case "137":

                                                $height=mysql_escape_string("4' 6 (137cm)"); break;

                                      case "140":

                                                $height=mysql_escape_string("4' 7 (140cm)"); break;

                                      case "142":

                                                $height=mysql_escape_string("4' 8 (142cm)"); break;

                                      case "145":

                                                $height=mysql_escape_string("4' 9 (145cm)"); break;

                                      case "147":

                                                $height=mysql_escape_string("4' 10 (147cm)"); break;

                                      case "150":

                                                $height=mysql_escape_string("4' 11 (150cm)"); break;

                                      case "152":

                                                $height=mysql_escape_string("5' 0 (152cm)"); break;

                                      case "155":

                                                $height=mysql_escape_string("5' 1 (155cm)"); break;

                                      case "157":

                                                $height=mysql_escape_string("5' 2 (157cm)"); break;

                                      case "160":

                                                $height=mysql_escape_string("5' 3 (160cm)"); break;

                                      case "163":

                                                $height=mysql_escape_string("5' 4 (163cm)"); break;

                                      case "165":

                                                $height=mysql_escape_string("5' 5 (165cm)"); break;

                                      case "168":

                                                          $height=mysql_escape_string("5' 6 (168cm)"); break;

                                      case "170":

                                                $height=mysql_escape_string("5' 7 (170cm)"); break;

                                      case "173":

                                                $height=mysql_escape_string("5' 8 (173cm)"); break;

                                      case "175":

                                                $height=mysql_escape_string("5' 9 (175cm)"); break;

                                      case "178":

                                                $height=mysql_escape_string("5' 10 (178cm)"); break;

                                      case "180":

                                                $height=mysql_escape_string("5' 11 (180cm)"); break;

                                      case "183":

                                                $height=mysql_escape_string("6' 0 (183cm)"); break;

                                      case "185":

                                                $height=mysql_escape_string("6' 1 (185cm)"); break;

                                      case "188":

                                                $height=mysql_escape_string("6' 2 (188cm)"); break;

                                      case "190":

                                                $height=mysql_escape_string("6' 3 (190cm)"); break;

                                      case "193":

                                                $height=mysql_escape_string("6' 4 (193cm)"); break;

                                      case "196":

                                                $height=mysql_escape_string("6' 5 (196cm)"); break;

                                      case "198":

                                                $height=mysql_escape_string("6' 6 (198cm)"); break;

                                      case "201":

                                                $height=mysql_escape_string("6' 7 (201cm)"); break;

                                      case "203":

                                                $height=mysql_escape_string("6' 8 (203cm)"); break;

                                      case "206":

                                                $height=mysql_escape_string("6' 9 (206cm)"); break;

                                      case "208":

                                                $height=mysql_escape_string("6' 10 (208cm)"); break;

                                      case "211":

                                                $height=mysql_escape_string("6' 11 (211cm)"); break;

                                      case "213":

                                                $height=mysql_escape_string("7' 0 (213cm)"); break;

                                      case "216":

                                                $height=mysql_escape_string("7' 1 (216cm)"); break;

                              case "218":

                                                $height=mysql_escape_string("7' 2 (218cm)"); break;

                                      case "221":

                                                $height=mysql_escape_string("7' 3 (221cm)"); break;

                                      case "224":

                                                $height=mysql_escape_string("7' 4 (224cm)"); break;

                                      case "226":

                                                $height=mysql_escape_string("7' 5 (226cm)"); break;

                                       case "229":

                                                 $height=mysql_escape_string("7' 6 (229cm)"); break;

                                       default:

                                                 $height='Not stated'; break;

                                       }

                                $height=str_replace ('\\', '', $height);

                                      print("$height"); ?>

              -

              <?php

                              switch ($sql_they->mym_maxheight) {

                                      case "121":

                                                $height=mysql_escape_string("4' 0 (121cm)"); break;

                                      case "124":

                                                $height=mysql_escape_string("4' 1 (124cm)"); break;

                                      case "127":

                                                $height=mysql_escape_string("4' 2 (127cm)"); break;

                                      case "130":

                                                $height=mysql_escape_string("4' 3 (130cm)"); break;

                                      case "132":

                                                $height=mysql_escape_string("4' 4 (132cm)"); break;

                                      case "135":

                                                $height=mysql_escape_string("4' 5 (135cm)"); break;

                                      case "137":

                                                $height=mysql_escape_string("4' 6 (137cm)"); break;

                                      case "140":

                                                $height=mysql_escape_string("4' 7 (140cm)"); break;

                                      case "142":

                                                $height=mysql_escape_string("4' 8 (142cm)"); break;

                                      case "145":

                                                $height=mysql_escape_string("4' 9 (145cm)"); break;

                                      case "147":

                                                $height=mysql_escape_string("4' 10 (147cm)"); break;

                                      case "150":

                                                $height=mysql_escape_string("4' 11 (150cm)"); break;

                                      case "152":

                                                $height=mysql_escape_string("5' 0 (152cm)"); break;

                                      case "155":

                                                $height=mysql_escape_string("5' 1 (155cm)"); break;

                                      case "157":

                                                $height=mysql_escape_string("5' 2 (157cm)"); break;

                                      case "160":

                                                $height=mysql_escape_string("5' 3 (160cm)"); break;

                                      case "163":

                                                $height=mysql_escape_string("5' 4 (163cm)"); break;

                                      case "165":

                                                $height=mysql_escape_string("5' 5 (165cm)"); break;

                                      case "168":

                                                          $height=mysql_escape_string("5' 6 (168cm)"); break;

                                      case "170":

                                                $height=mysql_escape_string("5' 7 (170cm)"); break;

                                      case "173":

                                                $height=mysql_escape_string("5' 8 (173cm)"); break;

                                      case "175":

                                                $height=mysql_escape_string("5' 9 (175cm)"); break;

                                      case "178":

                                                $height=mysql_escape_string("5' 10 (178cm)"); break;

                                      case "180":

                                                $height=mysql_escape_string("5' 11 (180cm)"); break;

                                      case "183":

                                                $height=mysql_escape_string("6' 0 (183cm)"); break;

                                      case "185":

                                                $height=mysql_escape_string("6' 1 (185cm)"); break;

                                      case "188":

                                                $height=mysql_escape_string("6' 2 (188cm)"); break;

                                      case "190":

                                                $height=mysql_escape_string("6' 3 (190cm)"); break;

                                      case "193":

                                                $height=mysql_escape_string("6' 4 (193cm)"); break;

                                      case "196":

                                                $height=mysql_escape_string("6' 5 (196cm)"); break;

                                      case "198":

                                                $height=mysql_escape_string("6' 6 (198cm)"); break;

                                      case "201":

                                                $height=mysql_escape_string("6' 7 (201cm)"); break;

                                      case "203":

                                                $height=mysql_escape_string("6' 8 (203cm)"); break;

                                      case "206":

                                                $height=mysql_escape_string("6' 9 (206cm)"); break;

                                      case "208":

                                                $height=mysql_escape_string("6' 10 (208cm)"); break;

                                      case "211":

                                                $height=mysql_escape_string("6' 11 (211cm)"); break;

                                      case "213":

                                                $height=mysql_escape_string("7' 0 (213cm)"); break;

                                      case "216":

                                                $height=mysql_escape_string("7' 1 (216cm)"); break;

                              case "218":

                                                $height=mysql_escape_string("7' 2 (218cm)"); break;

                                      case "221":

                                                $height=mysql_escape_string("7' 3 (221cm)"); break;

                                      case "224":

                                                $height=mysql_escape_string("7' 4 (224cm)"); break;

                                      case "226":


                                                $height=mysql_escape_string("7' 5 (226cm)"); break;

                                       case "229":

                                                 $height=mysql_escape_string("7' 6 (229cm)"); break;

                                       default:

                                                 $height='Not stated'; break;


                                       }

                                $height=str_replace ('\\', '', $height);

                                      print("$height"); ?>

            </td>

            <td  align="left">

              <?=PRGRETUSER_RELATIONSHIP?>

            </td>

            <td ><?php echo $sql_they->mym_relationship ?></td><?php */?>
          </tr>

          <tr class="tdeven">

            <td  align="left" ><span class="tdhead"><b><?=MY_MATCH?></b></span></td>

            <td colspan="3" class="tdeven" > <textarea  class="inputl"rows="10" name="txtMyComment" cols="59" tabindex="15"><?php echo $sql_they->mym_comment; ?></textarea></td>
          </tr>

          <tr align="center" class="tdodd">

            <td colspan="4" > <input type="radio" name="rdoApprove" value="Approve">

              <?php echo AFF_AUTHORISE_APPROVE?>&nbsp; <input type="radio" name="rdoApprove" value="Reject" >

              <?php echo AFF_AUTHORISE_REJECT?> &nbsp; <input type="radio" name="rdoApprove" value="Skip" checked>

              <?php echo AFF_AUTHORISE_SKIP?><br> <?php echo AFF_AUTHORISE_REASON?>

              <input name='reason' type='text' class="inputl" size='30'></td>
          </tr>

          <tr align="center">

            <td colspan="4" class="tdfoot"> <input type="submit" name="Submit" value="<?php echo BUTTON_SUBMIT ?>" class="button">            </td>
          </tr>
        </form>
      </table></td>

      <td>&nbsp;</td>
      <td valign="top"><table width="100%" border="0" cellspacing="5" cellpadding="0">
        <tr>
          <td><span class="blue"><b>Photos:</b></span></td>
        </tr>
        <tr>
          <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="41%"><div align="center"><img src="1.jpg" width="71" height="71" style="border:1px solid #bcdaec" /><br />
			  <a href="#">Delete</a></div></td>
              <td width="18%"><div align="center"></div></td>
              <td width="41%"><div align="center"><img src="1.jpg" width="71" height="71" style="border:1px solid #bcdaec" /><br />
			  <a href="#">Delete</a></div></td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
            </tr>
            <tr>
              <td><div align="center"><img src="1.jpg" width="71" height="71" style="border:1px solid #bcdaec" /><br />
                  <a href="#">Delete</a></div></td>
              <td><div align="center"></div></td>
              <td><div align="center"><img src="1.jpg" width="71" height="71" style="border:1px solid #bcdaec" /><br />
                  <a href="#">Delete</a></div></td>
            </tr>
          </table></td>
        </tr>
        <tr>
          <td><hr size="1" /></td>
        </tr>
        <tr>
          <td><span class="blue"><b>Audio:</b></span></td>
        </tr>
        <tr>
          <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="41%"><div align="center"><img src="1.jpg" width="71" height="71" style="border:1px solid #bcdaec" /><br />
                  <a href="#">Delete</a></div></td>
              <td width="18%"><div align="center"></div></td>
              <td width="41%"><div align="center"><img src="1.jpg" width="71" height="71" style="border:1px solid #bcdaec" /><br />
                  <a href="#">Delete</a></div></td>
            </tr>

          </table></td>
        </tr>
        <tr>
          <td><hr size="1" /></td>
        </tr>
        <tr>
          <td><span class="blue"><b>Video</b></span></td>
        </tr>
        <tr>
          <td><div align="center"><img src="1.jpg" width="71" height="71" style="border:1px solid #bcdaec" /><br />
                  <a href="#">Delete</a></div></td>
        </tr>
        <tr>
          <td><hr size="1" /></td>
        </tr>
        <tr>
          <td><span class="blue"><b>Gallery:</b></span></td>
        </tr>
        <tr>
          <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="41%"><div align="center"><img src="1.jpg" width="71" height="71" style="border:1px solid #bcdaec" /><br />
                  <a href="#">Delete</a></div></td>
              <td width="18%"><div align="center"></div></td>
              <td width="41%"><div align="center"><img src="1.jpg" width="71" height="71" style="border:1px solid #bcdaec" /><br />
                  <a href="#">Delete</a></div></td>
            </tr>

          </table></td>
        </tr>

      </table></td>
    </tr>
  </table>
</div></div>
        </div>

<?php 
if(!$edit_mem){
include("include/footer.php"); 
}
?>