<?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 } ?>
  <?php if ($success) { ?>
  <div class="success"><?php echo $success; ?></div>
  <?php } ?>
  <div class="box">
    <div class="heading">
      <h1><img src="view/image/setting.png" alt="" /> <?php echo $heading_title; ?></h1>
      <div class="buttons"><a onclick="$('#form').submit();" class="button"><?php echo $button_save; ?></a><a href="<?php echo $cancel; ?>" class="button"><?php echo $button_cancel; ?></a></div>
    </div>
    <div class="content">
      <div id="tabs" class="htabs">
		<a href="#tab-seo"><?php echo $tab_seo; ?></a>
		<a href="#tab-setting"><?php echo $tab_setting; ?></a>		
		<a href="#tab-image"><?php echo $tab_image; ?></a>
		<a href="#tab-social"><?php echo $tab_social; ?></a>
		<a href="#tab-mapa"><?php echo $tab_mapa; ?></a>		
	  </div>
      <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="form">
    	<div id="tab-seo">
          <table class="form">
          
            <tr>
              <td><span class="required">*</span> <?php echo $entry_title; ?></td>
              <td><input type="text" name="config_title" value="<?php echo $config_title; ?>" />
                <?php if ($error_title) { ?>
                <span class="error"><?php echo $error_title; ?></span>
                <?php } ?></td>
            </tr>
            <tr>
              <td><?php echo $entry_meta_description; ?></td>
              <td><textarea name="config_meta_description" cols="40" rows="5"><?php echo $config_meta_description; ?></textarea></td>
            </tr>
          </table>
        </div>
        <div id="tab-setting">
          <table class="form">
          
			<tr>
              <td><?php echo $entry_status; ?></td>
			  <td><select name="config_futura_seo_status">
                <?php if ($config_futura_seo_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><span class="required">*</span> <?php echo $entry_name; ?></td>
              <td><input type="text" name="config_name" value="<?php echo $config_name; ?>" size="40" />
                <?php if ($error_name) { ?>
                <span class="error"><?php echo $error_name; ?></span>
                <?php } ?></td>
            </tr>
            <tr>
              <td><span class="required">*</span> <?php echo $entry_owner; ?></td>
              <td><input type="text" name="config_owner" value="<?php echo $config_owner; ?>" size="40" />
                <?php if ($error_owner) { ?>
                <span class="error"><?php echo $error_owner; ?></span>
                <?php } ?></td>
            </tr>
            
            <tr>
              <td><span class="required">*</span> <?php echo $entry_address; ?></td>
              <td><textarea name="config_address" cols="40" rows="5"><?php echo $config_address; ?></textarea>
                <?php if ($error_address) { ?>
                <span class="error"><?php echo $error_address; ?></span>
                <?php } ?></td>
            </tr>
            
            <tr>
              <td><?php echo $entry_email; ?></td>
              <td><textarea name="config_futura_seo_email" cols="40" rows="5"><?php echo $config_futura_seo_email; ?></textarea>
                <?php if ($error_email) { ?>
                <span class="error"><?php echo $error_email; ?></span>
                <?php } ?></td>
            </tr>
            <tr>
              <td><span class="required">*</span> <?php echo $entry_exibir; ?></td>
              <td><select name="config_futura_seo_exibe_email">
                  <?php $cont = 1; foreach ($text_opcao_exibir as $exbir) { 
				  if($config_futura_seo_exibe_email==$cont){
				  ?>
				  <option value="<?php echo $cont++; ?>" selected="selected"><?php echo $exbir; ?></option>
				  <?php				  
				  }else{
				  ?>
				  <option value="<?php echo $cont++; ?>"><?php echo $exbir; ?></option>
				  <?php
				  }
				  } ?>
                </select>
			</td>
            </tr>
            <tr>
              <td><?php echo $entry_telephone_title; ?></td>
              <td><input type="text" name="config_futura_seo_telephone_title" value="<?php echo $config_futura_seo_telephone_title; ?>" />
            </tr>			
            <tr>
              <td><span class="required">*</span> <?php echo $entry_telephone; ?></td>
              <td><input type="text" id="telefone" name="config_telephone" value="<?php echo $config_telephone; ?>" />
                <?php if ($error_telephone) { ?>
                <span class="error"><?php echo $error_telephone; ?></span>
                <?php } ?></td>
            </tr>
            <tr>
              <td><?php echo $entry_fax; ?></td>
              <td><input type="text" id="fax" name="config_fax" value="<?php echo $config_fax; ?>" /></td>
            </tr>
			           
            <tr>
              <td><?php echo $entry_telephone_extra; ?></td>
              <td><input type="text" id="telefoneextra" name="config_futura_seo_telephone_extra" value="<?php echo $config_futura_seo_telephone_extra; ?>" /></td>
            </tr>
            
            <tr>
              <td><?php echo $entry_title_column; ?></td>
              <td><input type="text" name="config_futura_seo_titulo_column" value="<?php echo $config_futura_seo_titulo_column; ?>" /></td>
            </tr>                        

            <tr>
              <td><?php echo $entry_celular; ?></td>
              <td>
				<input type="text" name="config_futura_seo_celular[]" value="<?php echo $config_futura_seo_celular[0]; ?>" /><br/><br/>
				<input type="text" name="config_futura_seo_celular[]" value="<?php echo $config_futura_seo_celular[1]; ?>" /><br/><br/>
				<input type="text" name="config_futura_seo_celular[]" value="<?php echo $config_futura_seo_celular[2]; ?>" /><br/><br/>				
				<input type="text" name="config_futura_seo_celular[]" value="<?php echo $config_futura_seo_celular[3]; ?>" />
			  </td>
            </tr>						
          </table>
        </div>
		<div id="tab-image">
			<table class="form">
				<tr>
					<td><?php echo $entry_image; ?></td>
					<td>
					<div class="image"><img src="<?php echo $img_padrao; ?>" alt="" id="thumb-img-padrao" />					
					<input type="hidden" name="config_futura_seo_img_padrao" value="<?php echo $config_futura_seo_img_padrao; ?>" id="imgpadrao" />
					<br />
					<a onclick="image_upload('imgpadrao', 'thumb-img-padrao');"><?php echo $text_browse; ?></a>&nbsp;&nbsp;|&nbsp;&nbsp;<a onclick="$('#thumb-img-padrao').attr('src', '<?php echo $no_image; ?>'); $('#imgpadrao').attr('value', '');"><?php echo $text_clear; ?></a>
					</div>
					</td>
				</tr>
				
				<tr>
					<td><?php echo $entry_image_contato; ?></td>
					<td>
					<div class="image"><img src="<?php echo $img_contato; ?>" alt="" id="thumb-img-contato" />					
					<input type="hidden" name="config_futura_seo_img_contato" value="<?php echo $config_futura_seo_img_contato; ?>" id="imgcontato" />
					<br />
					<a onclick="image_upload('imgcontato', 'thumb-img-contato');"><?php echo $text_browse; ?></a>&nbsp;&nbsp;|&nbsp;&nbsp;<a onclick="$('#thumb-img-contato').attr('src', '<?php echo $no_image; ?>'); $('#imgcontato').attr('value', '');"><?php echo $text_clear; ?></a>
					</div>
					</td>
				</tr>
				
				<tr>
					<td><?php echo $entry_image_celular; ?></td>
					<td>
					<div class="image"><img src="<?php echo $img_celular; ?>" alt="" id="thumb-img-celular" />					
					<input type="hidden" name="config_futura_seo_img_celular" value="<?php echo $config_futura_seo_img_celular; ?>" id="imgcelular" />
					<br />
					<a onclick="image_upload('imgcelular', 'thumb-img-celular');"><?php echo $text_browse; ?></a>&nbsp;&nbsp;|&nbsp;&nbsp;<a onclick="$('#thumb-img-celular').attr('src', '<?php echo $no_image; ?>'); $('#imgcelular').attr('value', '');"><?php echo $text_clear; ?></a>
					</div>
					</td>
				</tr>
				
			</table>
		</div>
		<div id="tab-social">
			<table class="form">
				<tr>
					<td><?php echo $entry_facebook; ?></td>
					<td><input type="text" name="config_futura_seo_facebook" value="<?php echo $config_futura_seo_facebook; ?>" /></td>
				</tr>
				
				<tr>
					<td><?php echo $entry_image_social; ?></td>
					<td>
					<div class="image"><img src="<?php echo $img_social; ?>" alt="" id="thumb-img-social" />					
					<input type="hidden" name="config_futura_seo_img_social" value="<?php echo $config_futura_seo_img_social; ?>" id="imgsocial" />
					<br />
					<a onclick="image_upload('imgsocial', 'thumb-img-social');"><?php echo $text_browse; ?></a>&nbsp;&nbsp;|&nbsp;&nbsp;<a onclick="$('#thumb-img-social').attr('src', '<?php echo $no_image; ?>'); $('#imgsocial').attr('value', '');"><?php echo $text_clear; ?></a>
					</div>
					</td>
				</tr>					
											
			</table>	
		</div>

		<div id="tab-mapa">
			<table class="form">
				<tr>
    	            <td><?php echo $entry_status_mapa; ?></td>
        	        <td>
            	        <select name="config_futura_mapa_status">
        				<?php if ($config_futura_mapa_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><?php echo $entry_mapa; ?></td>
					<td><textarea name="config_futura_mapa" cols="40" rows="5"><?php echo $config_futura_mapa; ?></textarea></td>
				</tr>
				
				<tr>
					<td><?php echo $entry_width_mapa; ?></td>
					<td><input type="text" name="config_futura_width_mapa" value="<?php echo $config_futura_width_mapa; ?>" class="numeric" />
                        <?php if ($error_width_mapa) { ?>
                        <span class="error"><?php echo $error_width_mapa; ?></span>
                        <?php } ?>					
					</td>
				</tr>
				
				<tr>
					<td><?php echo $entry_height_mapa; ?></td>
					<td><input type="text" name="config_futura_height_mapa" value="<?php echo $config_futura_height_mapa; ?>"  class="numeric" />
                        <?php if ($error_height_mapa) { ?>
                        <span class="error"><?php echo $error_height_mapa; ?></span>
                        <?php } ?>					
					</td>
				</tr>										
											
			</table>	
		</div>			
		
      </form>
    </div>
  </div>
</div>
<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).val()),
					dataType: 'text',
					success: function(data) {
						$('#' + thumb).replaceWith('<img src="' + data + '" alt="" id="' + thumb + '" />');
					}
				});
			}
		},	
		bgiframe: false,
		width: 800,
		height: 400,
		resizable: false,
		modal: false
	});
};
//--></script> 
<script type="text/javascript"><!--
$('#template').load('index.php?route=setting/setting/template&token=<?php echo $token; ?>&template=' + encodeURIComponent($('select[name=\'config_template\']').attr('value')));
//-->
</script> 



<script type="text/javascript">
$('#tabs a').tabs();
$(document).ready(function(){
	
	jQuery(function($){
		$("#telefone").mask("(99) 9999-9999");
		$("#telefoneextra").mask("(99) 9999-9999");			
		$("#fax").mask("(99) 9999-9999");
		$("input[name='config_futura_seo_celular[]']").mask("(99) 9999-9999?9");
	 });		
});
//-->
</script> 
<?php echo $footer; ?>