<?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'];


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

$lin = mysql_fetch_assoc($sql);

?>


        <ul class="breadcrumb">
          <li><a href="<?php echo sti('adm');  ?>">Home</a></li>
          <li>Editar Banner 
          <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']; ?>'>
            </div>
          </div>
        <!--   <div class="control-group">
            <label class="control-label" for="tituloi">Título Inglês</label>
            <div class="controls">

              <input type="text" class="input-xlarge" name='tituloi' id='tituloi' value='<?php echo $lin['titulo_en']; ?>'>
            </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="textarea">Texto</label>
            <div class="controls">
              <textarea class="input-xxlarge" id="myArea2" name="texto" rows="30"><?php echo stripslashes($lin['texto']); ?></textarea>
            </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"; ?>
