include("../includes/common.htm");
if (($fid) && ($status=='save')) {
if ($heightinches) $height.=".".$heightinches;
if ($waistinches) $waist.=".".$waistinches;
if ($hipinches) $hips.=".".$hipinches;
if ($weightounces) $weight.=".".$weightounces;
/*
$_POST = ($HTTP_POST_VARS);
foreach ($_POST as $key => $val) {
$$key = $val;
print "$val
";
}print "
";
*/
$current_year=date("Y");
//$age=$current_year-$DateOfBirth_Year;
if ($DateOfBirth_Month<10) { $DateOfBirth_Month="0" . $DateOfBirth_Month; }
if ($DateOfBirth_Day<10) { $DateOfBirth_Day="0" . $DateOfBirth_Day; }
$dob="$DateOfBirth_Year-$DateOfBirth_Month-$DateOfBirth_Day";
if (($DateOfBirth_Month<$current_month) && ($dob!='')) { $age=$current_year-$DateOfBirth_Year; }
else if (($DateOfBirth_Month==$current_month) && ($DateOfBirth_Day>$current_day) && ($dob!='')) { $age=$current_year-$DateOfBirth_Year; }
else { $age=$current_year-$DateOfBirth_Year; $age=$age-1; }
/*
print "birth month:$DateOfBirth_Month (current month: $current_month)
";
print "birth day:$DateOfBirth_Day (current day: $current_day)
Age: $age";
exit;
*/
$update="update lerage_models set sex='$sex',height='$height',chest='$chest',waist='$waist',hips='$hips',haircolor='$haircolor',eyecolor='$eyecolor',skincolor='$skincolor',cup='$cup',hairlen='$hairlen',age='$age',ethnic='$ethnic',weight='$weight',system='$details',DOB='$dob' where id='$fid'";
//print "$update
";
$updaterec = mysql_query("$update") or $msg="Unable to update, contact admin.
";
if ($updaterec!='') { $msg="Record successfully updated."; }
}
$qry="select * from lerage_models where id='$fid'";
print($qry);
$rec=SelectQry($qry);
$dob=split("-",$rec[0]['DOB']);
$dob_month=$dob[1];
$dob_year=$dob[0];
$dob_day=$dob[2];
?>