<?php 
/*
##################################################################
#                       PHP 4&5 MySQL 4&5                        #
##################################################################
#           Copyright (c) 2004-2008 Armia Systems Inc            #
##################################################################
#               This file is part of Cybermatch site             #
##################################################################
#    Developed By: simi (simi@armia.com)                         #

##################################################################
#               Developed On:   03-04-2008                       #
##################################################################
#               Modified By:                                     #
##################################################################
#               Modified On:                                     #
##################################################################
# This script may not be distributed, sold, given away for free  #
# to third party, or used as a part of any internet services 	 #
# such as webdesign etc.                                         #
##################################################################
*/

require_once ("config.inc.php");
require_once ("includes/userlogincheck.inc.php");
require_once ("includes/mysql.inc.php");
require_once ("includes/arrays.inc.php");
require_once ("classes/settings.class.php");
require_once ("classes/userside.class.php");
require_once ("classes/misc.class.php");

$message	= "";
$script		= "";

$objC		= new check();
if (!$objDB) {
	$message	= "Unable to Locate Database Server.";
} else {
	$objU			= new userside($objDB);
	$objS			= new settings($objDB);
	$objM			= new misc($objDB);
	$objS->set_variables();
	
	if (isset($_POST['CON1'])) {
		$objU->set_values($_POST);
                $id= $_POST['id'];
		$message	= $objU->save_user_partner_preference($_SESSION['user_id'], $id);
		if ($message == "")
			$message	.= "Your partner preference(s) saved.<br>";
	} else {
		$array	= $objU->selectpartner($_SESSION['user_id']); 
		if (!empty($array))
			$id	= $array['nPartner_Pref_Id'];
		$objU->set_values($array);
	}
	$script		= $objM->get_script($message);
	$message	= $objM->remove_script($message);
}
include_once ("title.inc.php");
include_once ("tophtml.inc.php");
?>
<script type="text/javascript"  src="js/googlefix.js"></script>
<script language="javascript" type="text/javascript">
function check_option_dosent_matter(obj)
{
	var check_flag = 0;
	var i = 0;
	for(i=0;i<document.frmUser.elements[obj.name].length;i++){
		if(check_flag == 1){
			document.frmUser.elements[obj.name][i].checked =false;
		}
		if (document.frmUser.elements[obj.name][i].value=="null" || document.frmUser.elements[obj.name][i].value=="")
		{
			if (document.frmUser.elements[obj.name][i].checked==true)
				check_flag = 1;
		}
	}
}


function check_option(obj){
	for(i=0;i<document.frmUser.elements[obj.name].length;i++){
		if (document.frmUser.elements[obj.name][i].value=="null" || document.frmUser.elements[obj.name][i].value==""){
			if (document.frmUser.elements[obj.name][i].checked==true)
				document.frmUser.elements[obj.name][i].checked =false;
			}
	}
}
</script>

