<?php include VIEW_DIR.'mobile/common/menu/profile.tpl'; ?>

<form method="post" action="<?php e($this->_vars['action']['url']); ?>"><?php HTML::requires(); ?>
<?php if ($this->_vars['action']['complete']): ?>
			<?php _e('Updated'); ?><br><br>
			<?php loadPlugin::callFunc('hitsuji_banner', POSITION_MOBILE); ?>
<?php elseif ($this->_vars['action']['confirm']): ?>
<table border="0" width="<?php Theme::exec()->mainWidth(); ?>">
	<tr><td bgcolor="<?php Theme::exec()->bgColumnColor(); ?>"><?php _e('Profile Viewable'); ?>:<br></td></tr>
	<tr><td><?php e($this->_vars['visibility'][$this->_vars['act_profile']['visibility']]); ?><br></td></tr>

	<tr><td bgcolor="<?php Theme::exec()->bgColumnColor(); ?>"><?php _e('Name'); ?>:<br></td></tr>
	<tr><td> 
		<?php e($this->_vars['act_profile']['first_name']); ?>&nbsp;
		<?php e($this->_vars['act_profile']['last_name']); ?>
	<br></td></tr>
	<tr><td><?php e($this->_vars['visibility'][$this->_vars['act_profile']['name_flag']]); ?><br></td></tr>

	<tr><td bgcolor="<?php Theme::exec()->bgColumnColor(); ?>"><?php _e('Nickname'); ?>:<br></td></tr>
	<tr><td><?php e($this->_vars['act_profile']['nickname']); ?><br></td></tr>

	<tr><td bgcolor="<?php Theme::exec()->bgColumnColor(); ?>"><?php _e('Present address'); ?>:<br></td></tr>
	<tr><td>
		<?php e($this->_vars['reference']['ara_region'][$this->_vars['act_profile']['ref_region']]); ?>
		<?php HTML::reference('ara_city', $this->_vars['act_profile']['ref_city']); ?>
	<br></td></tr>
	<tr><td><?php e($this->_vars['visibility'][$this->_vars['act_profile']['region_flag']]); ?><br></td></tr>

	<tr><td bgcolor="<?php Theme::exec()->bgColumnColor(); ?>"><?php _e('Gender'); ?>:<br></td></tr>
	<tr><td><?php e($this->_vars['reference']['act_gender'][$this->_vars['act_profile']['ref_gender']]); ?><br></td></tr>
	<tr><td><?php e($this->_vars['visibility'][$this->_vars['act_profile']['gender_flag']]); ?><br></td></tr>

	<tr><td bgcolor="<?php Theme::exec()->bgColumnColor(); ?>"><?php _e('Blood Type'); ?>:<br></td></tr>
	<tr><td><?php e($this->_vars['reference']['act_blood'][$this->_vars['act_profile']['ref_blood']]); ?><br></td></tr>
	<tr><td><?php e($this->_vars['visibility'][$this->_vars['act_profile']['blood_flag']]); ?><br></td></tr>

	<tr><td bgcolor="<?php Theme::exec()->bgColumnColor(); ?>"><?php _e('Birthday'); ?>:<br></td></tr>
	<tr><td>
		<?php eDate($this->_vars['act_profile']['birthday'], _('Y-m-d')); ?>
	<br></td></tr>
	<tr><td><?php e($this->_vars['visibility'][$this->_vars['act_profile']['birthday_flag']]); ?><br></td></tr>

	<tr><td bgcolor="<?php Theme::exec()->bgColumnColor(); ?>"><?php _e('Age Viewable'); ?>:<br></td></tr>
	<tr><td><?php e($this->_vars['visibility'][$this->_vars['act_profile']['age_flag']]); ?><br></td></tr>

	<tr><td bgcolor="<?php Theme::exec()->bgColumnColor(); ?>"><?php _e('Marital Status'); ?>:<br></td></tr>
	<tr><td><?php e($this->_vars['reference']['act_married'][$this->_vars['act_profile']['ref_married']]); ?><br></td></tr>
	<tr><td><?php e($this->_vars['visibility'][$this->_vars['act_profile']['married_flag']]); ?><br></td></tr>

	<tr><td bgcolor="<?php Theme::exec()->bgColumnColor(); ?>"><?php _e('Hometown'); ?>:<br></td></tr>
	<tr><td>
		<?php e($this->_vars['reference']['ara_region'][$this->_vars['act_profile']['ref_hometown']]); ?>
		<?php HTML::reference('ara_city', $this->_vars['act_profile']['ref_homecity']); ?>
	<br></td></tr>
	<tr><td><?php e($this->_vars['visibility'][$this->_vars['act_profile']['hometown_flag']]); ?><br></td></tr>
