<?php
require_once ("../config.inc.php");
require_once ("../includes/adminlogincheck.inc.php");
require_once ("../includes/mysql.inc.php");
require_once ("../includes/arrays.inc.php");
require_once ("../classes/users.class.php");
require_once ("../includes/fckeditor/fckeditor.php");

$page		= isset($_REQUEST['page'])	?	trim($_REQUEST['page'])	:	"1";
$id			= isset($_REQUEST['id'])	?	trim($_REQUEST['id'])	:	"0";
$message	= "";

$objC		= new check();

if (!$objDB) {

	$message	= "Unable to Locate Database Server.";

} else {

	$objU		= new users($objDB);
	$arrProvider= $objU->get_providers(); //print_r($arrProvider);

	$objU->set_values($_POST); 
	$arrCountry	= $objU->get_country_list();

	if (isset($_POST['SaveNow'])) { 

                $dates   =   explode('/',$objU->dDob);
                if (!checkdate($dates[0], $dates[1], $dates[2])) {
                    $message = "Invalid date format.<br>";                    
                }
                $birthdate = strtotime($objU->dDob);

                $min = strtotime('+18 years', $birthdate);

                if (time() < $min) {
                    $message = "User don't have the minimum age required to register.</br>";
                }
                if(!$message)
                    $message	= $objU->save($id); 
		if ($message == "") {
			header("Location: users.php?page=$page&act=1");
			exit;
		}
		$arrState	= $objU->get_state_list($objU->vCountry);
		$arrCounty	= $objU->get_county_list($objU->vState);

	} elseif (isset($_POST['BackNow'])) {
		if ($message == "") {
			header("Location: users.php?page=$page");
			exit;
		}
	} else {
		if ($id > 0) {
			$array	= $objU->select($id);
                        ///echo"<prE>";print_r($array);echo"</pre>";
			$objU->set_values($array);
			$arrState	= $objU->get_state_list($objU->vCountry);
			//$arrState	= $objU->get_state_list('USA');
			$arrCounty	= $objU->get_county_list($objU->vState);
		} else {
			$arrCountry	= $objU->get_country_list();
			$country	= "";
			if (!empty($arrCountry))
				foreach ($arrCountry as $key=>$value)
					$country	= $value;
                        $country=$arrCountry[1];
			$objU->vCountry	= $country;
			$arrState	= $objU->get_state_list($country);
			$state		= "";
			if (!empty($arrState))
				foreach ($arrState as $key=>$value)
					$state	= $value;
			$objU->vState	= $state;
			$arrCounty	= $objU->get_county_list($state);
			$objU->vCountry	= $country;
		}

	}
}

if($array['dDob']!='')
{
	$_SESSION['chek_dob']=$array['dDob'];
}//end if
else
{
	//$array['dDob']=$_SESSION['chek_dob'];
        $array['dDob']=date('m/d/Y');
}//end else

//$arrDob=explode("-",$array['dDob']);
$arrDob=explode("/",date('Y/m/d',strtotime($array['dDob'])));
//print_r($arrDob);
list($year,$month,$date)=$arrDob;
if($year<0)
{
    $year='0000';
}

$objU->dDob=$month."/".$date."/".$year;


include_once('title.inc.php');
?>
<!--<script type="text/javascript" src="../date/date-picker.js"></script>-->
<style type="text/css">
  /*div.calendar_widget { position: absolute; top: 0px; left: 0px; width:140px; height: 200px; display: none; }*/
}
</style>
<script type="text/javascript" src="../js/jquery.js"></script>
<script language="javascript">
$(document).ready(function()
{
	$("#vLogin").blur(function()
	{
            if ($.trim($("#vLogin").val())!=''){
		//remove all the class add the messagebox classes and start fading
		$("#msgbox").removeClass().addClass('warningok').text('....Checking...').fadeIn("slow");
		//check the username exists or not from ajax
		$.post("../check_username_availability.php",{ user_name:$(this).val() } ,function(data)
                {
		  if(data=='no') //if username not avaiable
		  {
		  	$("#msgbox").fadeTo(200,0.1,function() //start fading the messagebox
			{
			  //add message and change the class of the box and start fading
			  $(this).html('This username already exists').removeClass().addClass('warning').fadeTo(900,1);
			});
                   }
                  else  if(data=='invalid') //if username not avaiable
		  {
		  	$("#msgbox").fadeTo(200,0.1,function() //start fading the messagebox
			{
			  //add message and change the class of the box and start fading
			  $(this).html('Invalid username. Please remove spaces.').removeClass().addClass('warning').fadeTo(900,1);
			});
                   }
		  else
		  {
		  	$("#msgbox").fadeTo(200,0.1,function()  //start fading the messagebox
			{
			  //add message and change the class of the box and start fading
			  $(this).html('Username available to register').addClass('warningok').fadeTo(900,1);
			});
		  }

                });
            }

	});
});
</script>
<script type="text/javascript" src="../scripts/calendar.js"></script>
<script type="text/javascript" src="../scripts/calendar-setup.js"></script>
<script type="text/javascript" src="../scripts/calendar-en.js"></script>
<link href="../scripts/calendar.css" rel="stylesheet" type="text/css">
<script language="javascript" type="text/javascript">
function validate()
{
	var frm	= document.frmUser;

	if (frm.vLogin.value == "") {
		alert("Please enter loginname of the user.");
		frm.vLogin.focus();
		return false;
	}

//        if ($.trim(frm.vPass.value)==''){
//
//		alert("Please enter password.");
//		frm.vPass.focus();
//		return false;
//	}
        //Password length check
        if($.trim(frm.vPass.value)!='' && ($.trim(frm.vPass.value).length)<6){
            	alert("Password should be atleast 6 characters long.");
		frm.vPass.focus();
		return false;
	}

	if (frm.vEmail.value == "") {
		alert("Please enter email address of user.");
		frm.vEmail.focus();
		return false;
	}

	if (frm.vTitle.value == "") {
		alert("Please enter title of the profile.");
		frm.vTitle.focus();
		return false;
	}

	if (frm.vFirstName.value == "") {
		alert("Please enter first name of user.");
		frm.vFirstName.focus();
		return false;
	}

	if (frm.vLastName.value == "") {
		alert("Please enter last name of user.");
		frm.vLastName.focus();
		return false;
	}

	if (frm.dDob.value == "") {
		alert("Please enter date of birth of user.");
		frm.dDob.focus();
		return false;
	}

	if (frm.vTitle.value == "") {
		alert("Please enter title of the profile.");
		frm.vTitle.focus();
		return false;
	}
	return true;
}
</script>
<script type="text/javascript"  src="../js/ajax.js"></script>
<script type="text/javascript" language="javascript">
var ajax = new Array();
var sajax = new Array();

