<?php
if($tpl['arr']['type'] == 'image')
{
	?>
	<form action="" method="post" id="frmUpdateSection" class="pj-form form" autocomplete="off">
		<input type="hidden" name="id" value="<?php echo $tpl['arr']['id'];?>" />
		<input type="hidden" name="type" value="<?php echo $tpl['arr']['type'];?>" />
		<input type="hidden" name="image_id" value="<?php echo $tpl['arr']['image_id'];?>" />
		<p>
			<label class="title"><?php __('lblRotationDegree'); ?></label>
			<span class="inline_block">
				<input type="text" name="deg" id="deg" value="<?php echo pjSanitize::html($tpl['arr']['deg']);?>" class="pj-form-field w150 required" data-msg-required="<?php __('lblFieldRequired');?>"/>
			</span>
		</p>
		<p>
			<label class="title"><?php __('lblSize'); ?></label>
			<span class="inline_block">
				<input type="text" name="size" id="size" value="<?php echo pjSanitize::html($tpl['arr']['width']);?>" class="pj-form-field w150 required" data-msg-required="<?php __('lblFieldRequired');?>"/>
			</span>
		</p>
		<p>
			<label class="title"><?php __('lblImagePosition'); ?></label>
			<span class="inline_block">
				<select name="position" id="position" class="pj-form-field required" data-msg-required="<?php __('lblFieldRequired');?>">
					<?php
					foreach (__('position', true) as $k => $v)
					{
						?><option value="<?php echo $k; ?>"<?php echo $k == $tpl['arr']['position'] ? ' selected="selected"' : NULL;?>><?php echo $v; ?></option><?php
					}
					?>
				</select>
			</span>
		</p>
		<?php
		if(!empty($tpl['gallery_arr']))
		{ 
			?>
			<p>
				<label class="block"><?php __('lblSelectAnImage'); ?></label>
				<?php
				foreach($tpl['gallery_arr'] as $v)
				{ 
					?>
					<div class="fmImageOuter<?php echo $v['id'] == $tpl['arr']['image_id'] ? ' active' : null;?>">
						<a href="#" class="fmImageItem" data-id="<?php echo $v['id'];?>">
							<img src="<?php echo PJ_INSTALL_URL . $v['small_path'] ;?>"/>
						</a>
						<span></span>
					</div>
					<?php
				} 
				?>
			</p>
			<?php
		}else{
			$message = __('lblNoImagesMessage', true);
			$message = str_replace("{STAG}", '<a href="'.$_SERVER['PHP_SELF'].'?controller=pjAdminFloorplans&amp;action=pjActionUpdate&id='.$tpl['arr']['floorplan_id'].'&tab_id=tab-2">', $message);
			$message = str_replace("{ETAG}", "</a>", $message)
			?>
			<p>
				<label class="block"><?php echo $message; ?></label>
			</p>
			<?php
		} 
		?>
	</form>
	<?php
}else{
	?>
	<form action="" method="post" id="frmUpdateSection" class="pj-form form" autocomplete="off">
		<input type="hidden" name="id" value="<?php echo $tpl['arr']['id'];?>" />
		<input type="hidden" name="type" value="<?php echo $tpl['arr']['type'];?>" />
		<p>
			<label class="title"><?php __('lblTitle'); ?></label>
			<span class="inline_block">
				<input type="text" name="title" id="title" value="<?php echo pjSanitize::html($tpl['arr']['title']);?>" class="pj-form-field w250 required" data-msg-required="<?php __('lblFieldRequired');?>"/>
			</span>
		</p>
		<p>
			<label class="title"><?php __('lblSize'); ?></label>
			<span class="inline_block">
				<input type="text" name="size" id="size" value="<?php echo pjSanitize::html($tpl['arr']['size']);?>" class="pj-form-field w150" data-msg-required="<?php __('lblFieldRequired');?>"/>
			</span>
		</p>
		<p>
			<label class="title"><?php __('lblDimensions'); ?></label>
			<span class="inline_block">
				<input type="text" name="dimensions" id="dimensions" value="<?php echo pjSanitize::html($tpl['arr']['dimensions']);?>" class="pj-form-field w250" data-msg-required="<?php __('lblFieldRequired');?>"/>
			</span>
		</p>
		<p>
			<label class="title"><?php __('lblInfo'); ?></label>
			<span class="inline_block">
				<textarea name="info" class="pj-form-field w350 h80"><?php echo stripslashes($tpl['arr']['info']);?></textarea>
			</span>
		</p>
	</form>
	<?php
}
?>