<?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");

$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_three($_SESSION['user_id']);
		if ($message == "")
			$message	.= "Your appearence(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>

<div class="row">
	<div class="eight columns">
		<div class="row"><div class="inenr-hd"><h2>My Appearance</h2></div></div>
		<div class="row">
			<div class="search-rslts maintext1 my_appearence">
				<form name="frmStep3" 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('1',$allowFieldArray))
							{
						?>
					</div>
					
					<div class="full_row">
						<div class="twelve"><b>My looks today</b></div>
						<div class="twelve">
							(Describe your looks now. If you change your hair color, get glasses or have a great week at the gym, change your profile.)
						</div>
						<div class="twelve">
							<textarea name="tmy_looks_today" cols="60" rows="5" class="textbox_textarea"><?php echo $objU->tmy_looks_today?></textarea>
						</div>
					</div>
					<?php
						}//end if
						if(in_array('2',$allowFieldArray))
						{
					?>
					
					<div class="full_row">
						<div class="twelve"><b>My likes on any given day</b></div>
						<div class="twelve">
							(What do you like to do in life? What are the things that make you happy?)
						</div>
						<div class="twelve">
							<textarea name="tmy_likes_onanyday" cols="60" rows="5" class="textbox_textarea"><?php echo $objU->tmy_likes_onanyday?></textarea>
						</div>
					</div>
					<?php
						}//end if
						if(in_array('3',$allowFieldArray))
						{
					?>
					
					<div class="full_row">
						<div class="twelve"><b>My dislikes on any given day</b></div>
						<div class="twelve">
							(What could you do without? What could go away and life would only get better?)
						</div>
						<div class="twelve">
							<textarea name="tmy_dislikes_onanyday" cols="60" rows="5" class="textbox_textarea"><?php echo $objU->tmy_dislikes_onanyday?></textarea>
						</div>
					</div>
					<?php
						}//end if
						if(in_array('4',$allowFieldArray))
						{
					?>
					
					<div class="full_row">
						<div class="twelve"><b>My personality</b></div>
						<div class="twelve">
							(You know who you are.)
						</div>
						<div class="twelve">
							<textarea name="tmy_personality" cols="60" rows="5" class="textbox_textarea"><?php echo $objU->tmy_personality?></textarea>
						</div>
					</div>
					<?php
						}//end if
						if(in_array('5',$allowFieldArray))
						{
					?>
					
					<div class="full_row">
						<div class="twelve"><b>My mood today</b></div>
						<div class="twelve">
							(What is your mood today or most days? Change this entry whenever you &quot;feel&quot; like it.)
						</div>
						<div class="twelve">
							<textarea name="tmy_mood_today" cols="60" rows="5" class="textbox_textarea"><?php echo $objU->tmy_mood_today?></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="4"></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');?>
