Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
<?php include("./layout/header.php");
include ("./Utility/dataConnect.php");
include ("./Utility/profileData.php");
session_start();
//setcookie('LivingHealthy', 'RajanM', time() + (86400 * 30), "/"); // 86400 = 1 day
//$AccountName = $_COOKIE['LivingHealthy'];
$AccountName = 'hhp14001';
$memberData = new userProfile($AccountName);
function debug_to_console( $data ) {
$output = $data;
if ( is_array( $output ) )
$output = implode( ',', $output);
echo "<script>console.log( 'Debug Objects: " . $output . "' );</script>";
}
if(isset($AccountName)) {
if (isset($_POST['submit'])) {
if(isset($_POST['DateOfBirth'])) {
$memberData->setDOB($_POST["DateOfBirth"]);
}
if(isset($_POST["GeneticGender"])) {
$memberData->setGeneticGender($_POST["GeneticGender"]);
}
if(isset($_POST["Weight"])) {
$memberData->setWeight($_POST["Weight"]);
}
if(isset($_POST["HeightFeet"])) {
$memberData->setHeightFeet($_POST["HeightFeet"]);
}
if(isset($_POST["HeightInches"])) {
$memberData->setHeightInches($_POST["HeightInches"]);
}
if(isset($_POST["MaritalStatus"])) {
$memberData->setMaritalStatus($_POST["MaritalStatus"]);
}
if(isset($_POST["Occupation"])) {
$memberData->setOccupation($_POST["Occupation"]);
}
if(isset($_POST["LevelOfEducation"])) {
$memberData->setLevelOfEducation($_POST["LevelOfEducation"]);
}
if(isset($_POST["IncomeRange"])) {
$memberData->setIncomeRange($_POST["IncomeRange"]);
}
if(isset($_POST["ReligiousObservance"])) {
$memberData->setReligiousObservance($_POST["ReligiousObservance"]);
}
if(isset($_POST["ResidentialSetting"])) {
$memberData->setResidentialSetting($_POST["ResidentialSetting"]);
}
if(isset($_POST["Ethnicity"])) {
$memberData->setEthnicity($_POST["Ethnicity"]);
}
if(isset($_POST["Medication"])) {
$memberData->setMedication($_POST["Medication"]);
}
if(isset($_POST["DrivingHistory"])) {
$memberData->setDrivingHistory($_POST["DrivingHistory"]);
}
if(isset($_POST["CreditScore"])) {
$memberData->setCreditScore($_POST["CreditScore"]);
}
if(isset($_POST["DietChoices"])) {
$memberData->setDietChoices($_POST["DietChoices"]);
}
if(isset($_POST["IsDisabled"])) {
$memberData->setIsDisabled($_POST["IsDisabled"]);
}
if(isset($_POST["IsDiabetic"])) {
$memberData->setIsDiabetic($_POST["IsDiabetic"]);
}
if(isset($_POST["IsSmoker"])) {
$memberData->setIsSmoker($_POST["IsSmoker"]);
}
$memberData->writeProfile();
}
}
?>
<!-- ############## UI ################# -->
<div class="dropdown" style="float: right; margin-right: 5em;margin-top:3px;">
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
Dropdown
<span class="caret"></span>
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
<li><a href="summary.php">Summary</a></li>
<li><a href="profile.php">Profile</a></li>
<li><a href="demo.php">Demo</a></li>
<li><a href="#">Leaderboard</a></li>
<li><a href="#" onclick="location.href = `logout.php`;">Logout</a></li>
</ul>
</div>
<div class="main-content" style="background-color:#f2f2f2;">
<form id="profile" class="form-labels-on-top" method="post" action="">
<div class="form-title-row">
<h1>Profile
</h1>
</div>
<div class="form-row">
<label>
<span>Birth date*
</span>
<input type="date" name="DateOfBirth" style="width: 300px;" value="<?php echo ($memberData->getIsProfilePresent()=='true')? (htmlspecialchars($memberData->getDOB())): ""; ?>">
</label>
</div>
<div class="form-row">
<label>
<span>What is your biological gender?*
</span>
</label>
<div class="form-radio-buttons">
<div>
<label>
<input type="radio" name="GeneticGender" value="Male" <?php echo ($memberData->getIsProfilePresent()=='true' && $memberData->getGeneticGender()=='Male')? 'checked': ''; ?> >
<span>Male
</span>
</label>
<label>
<input type="radio" name="GeneticGender" value="Female" <?php echo ($memberData->getIsProfilePresent()=='true' && $memberData->getGeneticGender()=='Female')? 'checked': ''; ?>>
<span>Female
</span>
</label>
</div>
</div>
</div>
<div class="form-row">
<label>
<span>What is your height?*
</span>
<input type="number" name="HeightFeet" style="width: 100px;" value="<?php echo ($memberData->getIsProfilePresent()=='true')? (htmlspecialchars($memberData->getHeightFeet())): ""; ?>">
<p id="unit"> feet
</p> &ensp;
<input type="number" name="HeightInches" style="width: 100px;" value="<?php echo ($memberData->getIsProfilePresent()=='true')? (htmlspecialchars($memberData->getHeightInches())): ""; ?>">
<p id="unit"> inches
</p>
</label>
</div>
<div class="form-row">
<label>
<span>What is your weight?*
</span>
<input type="number" name="Weight" style="width: 100px;" value="<?php echo ($memberData->getIsProfilePresent()=='true')? (htmlspecialchars($memberData->getWeight())): ""; ?>">
<p id="unit"> pounds
</p>
</label>
</div>
<div class="form-row">
<label>
<span>What is your Marital Status?*
</span>
</label>
<div class="form-radio-buttons">
<div>
<label>
<input type="radio" name="MaritalStatus" value="Single" <?php echo ($memberData->getIsProfilePresent()=='true' && $memberData->getMaritalStatus()=='Single')? 'checked': ''; ?>>
<span>Single
</span>
</label>
</div>
<div>
<label>
<input type="radio" name="MaritalStatus" value="Married" <?php echo ($memberData->getIsProfilePresent()=='true' && $memberData->getMaritalStatus()=='Married')? 'checked': ''; ?>>
<span>Married
</span>
</label>
</div>
<div>
<label>
<input type="radio" name="MaritalStatus" value="Separated" <?php echo ($memberData->getIsProfilePresent()=='true' && $memberData->getMaritalStatus()=='Separated')? 'checked': ''; ?>>
<span>Separated
</span>
</label>
</div>
<div>
<label>
<input type="radio" name="MaritalStatus" value="Divorced" <?php echo ($memberData->getIsProfilePresent()=='true' && $memberData->getMaritalStatus()=='Divorced')? 'checked': ''; ?>>
<span>Divorced
</span>
</label>
</div>
<div>
<label>
<input type="radio" name="MaritalStatus" value="Widowed" <?php echo ($memberData->getIsProfilePresent()=='true' && $memberData->getMaritalStatus()=='Widowed')? 'checked': ''; ?>>
<span>Widowed
</span>
</label>
</div>
</div>
</div>
<div class="form-row">
<label>
<span>What level of education have you completed?*
</span>
</label>
<div class="form-radio-buttons">
<div>
<label>
<input type="radio" name="LevelOfEducation" value="Below High School" <?php echo ($memberData->getIsProfilePresent()=='true' && $memberData->getLevelOfEducation()=='Below High School')? 'checked': ''; ?>>
<span>
< High School
</span>
</label>
</div>
<div>
<label>
<input type="radio" name="LevelOfEducation" value="High School" <?php echo ($memberData->getIsProfilePresent()=='true' && $memberData->getLevelOfEducation()=='High School')? 'checked': ''; ?>>
<span>High School
</span>
</label>
</div>
<div>
<label>
<input type="radio" name="LevelOfEducation" value="College" <?php echo ($memberData->getIsProfilePresent()=='true' && $memberData->getLevelOfEducation()=='College')? 'checked': ''; ?>>
<span>College
</span>
</label>
</div>
<div>
<label>
<input type="radio" name="LevelOfEducation" value="Graduate Degree" <?php echo ($memberData->getIsProfilePresent()=='true' && $memberData->getLevelOfEducation()=='Graduate Degree')? 'checked': ''; ?>>
<span>Graduate
</span>
</label>
</div>
</div>
</div>
<div class="form-row">
<label>
<span>What is your current occupation?
</span>
<select name="Occupation" value="Graduate Degree">
<option value = "Student" <?php echo ($memberData->getIsProfilePresent()==true && $memberData->getOccupation()=='Student')? 'selected': ''; ?>>Student
</option>
<option value = "mgmt" <?php echo ($memberData->getIsProfilePresent()==true && $memberData->getOccupation()=='mgmt')? 'selected': ''; ?> >Management, Business, and Finance
</option>
<option value = "Professional and Related Services" <?php echo ($memberData->getIsProfilePresent()==true && $memberData->getOccupation()=='Professional and Related Services')? 'selected': ''; ?> >
Professional and Related Services
</option>
<option value = "Sales and Related Services" <?php echo ($memberData->getIsProfilePresent()==true && $memberData->getOccupation()=='Sales and Related Services')? 'selected': ''; ?> >Sales and Related
</option>
<option value = "Office and Administrative Support" <?php echo ($memberData->getIsProfilePresent()==true && $memberData->getOccupation()=='Office and Administrative Support')? 'selected': ''; ?> >Office and Administrative Support
</option>
<option value = "Farming, Fishing and Forestry" <?php echo ($memberData->getIsProfilePresent()==true && $memberData->getOccupation()=='Farming, Fishing and Forestry')? 'selected': ''; ?> >Farming, Fishing and Forestry
</option>
<option value = "Construction and Extraction" <?php echo ($memberData->getIsProfilePresent()==true && $memberData->getOccupation()=='Construction and Extraction')? 'selected': ''; ?> >Construction and Extraction
</option>
<option value = "Installation, Maintenance and Repair" <?php echo ($memberData->getIsProfilePresent()==true && $memberData->getOccupation()=='Installation, Maintenance and Repair')? 'selected': ''; ?> >Installation, Maintenance and Repair
</option>
<option value = "Production" <?php echo ($memberData->getIsProfilePresent()==true && $memberData->getOccupation()=='Production')? 'selected': ''; ?> >Production
</option>
<option value = "Transportation and Material Moving" <?php echo ($memberData->getIsProfilePresent()==true && $memberData->getOccupation()=='Transportation and Material Moving')? 'selected': ''; ?> >Transportation and Material Moving
</option>
<option value = "Unenployed" <?php echo ($memberData->getIsProfilePresent()==true && $memberData->getOccupation()=='Unenployed')? 'selected': ''; ?> >Unemployed
</option>
</select>
</label>
</div>
<div class="form-row">
<label>
<span>What is your annual income?*
</span>
<select name="IncomeRange">
<option value = "<25000" <?php echo ($memberData->getIsProfilePresent()==true && $memberData->getIncomeRange()=='<25000')? 'selected': ''; ?> >
< 25,000
</option>
<option value = "25000-50000" <?php echo ($memberData->getIsProfilePresent()==true && $memberData->getIncomeRange()=='25000-50000')? 'selected': ''; ?> >25,000 - 50,000
</option>
<option value = "50000-75000" <?php echo ($memberData->getIsProfilePresent()==true && $memberData->getIncomeRange()=='50000-75000')? 'selected': 'false'; ?>>50,000 - 75,000
</option>
<option value = "75000-100000" <?php echo ($memberData->getIsProfilePresent()==true && $memberData->getIncomeRange()=='75000-100000')? 'selected': ''; ?> >75,000 - 100,000
</option>
<option value = ">100000" <?php echo ($memberData->getIsProfilePresent()==true && $memberData->getIncomeRange()=='>100000')? 'selected': ''; ?> > 100,000
</option>
</select>
</label>
</div>
<div class="form-row">
<label>
<span>Do you follow any religion?
</span>
</label>
<div class="form-radio-buttons">
<div>
<label>
<input type="radio" name="ReligiousObservance" value="None" <?php echo ($memberData->getIsProfilePresent()=='true' && $memberData->getReligiousObservance()=='None')? 'checked': ''; ?>>
<span>None
</span>
</label>
</div>
<div>
<label>
<input type="radio" name="ReligiousObservance" value="Strongly" <?php echo ($memberData->getIsProfilePresent()=='true' && $memberData->getReligiousObservance()=='Strongly')? 'checked': ''; ?>>
<span>Strongly
</span>
</label>
</div>
<div>
<label>
<input type="radio" name="ReligiousObservance" value="Moderately" <?php echo ($memberData->getIsProfilePresent()=='true' && $memberData->getReligiousObservance()=='Moderately')? 'checked': ''; ?>>
<span>Moderately
</span>
</label>
</div>
</div>
</div>
<div class="form-row">
<label>
<span>What is your type of residence?
</span>
</label>
<div class="form-radio-buttons">
<div>
<label>
<input type="radio" name="ResidentialSetting" value="Rural" <?php echo ($memberData->getIsProfilePresent()=='true' && $memberData->getResidentialSetting()=='Rural')? 'checked': ''; ?>>
<span>Rural
</span>
</label>
</div>
<div>
<label>
<input type="radio" name="ResidentialSetting" value="Urban" <?php echo ($memberData->getIsProfilePresent()=='true' && $memberData->getResidentialSetting()=='Urban')? 'checked': ''; ?>>
<span>Urban
</span>
</label>
</div>
<div>
<label>
<input type="radio" name="ResidentialSetting" value="Suburban" <?php echo ($memberData->getIsProfilePresent()=='true' && $memberData->getResidentialSetting()=='Suburban')? 'checked': ''; ?>>
<span>Suburban
</span>
</label>
</div>
</div>
</div>
<div class="form-row">
<label>
<span>Please indicate your Ethnicity
</span>
<select name="Ethnicity">
<option value="Americal Indian, or Alaskan Native" <?php echo ($memberData->getIsProfilePresent()==true && $memberData->getEthnicity()=='American Indian, or Alaskan Native')? 'selected': ''; ?> >American Indian or Alaskan Native
</option>
<option value="Asian" <?php echo ($memberData->getIsProfilePresent()==true && $memberData->getEthnicity()=='Asian')? 'selected': ''; ?> >Asian
</option>
<option value="Black or African American" <?php echo ($memberData->getIsProfilePresent()==true && $memberData->getEthnicity()=='Black or African American')? 'selected': ''; ?> >Black or African American
</option>
<option value="Hispanic/Latino" <?php echo ($memberData->getIsProfilePresent()==true && $memberData->getEthnicity()=='Hispanic/Latino')? 'selected': ''; ?> >Hispanic/Latino
</option>
<option value="Caucasion" <?php echo ($memberData->getIsProfilePresent()==true && $memberData->getEthnicity()=='Caucasion')? 'selected': ''; ?> >Caucasian
</option>
<option value="Other" <?php echo ($memberData->getIsProfilePresent()==true && $memberData->getEthnicity()=='Other')? 'selected': ''; ?> >Other
</option>
</select>
</label>
</div>
<div class="form-row">
<label>
<span>Do you suffer from any Disabilities?*
</span>
</label>
<div class="form-radio-buttons">
<div>
<label>
<input type="radio" name="IsDisabled" value="yes" <?php echo ($memberData->getIsProfilePresent()=='true' && $memberData->getIsDisabled()=='yes')? 'checked': ''; ?>>
<span>Yes
</span>
</label>
<label>
<input type="radio" name="IsDisabled" value="no" <?php echo ($memberData->getIsProfilePresent()=='true' && $memberData->getIsDisabled()=='no')? 'checked': ''; ?>>
<span>No
</span>
</label>
</div>
</div>
</div>
<div class="form-row">
<label>
<span>Are you a Smoker?*
</span>
</label>
<div class="form-radio-buttons">
<div>
<label>
<input type="radio" name="IsSmoker" value="smoker" <?php echo ($memberData->getIsProfilePresent()=='true' && $memberData->getIsSmoker()=='smoker')? 'checked': ''; ?>>
<span>Yes
</span>
</label>
<label>
<input type="radio" name="IsSmoker" value="non-Smoker" <?php echo ($memberData->getIsProfilePresent()=='true' && $memberData->getIsSmoker()=='non-Smoker')? 'checked': ''; ?>>
<span>No
</span>
</label>
</div>
</div>
</div>
<div class="form-row">
<label>
<span>Are you Diabetic?*
</span>
</label>
<div class="form-radio-buttons">
<div>
<label>
<input type="radio" name="IsDiabetic" value="yes" <?php echo ($memberData->getIsProfilePresent()=='true' && $memberData->getIsDiabetic()=='yes')? 'checked': ''; ?>>
<span>Yes
</span>
</label>
<label>
<input type="radio" name="IsDiabetic" value="no" <?php echo ($memberData->getIsProfilePresent()=='true' && $memberData->getIsDiabetic()=='no')? 'checked': ''; ?>>
<span>No
</span>
</label>
</div>
</div>
</div>
<div class="form-row">
<label>
<span>Medication for any pre-existing condition
</span>
<input type="text" name="Medication" value = "<?php echo ($memberData->getIsProfilePresent()=='true')? htmlspecialchars($memberData->getMedication()): ''; ?>">
</label>
</div>
<div class="form-row">
<label>
<span>How is your driving history?*
</span>
</label>
<div class="form-radio-buttons">
<div>
<label>
<input type="radio" name="DrivingHistory" value="0 Accidents per year" <?php echo ($memberData->getIsProfilePresent()=='true' && $memberData->getDrivingHistory()=='0 Accidents per year')? 'checked': ''; ?> >
<span>0 accident per year
</span>
</label>
</div>
<div>
<label>
<input type="radio" name="DrivingHistory" value="1 Accidents per year" <?php echo ($memberData->getIsProfilePresent()=='true' && $memberData->getDrivingHistory()=='1 Accidents per year')? 'checked': ''; ?> >
<span>1 accident per year
</span>
</label>
</div>
<div>
<label>
<input type="radio" name="DrivingHistory" value="2 or more accidents per year" <?php echo ($memberData->getIsProfilePresent()=='true' && $memberData->getDrivingHistory()=='2 or more accidents per year')? 'checked': ''; ?> >
<span>2+ accident per year
</span>
</label>
</div>
</div>
</div>
<div class="form-row">
<label>
<span>What is your credit score?
</span>
</label>
<div class="form-radio-buttons">
<div>
<label>
<input type="radio" name="CreditScore" value="Below 500" <?php echo ($memberData->getIsProfilePresent()=='true' && $memberData->getCreditScore()=='Below 500')? 'checked': ''; ?> >
<span>
< 500
</span>
</label>
</div>
<div>
<label>
<input type="radio" name="CreditScore" value="500-750" <?php echo ($memberData->getIsProfilePresent()=='true' && $memberData->getCreditScore()=='500-750')? 'checked': ''; ?> >
<span>500 - 750
</span>
</label>
</div>
<div>
<label>
<input type="radio" name="CreditScore" value="Above 750" <?php echo ($memberData->getIsProfilePresent()=='true' && $memberData->getCreditScore()=='Above 750')? 'checked': ''; ?> >
<span>750+
</span>
</label>
</div>
</div>
</div>
<div class="form-row">
<label>
<span>Preferred Diet
</span>
</label>
<div class="form-radio-buttons">
<div>
<label>
<input type="radio" name="DietChoices" value="None" <?php echo ($memberData->getIsProfilePresent()=='true' && $memberData->getDietChoices()=='None')? 'checked': ''; ?> >
<span>None
</span>
</label>
</div>
<div>
<label>
<input type="radio" name="DietChoices" value="Vegetarian" <?php echo ($memberData->getIsProfilePresent()=='true' && $memberData->getDietChoices()=='Vegetarian')? 'checked': ''; ?> >
<span>Vegetarian
</span>
</label>
</div>
<div>
<label>
<input type="radio" name="DietChoices" value="Vegan" <?php echo ($memberData->getIsProfilePresent()=='true' && $memberData->getDietChoices()=='Vegan')? 'checked': ''; ?> >
<span>Vegan
</span>
</label>
</div>
<div>
<label>
<input type="radio" name="DietChoices" value="Pescatarian" <?php echo ($memberData->getIsProfilePresent()=='true' && $memberData->getDietChoices()=='Pescatarian')? 'checked': ''; ?> >
<span>Pescatarian
</span>
</label>
</div>
</div>
</div>
<input type="submit" name="submit" class="next btn btn-success" value="Save" />
</form>
</div>
<?php
//include header template
require 'layout/footer.php';
?>
</body>
<script type="text/javascript">
function scrollToTop() {
document.body.scrollTop = 0;
document.documentElement.scrollTop = 0;
}
$(document).ready(function(){
var form = $("#profile");
form.validate({
errorPlacement: function(error, element) {
error.insertBefore(element);
},
rules: {
DateOfBirth: {
required: true
},
GeneticGender: {
required: true
},
HeightFeet: {
required: true,
number: true,
min: 1
},
HeightInches: {
required: true,
number: true,
min: 0
},
Weight: {
required: true,
min: 10
},
MaritalStatus: {
required: true
},
LevelOfEducation: {
required: true
},
IncomeRange: {
required: true
},
IsDisabled: {
required: true
},
IsDiabetic: {
required: true
},
IsSmoker: {
required: true
},
DrivingHistory: {
required: true
}
},
messages: {
}
});
});
</script>
</html>