Viewing file: blog_textos_cad.php (9.18 KB) -rwxr-xr-x Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
require_once("../../config/config.php");
require_once(INCLUDES . "conexao_inc.php");
require_once(INCLUDES . "lib.php");
require_once(INCLUDES . "lib_datas.php");
require_once("blog_textos_class.php");
$blog_textos = new BlogTextos();
if ($_POST) {
$id = $_POST['id'];
$blog_textos->set("data",$_POST['data']);
$blog_textos->set("titulo",$_POST['titulo']);
$blog_textos->set("texto",$_POST['texto']);
$blog_textos->set("autor",$_SESSION['nome_usuario']);
$blog_textos->set("ativo",$_POST['ativo']);
if (is_numeric($id))
$resultado = $blog_textos->alterar($id);
else
$resultado = $blog_textos->inserir();
if ($resultado) {
$msg = "O texto foi salvo!";
$ir = "blog_textos_lista.php";
}
else
$msg = "Ocorreu um erro ao salvar os dados!";
}
if ($_GET['alterar'])
$blog_textos->buscar($_GET['alterar']);
if ($blog_textos->get("ativo"))
$ativo[$blog_textos->get("ativo")] = "checked=\"checked\"";
else
$ativo['S'] = "checked=\"checked\"";
?>
<!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">
<meta name="Description" content="IRPEN">
<meta name="resource-type" content="document">
<meta name="classification" content="Internet">
<meta name="robots" content="all">
<meta name="rating" content="General">
<meta name="Author" content="Netnigro Consultoria e Projetos em Informática">
<meta name="language" content="pt-br">
<link rel="shortcut icon" href="imagens/favicon.gif"type="image/gif">
<link rel="stylesheet" href="<?= HOST;?>css/irpen.css" type="text/css" />
<link rel="stylesheet" media="all" type="text/css" href="<?= HOST;?>css/menu_dropline.css" />
<!--[if IE]>
<link rel="stylesheet" media="all" type="text/css" href="css/menu_dropline_ie.css" />
<![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" media="all" type="text/css" href="css/menu_dropline_ie6.css" />
<![endif]-->
<title>IRPEN | Instituto de Registro Civil de Pessoas Naturais do Paraná - 2008</title>
<script language="javascript" type="text/javascript" src="../../lib/jquery-1.2.6.js"></script>
<script language="javascript" type="text/javascript" src="../../lib/calendar/ui.datepicker.js"></script>
<script language="javascript" type="text/javascript" src="../../lib/tinymce/tiny_mce.js"></script>
<script language="javascript" type="text/javascript" src="../../lib/tinymce/plugins/tinybrowser/tb_tinymce.js.php"></script>
<link rel="stylesheet" type="text/css" href="../../lib/calendar/ui.datepicker.css" />
<script language="javascript" type="text/javascript">
<!-- TinyMCE -->
tinyMCE.init({
mode : "textareas",
theme : "advanced",
language : 'pt',
plugins :'style,table,advhr,advimage,iespell,searchreplace,contextmenu,paste,noneditable,preview',
file_browser_callback : "tinyBrowser",
button_tile_map : true,
convert_urls : false,
fix_list_elements: true,
apply_source_formatting : true,
extended_valid_elements: "fieldset[class|id],legend[class|id],br[class],div[align|class|id]",
//Css
content_css: "../estilos.css",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_buttons1_add : "fontselect,fontsizeselect,separator,forecolor,backcolor",
theme_advanced_buttons2_add_before: "cut,copy,paste,pasteword,separator,search,replace,separator",
theme_advanced_buttons3_add_before : "tablecontrols,separator",
theme_advanced_buttons3_add : "iespell,advhr",
theme_advanced_disable : "styleselect,strikethrough"
});
$(document).ready(function(){
$("#data").attachDatepicker();
$("form").submit(function(){
var continuar = true;
$(".notnull").each(function(){
if ($(this).val() == "") {
$(this).addClass('erro');
continuar = false;
}
else {
$(this).removeClass('erro');
}
});
$(".notnull_select").each(function(){
if ($(this).val() == 0) {
$(this).addClass('erro');
continuar = false;
}
else {
$(this).removeClass('erro');
}
});
$(".erro").blur(function(){
if ($(this).val() != "")
$(this).removeClass('erro');
});
if (!continuar) {
alert('Preencha os campos marcados!');
return false;
}
if (confirm('Salvar registro?'))
return true;
else
return false;
});
<?php if ($msg!="") { ?>
alert("<?= $msg;?>");
<?php } ?>
<?php if ($ir!="") { ?>
location.href="<?= $ir;?>";
<?php } ?>
});
</script>
</head>
<body>
<div id="wrap">
<?php include "../topo_gestao.php";?>
<div id="header-photo">
</div>
<!-- content-wrap starts -->
<div id="content-wrap">
<table width="100%" border="0">
<tr><!--
<td align="left" valign="top" width="20%">
<?php
//Menu do site
//include(DIR_ADMIN . "menu_gestao.php");
?>
</td>
<td align="left" valign="top" bgcolor="#cccccc">
</td>-->
<td align="left" valign="top" bgcolor="#FFFFFF" width="1%">
</td>
<td align="left" valign="top">
<?php
/*
echo '<pre>';
print_r($_SESSION);
echo '</pre>';
*/
?>
<form id="form_texto" name="form_texto" method="post" action="">
<input type="hidden" name="id" id="id" value="<?= $blog_textos->get("id");?>" />
<h2>MANUTENÇÃO DO MÓDULO BLOG - TEXTOS</h2>
<table width="90%" border="0" align="center">
<tr>
<td><!--<label for="data_inicio">Data:</label>--> </td>
<td><!--<input name="data" type="text" class="notnull" id="data" value="<?= $blog_textos->get("data");?>" size="10" readonly="readonly" />--> <input type="hidden" name="data" id="data" value="<?= $blog_textos->get("data") != '' ? $blog_textos->get("data") : date('d/m/Y H:i:s')?>" /></td>
<td align="right"> </td>
<td> </td>
</tr>
<tr>
<td><label for="titulo2" class="info_campo">Titulo:</label></td>
<td><input name="titulo" type="text" class="notnull" id="titulo" value="<?= $blog_textos->get("titulo");?>" size="50" maxlength="250" /></td>
<td width="40">Ativo:</td>
<td width="150"><input name="ativo" type="radio" id="ativo_sim" value="S" class="radio" <?= $ativo['S'];?> />
<label for="ativo_sim" class="label_auto">Sim</label>
<input name="ativo" type="radio" id="ativo_nao" value="N" class="radio" <?= $ativo['N'];?> />
<label for="ativo_nao" class="label_auto">Não</label></td>
</tr>
<tr>
<td valign="top"><label for="descricao2">Texto:</label></td>
<td colspan="3"><textarea name="texto" rows="12" id="texto" style="width:100%"><?= $blog_textos->get("texto");?></textarea></td>
</tr>
<tr>
<td> </td>
<td colspan="3"> </td>
</tr>
<tr>
<td colspan="4" align="center"><input type="submit" value="Salvar" />
<input type="button" value="Voltar" onclick="javascript: location.href='blog_textos_lista.php';" /></td>
</tr>
</table>
<br />
<br class='clear' />
<br class='clear' />
<br class='clear' />
<br class='clear' />
<br class='clear' />
<center>
</center>
</form>
<br />
</td>
</tr>
</table>
</div>
<div align="center">
<strong><br />
Rua Mal. Deodoro, 51 - Galeria Ritz - 18º Andar | Fone: (41) 3232-9811 | CEP 80.020-905 - Curitiba - Paraná</strong>
<!-- content-wrap ends-->
</div>
<!-- footer starts -->
<div id="footer-wrap">
</div>
<div id="rodape">
</div>
</div>
</body>
</html>
|