<div class="row">
	<div class="eight columns">
		<div class="search-rslts">
			<div class="row"><div class="inenr-hd"><h2>My Partner Preference</h2></div></div>
			<div class="row">
				<h2 class="headings2">About My Partner</h2>
			</div>
			<div class="row">
				<form name="frmUser" method="post" action="<?php echo $_SERVER['PHP_SELF']?>">
					<div class="newdesignforinput maintext1">
						<?php if(isset($message) && trim($message)!='')
							  {
						?>
						<div class="full_row">
							<div class="maintext1 success"><?php echo $message;?></div>
						</div>
						<?php }//end if?>
						
						
						<div class="full_row">
							<div class="three columns">Preferred Age Range</div>
							<div class="five columns margin_R_200">
								<div class="two columns" align="center"><b>From</b></div>
								<div class="four columns">
									<select name="nAge_Low" class="textbox2">
										<?php foreach ($arrPartnerAgeFrom as $key => $value) { ?>
										<option value="<?php echo $value?>" <?php echo $objU->nAge_Low == $value ? "selected" : ""?>>
										<?php echo $value?>
										</option>
										<?php } ?>
									</select>
								</div>
								<div class="two columns" align="center"><b>To</b></div>
								<div class="four columns">
									<select name="nAge_High" class="textbox2">
										<?php foreach ($arrPartnerAgeTo as $key => $value) { ?>
										<option value="<?php echo $value?>" <?php echo $objU->nAge_High == $value ? "selected" : ""?>>
										<?php echo $value?>
										</option>
										<?php } ?>
									</select>
								</div>
							</div>
						</div>
						
						<div class="full_row">
							<div class="three columns">Body Type</div>
							<div class="five columns margin_R_200">
								<select name="vBody_Type" class="textbox">
									<?php foreach ($arrPartnerBodyType as $key => $value) { ?>
									<option value="<?php echo $key?>" <?php echo $objU->vBody_Type == $key ? "selected" : ""?>>
									<?php echo $value?>
									</option>
									<?php } ?>
								</select>
							</div>
						</div>
						
						<div class="full_row">
							<div class="three columns">Height Range</div>
							<div class="five columns margin_R_200">
								<div class="two columns" align="center"><b>From</b></div>
								<div class="four columns">
									<select name="vFeet_Low" class="textbox2">
                                        <?php foreach ($arrFeet as $key => $value) { ?>
                                        <option value="<?php echo $value?>" <?php echo $objU->vFeet_Low == $value ? "selected" : ""?>>
                                        <?php echo $value?>
                                        </option>
                                        <?php } ?>
                                      </select>
								</div>
								<div class="one columns" align="center"><b>Ft</b></div>
								<div class="four columns">
									<select name="vInch_Low" class="textbox2">
                                        <?php foreach ($arrInch as $key => $value) { ?>
                                        <option value="<?php echo $value?>" <?php echo $objU->vInch_Low == $value ? "selected" : ""?>>
                                        <?php echo $value?>
                                        </option>
                                        <?php } ?>
                                      </select>
								</div>
								<div class="one columns" align="center"><b>in.</b></div>
								
							<div class="clear"></div>
							
								<div class="two columns" align="center"><b>To</b></div>
								<div class="four columns">
									<select name="vFeet_High" class="textbox2">
                                        <?php foreach ($arrFeet as $key => $value) { ?>
                                        <option value="<?php echo $value?>" <?php echo $objU->vFeet_High == $value ? "selected" : ""?>>
                                        <?php echo $value?>
                                        </option>
                                        <?php } ?>
                                     </select>
								</div>
								<div class="one columns" align="center"><b>Ft</b></div>
								<div class="four columns">
									<select name="vInch_High" class="textbox2">
                                        <?php foreach ($arrInch as $key => $value) { ?>
                                        <option value="<?php echo $value?>" <?php echo $objU->vInch_High == $value ? "selected" : ""?>>
                                        <?php echo $value?>
                                        </option>
                                        <?php } ?>
                                      </select>
								</div>
								<div class="one columns" align="center"><b>in.</b></div>
							</div>
						</div>
						
						<div class="full_row">
							<div class="three columns">Smoking</div>
							<div class="five columns margin_R_200">
								<select name="vSmoking" class="textbox">
									<?php foreach ($arrPartnerSmoking as $key => $value) { ?>
									<option value="<?php echo $key?>" <?php echo $objU->vSmoking == $key ? "selected" : ""?>>
									<?php echo $value?>
									</option>
									<?php } ?>
								</select>
							</div>
						</div>
						
						<div class="full_row">
							<div class="three columns">Drinking</div>
							<div class="five columns margin_R_200">
								<select name="vDrinking" class="textbox">
									<?php foreach ($arrPartnerDrinking as $key => $value) { ?>
									<option value="<?php echo $key?>" <?php echo $objU->vDrinking == $key ? "selected" : ""?>>
									<?php echo $value?>
									</option>
									<?php } ?>
								</select>
							</div>
						</div>
						
						<div class="full_row">
							<div class="three columns">Eye Color</div>
							<div class="five columns margin_R_200">
								<select name="vHair_Color" class="textbox">
									<?php foreach ($arrPartnerHairColor as $key => $value) { ?>
									<option value="<?php echo $key?>" <?php echo $objU->vHair_Color == $key ? "selected" : ""?>>
									<?php echo $value?>
									</option>
									<?php } ?>
								</select>
							</div>
						</div>
						
						<div class="full_row">
							<div class="three columns">Ethnicity</div>
							<div class="five columns margin_R_200">
								<select name="vEthinicity" class="textbox">
									<?php foreach ($arrPartnerEthnicity as $key => $value) { ?>
									<option value="<?php echo $key?>" <?php echo $objU->vEthinicity == $key ? "selected" : ""?>>
									<?php echo $value?>
									</option>
									<?php } ?>
								</select>
							</div>
						</div>
						
						<div class="full_row">
							<div class="three columns">Religion</div>
							<div class="five columns margin_R_200">
								<select name="vRelegion" class="textbox">
									<?php foreach ($arrPartnerReligion as $key => $value) { ?>
									<option value="<?php echo $key?>" <?php echo $objU->vRelegion == $key ? "selected" : ""?>>
									<?php echo $value?>
									</option>
									<?php } ?>
								</select>
							</div>
						</div>
						
						<div class="full_row">
							<div class="three columns">Highest Education</div>
							<div class="five columns margin_R_200">
								<select name="vEducation" class="textbox">
									<?php foreach ($arrPartnerEducation as $key => $value) { ?>
									<option value="<?php echo $key?>" <?php echo $objU->vEducation == $key ? "selected" : ""?>>
									<?php echo $value?>
									</option>
									<?php } ?>
								</select>
							</div>
						</div>
						
						<div class="full_row">
							<div class="three columns">Languages</div>
							<div class="five columns margin_R_200 my_date_input">
								<?php echo $objC->generate_checkbox_list_js("vLanguages[]", $objU->vLanguages, $arrPartnerLanguages, 3, 'key');?>
							</div>
						</div>
						
						<div class="full_row">
							<div class="three columns">Profession</div>
							<div class="five columns margin_R_200">
								<select name="vProfession" class="textbox">
									<?php foreach ($arrPartnerProfession as $key => $value) { ?>
									<option value="<?php echo $key?>" <?php echo $objU->vProfession == $key ? "selected" : ""?>>
									<?php echo $value?>
									</option>
									<?php } ?>
								</select>
							</div>
						</div>
						
						<div class="full_row">
							<div class="three columns">Annual Income</div>
							<div class="five columns margin_R_200">
								<select name="vIncome" class="textbox">
									<?php foreach ($arrPartnerIncome as $key => $value) { ?>
									<option value="<?php echo $key?>" <?php echo $objU->vIncome == $key ? "selected" : ""?>>
									<?php echo $value?>
									</option>
									<?php } ?>
								</select>
							</div>
						</div>
						
						<div class="full_row">
							<div class="three columns">Relation Status</div>
							<div class="five columns margin_R_200">
								<select name="vRelationship" class="textbox">
									<?php foreach ($arrPartnerRelationShip as $key => $value) { ?>
									<option value="<?php echo $key?>" <?php echo $objU->vRelationship == $key ? "selected" : ""?>>
									<?php echo $value?>
									</option>
									<?php } ?>
								</select>
							</div>
						</div>
						
						<div class="full_row">
							<div class="three columns">Children</div>
							<div class="five columns margin_R_200">
								<select name="vChildren" class="textbox">
									<?php foreach ($arrPartnerChildren as $key => $value) { ?>
									<option value="<?php echo $value?>" <?php echo $objU->vChildren == $value ? "selected" : ""?>>
									<?php echo $value?>
									</option>
									<?php } ?>
								</select>
							</div>
						</div>
						
						<div class="full_row">
							<div class="three columns">&nbsp;</div>
							<div class="five columns margin_R_200">
								<input name="CON1" type="submit" class="loginbutton" value="Save"><input type="hidden" name="id" value="<?php echo $id?>"><input type="hidden" name="step" value="9">
							</div>
						</div>
						
						 

						
				
					</div>
				</form>
			</div>
		</div>
	</div>
	<div class="four columns right search_result_R">
		<?php include_once ("left.inc.php");?>
	</div>
</div>

<table width="100%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td valign="top"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="72%" valign="top"><div class="search-rslts"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td>              
					<table width="100%"  border="0" cellspacing="0" cellpadding="10">
                <tr>
                  <td>
                    
					<form name="frmUser" method="post" action="<?php echo $_SERVER['PHP_SELF']?>">
                    <table width="100%"  border="0" cellspacing="0" cellpadding="5" class="newdesignforinput">
					
                    <tr>
                      <td>&nbsp;</td>
                      <td></td>
                    </tr>
                  </table>
					</form>
                    </td>
                </tr>
              </table>
              <div id="hide"><?php echo $script?></div>
			</td>
          </tr>
        </table></div></td>
		<td width="1%">&nbsp;</td>
        <td width="27%" valign="top"><?php include_once ("left.inc.php");?></td>
      </tr>
    </table>      
      </td>
  </tr>
</table>
<?php include_once('bottomhtml.inc.php');?>
