<?php
//initialise---------------------------------------
require_once('./admin.php');
$Display->Title = 'Profile';
$Display->Subtitle = 'Identity';
$UpdateFile = 'profile-identity-update.php';
require('./admin-display-header.php');
//database connect---------------------------------
if(empty($Error)) //do not, if updating a profile
{
$Name = $DC->Result('SELECT * FROM '.PR_DATABASE_PREFIX."identity WHERE identity_name = 'name'");
$Name = $Name[0]['identity_value'];
$Description = $DC->Result('SELECT * FROM '.PR_DATABASE_PREFIX."identity WHERE identity_name = 'description'");
$Description = $Description[0]['identity_value'];
$RealName = $DC->Result("SELECT * FROM ".PR_DATABASE_PREFIX."identity WHERE identity_name = 'realname'");
$RealName = $RealName[0]['identity_value'];
$Sex = $DC->Result("SELECT * FROM ".PR_DATABASE_PREFIX."identity WHERE identity_name = 'sex'");
$Sex = $Sex[0]['identity_value'];
$DateOfBirth = $DC->Result("SELECT * FROM ".PR_DATABASE_PREFIX."identity WHERE identity_name = 'dateofbirth'");
$DateOfBirth = $DateOfBirth[0]['identity_value'];
if(!empty($DateOfBirth))
{
$DOBYear = substr($DateOfBirth, 0, 4);
$DOBMonth = substr($DateOfBirth, 4, 2);
$DOBDate = substr($DateOfBirth, 6, 2);
}
else
$DOBYear = $DOBMonth = $DOBDate = null;
$DOBShow = $DC->Select('config', 'config_name', 'show_dob');
$DOBShow = $DOBShow[0]['config_value'];
$Country = $DC->Result("SELECT * FROM ".PR_DATABASE_PREFIX."identity WHERE identity_name = 'country'");
$Country = $Country[0]['identity_value'];
$City = $DC->Result("SELECT * FROM ".PR_DATABASE_PREFIX."identity WHERE identity_name = 'city'");
$City = $City[0]['identity_value'];
}
?>
<h2> Main profile identity » </h2>
<p> Identity is the main part of you profile </p>
<table>
<form method="post" action="profile-identity-update.php?action=identity">
<tr> <td align="right"> Nickname </td>
<td> <input type="text" name="name" value="<?php _P($Name); ?>" size="60" /> </td>
</tr>
<tr> <td align="right"> Description </td>
<td> <input type="text" name="description" value="<?php _P($Description); ?>" size="60" /> </td>
</tr>
<tr> <td align="right"> Real name </td>
<td> <input type="text" name="realname" value="<?php _P($RealName); ?>" size="60" /> </td>
</tr>
<tr> <td align="right"> Gender </td>
<td> <select name="sex">
<option value="female" <?php if($Sex=='female') _P('selected="selected"'); ?>>Female</option>
<option value="male" <?php if($Sex=='male') _P('selected="selected"'); ?>>male</option>
</select>
</td>
</tr>
<tr> <td align="right"> Date Of Birth </td>
<td> <?php require('./profile-identity-dob.php'); ?> </td>
</tr>
<tr> <td align="right"> Country </td>
<td> <input type="text" name="country" value="<?php _P($Country); ?>" size="60" /> </td>
</tr>
<tr> <td align="right"> City </td>
<td> <input type="text" name="city" value="<?php _P($City); ?>" size="60" /> </td>
</tr>
<tr> <td align="right"> </td>
<td align="right"> <input type="submit" value="Update Identity »" style="font-size:large" /> </td>
</tr>
</form>
</table>
<?php require('./admin-display-footer.php'); ?>