function getStateList(sel)
{
	var stateCode = sel.options[sel.selectedIndex].value;
	document.getElementById('girish_state').options.length = 0;	// Empty city select box
	if(stateCode.length>0){
		var index = ajax.length;
		ajax[index] = new sack();

		ajax[index].requestFile = 'get_state_list.php?id='+stateCode;	// Specifying which file to get
		ajax[index].onCompletion = function(){ createStateList(index) };	// Specify function that will be executed after file has been found
		ajax[index].runAJAX();		// Execute AJAX function
	}
}
function createStateList(index)
{
	var obj = document.getElementById('girish_state');
	eval(ajax[index].response);	// Executing the response from Ajax as Javascript code
}

function getCountyList(sel)
{
	var countryCode = sel.options[sel.selectedIndex].value;
	document.getElementById('girish_county').options.length = 0;	// Empty city select box
	if(countryCode.length>0){
		var index = ajax.length;
		ajax[index] = new sack();

		ajax[index].requestFile = 'get_county_list.php?id='+countryCode;	// Specifying which file to get
		ajax[index].onCompletion = function(){ createCountyList(index) };	// Specify function that will be executed after file has been found
		ajax[index].runAJAX();		// Execute AJAX function
	}
}

function createCountyList(index)
{
	var obj = document.getElementById('girish_county');
	eval(ajax[index].response);	// Executing the response from Ajax as Javascript code
}
</script>
<?php include_once('tophtml.php');?>
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
    <tr>
        <td valign="top" class="white"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td width="72%" valign="top">
                        <table width="100%"  border="0" cellspacing="0" cellpadding="5">
                            <tr>
                                <td><table width="100%"  border="0" cellspacing="0" cellpadding="5">
                                        <tr>
                                            <td width="41%" class="headings1" colspan="2">Manage Profile</td>
                                        </tr>
										</table>
										<div class="bordernew padding2">
										<table>
                                        <tr>
                                            <td colspan="2" class="maintext"><?php include_once('usertabs.php');?></td>
                                        </tr>
										<tr><td>
										<form name="frmUser" method="post" action="" >
                            <table width="100%"  border="0" cellspacing="0" cellpadding="5">
                                <tr>
                                    <td><table width="100%"  border="0" cellspacing="0" cellpadding="0" class="tblestyle_admin2">
                                        <?php if ($objDB) {
                                                if(isset($message) && $message!='') {?>
                                                    <tr align="left">
                                                        <td align="center" class="maintext2">&nbsp;</td>
                                                        <td  colspan="3" class="maintext2 warning"><span style="color: red;"><?php echo $message;?></span></td>
                                                    </tr>
                                            <?php
                                             }//end if?>
                                            <tr align="left">
                                                <td width="3%" class="maintext2">&nbsp;</td>
                                                <td width="39%" valign="top" class="maintext2">Username <span class="warning">*</span></td>
                                                <td colspan="2" valign="top" class="maintext2">
                                                    <!--input name="vLogin" type="text" class="textbox"  value="<?php echo htmlspecialchars($objU->vLogin)?>" size="35" maxlength="100"-->
                                                    <input name="vLogin" id="vLogin" type="text" class="textbox"  value="<?php echo htmlspecialchars($objU->vLogin)?>" size="35" maxlength="100" onChange="javascript:this.value=this.value.toLowerCase();">
                                                    &nbsp;<span id="msgbox" style="display:none"></span>
                                                </td>
                                            </tr>
                                            <tr align="left">
                                                <td class="maintext2">&nbsp;</td>
                                                <td valign="top" class="maintext2">Password </td>
                                                <td colspan="2" valign="top" class="maintext2"><input name="vPass" type="password" size="35" maxlength="100" class="textbox txt-bx">
                                                  <?php if ($id > 0) { ?>
                                                    <strong>Note:</strong> <em>Entering a password here will reset the existing password. </em>
                                                                                                                                        <?php } ?></td>
                                            </tr>
                                            <tr align="left">
                                                <td class="maintext2">&nbsp;</td>
                                                <td valign="top" class="maintext2">Email Address<span class="warning">*</span></td>
                                                <td colspan="2" valign="top" class="maintext2"><input name="vEmail" type="text" class="textbox" value="<?php echo $objU->vEmail?>" size="35" maxlength="200"></td>
                                            </tr>
                                            <tr align="left">
                                                <td class="maintext2">&nbsp;</td>
                                                <td valign="top" class="maintext2">Profile Title <span class="warning">*</span></td>
                                                <td colspan="2" valign="top" class="maintext2"><input name="vTitle" type="text" class="textbox" value="<?php echo $objU->vTitle?>" size="35" maxlength="250"></td>
                                            </tr>
                                            <tr align="left">
                                                <td class="maintext2">&nbsp;</td>
                                                <td valign="top" class="maintext2">First Name <span class="warning">*</span></td>
                                                <td colspan="2" valign="top" class="maintext2"><input name="vFirstName" type="text" class="textbox" value="<?php echo htmlspecialchars($objU->vFirstName)?>" size="35" maxlength="200"></td>
                                            </tr>
                                            <tr align="left">
                                                <td class="maintext2">&nbsp;</td>
                                                <td width="39%" valign="top" class="maintext2">Middle Name</td>
                                                <td colspan="2" valign="top" class="maintext2"><input name="vMiddleName" type="text" class="textbox" value="<?php echo htmlspecialchars($objU->vMiddleName)?>" size="35" maxlength="200"></td>
                                            </tr>
                                            <tr align="left">
                                                <td class="maintext2">&nbsp;</td>
                                                <td valign="top" class="maintext2">Last Name <span class="warning">*</span></td>
                                                <td colspan="2" valign="top" class="maintext2"><input name="vLastName" type="text" class="textbox" value="<?php echo htmlspecialchars($objU->vLastName)?>" size="35" maxlength="200"></td>
                                            </tr>
                                            <tr align="left">
                                                <td class="maintext2">&nbsp;</td>
                                                <td valign="top" class="maintext2">Mobile Number</td>
                                                <td colspan="2" valign="top" class="maintext2"><input name="vMobile" type="text" class="textbox" value="<?php echo htmlspecialchars($objU->vMobile)?>" size="35" maxlength="200"></td>
                                            </tr>
                                            <tr align="left">
                                                <td class="maintext2">&nbsp;</td>
                                                <td valign="top" class="maintext2">Mobile Service Provider</td>
                                                <td width="13%" valign="top" class="maintext2"><select name="vProvider" class="textbox3">
                                                                                <?php foreach ($arrProvider as $key => $value) { ?>
                                                        <option value="<?php echo $value['vSMSgateway']?>" <?php echo $objU->vProvider == $value['vSMSgateway'] ? "selected" : ""?>>
                                                                                                                                            <?php echo $value['provider']?>
                                                        </option>
                                                                                                                                                <?php } ?>
                                                    </select></td>
                                                <td width="45%" valign="top" class="maintext2"><strong>Note:</strong> <em>If the mobile number entered above does not match the &quot;Mobile Service Provider&quot; selected here you will not be able to receive Mobile alerts. </em></td>
                                            </tr>
                                            <tr align="left">
                                                <td class="maintext2">&nbsp;</td>
                                                <td valign="top" class="maintext2">Gender</td>
                                                <td colspan="2" valign="top" class="maintext2"><select name="vGender" class="textbox">
                                                                                <?php foreach ($arrGender as $key => $value) { ?>
                                                        <option value="<?php echo $value?>" <?php echo $objU->vGender == $value ? "selected" : ""?>>
                                                                                                                                            <?php echo $value?>
                                                        </option>
                                                                                                                                                <?php } ?>
                                                    </select>  </td>
                                            </tr>
                                            <tr align="left">
                                                <td class="maintext2">&nbsp;</td>
                                                <td valign="top" class="maintext2">Where did you hear about us</td>
                                                <td colspan="2" valign="top" class="maintext2"><select name="vHearing_Source" class="textbox">
                                                                                <?php foreach ($arrHearAboutUs as $key => $value) { ?>
                                                        <option value="<?php echo $value?>" <?php echo $objU->vHearing_Source == $value ? "selected" : ""?>>
                                                                                                                                            <?php echo $value?>
                                                        </option>
                                                                                                                                                <?php } ?>
                                                    </select></td>
                                            </tr>
                                            <tr align="left">
                                                <td class="maintext2">&nbsp;</td>
                                                <td valign="top" class="maintext2">Date of Birth <em>(mm/dd/yyyy): </em></td>
                                                <td colspan="0" valign="top" class="maintext2"><span>
                                                        <!--<input id='date' onClick="javascript:void(0);" name="dDob" value="<?php echo $objU->dDob?>" class="textbox" readonly>
                                                        <a href="javascript:void(0);" onClick="javascript:show_calendar_widget(this);" id="date_link" class="calendar-link"><img src="../images/toggleButton.gif" width="20" height="23" border="0"></a></span>-->
                                                        <input name="dDob" id="dDob" type="text" value="<?php echo $objU->dDob?>" maxlength="50" readonly class="textbox">
                                                        
                                                       </td>
                                                       <td><input type="button" value="v" id="button1" name="button12"  class="button_stylenew" style=" width:30px;">
                                                        <script type="text/javascript" language="javascript">
                                                                Calendar.setup({
                                                                      inputField    : "dDob",
                                                                      button        : "button1",
                                                                      ifFormat      : "%m/%d/%Y",       // format of the input field
                                                                      showsTime     : false,
                                                                      timeFormat    : "24"
                                                                });
                                                       </script></td>
                                            </tr>
                                            <tr align="left">
                                                <td class="maintext2">&nbsp;</td>
                                                <td valign="top" class="maintext2">Relationship Status</td>
                                                <td colspan="2" valign="top" class="maintext2"><select name="vRealtion_Status" class="textbox">
                                                                                <?php foreach ($arrRelationShipStatus as $key => $value) { ?>
                                                        <option value="<?php echo $value?>" <?php echo $objU->vRealtion_Status == $value ? "selected" : ""?>>
                                                                                                                                            <?php echo $value?>
                                                        </option>
                                                                                                                                                <?php } ?>
                                                    </select></td>
                                            </tr>
                                            <tr align="left">
                                                <td class="maintext2">&nbsp;</td>
                                                <td valign="top" class="maintext2">Country</td>
                                                <td colspan="2" valign="top" class="maintext2">
                                                    
                                                    <select name="vCountry" class="textbox3" id="girish_country" onchange="getStateList(this)">
                                                       <?php foreach ($arrCountry as $key => $value) { ?>
                                                            <option value="<?php echo stripslashes($value) ?>" <?php echo stripslashes($objU->vCountry) == stripslashes($value) ? "selected" : "" ?>>
                                                                    <?php echo stripslashes($value) ?>
                                                              </option>
                                                                                                                                                                                                   
                                                        <?php } ?>
                                                    </select></td>
                                            </tr>
                                            <tr align="left">
                                                <td class="maintext2">&nbsp;</td>
                                                <td valign="top" class="maintext2">State</td>
                                                <td colspan="2" valign="top" class="maintext2"><select name="vState" id="girish_state" class="textbox3">
                                                                                <?php foreach ($arrState as $key => $value) { ?>
                                                        <option value="<?php echo stripslashes($value)?>" <?php echo stripslashes($objU->vState) == stripslashes($value) ? "selected" : ""?>>
                                                                                                                                            <?php echo stripslashes($value)?>
                                                        </option>
                                                                                                                                                <?php } ?>
                                                    </select>                                      </td>
                                            </tr>
                                            <tr align="left">
                                                <td class="maintext2">&nbsp;</td>
                                                <td valign="top" class="maintext2">Height</td>
                                                <td colspan="2" valign="top" class="maintext2"><select name="vFeet" class="textbox2" style="width:224px !important;">
                                                                                <?php foreach ($arrFeet as $key => $value) { ?>
                                                        <option value="<?php echo $value?>" <?php echo $objU->vFeet == $value ? "selected" : ""?>>
                                                                                                                                            <?php echo $value?>
                                                        </option>
                                                                                                                                                <?php } ?>
                                                    </select>
                                                    ft
                                                    <select name="vInch" class="textbox2" style="width:224px !important;">
                                                                                <?php foreach ($arrInch as $key => $value) { ?>
                                                        <option value="<?php echo $value?>" <?php echo $objU->vInch == $value ? "selected" : ""?>>
                                                                                                                                            <?php echo $value?>
                                                        </option>
                                                                                                                                                <?php } ?>
                                                    </select>
                                                    in</td>
                                            </tr>
                                            <tr align="left">
                                                <td class="maintext2">&nbsp;</td>
                                                <td valign="top" class="maintext2">Body Type</td>
                                                <td colspan="2" valign="top" class="maintext2"><select name="vBody_Type" class="textbox">
                                                                                <?php foreach ($arrBodyType as $key => $value) { ?>
                                                        <option value="<?php echo $value?>" <?php echo $objU->vBody_Type == $value ? "selected" : ""?>>
                                                                                                                                            <?php echo $value?>
                                                        </option>
                                                                                                                                                <?php } ?>
                                                    </select></td>
                                            </tr>
                                            <tr align="left">
                                                <td class="maintext2">&nbsp;</td>
                                                <td valign="top" class="maintext2">Smoking</td>
                                                <td colspan="2" valign="top" class="maintext2"><select name="vSmoking" class="textbox">
                                                                                <?php foreach ($arrSmoking as $key => $value) { ?>
                                                        <option value="<?php echo $value?>" <?php echo $objU->vSmoking == $value ? "selected" : ""?>>
                                                                                                                                            <?php echo $value?>
                                                        </option>
                                                                                                                                                <?php } ?>
                                                    </select></td>
                                            </tr>
                                            <tr align="left">
                                                <td class="maintext2">&nbsp;</td>
                                                <td valign="top" class="maintext2">Drinking</td>
                                                <td colspan="2" valign="top" class="maintext2"><select name="vDrinking" class="textbox">
                                                                                <?php foreach ($arrDrinking as $key => $value) { ?>
                                                        <option value="<?php echo $value?>" <?php echo $objU->vDrinking == $value ? "selected" : ""?>>
                                                                                                                                            <?php echo $value?>
                                                        </option>
                                                                                                                                                <?php } ?>
                                                    </select> </td>
                                            </tr>
                                            <tr align="left">
                                                <td class="maintext2">&nbsp;</td>
                                                <td valign="top" class="maintext2">Children</td>
                                                <td colspan="2" valign="top" class="maintext2"><select name="nChildren" class="textbox">
                                                                                <?php foreach ($arrChildren as $key => $value) { ?>
                                                        <option value="<?php echo $value?>" <?php echo $objU->nChildren == $value ? "selected" : ""?>>
                                                                                                                                            <?php echo $value?>
                                                        </option>
                                                                                                                                                <?php } ?>
                                                    </select></td>
                                            </tr>
                                            <tr align="left">
                                                <td class="maintext2">&nbsp;</td>
                                                <td valign="top" class="maintext2">Ethnicity</td>
                                                <td colspan="2" valign="top" class="maintext2"><select name="vEthinicity" class="textbox">
                                                                                <?php foreach ($arrEthnicity as $key => $value) { ?>
                                                        <option value="<?php echo $value?>" <?php echo $objU->vEthinicity == $value ? "selected" : ""?>>
                                                                                                                                            <?php echo $value?>
                                                        </option>
                                                                                                                                                <?php } ?>
                                                    </select></td>
                                            </tr>
                                            <tr align="left">
                                                <td class="maintext2">&nbsp;</td>
                                                <td valign="top" class="maintext2">Religion</td>
                                                <td colspan="2" valign="top" class="maintext2"><select name="vReligion" class="textbox">
                                                                                <?php foreach ($arrReligion as $key => $value) { ?>
                                                        <option value="<?php echo $value?>" <?php echo $objU->vReligion == $value ? "selected" : ""?>>
                                                                                                                                            <?php echo $value?>
                                                        </option>
                                                                                                                                                <?php } ?>
                                                    </select></td>
                                            </tr>
                                            <tr align="left">
                                                <td class="maintext2">&nbsp;</td>
                                                <td valign="top" class="maintext2">Highest level of education completed</td>
                                                <td colspan="2" valign="top" class="maintext2"><select name="vEducation" class="textbox">
                                                                                <?php foreach ($arrEducation as $key => $value) { ?>
                                                        <option value="<?php echo $value?>" <?php echo $objU->vEducation == $value ? "selected" : ""?>>
                                                                                                                                            <?php echo $value?>
                                                        </option>
                                                                                                                                                <?php } ?>
                                                    </select></td>
                                            </tr>
                                            <tr align="left">
                                                <td class="maintext2">&nbsp;</td>
                                                <td valign="top" class="maintext2"><strong>My looks today</strong> (Describe your looks now. If you change your hair color, get glasses or have a great week at the gym, change your profile.)</td>
                                                <td colspan="2" valign="top" class="maintext2"><textarea name="tmy_looks_today" cols="60" rows="5" class="textbox_textarea txt-area-big"><?php echo $objU->tmy_looks_today?>
                                                    </textarea></td>
                                            </tr>
                                            <tr align="left">
                                                <td class="maintext2">&nbsp;</td>
                                                <td valign="top" class="maintext2"><strong>My likes on any given day</strong> (What do you like to do in life? What are the things that make you happy?)</td>
                                                <td colspan="2" valign="top" class="maintext2"><textarea name="tmy_likes_onanyday" cols="60" rows="5" class="textbox_textarea txt-area-big"><?php echo $objU->tmy_likes_onanyday?></textarea></td>
                                            </tr>
                                            <tr align="left">
                                                <td class="maintext2">&nbsp;</td>
                                                <td valign="top" class="maintext2"><strong>My dislikes on any given day</strong> (What could you do without? What could go away and life would only get better?)</td>
                                                <td colspan="2" valign="top" class="maintext2"><textarea name="tmy_dislikes_onanyday" cols="60" rows="5" class="textbox_textarea txt-area-big"><?php echo $objU->tmy_dislikes_onanyday?></textarea></td>
                                            </tr>
                                            <tr align="left">
                                                <td class="maintext2">&nbsp;</td>
                                                <td valign="top" class="maintext2"><strong>My personality</strong> (You know who you are.)</td>
                                                <td colspan="2" valign="top" class="maintext2"><textarea name="tmy_personality" cols="60" rows="5" class="textbox_textarea txt-area-big"><?php echo $objU->tmy_personality?></textarea></td>
                                            </tr>
                                            <tr align="left">
                                                <td class="maintext2">&nbsp;</td>
                                                <td valign="top" class="maintext2"><strong>My mood today</strong> (What is your mood today or most days? Change this entry whenever you &quot;feel&quot; like it.)</td>
                                                <td colspan="2" valign="top" class="maintext2"><textarea name="tmy_mood_today" cols="60" rows="5" class="textbox_textarea txt-area-big"><?php echo $objU->tmy_mood_today?></textarea></td>
                                            </tr>
                                            <tr align="left">
                                                <td class="maintext2">&nbsp;</td>
                                                <td valign="top" class="maintext2"><strong>Music</strong> (Concerts / live music fan? Last band you saw live. Top five musical artists. etc.)</td>
                                                <td colspan="2" valign="top" class="maintext2"><textarea name="tmy_music" cols="60" rows="5" class="textbox_textarea txt-area-big"><?php echo $objU->tmy_music?></textarea></td>
                                            </tr>
                                            <tr align="left">
                                                <td class="maintext2">&nbsp;</td>
                                                <td valign="top" class="maintext2"><strong>Movies</strong> (Favorite five. Best Scene. Couldn't pay me to watch.)</td>
                                                <td colspan="2" valign="top" class="maintext2"><textarea name="tmy_movies" cols="60" rows="5" class="textbox_textarea txt-area-big"><?php echo $objU->tmy_movies?></textarea></td>
                                            </tr>
                                            <tr align="left">
                                                <td class="maintext2">&nbsp;</td>
                                                <td valign="top" class="maintext2"><strong>TV</strong> (On my TIVO. Shows I wish they'd cancel. Shows I wish they'd bring back.)</td>
                                                <td colspan="2" valign="top" class="maintext2"><textarea name="tmy_tv" cols="60" rows="5" class="textbox_textarea txt-area-big"><?php echo $objU->tmy_tv?></textarea></td>
                                            </tr>
                                            <tr align="left">
                                                <td class="maintext2">&nbsp;</td>
                                                <td colspan="3" valign="top" class="maintext2"><strong>Sports</strong></td>
                                            </tr>
                                            <tr align="left">
                                                <td class="maintext2">&nbsp;</td>
                                                <td valign="top" class="maintext2">(The ones you play.)</td>
                                                <td colspan="2" valign="top" class="maintext2"><textarea name="tmy_sports_play" cols="60" rows="5" class="textbox_textarea txt-area-big"><?php echo $objU->tmy_sports_play?></textarea></td>
                                            </tr>
                                            <tr align="left">
                                                <td class="maintext2">&nbsp;</td>
                                                <td valign="top" class="maintext2">(The ones you watch.)</td>
                                                <td colspan="2" valign="top" class="maintext2"><textarea name="tmy_sports_watch" cols="60" rows="5" class="textbox_textarea txt-area-big"><?php echo $objU->tmy_sports_watch?></textarea></td>
                                            </tr>
                                            <tr align="left">
                                                <td class="maintext2">&nbsp;</td>
                                                <td colspan="3" valign="top" class="maintext2"><strong>Travel</strong></td>
                                            </tr>
                                            <tr align="left">
                                                <td class="maintext2">&nbsp;</td>
                                                <td valign="top" class="maintext2">(Places you've been.)</td>
                                                <td colspan="2" valign="top" class="maintext2"><textarea name="tmy_travel_been" cols="60" rows="5" class="textbox_textarea txt-area-big"><?php echo $objU->tmy_travel_been?></textarea></td>
                                            </tr>
                                            <tr align="left">
                                                <td class="maintext2">&nbsp;</td>
                                                <td valign="top" class="maintext2">(Places you're going.)</td>
                                                <td colspan="2" valign="top" class="maintext2"><textarea name="tmy_travel_going" cols="60" rows="5" class="textbox_textarea txt-area-big"><?php echo $objU->tmy_travel_going?></textarea></td>
                                            </tr>
                                            <tr align="left">
                                                <td class="maintext2">&nbsp;</td>
                                                <td valign="top" class="maintext2"><strong>Arts and Cultural Events</strong> (Special exhibits, guest speakers at local universities, independent films &ndash; What's going on in the city? Talk about it!)</td>
                                                <td colspan="2" valign="top" class="maintext2"><textarea name="tmy_arts_culture_events" cols="60" rows="5" class="textbox_textarea txt-area-big"><?php echo $objU->tmy_arts_culture_events?></textarea></td>
                                            </tr>
                                            <tr align="left">
                                                <td class="maintext2">&nbsp;</td>
                                                <td valign="top" class="maintext2"><strong>Name your poison and your place</strong> (Capitol City Brewing Company, Capitol Lounge Martini Bar, Urban Restaurant and Wine Bar)</td>
                                                <td colspan="2" valign="top" class="maintext2"><textarea name="tmy_poison_place" cols="60" rows="5" class="textbox_textarea txt-area-big"><?php echo $objU->tmy_poison_place?></textarea></td>
                                            </tr>
                                            <tr align="left">
                                                <td class="maintext2">&nbsp;</td>
                                                <td valign="top" class="maintext2"><strong>A day in my life</strong> (Describe a typical day in your life from the moment you rise to the moment you lie down.)</td>
                                                <td colspan="2" valign="top" class="maintext2"><textarea name="taday_in_my_life" cols="60" rows="5" class="textbox_textarea txt-area-big"><?php echo $objU->taday_in_my_life?></textarea></td>
                                            </tr>
                                            <tr align="left">
                                                <td class="maintext2">&nbsp;</td>
                                                <td colspan="3" valign="top" class="maintext2"><strong>Nightlife</strong></td>
                                            </tr>
                                            <tr align="left">
                                                <td class="maintext2">&nbsp;</td>
                                                <td valign="top" class="maintext2">Out</td>
                                                <td colspan="2" valign="top" class="maintext2"><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></td>
                                            </tr>
                                            <tr align="left">
                                                <td class="maintext2">&nbsp;</td>
                                                <td valign="top" class="maintext2">In</td>
                                                <td colspan="2" valign="top" class="maintext2"><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></td>
                                            </tr>
                                            <tr align="left">
                                                <td class="maintext2">&nbsp;</td>
                                                <td valign="top" class="maintext2"><strong>Food</strong> (What, where, when, and how I like to eat.)</td>
                                                <td colspan="2" valign="top" class="maintext2"><textarea name="tmy_food" cols="60" rows="5" class="textbox_textarea txt-area-big"><?php echo $objU->tmy_food?></textarea></td>
                                            </tr>
                                            <tr align="left">
                                                <td class="maintext2">&nbsp;</td>
                                                <td valign="top" class="maintext2"><strong>Money</strong> (What do you spend your money on?)</td>
                                                <td colspan="2" valign="top" class="maintext2"><textarea name="tmy_money" cols="60" rows="5" class="textbox_textarea txt-area-big"><?php echo $objU->tmy_money?></textarea></td>
                                            </tr>
                                            <tr align="left">
                                                <td class="maintext2">&nbsp;</td>
                                                <td valign="top" class="maintext2">Name the last restaurant you visited</td>
                                                <td colspan="2" valign="top" class="maintext2"><textarea name="tmy_last_restaurant" cols="60" rows="2" class="textbox_textarea txt-area-big"><?php echo $objU->tmy_last_restaurant?></textarea></td>
                                            </tr>
                                            <tr align="left">
                                                <td class="maintext2">&nbsp;</td>
                                                <td valign="top" class="maintext2">Review It</td>
                                                <td colspan="2" valign="top" class="maintext2"><textarea name="tmy_last_restaurant_review" cols="60" rows="5" class="textbox_textarea txt-area-big"><?php echo $objU->tmy_last_restaurant_review?></textarea></td>
                                            </tr>
                                            <tr align="left">
                                                <td class="maintext2">&nbsp;</td>
                                                <td valign="top" class="maintext2">What have you done for charity's sake?</td>
                                                <td colspan="2" valign="top" class="maintext2"><textarea name="tmy_charity" cols="60" rows="5" class="textbox_textarea txt-area-big"><?php echo $objU->tmy_charity?></textarea></td>
                                            </tr>
                                            <tr align="left">
                                                <td class="maintext2">&nbsp;</td>
                                                <td valign="top" class="maintext2"><strong>Did someone say &quot;Politics?&quot;</strong> ( Where do you stand?)</td>
                                                <td colspan="2" valign="top" class="maintext2"><textarea name="tmy_politics" cols="60" rows="5" class="textbox_textarea txt-area-big"><?php echo $objU->tmy_politics?></textarea></td>
                                            </tr>
                                            <tr align="left">
                                                <td class="maintext2">&nbsp;</td>
                                                <td valign="top" class="maintext2">Of the major issues in the world, which are you the most passionate about?</td>
                                                <td colspan="2" valign="top" class="maintext2"><textarea name="tmy_major_world_issue" cols="60" rows="5" class="textbox_textarea txt-area-big"><?php echo $objU->tmy_major_world_issue?></textarea></td>
                                            </tr>
                                            <tr align="left">
                                                <td class="maintext2">&nbsp;</td>
                                                <td valign="top" class="maintext2">What are you doing about it?</td>
                                                <td colspan="2" valign="top" class="maintext2"><textarea name="tmy_doings_on_major_world_issue" cols="60" rows="5" class="textbox_textarea txt-area-big"><?php echo $objU->tmy_doings_on_major_world_issue?></textarea></td>
                                            </tr>
                                            
                                            <!-- 
                                            <tr align="left">
                                                <td class="maintext2">&nbsp;</td>
                                                <td valign="top" class="maintext2">&nbsp;</td>
                                                <td colspan="2" valign="top" class="maintext2">The 9:30 Club is featuring one of your old favs like Emmet Swimming or one of your new favs like Joss Stone; however your boss just offered you free tix to the National Symphony Orchestra at the Kennedy Center:
                                                    <input type="hidden" name="tmy_scenario_question_one" value="The 9:30 Club is featuring one of your old favs like Emmet Swimming or one of your new favs like Joss Stone; however your boss just offered you free tix to the National Symphony Orchestra at the Kennedy Center"></td>
                                            </tr>
                                            
                                            <tr align="left">
                                                <td class="maintext2">&nbsp;</td>
                                                <td valign="top" class="maintext2">&nbsp;</td>
                                                <td colspan="2" valign="top" class="maintext2">A gorgeous girl/guy walks up to you at a Martini bar, with that look in her/his eye. What do you do?:
                                                    <input type="hidden" name="tmy_scenario_question_two" value="A gorgeous girl/guy walks up to you at a Martini bar, with that look in her/his eye. What do you do?"> </td>
                                            </tr>
                                             -->
                                            <tr align="left">
                                                <td class="maintext2">&nbsp;</td>
                                                <td valign="top" class="maintext2"><strong>If I could build a guy/girl&hellip;</strong> (Build your perfect mate. Keep it PG)</td>
                                                <td colspan="2" valign="top" class="maintext2"><textarea name="tmy_perfect_mate" cols="60" rows="5" class="textbox_textarea txt-area-big"><?php echo $objU->tmy_perfect_mate?></textarea></td>
                                            </tr>
                                            <tr align="left">
                                                <td class="maintext2">&nbsp;</td>
                                                <td valign="top" class="maintext2">Current Profile Status</td>
                                                <td colspan="2" valign="top" class="maintext2"><select name="vStatus" class="textbox">
                                                                                <?php foreach ($arrStatus as $key => $value) { ?>
                                                        <option value="<?php echo $key?>" <?php echo $objU->vStatus == $key ? "selected" : ""?>>
                                                                                                                                            <?php echo $value?>
                                                        </option>
                                                                                                                                                <?php } ?>
                                                    </select></td>
                                            </tr>
                                            <tr align="left">
                                                <td class="maintext2">&nbsp;</td>
                                                <td valign="top" class="maintext2">Featured Profile</td>
                                                <td colspan="2" valign="top" class="maintext2"><select name="vFeatured" class="textbox">
                                                                                <?php foreach ($arrFeatured as $key => $value) { ?>
                                                        <option value="<?php echo $key?>" <?php echo $objU->vFeatured == $key ? "selected" : ""?>>
                                                                                                                                            <?php echo $value?>
                                                        </option>
                                                                                                                                                <?php } ?>
                                                    </select></td>
                                            </tr>
                                            <tr align="left">
                                                <td class="maintext2">&nbsp;</td>
                                                <td valign="top" class="maintext2">ID Verified Profile</td>
                                                <td colspan="2" valign="top" class="maintext2"><select name="vId_Varified" class="textbox">
                                                                                <?php foreach ($arrIDVerified as $key => $value) { ?>
                                                        <option value="<?php echo $key?>" <?php echo $objU->vId_Varified == $key ? "selected" : ""?>>
                                                                                                                                            <?php echo $value?>
                                                        </option>
                                                                                                                                                <?php } ?>
                                                    </select> </td>
                                            </tr>
                                            <tr align="left">
                                                <td class="maintext2">&nbsp;</td>
                                                <td valign="top" class="maintext2">Background Verified Profile</td>
                                                <td colspan="2" valign="top" class="maintext2"><select name="vBC_Verified" class="textbox">
                                                                                <?php foreach ($arrBackgroundVerified as $key => $value) { ?>
                                                        <option value="<?php echo $key?>" <?php echo $objU->vBC_Verified == $key ? "selected" : ""?>>
                                                                                                                                            <?php echo $value?>
                                                        </option>
                                                                                                                                                <?php } ?>
                                                    </select>

                                                </td>
                                            </tr>

                                            <!--   **** This area commented -- as this feature is not required 13 Oct 2012 *********


                                            <!--<tr align="left">

                                                <td class="maintext2">&nbsp;</td>
                                                <td valign="top" class="maintext2">Profile Display Type</td>
                                                <td colspan="2" valign="top" class="maintext2"><select name="vProfileType" class="textbox">
                                                                                <?php // foreach ($arrProfileType as $key => $value) { ?>
                                                        <option value="<?php // echo stripslashes($key)?>" <?php // echo $objU->vProfileType == stripslashes($key) ? "selected" : ""?>>
                                                                                                                                            <?php // echo stripslashes($value)?>
                                                        </option>
                                                                                                                                                <?php // } ?>
                                                    </select></td>
                                            </tr>
                                            <tr align="left">
                                                <td class="maintext2">&nbsp;</td>
                                                <td colspan="3" valign="top" class="maintext2"><strong>Note</strong> <em>If you change Profile Display Type to &quot;Unique&quot;, then the user's profile will display only basic details and content in the below text area (Admin written profile details).</em></td>
                                            </tr>
                                            <tr align="left">
                                                <td class="maintext2">&nbsp;</td>
                                                <td valign="top" class="maintext2">Administrator Written Profile <em>(Unique)</em></td>

                                                <td colspan="2" valign="top" class="maintext2"><?php /*
                                                                                $sBasePath                      = "fckeditor/";
                                                                                $sBasePath                      = dirname(dirname($_SERVER['PHP_SELF'])) == "/" ? "/includes/fckeditor/" : dirname(dirname($_SERVER['PHP_SELF'])) ."/includes/fckeditor/";
                                                                                                                                    $oFCKeditor 					= new FCKeditor('tmy_profile') ;
                                                                                                                                    $oFCKeditor->BasePath			= $sBasePath ;
                                                                                                                                    $oFCKeditor->Value				= $objU->tmy_profile;
                                                                                                                                    $oFCKeditor->Config['SkinPath'] = $sBasePath . 'editor/skins/silver/' ;
                                                                                                                                    $oFCKeditor->Width  = '90%' ;
                                                                                                                                    $oFCKeditor->Height = '300' ;
                                                                                                                                    $oFCKeditor->Create() ;*/
                                                                                                                                    ?></td>
                                            </tr>-->
                                            <input type="hidden" name="vProfileType" value="<?php echo $objU->vProfileType ?>" />
                                            <input type="hidden" name="tmy_profile" value="<?php echo $objU->tmy_profile ?>" />                                                                                                                                                                    <?php
                                     }//end first if
                                                                                                                        ?>
                                        </table>
                                        <table width="100%"  border="0" cellspacing="0" cellpadding="0">
                                            <tr>
                                                <td align="right"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
                                                        <tr>
                                                            <td>&nbsp;</td>
                                                        </tr>
                                                    </table>
                                                                            <?php if ($objDB) {
                                                                                ?>
                                                    <table width="100%"  border="0" cellspacing="0" cellpadding="5">
                                                        <tr>
                                                            <td align="left"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
                                                                    <tr>
																		<td width="31%">&nbsp;</td>
																		<td width="7%"><input name="BackNow" type="submit" class="back-btn" value="Back"></td>
                                                                        <td><input type="submit" class="loginbutton" name="SaveNow" value="Update Profile" onclick="return validate();"><input type="hidden" name="page" value="<?php echo $page?>">
                                                                            <input type="hidden" name="id" value="<?php echo $id?>"></td>
                                                                                <?php //if ($id > 0) { ?>
                                                                        
                                                                                    <?php //}//end if?>
                                                                    </tr>
                                                                </table></td>
                                                        </tr>
                                                    </table>
                                                                                <?php
                                                                            }//end first if
                                                                            ?></td>
                                            </tr>
                                        </table></td>
                                </tr>
                            </table></form>
										</td></tr>
                                    </table></td>
                            </tr>
                        </table>
                        
							</div>
							</td>
                </tr>
            </table>
        </td>
    </tr>
</table>
<div class="calendar_widget" id="calendar_widget" style="display:none "><iframe id='calendar_widget_iframe' name='calendar_widget_iframe' style="border: none;" width=100% height=100% src="../date/calendar_widget.html" /></div>
<?php include_once('bottomhtml.php');?>