<?php
session_start();

include "../phpconfig/config.php";
include "../phpconfig/valida_login.php";
include "../phpconfig/funcoes.php";
include '../phpconfig/slugfy.php';    //Geração de slugs
include '../phpconfig/resize.php';    //Classe de resige GD2
include '../phpconfig/genpass.php';   //Geração de senhas
include "../includes/topo.php"; 


$id     = $_GET['id'];
$uf     = $_GET['uf'];
$id_cidade     = $_GET['cidade'];


$sql = mysql_query("SELECT * FROM bannercidades WHERE id='$id'");

$lin = mysql_fetch_assoc($sql);

$cidade = retorna($id_cidade, 'l_cidades');


?>


        <ul class="breadcrumb">
          <li><a href="<?php echo sti('adm');  ?>">Home</a></li>
          <li>Editar Banner de <?php echo $cidade['cidade'];  ?>
          <li class="active"><?php echo $lin['titulo_pt']; ?> </li>
        </ul>

 <form class="form-horizontal" method="post" action="edita.php" id='bannerform'  enctype="multipart/form-data">
        <fieldset>

          <div class="control-group">
            <label class="control-label" for="input01">Banner</label>
            <div class="controls">
              <img width='300' src='<?php echo  sti('down').'banners/'.$lin['imagem'];  ?>' />

            </div>
          </div>

          <div class="control-group">
            <label class="control-label" for="titulop">Título</label>
            <div class="controls">
              <input type="hidden" name='id'  value='<?php echo $lin['id']; ?>'>
              <input type="text" class="input-xlarge" name='titulop' id='titulop' value='<?php echo $lin['titulo_pt']; ?>'>
              <input type="hidden"  name='id_cidade' value="<?php  echo $id_cidade;  ?>">
              <input type="hidden"  name='uf' value="<?php  echo $uf;  ?>">            
            </div>
          </div>

          <div class="control-group">
            <label class="control-label" for="tituloe">Descrição</label>
            <div class="controls">

              <input type="text" class="input-xlarge" name='descricao' id='tituloe' value='<?php echo $lin['descricao']; ?>'>
            </div>
          </div> 



          <div class="control-group">
            <label class="control-label" for="link">Link</label>
            <div class="controls">
              <input type="text" class="input-xlarge" name='link' id='link' value='<?php echo $lin['link']; ?>'>
            </div>
          </div>

          <div class="control-group">
            <label class="control-label" for="imagem">Imagem</label>
            <div class="controls">
               <input id="imagem" name='imagem' accept="image/*" type="file">
            </div>
          </div>

          <div class="form-actions">
            <button type="submit" class="btn btn-primary">Salvar</button>
           <!--  <a class="btn btn-warning pull-right" href="index.php">Voltar</a> -->
          </div>
        </fieldset>
      </form>

         <script src="http://js.nicedit.com/nicEdit-latest.js" type="text/javascript"></script>
    <script type="text/javascript">
      //<![CDATA[
      var area1;

      function toggleArea1() {
      
            area1 = new nicEditor({fullPanel : true}).panelInstance('myArea2',{hasPanel : true});

      }


      bkLib.onDomLoaded(function() { 
      
          new nicEditor({buttonList : ['fontFormat','bold','italic','underline','strikeThrough','subscript','superscript','html','image','link','ul']}).panelInstance('myArea2');
      
      toggleArea1(); });

      //]]>
      </script>



<?php include "../includes/rodape.php"; ?>
