<?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.                                         #
##################################################################
*/
?>
<?php
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();
	
	//fetching step 3,4,5 admin allowed fields
	$sql_fld=$objS->select_rows(TABLEPREFIX.'SignUpField','*',"Where vActive='1'");
	if(mysql_num_rows($sql_fld)>0)
	{
		$allowFieldArray=array();
		while($arr=mysql_fetch_array($sql_fld))
		{
			$allowFieldArray[]=$arr['nSId'];
		}//end while
	}//end if

	if (isset($_POST['CON1'])) {
		$objU->set_values($_POST);
		$message	= $objU->register_step_five($_SESSION['user_id']);
		if ($message == "")
			$message	.= "Your life style(s) saved.<br>";
	} else {
		$array	= $objU->select($_SESSION['user_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 type="text/javascript" language="javascript">
function changeCSS(obj, type)
{
	if (type == 'text') {
		obj.className = 'textbox';
	} else if (type == 'textarea') {
		obj.className = 'textbox_textarea';
	} else if (type == 'select') {
		obj.className = 'textbox';
	} else {
		obj.className = 'textbox';
	}
}
</script>


<div class="row">
	<div class="eight columns">
		<div class="row"><div class="inenr-hd"><h2>My Lifestyle</h2></div></div>
		<div class="row">
			<div class="search-rslts maintext1 my_lifestyle">
				<form name="frmStep5" method="post" action="<?php echo $_SERVER['PHP_SELF']?>">
					<div class="row newdesignforinput">
						<?php if(isset($message) && trim($message)!='')
					      {
						?>
						<div class="row maintext1 success"><?php echo $message;?></div>  
						<?php }//end if?>
						<?php
						if(is_array($allowFieldArray))
						{
							if(in_array('17',$allowFieldArray))
							{
						?>
					</div>
					
					<div class="full_row">
						<div class="twelve"><b>A day in my life</b></div>
						<div class="twelve">
							(Describe a typical day in your life from the moment you rise to the moment you lie down.)
						</div>
						<div class="twelve">
							<textarea name="taday_in_my_life" cols="60" rows="5" class="textbox_textarea"><?php echo $objU->taday_in_my_life?></textarea>
						</div>
					</div>
					<?php
						}//end if
						if(in_array('18',$allowFieldArray))
						{
					?>
					
					
					<div class="full_row">
						<div class="twelve"><b>Nightlife</b></div>
						<div class="twelve">
							When you go out in the evening what's your favorite place?
						</div>
						<div class="twelve">
							<select name="vmy_night_life_out" class="textbox">
								<?php foreach ($arrNightLiftOut as $key => $value) { ?>
								<option value="<?php echo $value?>" <?php echo $objU->vmy_night_life_out == $value ? "selected" : ""?>>
								<?php echo $value?>
								</option>
								<?php } ?>
							</select>
						</div>
						<div class="twelve">
							when you are at home at night, what you would like to have?
						</div>
						<div class="twelve">
							<select name="vmy_night_life_in" class="textbox">
								<?php foreach ($arrNightLifeIn as $key => $value) { ?>
								<option value="<?php echo $value?>" <?php echo $objU->vmy_night_life_in == $value ? "selected" : ""?>>
								<?php echo $value?>
								</option>
								<?php } ?>
							</select>
						</div>
					</div>
					<?php
						}//end if
						if(in_array('19',$allowFieldArray))
						{
					?>
					
					<div class="full_row">
						<div class="twelve"><b>Food</b></div>
						<div class="twelve">
							(What, where, when, and how I like to eat.)
						</div>
						<div class="twelve">
							<textarea name="tmy_food" cols="60" rows="5" class="textbox_textarea"><?php echo $objU->tmy_food?></textarea>
						</div>
					</div>
					<?php
						}//end if
						if(in_array('20',$allowFieldArray))
						{
					?>
					
					<div class="full_row">
						<div class="twelve"><b>Money</b></div>
						<div class="twelve">
							(What do you spend your money on?)
						</div>						
					</div>
					<?php
						}//end if
						if(in_array('21',$allowFieldArray))
						{
					?>
					
					<div class="full_row">
						<div class="twelve"><textarea name="tmy_money" cols="60" rows="5" class="textbox_textarea"><?php echo $objU->tmy_money?></textarea></div>
						<div class="twelve"><b>Name the last restaurant you visited</b></div>
						<div class="twelve">
							<textarea name="tmy_last_restaurant" cols="60" rows="2" class="textbox_textarea"  onKeyDown="changeCSS(this, 'textarea');"><?php echo $objU->tmy_last_restaurant?></textarea>
						</div>
					</div>
					<?php
						}//end if
						if(in_array('22',$allowFieldArray))
						{
					?>
					
					
					<div class="full_row">
						<div class="twelve"><b>Review it</b></div>
						<div class="twelve">
							<textarea name="tmy_last_restaurant_review" cols="60" rows="5" class="textbox_textarea"><?php echo $objU->tmy_last_restaurant_review?></textarea>
						</div>
					</div>
					<?php
						}//end if
						if(in_array('23',$allowFieldArray))
						{
					?>
					  
					
					<div class="full_row">
						<div class="twelve"><b>What have you done for charity's sake?</b></div>
						<div class="twelve">
							<textarea name="tmy_charity" cols="60" rows="5" class="textbox_textarea"><?php echo $objU->tmy_charity?></textarea>
						</div>
					</div>
					<?php
						}//end if
					}//end if
					?>
					
					<div class="full_row">
						<div class="twelve" align="right"><input name="CON1" type="submit" class="loginbutton" value="Save"><input type="hidden" name="step" value="6"></div>
					</div>
					
				</form>
				
				<div id="hide"><?php echo $script?></div>
				
			</div>
		</div>
	</div>
	
	<div class="four columns right search_result_R">
		<?php include_once ("left.inc.php");?>
	</div>
</div>
			

<?php include_once('bottomhtml.inc.php');?>
