|
Directory : /home/zjabogados/public_html/otrosscripts/ |
<?php require_once('../../../Connections/zyz.php'); ?>
<?php
session_start();
$motorBD = $_SESSION['motorBD'];
$idusuario = $_SESSION['idusuario'];
require_once("../Libs/functionsextra.php");
$sql = "SELECT p.`id_permiso`
FROM tb_permiso p
INNER JOIN tb_rel_grupo_rol rgr ON rgr.tb_rol = p.tb_rol
INNER JOIN tb_rel_usuario_grupo rug ON rug.tb_grupo = rgr.tb_grupo
WHERE rug.tb_usuario = $idusuario and p.id_permiso = 158";
$rs_permiso = mysql_query($sql, $zyz) or die(mysql_error());
$row_rs_permiso = mysql_fetch_assoc($rs_permiso);
$totalRows_rs_permiso = mysql_num_rows($rs_permiso);
mysql_free_result($rs_permiso);
if ($totalRows_rs_permiso >= 1) {
?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
mysql_select_db($database_zyz, $zyz);
$query_rs_documentos = "SELECT * FROM tb_documento_organizacional d INNER JOIN tb_version_del_documento v ON v.tb_documento_organizacional = d.id_documento_organizacional AND v.id_version_del_documento = (SELECT v2.id_version_del_documento FROM tb_version_del_documento v2 WHERE v2.tb_documento_organizacional = d.id_documento_organizacional ORDER BY v2.fecha_de_la_version DESC Limit 1)";
$rs_documentos = mysql_query($query_rs_documentos, $zyz) or die(mysql_error());
$row_rs_documentos = mysql_fetch_assoc($rs_documentos);
$totalRows_rs_documentos = mysql_num_rows($rs_documentos);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html><!-- InstanceBegin template="/Templates/Contenido.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<title>Documento sin título</title>
<!-- InstanceEndEditable --><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- InstanceBeginEditable name="head" -->
<link href="../css/reportes.css" rel="stylesheet" type="text/css">
<link href="../css/extras.css" rel="stylesheet" type="text/css">
<!-- InstanceEndEditable -->
<link href="../css/contenido.css" rel="stylesheet" type="text/css">
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><table border="0" align="center" cellpadding="0" cellspacing="10">
<tr>
<td><!-- InstanceBeginEditable name="Contenido" -->
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="5"><img src="../img/vertice_01.gif" width="5" height="17" /></td>
<td background="../img/top_.gif"><table cellspacing="0" cellpadding="0">
<tr>
<td><img src="../img/solapa_1.gif" width="8" height="17" /></td>
<td background="../img/solapa_2.gif" class="textoBlanco">DOCUMENTOS ORGANIZACIONALES</td>
<td><img src="../img/solapa_3.gif" width="8" height="17" /></td>
</tr>
</table></td>
<td width="5"><img src="../img/vertice_02.gif" width="5" height="7" /></td>
</tr>
<tr>
<td width="5" background="../img/izq.gif"> </td>
<td><table width="100%" border="0" cellpadding="2" cellspacing="2" id="reporte">
<tr>
<td><table width="100%" cellpadding="3" cellspacing="3">
<tr>
<td><img src="../img/logo.gif" width="211" height="43" /></td>
<td align="right"> </td>
</tr>
</table></td>
</tr>
<tr>
<td></td>
</tr>
</table>
<table border="0" cellpadding="2" cellspacing="2">
<tr>
<td> </td>
</tr>
<?php do { ?>
<tr>
<td><table border="0" cellpadding="2" cellspacing="2" class="tabla_doc">
<tr>
<td rowspan="7" align="center"><img src="../img/ico_down_documento.png" width="103" height="133" class="img_down" ><br>
ULTIMA<br>
VERSION</td>
<th colspan="3"><?php echo $row_rs_documentos['titulo']; ?></th>
</tr>
<tr>
<td>FECHA DE CREACIÓN:</td>
<td><?php echo FormatoFecha($row_rs_documentos['fecha_de_creacion']); ?></td>
<td rowspan="6"><table border="0" cellpadding="2" cellspacing="2" class="tabla_ver" onclick="window.open('../files/bd/<?php echo $row_rs_documentos['file_archivo']; ?>','_blank','scrollbars=yes,resizable=yes')">
<tr>
<td>ULTIMA VERSION</td>
<td><?php echo $row_rs_documentos['version']; ?></td>
<td rowspan="3" bgcolor="#999999"><img src="../img/ico_down_documento.png" width="48" height="61" class="img_down" ></td>
</tr>
<tr>
<td>COMENTARIOS</td>
<td><?php echo $row_rs_documentos['comentarios_de_la_nueva_version']; ?></td>
</tr>
<tr>
<td>FECHA DE LA VERSION</td>
<td><?php echo FormatoFecha($row_rs_documentos['fecha_de_la_version']); ?></td>
</tr>
</table>
<table border="0" cellpadding="2" cellspacing="2" class="tabla_ver" onclick="window.open('ver_documentos_organizacionales_versiones.php?id=<?php echo $row_rs_documentos['id_documento_organizacional']; ?>','_self','scrollbars=yes,resizable=yes')">
<tr>
<td>VERSIONES ANTERIORES</td>
<td align="right"><img src="../img/ico_versionaes_ant_documento.png" width="48" height="51"></td>
</tr>
</table></td>
</tr>
<tr>
<td>DESCRIPCION:</td>
<td><?php echo $row_rs_documentos['descripcion']; ?></td>
</tr>
<tr>
<td>PALABRAS CLAVES:</td>
<td><?php echo $row_rs_documentos['palabaras_claves']; ?></td>
</tr>
<tr>
<td>AUTOR:</td>
<td><?php echo $row_rs_documentos['autor']; ?></td>
</tr>
<tr>
<td>OBSERVACIONES: </td>
<td><?php echo $row_rs_documentos['observaciones_generales']; ?></td>
</tr>
<tr>
<td>BAJA</td>
<td><?php echo $row_rs_documentos['fecha_de_baja']; ?> (<?php echo $row_rs_documentos['motivo_de_baja']; ?>)</td>
</tr>
</table></td>
</tr>
<?php } while ($row_rs_documentos = mysql_fetch_assoc($rs_documentos)); ?>
</table>
<p></p>
<p></p></td>
<td width="5" background="../img/der.gif"> </td>
</tr>
<tr>
<td width="5"><img src="../img/vertice_03.gif" width="5" height="17" /></td>
<td background="../img/down.gif"> </td>
<td width="5"><img src="../img/vertice_04.gif" width="5" height="17" /></td>
</tr>
</table>
<p>
<!-- InstanceEndEditable --></td>
</tr>
</table></td>
</tr>
</table>
</body>
<!-- InstanceEnd --></html>
<?php
mysql_free_result($rs_documentos);
?>
<?php
}
else {
echo '<html><head></head><body>ERROR!! NO TIENE PERMISOS PARA VER ESTA PAGIINA!!</body></html>';
}
?>