<script type="text/javascript">
function check(){
	var nyelv = <?if(hun()):?>'hun'<?else:?>'eng'<?endif;?>;
	if( checkFormPersonal(nyelv) ){
		jQuery('#registration_form').submit();
	}
}
</script>

<div data-role="page">
<div data-role="header">
	<h1 style="margin-left: 70px; margin-right: 15px;">Workshop <?=lang('events_form_sub_reg')?></h1>
    <a class="ui-btn ui-shadow ui-btn-corner-all ui-btn-icon-left ui-btn-up-a" data-theme="a" data-wrapperels="span" data-iconshadow="true" data-shadow="true" data-corners="true" href="/mobile/ws/<?=$tema?>" data-role="button" data-icon="arrow-l" data-ajax="false">
		<span class="ui-btn-inner ui-btn-corner-all"><span class="ui-btn-text"><?=lang('forum_vissza')?></span>
		<span class="ui-icon ui-icon-arrow-l ui-icon-shadow">&nbsp;</span></span>
    </a>
</div>


<div data-role="content">
<h2><?=$event->name?></h2>

<?$hiba = $_SESSION['default']['wshiba'];
unset($_SESSION['default']['wshiba']);
$wsadatok=$_SESSION['default']['wsadatok'];
unset($_SESSION['default']['wsadatok']);?>

<?if($hiba):?>
<span style="color: #dd0000"><?=$hiba?></span>
<?endif;?>

<?=form_open('mobile/wsregisztracio', array('id' => 'registration_form', 'data-ajax'=>'false'))?>

<?=form_hidden('do', 'OK')?>
<?=form_hidden('event_main_id', $event->event_main_id)?>

<?if( count($dates) > 0 ):?>
	<?$i=1;?>
	<?foreach($dates as $date):?>
	<input type="radio" name="event_id" id="radio-choice-<?=$i?>" value="<?=$date->event_id?>" <?if(!$date->times->able_to_reg):?> disabled="disabled"<?endif;?><?if($esemid == $date->event_id):?> checked="checked"<?endif;?> />
    <label for="radio-choice-<?=$i?>"><?=$this->dateclass->getDateString($date->start_ts)?> <?=date('H:i',$date->start_ts)?> - <?=date('H:i',$date->end_ts)?><?if(!$date->times->able_to_reg && hun()):?> (betelt)<?endif;?>
	<?if(eng()):?><b><?if($date->location != ""):?><?=$date->location?><?else:?>Berkshire<?endif;?></b><?endif;?>
	</label>
	<?	if($i>=3) break;
		else $i++;	?>
	<?endforeach;?>
<?else:?>
	<input type="radio" name="event_id" id="radio-choice-1" value="personal" checked="checked" />
    <label for="radio-choice-1"><?=lang('event_ipkeres')?></label>
<?endif;?>

<div data-role="fieldcontain">
<?if($event->event_main_id==56 || $event->event_main_id==63):?>
	<label for="nev"><strong><?=lang('events_form_name')?>:</strong></label>
	<input type="text" name="strName1" id="nev" value="<?=$wsadatok['nev']?>" />
	</div>
	<div data-role="fieldcontain">
	<label for="tel"><strong><?=lang('events_form_phone')?>:</strong></label>
	<input type="tel" name="strTel" id="tel" value="<?=$wsadatok['tel']?>" />
	</div>
	<div data-role="fieldcontain">
	<label for="email"><strong><?=lang('events_form_email')?>:</strong></label>
	<input type="email" name="strEMail" id="email" value="<?=$wsadatok['email']?>" />
<?else:?>
	<?=$this->load->view('form_general')?>
<?endif;?>
</div>

<?=lang('events_form_comment')?>:<br />
<input type="text" name="comment" value="<?=$wsadatok['comment']?>" />

<div data-role="fieldcontain">
<label><input type="checkbox" id="policy" name="policy" /> <?=lang('event_feltelfog')?> <?=lang('event_feltelek')?> </label>
</div>

<?if($event->event_main_id==56 || $event->event_main_id==63):?>
	<input type="submit" value="<?=lang('events_form_sub_reg')?>" />
<?else:?>
	<input type="button" value="<?=lang('events_form_sub_reg')?>" onclick="check()" />
<?endif;?>
<?=form_close()?>

<br />
<a href="<?if(!hun()):?>http://www.archlinexp.com/mobile/page/ws-policy-conditions<?else:?>http://www.archline.hu/mobile/page/workshop-feltetelek<?endif;?>" target="_blank" style="color: #f00"><?=lang('event_feltelek')?></a>

</div>

<div data-role="footer">
    <p align="center">&copy; <?=lang('m_cegnev')?> | <a href="/interior/workshop/<?=$this->uri->segment(3)?>/register/<?=$this->uri->segment(5)?>" data-ajax="false"><?=lang('m_teljesv')?></a></p>
	</div>

</div>