<?php /* プロフィール追加項目 */
if (!empty($this->_vars['items'])):
foreach ($this->_vars['items'] as $_row): 
?>
	<tr><td bgcolor="<?php Theme::exec()->bgColumnColor(); ?>"><?php e($_row['item']); ?>:<br></td></tr>
	<tr><td>
		<input name="personals[<?php e($_row['ref_item']); ?>][ref_item]" type="hidden" value="<?php e($_row['ref_item']); ?>">
		<input name="personals[<?php e($_row['ref_item']); ?>][personal]" type="hidden" value="<?php e($_row['personal']); ?>">
		<input name="personals[<?php e($_row['ref_item']); ?>][visibility]" type="hidden" value="<?php e($_row['visibility']); ?>">
<?php if ($_row['type'] == FORM_TYPE_TEXT): ?>
		<?php e($_row['personal']); ?>
<?php elseif ($_row['type'] == FORM_TYPE_TEXTAREA): ?>
		<?php nl2br($_row['personal']); ?>
<?php elseif ($_row['type'] == FORM_TYPE_SELECT || $_row['type'] == FORM_TYPE_RADIO): ?>
		<?php e($_row['answers'][$_row['personal']]); ?>
<?php elseif ($_row['type'] == FORM_TYPE_CHECKBOX): ?>
		<?php HTML::mobileCheckedList($_row['answers'], $_row['personal'], 2); ?>
<?php elseif ($_row['type'] == FORM_TYPE_DATE): ?>
		<?php eDate($_row['personal'], _('Y-m-d')); ?>
<?php endif; ?>
	<br></td></tr>
<?php if ($_row['visible'] == VISIBLE_SELECT): ?>
	<tr><td><?php e($this->_vars['visibility'][$_row['visibility']]); ?><br></td></tr>
<?php endif; ?>
<?php endforeach; endif; ?>
	<tr><td bgcolor="<?php Theme::exec()->bgColumnColor(); ?>"><?php _e('Taste'); ?>:<br></td></tr>
	<tr><td>
		<?php if (!empty($this->_vars['alert']['taste'])): ?><font color="<?php Theme::exec()->alertColor(); ?>"><?php _e('Please enter.'); ?></font><br><?php endif; ?>
		<?php HTML::mobileCheckedList($this->_vars['reference']['act_taste'], $this->_vars['act_profile']['taste']); ?>
	<br></td></tr>

	<tr><td bgcolor="<?php Theme::exec()->bgColumnColor(); ?>"><?php _e('Comment'); ?>:<br></td></tr>
	<tr><td><?php HTML::htmlBody($this->_vars['act_profile']['comment']); ?><br></td></tr>

	<tr><td bgcolor="<?php Theme::exec()->bgColor(); ?>" align="center">
		<input type="submit" name="manip" value="<?php _e('Submit'); ?>">&nbsp;
		<input type="submit" name="<?php e($this->_vars['action']['goback']); ?>" value="<?php _e('Go back'); ?>">
	<br></td></tr>
