<?php echo $header; ?>
<div id="content">
  <div class="breadcrumb">
    <?php foreach ($breadcrumbs as $breadcrumb) { ?>
    <?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
    <?php } ?>
  </div>
  
  <?php if ($error_warning) { ?>
  	<div class="warning"><?php echo $error_warning; ?></div>
  <?php } ?>
  
  <div class="box">
    <div class="heading">
      <h1><img src="view/image/module.png" alt="" /> <?php echo $heading_title; ?></h1>
      <div class="buttons"><a onclick="$('#form').submit();" class="button"><?php echo $button_save; ?></a><a onclick="location = '<?php echo $cancel; ?>';" class="button"><?php echo $button_cancel; ?></a></div>
    </div>
  	<div class="content">
	<div id="tabs" class="htabs"><a href="#tab-general">General</a><a href="#tab-footer">Footer</a><a href="#tab-contact">Contact</a></div>
      <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="form">
	  <div id="tab-general">
	  <h2>Theme Status</h2>
	  <table class="form">
			<tr>
              <td>Enable?</td>
              <td>
					<select name="leisure[themeEnabled]">
                    	<option value="disable" <?php if(isset($leisure['themeEnabled']) && $leisure['themeEnabled']=='disable'){ echo 'selected="selected"'; }?>>Disable</option>
                        <option value="enable" <?php if(isset($leisure['themeEnabled']) && $leisure['themeEnabled']=='enable'){ echo 'selected="selected"'; }?>>Enable</option>
                    </select>
			  </td>
            </tr>
	  </table>
	  <h2>Product Cloud Zoom Setting</h2>
	  <table class="form">
			<tr>
              <td>Enable?</td>
              <td>
					<select name="leisure[cloudZoomEnabled]">
                    	<option value="disable" <?php if(isset($leisure['cloudZoomEnabled']) && $leisure['cloudZoomEnabled']=='disable'){ echo 'selected="selected"'; }?>>Disable</option>
                        <option value="enable" <?php if(isset($leisure['cloudZoomEnabled']) && $leisure['cloudZoomEnabled']=='enable'){ echo 'selected="selected"'; }?>>Enable</option>
                    </select>
			  </td>
            </tr>
	  </table>
	  <h2>Theme Color Setting</h2>
      <table class="form">
			<tr>
            	<td style="width:30%">Color Scheme:<br /> <small style="color:red">Note:</small> <small>If you want use  custom color scheme, please select custom color!</small></td>
                <td>
                	<select name="leisure[themeSetting]">
                    	<option value="style1" <?php if(isset($leisure['themeSetting']) && $leisure['themeSetting']=='style1'){ echo 'selected="selected"'; }?>>Style1 - Fashion Shop</option>
                        <option value="style2" <?php if(isset($leisure['themeSetting']) && $leisure['themeSetting']=='style2'){ echo 'selected="selected"'; }?>>Style2 - Gadget Shop</option>
						<option value="style3" <?php if(isset($leisure['themeSetting']) && $leisure['themeSetting']=='style3'){ echo 'selected="selected"'; }?>>Style3 - Lingerie Shop</option>
						<option value="style4" <?php if(isset($leisure['themeSetting']) && $leisure['themeSetting']=='style4'){ echo 'selected="selected"'; }?>>Style4 - Watch Shop</option>
						<option value="custom" <?php if(isset($leisure['themeSetting']) && $leisure['themeSetting']=='custom'){ echo 'selected="selected"'; }?>>Custom Color Scheme</option>
                    </select>
                </td>
            </tr>
      </table>
	  <h2>Custom Colors (<small>You must select "Custom Color Scheme" from above</small>)</h2>
      <table class="form">
      		<tr>
                <td>Custom Color:</td>
				<td>
				   <input type="text" name="leisure[customColor]" value="<?php if(isset($leisure['customColor'])){ echo $leisure['customColor']; } ?>" class="colorPicker" />
				   <span style="background:#<?php if(isset($leisure['customColor'])){ echo $leisure['customColor']; } ?>;"></span>
				</td>
        	</tr>
			<tr>	
				<td>Content Background Pattern<br /><small>Upload your own pattern</small></td>
           		<td>
                		<div class="image">
                        <?php if($leisure['bgImage']): ?>
                        	<img src="<?php echo HTTP_IMAGE . $leisure['bgImage']; ?>" alt="" id="thumb" width="100" height="100" />
                        <?php endif; ?>
                  		<input type="hidden" name="leisure[bgImage]" value="<?php echo $leisure['bgImage']; ?>" id="image"  />
                      	<br />
                      	<a onclick="image_upload('image', 'thumb');"><?php echo $text_browse; ?></a>
                     	<a onclick="$('#image').attr('value','');$('#thumb').remove();"><?php echo $button_remove; ?></a>
						</div>
               </td>
			</tr>
      </table>
	  </div>
	  <div id="tab-footer">
		<h2>Social Links</h2>
		<table class="form">
			<tr>
                <td>Title:</td>
				<td>
				   <input type="text" name="leisure[socialTitle]" value="<?php if(isset($leisure['socialTitle'])){ echo $leisure['socialTitle']; } ?>" />
				</td>
        	</tr>
      		<tr>
                <td>Facebook Page Url:</td>
				<td>
				   <input type="text" name="leisure[facebookUrl]" value="<?php if(isset($leisure['facebookUrl'])){ echo $leisure['facebookUrl']; } ?>" />
				</td>
        	</tr>
			<tr>
                <td>Twitter Page Url:</td>
				<td>
				   <input type="text" name="leisure[twitterUrl]" value="<?php if(isset($leisure['twitterUrl'])){ echo $leisure['twitterUrl']; } ?>" />
				</td>
        	</tr>
			<tr>
                <td>RSS Page Url:</td>
				<td>
				   <input type="text" name="leisure[RSSUrl]" value="<?php if(isset($leisure['RSSUrl'])){ echo $leisure['RSSUrl']; } ?>" />
				</td>
        	</tr>
		</table>
		<h2>Custom Footer</h2>
		<table class="form">
      		<tr>
                <td>Footer About Text:</td>
				<td>
				   <textarea id="leisure[footerAbout]" name="leisure[footerAbout]" cols="60" rows="10"><?php if(isset($leisure['footerAbout'])){ echo $leisure['footerAbout']; } ?></textarea>
				</td>
        	</tr>
			<tr>
                <td>Footer Copyright Text:</td>
				<td>
				   <input type="text" name="leisure[footerCopyright]" value="<?php if(isset($leisure['footerCopyright'])){ echo $leisure['footerCopyright']; } ?>" />
				</td>
        	</tr>
		</table>
		<h2>Footer Shipping Module Text:</h2>
		<table class="form">
			<tr>
              <td>Enable?</td>
              <td>
					<select name="leisure[shippingEnable]">
                    	<option value="disable" <?php if(isset($leisure['shippingEnable']) && $leisure['shippingEnable']=='disable'){ echo 'selected="selected"'; }?>>Disable</option>
                        <option value="enable" <?php if(isset($leisure['shippingEnable']) && $leisure['shippingEnable']=='enable'){ echo 'selected="selected"'; }?>>Enable</option>
                    </select>
			  </td>
            </tr>
      		<tr>
                <td>Line 1:</td>
				<td>
				   <input type="text" name="leisure[shippingLine1]" value="<?php if(isset($leisure['shippingLine1'])){ echo $leisure['shippingLine1']; } ?>" />
				</td>
        	</tr>
			<tr>
                <td>Line 2:</td>
				<td>
				   <input type="text" name="leisure[shippingLine2]" value="<?php if(isset($leisure['shippingLine2'])){ echo $leisure['shippingLine2']; } ?>" />
				</td>
        	</tr>
			<tr>
                <td>Line 3:</td>
				<td>
				   <input type="text" name="leisure[shippingLine3]" value="<?php if(isset($leisure['shippingLine3'])){ echo $leisure['shippingLine3']; } ?>" />
				</td>
        	</tr>
			<tr>
                <td>Line 4:</td>
				<td>
				   <input type="text" name="leisure[shippingLine4]" value="<?php if(isset($leisure['shippingLine4'])){ echo $leisure['shippingLine4']; } ?>" />
				</td>
        	</tr>
		</table>
		<h2>Footer Payment Logo</h2>
		<table class="form">
		<tr>	
				<td>Footer Payment Logo<br /><small>Upload your own logo</small></td>
           		<td>
                		<div class="image">
                        <?php if($leisure['footerPaymentLogo']): ?>
                        	<img src="<?php echo HTTP_IMAGE . $leisure['footerPaymentLogo']; ?>" alt="" id="footerPLogo" />
                        <?php endif; ?>
                  		<input type="hidden" name="leisure[footerPaymentLogo]" value="<?php echo $leisure['footerPaymentLogo']; ?>" id="footerPLogoImage"  />
                      	<br />
                      	<a onclick="image_upload('footerPLogoImage', 'footerPLogo');"><?php echo $text_browse; ?></a>
                     	<a onclick="$('#footerPLogoImage').attr('value','');$('#footerPLogo').remove();"><?php echo $button_remove; ?></a>
						</div>
               </td>
			</tr>
		</table>
	  </div>
	  <div id="tab-contact">
		<h2>Contact Form</h2>
		<table class="form">
			<tr>
                <td>Google Maps Code:</td>
				<td>
				   <textarea id="leisure[GoogleMapsCode]" name="leisure[GoogleMapsCode]" cols="60" rows="10"><?php if(isset($leisure['GoogleMapsCode'])){ echo $leisure['GoogleMapsCode']; } ?></textarea>
				</td>
        	</tr>
		</table>
	  </div>
	  </form>
    </div>
  
  </div>
  
  
