/
vwatualizadetalhe.php
67 lines (61 loc) · 1.78 KB
/
vwatualizadetalhe.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php
session_start();
include_once 'cls/exame.class.php';
include_once 'inc/comuns.inc.php';
function Main()
{
if ((isset($_SESSION['caso'])) && ($_SESSION['caso'] != 0))
{
if ((isset($_SESSION['exame'])) && ($_SESSION['exame'] > 0))
{
if ((isset($_SESSION['itemexame'])) && ($_SESSION['itemexame'] > 0))
{
if(isset($_GET["type"]) && ($_GET["type"] == "doc"))
$tpl = file_get_contents("tpl/caso-atualiza-item-doc-exame.html");
else
$tpl = file_get_contents("tpl/caso-atualiza-item-exame.html");
$e = new Exame();
$item = $e->CarregaImagemExame($_SESSION['caso'], $_SESSION['exame'], $_SESSION['itemexame']);
if ($item != false)
{
$urlimg = '<img class="thumbatual" src="viewimagem.php?img=' . base64_encode($item->Valor) . '">';
$tpl = str_replace('<!--caminhoimagem-->', $urlimg, $tpl);
$tpl = str_replace('<!--txtDesArquivo-->', $item->Descricao, $tpl);
$tpl = str_replace('<!--txtComplementoImagem-->', $item->Complemento, $tpl);
$tpl = str_replace('<!--tipo-->', $item->TipoItem, $tpl);
if ($_GET['act'] == "redir")
{
$tpl = str_replace('<!--retornoacao-->', "fntExibeRetorno('OK', '" . base64_encode($_SESSION['exame']) . "');", $tpl);
}
else if ($_GET['act'] == "fica")
{
$tpl = str_replace('<!--retornoacao-->', "fntExibeRetorno('" . base64_decode($_GET['act']) . "', '" . base64_decode($_GET['ret']) . "');", $tpl);
}
else
{
$tpl = str_replace('<!--retornoacao-->', "", $tpl);
}
}
else
{
$tpl = $e->getErro();
}
}
else
{
$tpl = "@lng[Item não encontrado]";
}
}
else
{
$tpl = "@lng[Exame não encontrado]";
}
}
else
{
$tpl = "@lng[Caso de estudo não encontrado]";
}
echo( Comuns::Idioma($tpl) );
}
Main();
?>