</table>
<?php else: ?>
<table border="0" width="<?php Theme::exec()->mainWidth(); ?>">
	<tr><td bgcolor="<?php Theme::exec()->bgColumnColor(); ?>"><?php _e('Profile Viewable'); ?>:<br></td></tr>
	<tr><td>
		<?php if (!empty($this->_vars['alert']['visibility'])): ?><font color="<?php Theme::exec()->alertColor(); ?>"><?php _e('Please select.'); ?></font><br><?php endif; ?>
		<select name="visibility"><?php HTML::options($this->_vars['visibility'], $this->_vars['act_profile']['visibility']); ?></select>
	<br></td></tr>
	<tr><td bgcolor="<?php Theme::exec()->bgColumnColor(); ?>"><?php _e('Name'); ?>:<br></td></tr>
	<tr><td>
		<?php if (!empty($this->_vars['alert']['first_name']) || !empty($this->_vars['alert']['last_name'])): ?><font color="<?php Theme::exec()->alertColor(); ?>"><?php _e('Please enter.'); ?></font><br><?php endif; ?>
		<input type="text" name="first_name" value="<?php e($this->_vars['act_profile']['first_name']); ?>" size="18">&nbsp;
		<input type="text" name="last_name" value="<?php e($this->_vars['act_profile']['last_name']); ?>" size="18">
	<br></td></tr>
	<tr><td>
		<?php if (!empty($this->_vars['alert']['name_flag'])): ?><font color="<?php Theme::exec()->alertColor(); ?>"><?php _e('Please select.'); ?></font><br><?php endif; ?>
		<select name="name_flag"><?php HTML::options($this->_vars['visibility'], $this->_vars['act_profile']['name_flag']); ?></select>
	<br></td></tr>
	<tr><td bgcolor="<?php Theme::exec()->bgColumnColor(); ?>"><?php _e('Nickname'); ?>:<br></td></tr>
	<tr><td>
		<?php if (!empty($this->_vars['alert']['nickname'])): ?><font color="<?php Theme::exec()->alertColor(); ?>"><?php _e('Please enter.'); ?></font><br><?php endif; ?>
		<input type="text" name="nickname" value="<?php e($this->_vars['act_profile']['nickname']); ?>">
	<br></td></tr>
	<tr><td bgcolor="<?php Theme::exec()->bgColumnColor(); ?>"><?php _e('Present address'); ?>:<br></td></tr>
	<tr><td>
		<?php if (!empty($this->_vars['alert']['ref_region'])): ?><font color="<?php Theme::exec()->alertColor(); ?>"><?php _e('Please select.'); ?></font><br><?php endif; ?>
		<select name="ref_region" onchange="setCity('<?php e(HTTP_ACTION); ?>public/json/city/', this, 'city');"><option value=""><?php _e('- Select One -'); ?></option><?php HTML::options($this->_vars['reference']['ara_region'], $this->_vars['act_profile']['ref_region']); ?></select>
		<?php if (!empty($this->_vars['alert']['ref_city'])): ?><font color="<?php Theme::exec()->alertColor(); ?>"><?php _e('Please select.'); ?></font><br><?php endif; ?>
		<select id="city" name="ref_city"><?php HTML::options($this->_vars['cities'], $this->_vars['act_profile']['ref_city']); ?></select>
	<br></td></tr>
	<tr><td>
		<?php if (!empty($this->_vars['alert']['region_flag'])): ?><font color="<?php Theme::exec()->alertColor(); ?>"><?php _e('Please select.'); ?></font><br><?php endif; ?>
		<select name="region_flag"><?php HTML::options($this->_vars['visibility'], $this->_vars['act_profile']['region_flag']); ?></select>
	<br></td></tr>

	<tr><td bgcolor="<?php Theme::exec()->bgColumnColor(); ?>"><?php _e('Gender'); ?>:<br></td></tr>
	<tr><td>
		<?php if (!empty($this->_vars['alert']['ref_gender'])): ?><font color="<?php Theme::exec()->alertColor(); ?>"><?php _e('Please select.'); ?></font><br><?php endif; ?>
		<select name="ref_gender"><?php HTML::options($this->_vars['reference']['act_gender'], $this->_vars['act_profile']['ref_gender']); ?></select>
	<br></td></tr>
	<tr><td>
		<?php if (!empty($this->_vars['alert']['gender_flag'])): ?><font color="<?php Theme::exec()->alertColor(); ?>"><?php _e('Please select.'); ?></font><br><?php endif; ?>
		<select name="gender_flag"><?php HTML::options($this->_vars['visibility'], $this->_vars['act_profile']['gender_flag']); ?></select>
	<br></td></tr>

	<tr><td bgcolor="<?php Theme::exec()->bgColumnColor(); ?>"><?php _e('Blood Type'); ?>:<br></td></tr>
	<tr><td>
		<?php if (!empty($this->_vars['alert']['ref_blood'])): ?><font color="<?php Theme::exec()->alertColor(); ?>"><?php _e('Please select.'); ?></font><br><?php endif; ?>
		<select name="ref_blood"><?php HTML::options($this->_vars['reference']['act_blood'], $this->_vars['act_profile']['ref_blood']); ?></select>
	<br></td></tr>
	<tr><td>
		<?php if (!empty($this->_vars['alert']['blood_flag'])): ?><font color="<?php Theme::exec()->alertColor(); ?>"><?php _e('Please select.'); ?></font><br><?php endif; ?>
		<select name="blood_flag"><?php HTML::options($this->_vars['visibility'], $this->_vars['act_profile']['blood_flag']); ?></select>
	<br></td></tr>

	<tr><td bgcolor="<?php Theme::exec()->bgColumnColor(); ?>"><?php _e('Birthday'); ?>:<br></td></tr>
	<tr><td>
		<?php if (!empty($this->_vars['alert']['birthday'])): ?><font color="<?php Theme::exec()->alertColor(); ?>"><?php _e('Please select date.'); ?></font><br><?php endif; ?>
		<?php HTML::dateSelect('birthday', $this->_vars['act_profile']['birthday'], DATE_START_AGE); ?>
	<br></td></tr>
	<tr><td>
		<?php if (!empty($this->_vars['alert']['birthday_flag'])): ?><font color="<?php Theme::exec()->alertColor(); ?>"><?php _e('Please select.'); ?></font><br><?php endif; ?>
		<select name="birthday_flag"><?php HTML::options($this->_vars['visibility'], $this->_vars['act_profile']['birthday_flag']); ?></select>
	<br></td></tr>

	<tr><td bgcolor="<?php Theme::exec()->bgColumnColor(); ?>"><?php _e('Age Viewable'); ?>:<br></td></tr>
	<tr><td>
		<?php if (!empty($this->_vars['alert']['age_flag'])): ?><font color="<?php Theme::exec()->alertColor(); ?>"><?php _e('Please select.'); ?></font><br><?php endif; ?>
		<select name="age_flag"><?php HTML::options($this->_vars['visibility'], $this->_vars['act_profile']['age_flag']); ?></select>
	<br></td></tr>

	<tr><td bgcolor="<?php Theme::exec()->bgColumnColor(); ?>"><?php _e('Marital Status'); ?>:<br></td></tr>
	<tr><td>
		<?php if (!empty($this->_vars['alert']['ref_married'])): ?><font color="<?php Theme::exec()->alertColor(); ?>"><?php _e('Please select.'); ?></font><br><?php endif; ?>
		<select name="ref_married"><?php HTML::options($this->_vars['reference']['act_married'], $this->_vars['act_profile']['ref_married']); ?></select>
	<br></td></tr>
	<tr><td>
		<?php if (!empty($this->_vars['alert']['married_flag'])): ?><font color="<?php Theme::exec()->alertColor(); ?>"><?php _e('Please select.'); ?></font><br><?php endif; ?>
		<select name="married_flag"><?php HTML::options($this->_vars['visibility'], $this->_vars['act_profile']['married_flag']); ?></select>
	<br></td></tr>

	<tr><td bgcolor="<?php Theme::exec()->bgColumnColor(); ?>"><?php _e('Hometown'); ?>:<br></td></tr>
	<tr><td>
		<?php if (!empty($this->_vars['alert']['ref_hometown'])): ?><font color="<?php Theme::exec()->alertColor(); ?>"><?php _e('Please select.'); ?></font><br><?php endif; ?>
		<select name="ref_hometown" onchange="setCity('<?php e(HTTP_ACTION); ?>public/json/city/', this, 'homecity');"><?php HTML::options($this->_vars['reference']['ara_region'], $this->_vars['act_profile']['ref_hometown']); ?></select>
		<?php if (!empty($this->_vars['alert']['ref_homecity'])): ?><font color="<?php Theme::exec()->alertColor(); ?>"><?php _e('Please select.'); ?></font><br><?php endif; ?>
		<select id="homecity" name="ref_homecity"><?php HTML::options($this->_vars['homecities'], $this->_vars['act_profile']['ref_homecity']); ?></select>
	<br></td></tr>
	<tr><td>
		<?php if (!empty($this->_vars['alert']['hometown_flag'])): ?><font color="<?php Theme::exec()->alertColor(); ?>"><?php _e('Please select.'); ?></font><br><?php endif; ?>
		<select name="hometown_flag"><?php HTML::options($this->_vars['visibility'], $this->_vars['act_profile']['hometown_flag']); ?></select>
	<br></td></tr>