</div>
<script type="text/javascript" src="view/javascript/ckeditor/ckeditor.js"></script> 
<script type="text/javascript"><!--
$('input.colorPicker').ColorPicker({
	onSubmit: function(hsb, hex, rgb, el) {
		$(el).val(hex);
		$(el).ColorPickerHide();
		$(el).parent().find('span').css('background','#'+hex);	
	},
	onBeforeShow: function () {
		$(this).ColorPickerSetColor(this.value);
	}
})
.bind('keyup', function(){
	$(this).ColorPickerSetColor(this.value);	
});
--></script>
<script type="text/javascript">
	function image_upload(field, thumb) {
	$('#dialog').remove();
	
	$('#content').prepend('<div id="dialog" style="padding: 3px 0px 0px 0px;"><iframe src="index.php?route=common/filemanager&token=<?php echo $token; ?>&field=' + encodeURIComponent(field) + '" style="padding:0; margin: 0; display: block; width: 100%; height: 100%;" frameborder="no" scrolling="auto"></iframe></div>');
	
	$('#dialog').dialog({
		title: '<?php echo $text_image_manager; ?>',
		close: function (event, ui) {
			if ($('#' + field).attr('value')) {
				$.ajax({
					url: 'index.php?route=common/filemanager/image&token=<?php echo $token; ?>&image=' + encodeURIComponent($('#' + field).attr('value')),
					dataType: 'text',
					success: function(data) {
						$('.image').find('img').remove();
						$('.image').prepend('<img src="' + data + '" alt="" id="' + thumb + '" />');
					}
				});
			}
		},	
		bgiframe: false,
		width: 700,
		height: 400,
		resizable: false,
		modal: false
	});
};
</script>
<script type="text/javascript"><!--
$('#tabs a').tabs();
//--></script> 
<?php echo $footer; ?>