Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Boa tarda galera..
tenho o seguinte código que captura informações do banco e de diretórios e forma uma string que é passada para uma outra página afim de gerar uma imagem...
<?php include("../cab_rod/head.php");
header('Content-Type: text/html; charset=iso-8859-1');
session_start("usuario");
?>
<br>
<br>
<html>
<head>
<link rel="stylesheet" type="text/css" href="../Css/css_arq_morto.css">
<title>Documento Pessoal</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<table height="79" border="3" cellpadding="1" cellspacing="1">
<tr>
<td bgcolor="#4569FA"><font color="#FFFFFF" size="2"><strong><?php echo $_SESSION["unidadenome"];?></strong></font></td>
</tr>
<tr>
<td bgcolor="#4569FA"><font color="#FFFFFF" size="2"><strong><?php echo $_SESSION["usuario"];?></strong></font></td>
</tr>
</table>
<?php include("../conexao/conexao.class.php");
**$myunidade=$_SESSION["unidade"];
$mat=$_SESSION["mat"];**
include("../conexao/unidades.php");
$minhaConexao = new Conexao();
$minhaConexao->open($unidadc);
foreach($_POST as $k => $dado ) {
$cod=$dado;
}
$consultar = "select * from sam002 where \"desc\"='$cod'";
$resultado = pg_query($consultar);
$resultrow=pg_fetch_row($resultado);
$dir='../../sistemaarquivomorto/Sam/'.$myunidade.'/vol1/'.$mat.'/'.$resultrow[0];
//Função para pegar o conteúdo do diretório das matrículas
function get_files_dir($dir, $tipos = null){
if(file_exists($dir)){
$dh = opendir($dir);
while (false !== ($filename = readdir($dh))) {
if($filename != '.' && $filename != '..'){
if(is_array($tipos)){
$extensao = get_extensao_file($filename);
if(in_array($extensao, $tipos)){
$files[] = $filename;
}
}$files[] = $filename;
}
}
}sort($files);
}
return $files;
}return false;
}
}
echo "<table width='38%' border='3' cellpadding='2' cellspacing='2' align='center'>
<tr>
<td bgcolor='#4569FA'>
<div align='center'><strong><font color='#FFFFFF' size='2'>".$cod." : Tipos de Documento</font></strong></div></td>
</tr>
</table>";
echo"<br>";
$var=get_files_dir($dir);
foreach($var as $tipdoc){
$dirdoc='../../sistemaarquivomorto/Sam/'.$myunidade.'/vol1/'.$mat.'/'.$resultrow[0].'/'.$tipdoc;
$var2=get_files_dir($dirdoc);
echo"<form action='gera_foto.php' name='gerando_imagem' runat='server' method='post'> <table width='134' height='154' border='3' cellpadding='2' align='center'>
<tr>
<td align='center' bgcolor='#4569FF' cellspacing='2' width='134' ><strong><font color='#FFFFFF'>".$tipdoc."<strong></font></td>";
foreach($var2 as $dirdoc2){
$dirdoc1='../../sistemaarquivomorto/Sam/'.$myunidade.'/vol1/'.$mat.'/'.$resultrow[0].'/'.$tipdoc.'/'.$dirdoc2;
$var3=get_files_dir($dirdoc1);
if(is_array($var3)){$var3=$var3;} else {$var3=scandir($dirdoc1);}
foreach($var3 as $dirdoc3){
$dirdoc5='../../sistemaarquivomorto/Sam/'.$myunidade.'/vol1/'.$mat.'/'.$resultrow[0].'/'.$tipdoc.'/'.$dirdoc2.'/'.$dirdoc3;
$arquivo =$dirdoc5;
$extensao = pathinfo($arquivo, PATHINFO_EXTENSION);
if($extensao=='jpg' || $extensao=='jpeg'){
$dirdoc7='../../sistemaarquivomorto/Sam/'.$myunidade.'/vol1/'.$mat.'/'.$resultrow[0].'/'.$tipdoc.'/'.$dirdoc2.'/'.$dirdoc3;
if($dirdoc2=='f'){
$frente='f';
$dirdocfrente='../../sistemaarquivomorto/Sam/'.$myunidade.'/vol1/'.$mat.'/'.$resultrow[0].'/'.$tipdoc.'/'.$frente.'/'.$dirdoc3;
if(file_exists($dirdocfrente)){
echo"<td width='134' height='154' align='center'>
<img src=".$dirdocfrente." alt='Frente' width='134' height='154' border='0'><table width='134' border='2' cellspacing='3' cellpadding='3'>
<tr>
<td align='center' bgcolor='#4569FF'><strong><font color='#FFFFFF'>Frente</strong></font></td>
<div align='center' width='134'><input type='submit' name='Frente' id='frente' value='Exibir' target='_new'>
<input type='hidden' name=".$dirdocfrente." value=".$dirdocfrente." width='134'></div>
</tr>
</table>
</td>";
} else {}
} else {}
echo"<br>";
if($dirdoc2=='v'){
$verso='v';
$dirdocverso='../../sistemaarquivomorto/Sam/'.$myunidade.'/vol1/'.$mat.'/'.$resultrow[0].'/'.$tipdoc.'/'.$verso.'/'.$dirdoc3;
if(file_exists($dirdocverso)){
echo"<td width='134' height='154' align='center'>
<img src=".$dirdocverso." alt='Frente' width='134' height='154' border='0'><table width='134' border='2' cellspacing='3' cellpadding='3'>
<tr>
<td align='center' bgcolor='#4569FF'><strong><font color='#FFFFFF'>Verso</strong></font></td>
<input name='verso' id='verso' type='submit' value='Exibir' width='134%'>
<input type='hidden' name=".$dirdocverso." value=".$dirdocverso." width='134'>
</tr>
</table>
</td></form>";
} else {}
} else {}
?>
<?php
}
}
}
}
?></tr>
</table> <br>
</body>
</html>
<br>
<br>
<?php include("../cab_rod/food.php");?>
quando eu clico no botão exibir, ele gera uma outra página com uma imagem.. agora começa o meu problema.. estou tentando não perder as informações nesta pagina, mas quando eu clico no botão "voltar" na página da imagem.. ele retorna.. mas minha página anterior volta vazia.. tentei prender isto com o session.. mas não estou cnseguindo.. segue o código da página que gera a imagem ..
<?php include("../cab_rod/head.php");
header('Content-Type: text/html; charset=iso-8859-1');
session_start("usuario");
?>
<html>
<head>
<style>
.rt90 {
-webkit-transform: perspective(100px) rotate(90deg);
-moz-transform: perspective(100px) rotate(90deg);
transform: perspective(100px) rotate(90deg);
}
.rt180 {
-webkit-transform: perspective(100px) rotate(180deg);
-moz-transform: perspective(100px) rotate(180deg);
transform: perspective(100px) rotate(180deg);
}
.rt270 {
-webkit-transform: perspective(100px) rotate(270deg);
-moz-transform: perspective(100px) rotate(270deg);
transform: perspective(100px) rotate(270deg);
}
.rt0 {
-webkit-transform: perspective(100px) rotate(0deg);
-moz-transform: perspective(100px) rotate(0deg);
transform: perspective(100px) rotate(0deg);
}
</style>
<title>Documento sem título</title>
<link rel="stylesheet" type="text/css" href="../Css/css_arq_morto.css">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
foreach($_POST as $foto => $img)
{
echo"<br>";
echo"<br>";
$img2=$img;
}
?>
<table border="3" cellpadding="2" cellspacing="2" align="center">
<tr>
<td bgcolor="#0066FF"><strong><font color="#FFFFFF">
<input type="submit" name="bnt_gira" id="bnt_gira" value="Girar Imagem">
</font></strong></td>
<td bgcolor="#0066FF"><strong><font color="#FFFFFF">
<form method="post" action="docpessoal_tipos.php">
**<?php $myunidade=$_SESSION["unidade"];
$mat=$_SESSION["mat"];
$cod=$_SESSION["cod"]; ?>
<input type="submit" name="btn_voltar" id="btn_voltar" value="Voltar">
<input type="hidden" name="matret" value="<?php echo $myunidade?>">
<input type="hidden" name="unidaderet" value="<?php echo $mat?>">
<input type="hidden" name="codret" value="<?php echo $cod?>">**
</form>
</font></strong></td>
</tr>
</table>
<?php
echo"<br>";
echo"<br>";
?>
<div align="center"><img name="imgr" id="imgr" src="<?php echo $img2 ?>"></div>
<script runat="server" language="JavaScript" type="text/javascript">
(function(){
var $img = document.getElementById("imgr"),
$btn = document.getElementById("bnt_gira"),
classes = ["rt90","rt180","rt270","rt0"],
i = 0,
max = classes.length;
$btn.addEventListener("click", function(){
$img.classList.remove("rt90","rt180","rt270","rt0");
$img.classList.add(classes);
i = i < max - 1 ? i + 1 : 0;
});
}());
*</script>*
*</body>*
*</html>*
*<?php include("../cab_rod/food.php");?>*
alguém pode ajudar?
Carregando comentários...