<?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"><span><?php echo $button_save; ?></span></a><a onclick="location = '<?php echo $cancel; ?>';" class="button"><span><?php echo $button_cancel; ?></span></a></div>
  </div>
  <div class="content">
    <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="form">
      <table id="module" class="list">
        <tbody id="module-row<?php echo $module_row; ?>">
          <tr>
            <td>Status</td>
            <td><select name="creativecp_status">
                <?php if ($module['status']) { ?>
                <option value="1" selected="selected"><?php echo $text_enabled; ?></option>
                <option value="0"><?php echo $text_disabled; ?></option>
                <?php } else { ?>
                <option value="1"><?php echo $text_enabled; ?></option>
                <option value="0" selected="selected"><?php echo $text_disabled; ?></option>
                <?php } ?>
              </select></td>
          </tr>
          <tr>
            <td colspan="2"><h3>Bottom Module settings</h3></td>
          </tr>
		  <tr>
            <td>About us Title</td>
            <td class="left"><input name="creativecp_abouttitle" type="text" id="creativecp_abouttitle" value="<?php echo $module['abouttitle'];?>" /></td>
          </tr>
          <tr>
            <td>About us text</td>
            <td class="left"><textarea name="creativecp_abouttext" id="creativecp_headerbg"><?php echo $module['abouttext'];?></textarea></td>
          </tr>
		  <tr>
            <td>Contact Us Title </td>
            <td class="left"><input name="creativecp_ctitle" type="text" id="creativecp_headerlink" value="<?php echo $module['ctitle'];?>" /></td>
          </tr>
		  <tr>
            <td>Contact Us Phone </td>
            <td class="left"><textarea name="creativecp_cphone" id="creativecp_headerlink"><?php echo $module['cphone'];?></textarea></td>
          </tr>
		  <tr>
            <td>Contact Us Mobile </td>
            <td class="left"><textarea name="creativecp_cmobile" id="creativecp_bodytext"><?php echo $module['cmobile'];?></textarea></td>
          </tr>
		  <tr>
		    <td>Contact Us Email </td>
		    <td class="left"><textarea name="creativecp_cemail" id="creativecp_bodytext"><?php echo $module['cemail'];?></textarea></td>
	      </tr>
		  <tr>
		    <td>Twitter Id </td>
		    <td class="left"><input name="creativecp_twitterid" type="text" id="textarea2" value="<?php echo $module['twitterid'];?>" /></td>
	      </tr>
		  <tr>
		    <td colspan="2"><h3>Facebook LikeBox settings </h3></td>
	      </tr>
		  <tr>
		    <td>Profile Id  </td>
		    <td class="left"><input name="creativecp_fbid" type="text" id="textarea22" value="<?php echo $module['fbid'];?>" /> 
		    <span class="help">(e.g.http://www.facebook.com/people/@/<strong>320113668000323</strong>,  in this URL "320113668000323")</span></td>
	      </tr>
		  <tr style="display:none">
		    <td>App Id </td>
		    <td class="left"><input name="creativecp_appid" type="text" id="creativecp_appid" value="<?php echo $module['appid'];?>" /></td>
	      </tr>
		  <tr>
		    <td colspan="2"><h3>Follow Us links </h3></td>
	      </tr>
		  <tr>
		    <td>Facebook</td>
		    <td class="left"><input name="creativecp_fburl" type="text" id="textarea23" value="<?php echo $module['fburl'];?>" /></td>
	      </tr>
		  <tr>
		    <td>Twitter</td>
		    <td class="left"><input name="creativecp_twurl" type="text" id="textarea24" value="<?php echo $module['twurl'];?>" /></td>
	      </tr>
		  <tr>
		    <td>Google</td>
		    <td class="left"><input name="creativecp_goourl" type="text" id="textarea25" value="<?php echo $module['goourl'];?>" /></td>
	      </tr>
		  <tr>
		    <td colspan="2" style="background-color:#e4e4e4"><h3>Theme customization options </h3><i style="font-size:10px">If you configure any of below options, it will apply in front end otherwise leave them blank for default styles.</i>
			</td>
	      </tr>
		 
		  <tr>
            <td colspan="2"><h3>Top bar</h3></td>
          </tr>
		  
		  <tr>
            <td>Background</td>
            <td class="left"><input name="creativecp_topbarbg" type="text" id="creativecp_topbarbg" value="<?php echo $module['topbarbg'];?>"  class="colorpickercls" /></td>
          </tr>
		  <tr>
            <td>Links</td>
            <td class="left"><input name="creativecp_topbarlink" type="text" id="creativecp_topbarlink" value="<?php echo $module['topbarlink'];?>"  class="colorpickercls" /></td>
          </tr>
		  
		  <tr>
            <td colspan="2"><h3>Category Menu</h3></td>
          </tr>
		  <tr>
            <td>Links</td>
            <td class="left"><input name="creativecp_categorymenulink" type="text" id="creativecp_categorymenulink" value="<?php echo $module['categorymenulink'];?>"  class="colorpickercls" /></td>
          </tr>
		   <tr>
            <td><?php echo "Font Size";?></td>
            <td class="left"><input name="creativecp_categorymenufontsize" type="text" id="creativecp_categorymenufontsize" value="<?php echo $module['categorymenufontsize'];?>" /> px</td>
          </tr>
		  <tr>
            <td colspan="2"><h3>SubMenu (Dropdown)</h3></td>
          </tr>
		  
		  <tr>
            <td>Background</td>
            <td class="left"><input name="creativecp_categorymenuddbg" type="text" id="creativecp_categorymenuddbg" value="<?php echo $module['categorymenuddbg'];?>"  class="colorpickercls" /></td>
          </tr>
		  <tr>
            <td>Links</td>
            <td class="left"><input name="creativecp_categorymenuddlink" type="text" id="creativecp_categorymenuddlink" value="<?php echo $module['categorymenuddlink'];?>"  class="colorpickercls" /></td>
          </tr>
		  
		  <tr>
            <td colspan="2"><h3>Product Heading</h3></td>
          </tr>
		  <tr>
            <td>Product Name</td>
            <td class="left"><input name="creativecp_productlink" type="text" id="creativecp_productlink" value="<?php echo $module['productlink'];?>"  class="colorpickercls" /></td>
          </tr>
		  
		  <tr>
            <td colspan="2"><h3>Button</h3></td>
          </tr>
		  
		  <tr>
            <td>Background</td>
            <td class="left"><input name="creativecp_buttonbg" type="text" id="creativecp_buttonbg" value="<?php echo $module['buttonbg'];?>"  class="colorpickercls" /></td>
          </tr>
		  <tr>
            <td>Links</td>
            <td class="left"><input name="creativecp_buttonlink" type="text" id="creativecp_buttonlink" value="<?php echo $module['buttonlink'];?>"  class="colorpickercls" /></td>
          </tr>
		  
		  <tr style="display:none">
            <td colspan="2"><h3>Button Featured</h3></td>
          </tr>
		  
		  <tr style="display:none">
            <td>Background</td>
            <td class="left"><input name="creativecp_buttonbgfe" type="text" id="creativecp_buttonbgfe" value="<?php echo $module['buttonbgfe'];?>"  class="colorpickercls" /></td>
          </tr>
		  <tr style="display:none">
            <td>Links</td>
            <td class="left"><input name="creativecp_buttonlinkfe" type="text" id="creativecp_buttonlinkfe" value="<?php echo $module['buttonlinkfe'];?>"  class="colorpickercls" /></td>
          </tr>
		  
		  <tr>
            <td colspan="2"><h3>Body</h3></td>
          </tr>
		  
		  <tr>
            <td>Backgorund color</td>
            <td class="left"><input name="creativecp_bodybg" type="text" id="creativecp_bodybg" value="<?php echo $module['bodybg'];?>"  class="colorpickercls" /></td>
          </tr>
		  <tr>
		  <td>Backgorund texture</td>
		    <td><table width="100%" border="0" cellpadding="0" cellspacing="0" class="nocsstable">
              <tr>
                <td><table>
                    
                      <tr>
                        <td><table>
						<tr><td colspan="5"><input type="radio" name="creativecp_bodytexture" value="" /> Default Texture</td></tr>
						<tr>
						
                            <?php 
			$k = 0;
			for($i=1; $i<=30; $i++){
			
			if($k%5==0 && $k!=0){echo '<tr>';}
			?>
                              <td><input type="radio" name="creativecp_bodytexture" value="<?php echo str_pad($i, 2, '0', STR_PAD_LEFT);?>.png" <?php if(isset($module['bodytexture']) && $module['bodytexture'] == str_pad($i, 2, '0', STR_PAD_LEFT).".png"){echo 'checked';}?> />
                                  <img src="../catalog/view/theme/creative/image/pattern/thumb/<?php echo str_pad($i, 2, '0', STR_PAD_LEFT);?>.png" width="20" /></td>
                              <?php 
			$k++;
			if($k%5==0){echo '</tr>';}
			}?>
                            
                        </table></td>
                      </tr>
                    
                </table></td>
                
              </tr>
            </table></td>
	      </tr>
		  <tr>
            <td>Text</td>
            <td class="left"><input name="creativecp_bodytext" type="text" id="creativecp_bodytext" value="<?php echo $module['bodytext'];?>"  class="colorpickercls" /></td>
          </tr>
		  <tr>
            <td>Font</td>
            <td class="left">
			<select name="creativecp_bodyfont">
			<option></option>
			<?php foreach($safefonts as $font){?>
			<option value="<?php echo $font;?>" <?php if($module['bodyfont']==$font){echo "selected";}?>><?php echo $font;?></option>
			<?php }?>
			</select>
			</td>
          </tr>
		  
		  <tr>
            <td colspan="2"><h3>Heading fonts</h3></td>
          </tr>
		  
		  <tr>
            <td>Font</td>
            <td class="left">
			
			<select name="creativecp_headingfont">
			<option></option>
			<?php foreach($googlefonts as $font){?>
			<option value="<?php echo $font;?>" <?php if($module['headingfont']==$font){echo "selected";}?>><?php echo $font;?></option>
			<?php }?>
			</select>
			</td>
          </tr>
		  <tr>
            <td>Text</td>
            <td class="left"><input name="creativecp_headingfonttext" type="text" id="creativecp_headingfonttext" value="<?php echo $module['headingfonttext'];?>"  class="colorpickercls" /></td>
          </tr>
		  
		  
		  
		  <tr>
            <td colspan="2"><h3>Footer</h3></td>
          </tr>
		  
		  <tr>
            <td>Heading</td>
            <td class="left"><input name="creativecp_footerheading" type="text" id="creativecp_footerheading" value="<?php echo $module['footerheading'];?>"  class="colorpickercls"/></td>
          </tr>
		  <tr>
            <td>Links</td>
            <td class="left"><input name="creativecp_footerlinks" type="text" id="creativecp_footerlinks" value="<?php echo $module['footerlinks'];?>"  class="colorpickercls"/></td>
          </tr>
		  <tr style="display:none">
            <td>Background</td>
            <td class="left"><input name="creativecp_footerbg" type="text" id="creativecp_footerbg" value="<?php echo $module['footerbg'];?>"  class="colorpickercls"/></td>
          </tr>
		  <tr>
            <td colspan="2"><h3>Footer Bar</h3></td>
          </tr>
		  <tr>
            <td>Background</td>
            <td class="left"><input name="creativecp_footerbarbg" type="text" id="creativecp_footerbarbg" value="<?php echo $module['footerbarbg'];?>"  class="colorpickercls" /></td>
          </tr>
		  <tr>
            <td>Links</td>
            <td class="left"><input name="creativecp_footerbarlink" type="text" id="creativecp_footerbarlink" value="<?php echo $module['footerbarlink'];?>"  class="colorpickercls"/></td>
          </tr>

        </tbody>
      </table>
    </form>
  </div>
</div>
<link rel="stylesheet" href="view/javascript/creative/colorpicker/css/colorpicker.css" type="text/css" />
<script type="text/javascript" src="view/javascript/creative/colorpicker/js/colorpicker.js"></script>
<script type="text/javascript" src="view/javascript/creative/colorpicker/js/eye.js"></script>
<script type="text/javascript" src="view/javascript/creative/colorpicker/js/utils.js"></script>
<script type="text/javascript" src="view/javascript/creative/colorpicker/js/layout.js?ver=1.0.2"></script>
<script type="text/javascript">
$('.colorpickercls').ColorPicker({
	onSubmit: function(hsb, hex, rgb, el) {
		$(el).val(hex);
		$(el).ColorPickerHide();
	},
	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(text) {
						$('#' + thumb).replaceWith('<img src="' + text + '" alt="" id="' + thumb + '" />');
					}
				});
			}
		},	
		bgiframe: false,
		width: 800,
		height: 400,
		resizable: false,
		modal: false
	});
};
//--></script>
<style type="text/css">
.nocsstable td{
 border:none!important;
}
</style>
<?php echo $footer; ?>