Incam_Intranet/documentos.php
2011-04-04 15:16:10 +00:00

90 lines
2.3 KiB
PHP

<?php
include("seguridad.php");
include("functions.php");
include_once("html/cabecera.php");
include_once("Objects/HTML.php");
$html=new HTML($locale);
?>
<h2><?php echo $locale['714']; ?></h2>
<div id="ContTabul">
<?php
if($_GET["msg"]!=""){
switch ($_GET["msg"]) {
case "1":$mensaje=$locale['955'];
$tipo="error";
break;
case "2":$mensaje=$locale['956'];
$tipo="error";
break;
case "3":$mensaje=$locale['957'];
$tipo="error";
break;
case "4":$mensaje=$locale['958'];
$tipo="ok";
break;
case "5":$mensaje=$locale['959'];
$tipo="ok";
break;
case "6":$mensaje=$locale['960'];
$tipo="ok";
break;
default:
break;
}
echo "<div class=\"aviso ".$tipo."\" >".$mensaje."</div>";
}
// Mostramos la lista de documentos
include_once("Objects/ListaDocumentos.php");
$lista=new ListaDocumentos($usuario);
$listadocumento=$lista->getDocumentos();
if(count($listadocumento)>0){
?>
<ul>
<?php
foreach($listadocumento as $documento){
echo "<li class=\"lista\">".$documento->getValor("nombre");
echo " (<a href='descargas.php?tipo=doc&cod=".$documento->getValor("oid")."' target=popup onclick=window.open('', 'popup', 'width = 200, height = 100')>".$locale['ver']."</a>)";
// Si es el Admin, se muestra para eliminar
if($usuario->tieneRol("1")){
echo " (<a href=\"eliminar_documento.php?oid=".$documento->getValor("oid")."\" style=\"color:#FF0000\">Eliminar</a>)";
}
echo "</li>";
}
?>
</ul>
<?php
}
// Si es Administrador puede subir documentos
if($usuario->tieneRol("1")){
?>
<form action="insertar_documento.php" method="POST" enctype="multipart/form-data">
<?php echo $locale['715']; ?><br />
<input type="hidden" name="MAX_FILE_SIZE" value="10000000">
<?php echo $locale['1803'];?><input type="text" name="nombre"><br />
Ruta : <input name="userfile" class="button" type="file"><br />
<div style="float:left">
<?php echo $locale['216'].': ';
?>
</div><div style="float:left">
<?php
echo $html->listaSelect("rol","oid","id","rol",array(),array(),false,true,"15");
?></div>
<div style="clear:both" ></div>
<input type="submit" class="button" value="Subir">
</form>
<?php
}
?>
</div>
<?php
include_once("html/pie.php");
?>