<?php /* プロフィール追加項目 */
if (!empty($this->_vars['items'])):
foreach ($this->_vars['items'] as $_row): 
?>
	<tr><td bgcolor="<?php Theme::exec()->bgColumnColor(); ?>"><?php e($_row['item']); ?><?php if($_row['required']): ?><span class="attention">*</font><?php endif; ?>:<br></td></tr>
	<tr><td>
		<?php if (!empty($_row['alert'])): ?><font color="<?php Theme::exec()->alertColor(); ?>"><?php _e('Please enter.'); ?></font><br><?php endif; ?>
		<input name="personals[<?php e($_row['ref_item']); ?>][ref_item]" type="hidden" value="<?php e($_row['ref_item']); ?>">
<?php if ($_row['type'] == FORM_TYPE_TEXT): ?>
		<input type="text" name="personals[<?php e($_row['ref_item']); ?>][personal]" value="<?php e($_row['personal']); ?>">
<?php elseif ($_row['type'] == FORM_TYPE_TEXTAREA): ?>
		<textarea name="personals[<?php e($_row['ref_item']); ?>][personal]" cols="40" rows="10"><?php e($_row['personal']); ?></textarea>
<?php elseif ($_row['type'] == FORM_TYPE_SELECT): ?>
		<select name="personals[<?php e($_row['ref_item']); ?>][personal]"><?php HTML::options($_row['answers'], $_row['personal']); ?></select>
