function Main() { header('Content-Type: text/html; charset=iso-8859-1'); $session = $_SESSION['casores'] ? $_SESSION['casores'] : $_SESSION['caso']; //if (((isset($_SESSION['casores'])) && ($_SESSION['casores'] > 0)) || ((isset($_SESSION['caso'])) && ($_SESSION['caso'] > 0))) if ($session) { $midia = $_POST['midia']; $clsmid = new Midia(); //$clsmid->setCodCaso($_SESSION['casores']); $clsmid->setCodCaso($session); $clsmid->setCodMidia(base64_decode($midia)); if ($clsmid->CarregaPorCodigoEspecifico()) { if ($clsmid->getTipoMidia() == Comuns::TIPO_MIDIA_VIDEO) { $vidplayer = new VideoPlayer($clsmid->getURL(), !is_null($clsmid->getLargura()) ? $clsmid->getLargura() : 320, !is_null($clsmid->getAltura()) ? $clsmid->getAltura() : 290, 'false', 'true'); if ($vidplayer) { $html = '<player>' . ($vidplayer->player() != "" ? $vidplayer->player() : $vidplayer->getLastError()) . '</player>'; $html .= '<descricao>' . (is_null($clsmid->getDescricao()) ? '' : $clsmid->getDescricao()) . '</descricao>'; $html .= '<complemento>' . (is_null($clsmid->getComplemento()) ? '' : $clsmid->getComplemento()) . '</complemento>'; $html .= '<btnfechar><a href="javascript:void(0);" onclick="jQuery(\'#view-midia\').html(\'\');" class="btnFecharMidia">@lng[Fechar]</a></btnfechar>'; } else { $html = "ERRO"; } } else { if ($clsmid->getTipoMidia() == Comuns::TIPO_MIDIA_AUDIO) { $audplayer = new AudioPlayer($clsmid->getURL(), 'false', 'true'); if ($audplayer) { $html = '<player>' . $audplayer->player() . '</player>'; $html .= '<descricao>' . (is_null($clsmid->getDescricao()) ? '' : $clsmid->getDescricao()) . '</descricao>'; $html .= '<complemento>' . (is_null($clsmid->getComplemento()) ? '' : $clsmid->getComplemento()) . '</complemento>'; $html .= '<btnfechar><a href="javascript:void(0);" onclick="fntFechaMidia();" class="btnFecharMidia">@lng[Fechar]</a></btnfechar>'; } else { $html = "ERRO"; } } else { if ($clsmid->getTipoMidia() == Comuns::TIPO_MIDIA_IMAGEM) { $html = '<player><img src="viewimagem.php?img=' . base64_encode($clsmid->getCodMidia()) . '&ex=f" alt="' . $clsmid->getDescricao() . '" title="' . $clsmid->getDescricao() . '" /></player>'; $html .= '<descricao>' . (is_null($clsmid->getDescricao()) ? '' : $clsmid->getDescricao()) . '</descricao>'; $html .= '<complemento>' . (is_null($clsmid->getComplemento()) ? '' : $clsmid->getComplemento()) . '</complemento>'; } } } } echo $html; } else { echo "ERRO. @lng[Seção não definida]"; } }
public function RetornaListaConfAnexos($strChaveAtual) { $sql = "select CodConteudo, TipoConteudo "; $sql .= "from mescasomontagemanexos "; $sql .= "where CodCaso = :pCodCaso "; $sql .= " and CodMontagem = 1 "; $sql .= " and CodChave = :pCodChave "; $cnn = Conexao2::getInstance(); $cmd = $cnn->prepare($sql); $cmd->bindParam(":pCodCaso", $this->codcaso, PDO::PARAM_INT); $cmd->bindParam(":pCodChave", $strChaveAtual, PDO::PARAM_STR); $cmd->execute(); if ($cmd->errorCode() == Comuns::QUERY_OK) { if ($cmd->rowCount() > 0) { $html = Comuns::TopoTabelaListagem("", "tabAnexos", array('Descrição', 'Tipo', 'Ações')); while ($linha = $cmd->fetch(PDO::FETCH_OBJ)) { if ($linha->TipoConteudo == 'C') { $c = new Conteudo(); $c->Carrega($this->codcaso, $linha->CodConteudo); $html .= '<tr>'; $html .= '<td>' . $c->getDescricao() . '</td>'; $html .= '<td>@lng[Hipertexto]</td>'; $html .= '<td>'; $html .= '<a href="javascript:void(0);" onclick="javascript:fntDeletaAnexo(\'' . base64_encode($strChaveAtual) . '\', \'C' . base64_encode($linha->CodConteudo) . '\')">' . Comuns::IMG_ACAO_DELETAR . '</a>'; $html .= '</td>'; $html .= '</tr>'; } else { $m = new Midia(); $m->setCodCaso($this->codcaso); $m->setCodMidia($linha->CodConteudo); $m->CarregaPorCodigoEspecifico(); $html .= '<tr>'; $html .= '<td>' . $m->getDescricao() . '</td>'; $html .= '<td>' . Comuns::DescreveTipoMidia($m->getTipoMidia()) . '</td>'; $html .= '<td>'; $html .= '<a href="javascript:void(0);" onclick="javascript:fntDeletaAnexo(\'' . base64_encode($strChaveAtual) . '\', \'M' . base64_encode($linha->CodConteudo) . '\')">' . Comuns::IMG_ACAO_DELETAR . '</a>'; $html .= '</td>'; $html .= '</tr>'; } } return $html; } else { return '<strong>@lng[Nenhum item cadastrado]</strong>'; } } else { $msg = $cmd->errorInfo(); $this->msg_erro = $msg[2]; return false; } }