<?php
error_reporting(E_WARNING);
require_once("funcoes.php");
require_once("valida.php");

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Adicionar Popup / Painel de Administra&ccedil;&atilde;o</title>
<?php require_once("topo.php"); ?>  
<link rel="stylesheet" href="css/query-ui.css" />
<script src="../js/jquery-1.10.2.min.js"></script>
<script src="js/jquery-ui.js"></script>
<div id="conteudo">

	<div id="top_conteudo"> 
    <form action="gerenciar_popup.php?pag=1" method="post" enctype="multipart/form-data">
    	<p style=""> Novo Popup</p>
        <a href="#"><div id="criar_produto"><input type="submit" name="salvar_popup" value="Salvar" style="color:#fff; cursor:pointer; font-size:12px; font-weight:bold; background-color:transparent; border:0" /></div></a>
        </div> 
                
        <div id="cadastros">
        
       <div id="tabs"> 
            <ul>
        		<li><a href="#geral"><span>Geral</span></a></li>
        	</ul>
            <div id="geral">
            <table>
                
                <tr>
                    <td>Tipo: </td>
                    <td><select required="" name="tipo" id="tipoPopup">
                            <option value="1">Cadastro de Newsletter</option>
                            <option value="2">Imagem / Informativo</option>
                        </select>
                    </td>
                 </tr>

                <tr class="titulo">
                    <td>Titulo: </td>
                    <td><input type="text" name="titulo" required="" /></td>
                </tr>

                <tr class="descricao">
                    <td>Descrição: </td>
                    <td><input type="text" name="descricao" required="" /></td>
                </tr>

                <tr class="descricao">
                    <td>Texto Botão: </td>
                    <td><input type="text" name="botao" required="" /></td>
                </tr>

                <tr class="descricao">
                    <td>Mensagem agradecimento: </td>
                    <td><input type="text" name="msg_agradecimento" required="" /></td>
                </tr>
                
                <tr>
                    <td>Imagem: </td>
                    <td><input type="file" name="foto" required="" /></td>
                </tr>

                <tr>
                    <td>Exibições: </td>
                    <td><input type="text" name="exibicoes" required="" value="1" /></td>
                </tr>

                
                
                </table>          
            
            </div> 
            
           
        </div>
        
        <script>
        $( "#tabs" ).tabs();
        </script>
        
        </table>
  
    </div> 
    </div> 
    </div>
    </div>

    </form>

    <script>
        $(document).ready(function(){
            $('#tipoPopup').change(function() {
            var tipo = $("#tipoPopup").val();
            if(tipo == 2){
                $(".descricao").css("display", "none");
                $("input[name=descricao]").val("");
                $(".input").removeAttr("required");
            } else {
                $(".descricao").css("display", "table-row");
                $(".input").attr("required", "required");
            }
            })
            })

   </script>

<?php require_once("footer.php"); ?>


</body>
</html>