Beispiel #1
0
		<label for="birthday" class="col-lg-2 control-label">Дата рождения</label>
		<div class="col-lg-10">
			<select name="day" class="form-control" style="width:70px;float:left;">
				<?for($i = 1; $i <= 31; $i++):?>
				<?$d = $i < 10 ? '0'.$i : $i;?>
				<option value="<?php 
echo $d;
?>
"<?if($item->birthday && date("d",strtotime($item->birthday)) == $d):?> selected<?endif;?>><?php 
echo $d;
?>
</option>
				<?endfor;?>
			</select>
			<select name="month" class="form-control" style="width:150px;float:left;margin-left:20px;">
				<?foreach(Mydate::monthsArray() as $mid => $mname):?>
				<option value="<?php 
echo $mid;
?>
"<?if($item->birthday && date("m",strtotime($item->birthday)) == $mid):?> selected<?endif;?>><?php 
echo $mname;
?>
</option>
				<?endforeach;?>
			</select>
			<select name="year" class="form-control" style="width:100px;float:left;margin-left:20px;">
				<?foreach(array_reverse(range(date("Y") - 100, date("Y") - 14)) as $year):?>
				<option value="<?php 
echo $year;
?>
"<?if($item->birthday && date("Y",strtotime($item->birthday)) == $year):?> selected<?endif;?>><?php