<?php elseif ($_row['type'] == FORM_TYPE_CHECKBOX): ?>
		<?php HTML::checkbox('personals['.$_row['ref_item'].'][personal]', $_row['answers'], $_row['personal'], 2); ?>
<?php elseif ($_row['type'] == FORM_TYPE_RADIO): ?>
		<?php HTML::radio('personals['.$_row['ref_item'].'][personal]', $_row['answers'], $_row['personal']); ?>
<?php elseif ($_row['type'] == FORM_TYPE_DATE): ?>
		<?php HTML::dateSelect('personals['.$_row['ref_item'].'][personal]', $_row['personal'], DATE_START_AGE); ?>
<?php endif; ?>
	<br></td></tr>
<?php if ($_row['visible'] == VISIBLE_SELECT): ?>
	<tr><td><select name="personals[<?php e($_row['ref_item']); ?>][visibility]"><?php HTML::options($this->_vars['visibility'], $_row['visibility']); ?></select><br></td></tr>
<?php endif; ?>
<?php endforeach; endif; ?>
	<tr><td bgcolor="<?php Theme::exec()->bgColumnColor(); ?>"><?php _e('Taste'); ?>:<br></td></tr>
	<tr><td>
		<?php if (!empty($this->_vars['alert']['taste'])): ?><font color="<?php Theme::exec()->alertColor(); ?>"><?php _e('Please enter.'); ?></font><br><?php endif; ?>
		<?php HTML::mobileCheckbox('taste', $this->_vars['reference']['act_taste'], $this->_vars['act_profile']['taste']); ?>
	<br></td></tr>

	<tr><td bgcolor="<?php Theme::exec()->bgColumnColor(); ?>"><?php _e('Comment'); ?>:<br></td></tr>
    <tr><td>
		<?php if (!empty($this->_vars['alert']['comment'])): ?><font color="<?php Theme::exec()->alertColor(); ?>"><?php _e('Please enter.'); ?></font><br><?php endif; ?>
		<?php HTML::mobileRichEditor('comment', $this->_vars['act_profile']['comment'], _('Comment')); ?>
	<br></td></tr>
	<tr><td bgcolor="<?php Theme::exec()->bgColor(); ?>" align="center"><input type="submit" name="confirm" value="<?php _e('Confirm'); ?>"><br></td></tr>
</table>
<?php endif; ?>
</form>
