Location: PHPKode > projects > PHP Report > phpreport-v1.0/FrVisualizarRel.php
<? 
/***********************************************************************************/
/*                                 PHP Report                                      */
/*                                                                                 */
/* Copyright (c) 2005 by Daniela Toniolo, Leonardo Galvão and Marli Carneiro       */
/*                                                                                 */
/* This is a free software. You can redistribute it and/or modify it under the     */
/* terms of the GNU General Public License.                                        */
/***********************************************************************************/

	session_cache_limiter('public');
	
	session_start();
	include("classes/Class_Layout.php");
	Layout::AcessoPagina("Visualizar");
	include("idiomas/Visualizar/".$_SESSION["Idioma"].".php");
	include("classes/Class_Conexao.php");
	include("classes/Class_GerarRel.php");
	include("classes/Class_SalvarRel.php");
	include("classes/Class_Relatorio.php");
	include("classes/Class_VisualizarRel.php");

	if (isset($_POST['Salvar'])) {
		SalvarRel::Salvar();
	} else {
		if(!isset($_GET['ver']) && !isset($_GET['id'])) header("Location: FrRelatorio.php");
	}

Layout::Cabecalho();
?>
<table width="50%"  border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td width="5">&nbsp;</td>
		<td width="55"><img src="imagens/titulo-relatorios.gif" width="55" height="55"></td>
		<td background="imagens/titulo-meio.gif" class="titulo">&nbsp;&nbsp;<?=_TITULO;?></td>
		<td width="5"><img src="imagens/titulo-dir.gif" width="5" height="55"></td>
	</tr>
	<tr>
		<td colspan="4">&nbsp;</td>
	</tr>
</table>
			<table width="50%" border="0" cellpadding="0" cellspacing="0">
				<tr>
				<? if(isset($_GET['ver'])) {?>
					<form name="form2" method="post" action="">
					<? GerarRel::PegarPassos(0); ?>
					</form>
					<form name="form1" method="post" action="">
					<input name="Salvar" type="hidden" value="1">
					<? GerarRel::PegarPassos(0); ?>
					<td align="center"><a href="#" onClick="javascript:EnviarForm('FrGerarRel11.php',document.form2);"><img src="imagens/editar.jpg" width="50" height="50" border="0" align="absmiddle"><br><?=_MODOEDICAO;?></a></td>
					<td align="center"><a href="#" onClick="javascript:EnviarForm('FrGerarRelSalvar.php',document.form1);"><img src="imagens/salvar.jpg" width="50" height="50" border="0" align="absmiddle"><br><?=_SALVAR;?></a></td>
					</form>
				<? } else { ?>
					<td align="center"><a href="#" onclick="Relatorio(<?=$_GET['id'];?>);"><img src="imagens/visualizar.jpg" width="50" height="50" border="0" align="absmiddle"><br><?=_VISUALIZAR;?></a></td>
					<?
					$edita = 0; 
					if($_SESSION["TipoUsu"]==2){
						$conecta = Conexao::Conecta();
						$query = "SELECT a.BASNOME FROM BASEDADOSACESSO a INNER JOIN RELATORIO r ON (r.RELBASE=a.BASNOME) WHERE a.USUCODIGO=".$_SESSION["CodUsu"]." AND r.RELCODIGO=".$_GET['id'];
						$result = $conecta->query($query); 
						if (DB::isError($result)) die ($result->getMessage()); 
						$rows = $result->numRows(); 
						if ($rows>0) $edita = 1; 
					} else if ($_SESSION["TipoUsu"]==1) $edita = 1; 
					
					if ($edita == 1){
					?>
					<td align="center"><a href="FrGerarRel1.php?id=<?=$_GET['id'];?>"><img src="imagens/editar.jpg" width="50" height="50" border="0" align="absmiddle"><br><?=_EDITAR;?></a></td>
					<td align="center"><a href="#" onclick="javascript:EnviarConf('FrRelatorio.php?del=<?=$_GET['id'];?>','Deseja excluir este relatório?');"><img src="imagens/deletar.jpg" width="50" height="50" border="0" align="absmiddle"><br><?=_EXCLUIR;?></a></td>
					<? } ?>
					<td align="center"><a href="FrExportarRel.php?id=<?=$_GET['id'];?>"><img src="imagens/exportar.jpg" width="50" height="50" border="0" align="absmiddle"><br><?=_EXPORTAR;?></a></td>
				<? } ?>
				</tr>
</table><br>
<br>
<?
if(isset($_GET['ver'])){ 
	VisualizarRel::Visualizar();
} else {
	VisualizarRel::DadosRel($_GET['id']);
	echo "<script>Relatorio(".$_GET['id'].");</script>";
}
Layout::Rodape();
if(isset($_GET['ver']) && !isset($_GET['pagina'])) print"<script>alert('"._AVISO."');</script>";
?>
Return current item: PHP Report