<?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-contato"><?php echo $tab_contato; ?></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><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>
					
          </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_img_padrao" value="<?php echo $config_futura_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>
			</table>
		</div>
		<div id="tab-social">
			<table class="form">
			
				<tr>
					<td><?php echo $entry_facebook; ?></td>
					<td><input type="text" name="config_futura_facebook" value="<?php echo $config_futura_facebook; ?>" /></td>
				</tr>
				
				<tr>
					<td><?php echo $entry_image_facebook; ?></td>
					<td>
					<div class="image"><img src="<?php echo $img_facebook; ?>" alt="" id="thumb-img-facebook" />					
					<input type="hidden" name="config_futura_img_facebook" value="<?php echo $config_futura_img_facebook; ?>" id="imgfacebook" />
					<br />
					<a onclick="image_upload('imgfacebook', 'thumb-img-facebook');"><?php echo $text_browse; ?></a>&nbsp;&nbsp;|&nbsp;&nbsp;<a onclick="$('#thumb-img-facebook').attr('src', '<?php echo $no_image; ?>'); $('#imgfacebook').attr('value', '');"><?php echo $text_clear; ?></a>
					</div>
					</td>
				</tr>
				
				<tr>
					<td><?php echo $entry_instagram; ?></td>
					<td><input type="text" name="config_futura_instagram" value="<?php echo $config_futura_instagram; ?>" /></td>
				</tr>
				
				<tr>
					<td><?php echo $entry_image_instagram; ?></td>
					<td>
					<div class="image"><img src="<?php echo $img_instagram; ?>" alt="" id="thumb-img-instagram" />					
					<input type="hidden" name="config_futura_img_instagram" value="<?php echo $config_futura_img_instagram; ?>" id="imginstagram" />
					<br />
					<a onclick="image_upload('imginstagram', 'thumb-img-instagram');"><?php echo $text_browse; ?></a>&nbsp;&nbsp;|&nbsp;&nbsp;<a onclick="$('#thumb-img-instagram').attr('src', '<?php echo $no_image; ?>'); $('#imginstagram').attr('value', '');"><?php echo $text_clear; ?></a>
					</div>
					</td>
				</tr>
				
				<tr>
					<td><?php echo $entry_twitter; ?></td>
					<td><input type="text" name="config_futura_twitter" value="<?php echo $config_futura_twitter; ?>" /></td>
				</tr>
				
				<tr>
					<td><?php echo $entry_image_twitter; ?></td>
					<td>
					<div class="image"><img src="<?php echo $img_twitter; ?>" alt="" id="thumb-img-twitter" />					
					<input type="hidden" name="config_futura_img_twitter" value="<?php echo $config_futura_img_twitter; ?>" id="imgtwitter" />
					<br />
					<a onclick="image_upload('imgtwitter', 'thumb-img-twitter');"><?php echo $text_browse; ?></a>&nbsp;&nbsp;|&nbsp;&nbsp;<a onclick="$('#thumb-img-twitter').attr('src', '<?php echo $no_image; ?>'); $('#imgtwitter').attr('value', '');"><?php echo $text_clear; ?></a>
					</div>
					</td>
				</tr>													
											
			</table>	
		</div>
		<div id="tab-contato">
			<table class="form">
			
                <tr>
                  <td><?php echo $entry_contato_status; ?></td>
            	  <td>
                  <select name="config_futura_contato_status">
            		<?php if ($config_futura_contato_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_address; ?></td>
                  <td><textarea name="config_futura_address" cols="40" rows="5"><?php echo $config_futura_address; ?></textarea>
                    <?php if ($error_address) { ?>
                    <span class="error"><?php echo $error_address; ?></span>
                    <?php } ?></td>
                </tr>
                
                <tr>
                  <td><?php echo $entry_exibir; ?></td>
                  <td><select name="config_futura_exibe_email">
                      <?php $cont = 0; foreach ($text_opcao_exibir as $exbir) { 
        				  if($config_futura_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>
                    <?php if ($error_exibe_email) { ?>
                    <span class="error"><?php echo $error_exibe_email; ?></span>
                    <?php } ?></td>                    
    			</td>
                </tr>                  
                
                <tr>
                  <td><?php echo $entry_email; ?></td>
                  <td><textarea name="config_futura_email" cols="40" rows="5"><?php echo $config_futura_email; ?></textarea>
                    <?php if ($error_email) { ?>
                    <span class="error"><?php echo $error_email; ?></span>
                    <?php } ?></td>
                </tr>
                
                <tr>
                  <td><?php echo $entry_telephone_status; ?></td>
            	  <td>
                  <select name="config_futura_telefone_status">
            		<?php if ($config_futura_telefone_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_telephone_title; ?></td>
                  <td><input type="text" name="config_futura_telephone_title" value="<?php echo $config_futura_telephone_title; ?>" />
                    <?php if ($error_title_telephone) { ?>
                    <span class="error"><?php echo $error_title_telephone; ?></span>
                    <?php } ?></td>                     
                  </td>
                </tr>			
                <tr>
                  <td><?php echo $entry_telephone; ?></td>
                  <td><input type="text" id="telefone" name="config_futura_telephone" value="<?php echo $config_futura_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_telephone_extra" value="<?php echo $config_futura_telephone_extra; ?>" /></td>
                </tr>
                
                <tr>
                  <td><?php echo $entry_title_column; ?></td>
                  <td><input type="text" name="config_futura_titulo_column" value="<?php echo $config_futura_titulo_column; ?>" /></td>
                </tr>                        
    
                <tr>
                  <td><?php echo $entry_celular; ?></td>
                  <td>
    				<input type="text" name="config_futura_celular[]" value="<?php echo $config_futura_celular[0]; ?>" /><br/><br/>
    				<input type="text" name="config_futura_celular[]" value="<?php echo $config_futura_celular[1]; ?>" /><br/><br/>
    				<input type="text" name="config_futura_celular[]" value="<?php echo $config_futura_celular[2]; ?>" /><br/><br/>				
    				<input type="text" name="config_futura_celular[]" value="<?php echo $config_futura_celular[3]; ?>" />
    			  </td>
                </tr>	                	                              						
			
				<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>
                        <?php if ($error_mapa) { ?>
                        <span class="error"><?php echo $error_mapa; ?></span>
                        <?php } ?>							
					</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_celular[]']").mask("(99) 9999-9999?9");
	 });	
});
//--></script> 
<?php echo $footer; ?>