KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.4.62
System : FreeBSD fbsdweb2.web.rcn.net 14.1-RELEASE FreeBSD 14.1-RELEASE releng/14.1-n267679-10e31f0946d8 GENERIC amd64
User : www ( 80)
PHP Version : 8.3.8
Disable Function : NONE
Directory :  /domains/logicswapweb/fnc/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /domains/logicswapweb/fnc/documento.php
<?php
class Documento extends Componente{

var $ruta="./aplicaciones/admon/documentos/docs/archivos/";
var $cantidad=0;
var $filas=0;
var $filas1=0;

function Documento() {
    $this->DBManager('MySQL');
	$this->connect();

}

function categoria(){
	$sql1="SELECT id,nombre FROM carpeta WHERE tipo='carpeta' ORDER BY nombre";
	if($this->execute($sql1)){
		$i=0;
		$resultado[0][0]=NULL;
		while(list($id,$name)=$this->fetchRow()){
			$resultado[$i][0]=$id;
			$resultado[$i][1]=$name;
			$i++;
		}
	}
	
	$this->filas=$i;
	return $resultado;
}

function subcategoria($id_car){
	$sql1="SELECT id,nombre FROM carpeta WHERE tipo='subcarpeta' AND parent='$id_car' ";
	if($this->execute($sql1)){
		$i=0;
		$resultado[0][0]=NULL;
		while(list($id,$name)=$this->fetchRow()){
			$resultado[$i][0]=$id;
			$resultado[$i][1]=$name;
			$i++;
		}
	}
	
	$this->filas1=$i;
	return $resultado;
}

function matrix(){
	$db1=new Documento();
	$db2=new Documento();
	$db3=new Documento();
	$db4=new Documento();

	//nivel 1
	$filas=0;
	$matrix["0"]["0"]="*";
	$matrix["0"]["1"]="*";
	$matrix["0"]["2"]="*";
	$matrix["0"]["3"]="*";
	$matrix["0"]["4"]="*";
	$matrix["0"]["5"]="*";
	$matrix["0"]["6"]="*";
	$matrix["0"]["7"]="*";
	$sql1="SELECT id,nombre FROM carpeta WHERE tipo='carpeta' ORDER BY nombre";
	if($db1->execute($sql1)){
		while(list($id,$name)=$db1->fetchRow()){
			$matrix[$filas]["0"]=$id;
			$matrix[$filas]["1"]=$name;
			$matrix[$filas]["2"]="-";
			$matrix[$filas]["3"]="-";
			$matrix[$filas]["4"]="-";
			$matrix[$filas]["5"]="-";
			$matrix[$filas]["6"]="-";
			$matrix[$filas]["7"]="-";
	//nivel 2
			$sql2="SELECT id,nombre FROM carpeta WHERE tipo='subcarpeta' AND parent='$id' ORDER BY nombre";
			if($db2->execute($sql2)){
				while(list($ids,$names)=$db2->fetchRow()){
	//nivel 3				
					$filas++;
					$matrix[$filas]["0"]="*";
					$matrix[$filas]["1"]="*";
					$matrix[$filas]["2"]=$ids;
					$matrix[$filas]["3"]=$names;
					$matrix[$filas]["4"]="-";
					$matrix[$filas]["5"]="-";				
					$matrix[$filas]["6"]="-";
					$matrix[$filas]["7"]="-";				
					$sql3="SELECT id,nombre FROM carpeta WHERE tipo='subcarpeta' AND parent='$ids' ORDER BY nombre";
					if($db3->execute($sql3)){
						while(list($idss,$namess)=$db3->fetchRow()){
	//nivel 4 
							$filas++;
							$matrix[$filas]["0"]="*";
							$matrix[$filas]["1"]="*";
							$matrix[$filas]["2"]="*";
							$matrix[$filas]["3"]="*";						
							$matrix[$filas]["4"]=$idss;
							$matrix[$filas]["5"]=$namess;						
							$matrix[$filas]["6"]="-";
							$matrix[$filas]["7"]="-";						
							$sql4="SELECT id,nombre FROM carpeta WHERE tipo='subcarpeta' AND parent='$idss' ORDER BY nombre";
							if($db4->execute($sql4)){
								while(list($idsss,$namesss)=$db4->fetchRow()){												
									$filas++;
									$matrix[$filas]["0"]="*";
									$matrix[$filas]["1"]="*";
									$matrix[$filas]["2"]="*";
									$matrix[$filas]["3"]="*";					
									$matrix[$filas]["4"]="*";
									$matrix[$filas]["5"]="*";									
									$matrix[$filas]["6"]=$idsss;
									$matrix[$filas]["7"]=$namesss;			
								}
							}else{
								echo "�imposible consultar la base de datos!";
							}	
						}
	//cierre nivel 4					
					}else{
						echo "�imposible consultar la base de datos!";
					}
				}
	//cierre nivel 3	
			}else{
				echo "�imposible consultar la base de datos!";
			}
			$filas++;
		}
	// cierra nivel 2	
	}else{
		echo "�imposible consultar la base de datos!";
	}
	//cierra nivel 1
	$matrix[$filas]["0"]="-";
	$matrix[$filas]["1"]="-";
	$matrix[$filas]["2"]="-";
	$matrix[$filas]["3"]="-";					
	$matrix[$filas]["4"]="-";
	$matrix[$filas]["5"]="-";									
	$matrix[$filas]["6"]="-";
	$matrix[$filas]["7"]="-";	

	$this->filas = $filas;
	return $matrix;
}

function documentos($id_car,$ini){
	$sql = "SELECT nombre FROM carpeta WHERE id='$id_car'";
    $this->execute($sql);
    list($nombre_carpeta) = $this->fetchRow();
	echo '<div align="center" class="menu1">Carpeta: '.$nombre_carpeta.'</div><br>';
	$db2=new Documento();
	$tabla=0;
	$control=0;
	$sql = "SELECT id,titulo,texto,fecha_ing,fecha_fin FROM documentos WHERE carpeta='$id_car' order by titulo";
    $this->execute($sql);
	if($this->numRows()){	
		$i = 1; $j=0; $limite =10; $write=0;
        while((list($id_pro, $titulo,$descripcion,$fecha_ing,$fecha_fin) = $this->fetchRow())){
			$fechaing=$this->fecha($fecha_ing);
			$fechafin=$this->fecha($fecha_fin);
			$sql2="SELECT titulo,fichero FROM archivo WHERE documento='$id_pro' order by titulo";
			$db2->execute($sql2);	
			$this->cantidad=$this->cantidad+$db2->numRows();
	 
    		while((list($titulo_arc,$fichero) = $db2->fetchRow()) && ($j<$limite)){	
			
			if($write>=$ini){
				if($i==1){ 
					$i++;
								
				$length=strlen($fichero); 
				$ext=substr($fichero,$length-3,$length);
				$tabla++;
				if($control==0){
					echo '<tr>';
				}
				echo '<td width="50%"><table width="100%" border="0">';
				echo '<tr><td width="50%" valign="top" align="left"><strong>Documento</strong><br>'.$titulo.'<br><br><strong>Archivo</strong><br><a href="'.$this->ruta.$fichero.'" title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';">'.$titulo_arc.'</a></td><td width="50%" valign="top" align="left"><strong>Ingreso<br></strong>'.$fechaing.'<br><br><strong>Vence<br></strong>'.$fechafin.'</td></tr>';
				if($ext=="pdf" || $ext=="PDF"){
					echo '<tr><td onMouseover="this.bgColor=\'#e0e0e0\'" onMouseout="this.bgColor=\'#ffffff\'" width="50%" valign="middle" align="center"><a href="'.$this->ruta.$fichero.'" target="_blank" title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';"><img src="aplicaciones/admon/documentos/img/DocumentoPdf.gif"></a><br><a href="'.$this->ruta.$fichero.'" target="_blank title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';">Descargar</a></td><td width="50%" valign="top" align="left"><br><strong>Descripcion</strong><br><div style="width:120px; height:50px; overflow:auto ">'.$descripcion.'</div></td></tr>';
				}elseif($ext=="mp3" || $ext=="MP3" || $ext=="wav" || $ext=="WAV" || $ext=="ogg" || $ext=="OGG" || $ext=="wma" || $ext=="WMA" || $ext=="rmp" || $ext=="RMP"){
					echo '<tr><td onMouseover="this.bgColor=\'#e0e0e0\'" onMouseout="this.bgColor=\'#ffffff\'" width="50%" valign="middle" align="center"><a href="'.$this->ruta.$fichero.'" target="_blank" title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';"><img src="aplicaciones/admon/documentos/img/audio.gif"></a><br><a href="'.$this->ruta.$fichero.'" target="_blank" title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';">Descargar</a></td><td width="50%" valign="top" align="left"><br><strong>Descripcion</strong><br><div style="width:100%; height:50px; overflow:auto ">'.$descripcion.'</div></td></tr>';
				}elseif($ext=="avi" || $ext=="AVI" || $ext=="mpg" || $ext=="MPG" || $ext=="pge" || $ext=="PGE"){
					echo '<tr><td onMouseover="this.bgColor=\'#e0e0e0\'" onMouseout="this.bgColor=\'#ffffff\'" width="50%" valign="middle" align="center"><a href="'.$this->ruta.$fichero.'" target="_blank" title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';"><img src="aplicaciones/admon/documentos/img/DocumentoAvi.gif"></a><br><a href="'.$this->ruta.$fichero.'" target="_blank" title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';">Descargar</a></td><td width="50%"><br><strong>Descripcion</strong><br><div style="width:100%; height:50px; overflow:auto ">'.$descripcion.'</div></td></tr>';
				}elseif($ext=="xls" || $ext=="XLS"){
					echo '<tr><td onMouseover="this.bgColor=\'#e0e0e0\'" onMouseout="this.bgColor=\'#ffffff\'" width="50%" valign="middle" align="center"><a href="'.$this->ruta.$fichero.'" target="_blank" title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';"><img src="aplicaciones/admon/documentos/img/DocumentoExcel.gif"></a><br><a href="'.$this->ruta.$fichero.'" target="_blank" title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';">Descargar</a></td><td width="50%" valign="top" align="left"><strong>Descripcion</strong><br><div style="width:120px; height:50px; overflow:auto ">'.$descripcion.'</div></td></tr>';
				}elseif($ext=="gif" || $ext=="GIF"){
					echo '<tr><td onMouseover="this.bgColor=\'#e0e0e0\'" onMouseout="this.bgColor=\'#ffffff\'" width="50%" valign="middle" align="center"><a href="'.$this->ruta.$fichero.'" target="_blank" title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';"><img src="aplicaciones/admon/documentos/img/DocumentoGif.gif"></a><br><a href="'.$this->ruta.$fichero.'" target="_blank" title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';">Descargar</a></td><td width="50%" valign="top" align="left"><br><strong>Descripcion</strong><br><div style="width:120px; height:50px; overflow:auto ">'.$descripcion.'</div></td></tr>';
				}elseif($ext=="jpg" || $ext=="JPG" || $ext=="PEG" || $ext=="peg"){
					echo '<tr><td onMouseover="this.bgColor=\'#e0e0e0\'" onMouseout="this.bgColor=\'#ffffff\'" width="50%" valign="middle" align="center"><a href="'.$this->ruta.$fichero.'" target="_blank" title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';"><img src="aplicaciones/admon/documentos/img/DocumentoJpg.gif"></a><br><a href="'.$this->ruta.$fichero.'" target="_blank" title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';">Descargar</a></td><td width="50%" valign="top" align="left"><br><strong>Descripcion</strong><br><div style="width:120px; height:50px; overflow:auto ">'.$descripcion.'</div></td></tr>';
				}elseif($ext=="mov" || $ext=="MOV"){
					echo '<tr><td onMouseover="this.bgColor=\'#e0e0e0\'" onMouseout="this.bgColor=\'#ffffff\'" width="50%" valign="middle" align="center"><a href="'.$this->ruta.$fichero.'" target="_blank" title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';"><img src="aplicaciones/admon/documentos/img/DocumentoMov.gif"></a><br><a href="'.$this->ruta.$fichero.'" target="_blank" title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';">Descargar</a></td><td width="50%" valign="top" align="left"><br><strong>Descripcion</strong><br><div style="width:120px; height:50px; overflow:auto ">'.$descripcion.'</div></td></tr>';
				}elseif($ext=="ppt" || $ext=="PPT"){
					echo '<tr><td onMouseover="this.bgColor=\'#e0e0e0\'" onMouseout="this.bgColor=\'#ffffff\'" width="50%" valign="middle" align="center"><a href="'.$this->ruta.$fichero.'" target="_blank" title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';"><img src="aplicaciones/admon/documentos/img/DocumentoPpt.gif"></a><br><a href="'.$this->ruta.$fichero.'" target="_blank" title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';">Descargar</a></td><td width="50%" valign="top" align="left"><br><strong>Descripcion</strong><br><div style="width:120px; height:50px; overflow:auto ">'.$descripcion.'</div></td></tr>';
				}elseif($ext=="swf" || $ext=="SWF"){
					echo '<tr><td onMouseover="this.bgColor=\'#e0e0e0\'" onMouseout="this.bgColor=\'#ffffff\'" width="50%" valign="middle" align="center"><a href="'.$this->ruta.$fichero.'" target="_blank" title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';"><img src="aplicaciones/admon/documentos/img/DocumentoSwf.gif"></a><br><a href="'.$this->ruta.$fichero.'" target="_blank" title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';">Descargar</a></td><td width="50%" valign="top" align="left"><br><strong>Descripcion</strong><br><div style="width:120px; height:50px; overflow:auto ">'.$descripcion.'</div></td></tr>';
				}elseif($ext=="txt" || $ext=="TXT"){
					echo '<tr><td onMouseover="this.bgColor=\'#e0e0e0\'" onMouseout="this.bgColor=\'#ffffff\'" width="50%" valign="middle" align="center"><a href="'.$this->ruta.$fichero.'" target="_blank" title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';"><img src="aplicaciones/admon/documentos/img/DocumentoTxt.gif"></a><br><a href="'.$this->ruta.$fichero.'" target="_blank" title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';">Descargar</a></td><td width="50%" valign="top" align="left"><br><strong>Descripcion</strong><br><div style="width:120px; height:50px; overflow:auto ">'.$descripcion.'</div></td></tr>';
				}elseif($ext=="doc" || $ext=="DOC"){
					echo '<tr><td onMouseover="this.bgColor=\'#e0e0e0\'" onMouseout="this.bgColor=\'#ffffff\'" width="50%" valign="middle" align="center"><a href="'.$this->ruta.$fichero.'" target="_blank" title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';"><img src="aplicaciones/admon/documentos/img/DocumentoWord.gif"></a><br><a href="'.$this->ruta.$fichero.'" target="_blank" title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';">Descargar</a></td><td width="50%" valign="top" align="left"><br><strong>Descripcion</strong><br><div style="width:120px; height:50px; overflow:auto ">'.$descripcion.'</div></td></tr>';
				}elseif($ext=="zip" || $ext=="ZIP" || $ext=="rar" || $ext=="RAR"){
					echo '<tr><td onMouseover="this.bgColor=\'#e0e0e0\'" onMouseout="this.bgColor=\'#ffffff\'" width="50%" valign="middle" align="center"><a href="'.$this->ruta.$fichero.'" target="_blank" title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';"><img src="aplicaciones/admon/documentos/img/DocumentoZip.gif"></a><br><a href="'.$this->ruta.$fichero.'" target="_blank" title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';">Descargar</a></td><td width="50%" valign="top" align="left"><br><strong>Descripcion</strong><br><div style="width:120px; height:50px; overflow:auto ">'.$descripcion.'</div></td></tr>';
				}elseif($ext=="bmp" || $ext=="BMP"){
					echo '<tr><td onMouseover="this.bgColor=\'#e0e0e0\'" onMouseout="this.bgColor=\'#ffffff\'" width="50%" valign="middle" align="center"><a href="'.$this->ruta.$fichero.'" target="_blank" title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';"><img src="aplicaciones/admon/documentos/img/DocumentoBmp.gif"></a><br><a href="'.$this->ruta.$fichero.'" target="_blank" title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';">Descargar</a></td><td width="50%" valign="top" align="left"><br><strong>Descripcion</strong><br><div style="width:120px; height:50px; overflow:auto ">'.$descripcion.'</div></td></tr>';
				}elseif($ext=="htm" || $ext=="HTM" || $ext=="TML" || $ext=="tml"){
					echo '<tr><td onMouseover="this.bgColor=\'#e0e0e0\'" onMouseout="this.bgColor=\'#ffffff\'" width="50%" valign="middle" align="center"><a href="'.$this->ruta.$fichero.'" target="_blank" title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';"><img src="aplicaciones/admon/documentos/img/DocumentoHtml.gif"></a><br><a href="'.$this->ruta.$fichero.'" target="_blank" title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';">Descargar</a></td><td width="50%" valign="top" align="left"><br><strong>Descripcion</strong><br><div style="width:120px; height:50px; overflow:auto ">'.$descripcion.'</div></td></tr>';
				}else{
					echo '<tr><td onMouseover="this.bgColor=\'#e0e0e0\'" onMouseout="this.bgColor=\'#ffffff\'" width="50%" valign="middle" align="center"><a href="'.$this->ruta.$fichero.'" target="_blank" title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';"><img src="aplicaciones/admon/documentos/img/Documento.gif"></a><br><a href="'.$this->ruta.$fichero.'" target="_blank" title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';">Descargar</a></td><td width="50%" valign="top" align="left"><br><strong>Descripcion</strong><br><div style="width:120px; height:50px; overflow:auto ">'.$descripcion.'</div></td></tr>';
				}
				
				echo '</table></td>';
				
				if($control==1){
					echo '</tr>';
					$control++;
				}
				
				if($control==2){
					$control=0;
				}else{
					$control++;	
				}	
				
			}else{
			
				$length=strlen($fichero); 
				$ext=substr($fichero,$length-3,$length);
				$tabla++;
				if($control==0){
					echo '<tr>';
				}
				echo '<td width="50%"><table width="100%" border="0">';
				echo '<tr><td width="50%" valign="top" align="left"><strong>Documento</strong><br>'.$titulo.'<br><br><strong>Archivo</strong><br><a href="'.$this->ruta.$fichero.'" title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';">'.$titulo_arc.'</a></td><td width="50%" valign="top" align="left"><strong>Ingreso<br></strong>'.$fechaing.'<br><br><strong>Vence<br></strong>'.$fechafin.'</td></tr>';
				if($ext=="pdf" || $ext=="PDF"){
					echo '<tr><td onMouseover="this.bgColor=\'#e0e0e0\'" onMouseout="this.bgColor=\'#ffffff\'" width="50%" valign="middle" align="center"><a href="'.$this->ruta.$fichero.'" target="_blank" title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';"><img src="aplicaciones/admon/documentos/img/DocumentoPdf.gif"></a><br><a href="'.$this->ruta.$fichero.'" target="_blank title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';">Descargar</a></td><td width="50%" valign="top" align="left"><br><strong>Descripcion</strong><br><div style="width:120px; height:50px; overflow:auto ">'.$descripcion.'</div></td></tr>';
				}elseif($ext=="mp3" || $ext=="MP3" || $ext=="wav" || $ext=="WAV" || $ext=="ogg" || $ext=="OGG" || $ext=="wma" || $ext=="WMA" || $ext=="rmp" || $ext=="RMP"){
					echo '<tr><td onMouseover="this.bgColor=\'#e0e0e0\'" onMouseout="this.bgColor=\'#ffffff\'" width="50%" valign="middle" align="center"><a href="'.$this->ruta.$fichero.'" target="_blank" title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';"><img src="aplicaciones/admon/documentos/img/audio.gif"></a><br><a href="'.$this->ruta.$fichero.'" target="_blank" title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';">Descargar</a></td><td width="50%" valign="top" align="left"><br><strong>Descripcion</strong><br><div style="width:100%; height:50px; overflow:auto ">'.$descripcion.'</div></td></tr>';
				}elseif($ext=="avi" || $ext=="AVI" || $ext=="mpg" || $ext=="MPG" || $ext=="pge" || $ext=="PGE"){
					echo '<tr><td onMouseover="this.bgColor=\'#e0e0e0\'" onMouseout="this.bgColor=\'#ffffff\'" width="50%" valign="middle" align="center"><a href="'.$this->ruta.$fichero.'" target="_blank" title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';"><img src="aplicaciones/admon/documentos/img/DocumentoAvi.gif"></a><br><a href="'.$this->ruta.$fichero.'" target="_blank" title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';">Descargar</a></td><td width="50%"><br><strong>Descripcion</strong><br><div style="width:100%; height:50px; overflow:auto ">'.$descripcion.'</div></td></tr>';
				}elseif($ext=="xls" || $ext=="XLS"){
					echo '<tr><td onMouseover="this.bgColor=\'#e0e0e0\'" onMouseout="this.bgColor=\'#ffffff\'" width="50%" valign="middle" align="center"><a href="'.$this->ruta.$fichero.'" target="_blank" title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';"><img src="aplicaciones/admon/documentos/img/DocumentoExcel.gif"></a><br><a href="'.$this->ruta.$fichero.'" target="_blank" title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';">Descargar</a></td><td width="50%" valign="top" align="left"><strong>Descripcion</strong><br><div style="width:120px; height:50px; overflow:auto ">'.$descripcion.'</div></td></tr>';
				}elseif($ext=="gif" || $ext=="GIF"){
					echo '<tr><td onMouseover="this.bgColor=\'#e0e0e0\'" onMouseout="this.bgColor=\'#ffffff\'" width="50%" valign="middle" align="center"><a href="'.$this->ruta.$fichero.'" target="_blank" title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';"><img src="aplicaciones/admon/documentos/img/DocumentoGif.gif"></a><br><a href="'.$this->ruta.$fichero.'" target="_blank" title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';">Descargar</a></td><td width="50%" valign="top" align="left"><br><strong>Descripcion</strong><br><div style="width:120px; height:50px; overflow:auto ">'.$descripcion.'</div></td></tr>';
				}elseif($ext=="jpg" || $ext=="JPG" || $ext=="PEG" || $ext=="peg"){
					echo '<tr><td onMouseover="this.bgColor=\'#e0e0e0\'" onMouseout="this.bgColor=\'#ffffff\'" width="50%" valign="middle" align="center"><a href="'.$this->ruta.$fichero.'" target="_blank" title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';"><img src="aplicaciones/admon/documentos/img/DocumentoJpg.gif"></a><br><a href="'.$this->ruta.$fichero.'" target="_blank" title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';">Descargar</a></td><td width="50%" valign="top" align="left"><br><strong>Descripcion</strong><br><div style="width:120px; height:50px; overflow:auto ">'.$descripcion.'</div></td></tr>';
				}elseif($ext=="mov" || $ext=="MOV"){
					echo '<tr><td onMouseover="this.bgColor=\'#e0e0e0\'" onMouseout="this.bgColor=\'#ffffff\'" width="50%" valign="middle" align="center"><a href="'.$this->ruta.$fichero.'" target="_blank" title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';"><img src="aplicaciones/admon/documentos/img/DocumentoMov.gif"></a><br><a href="'.$this->ruta.$fichero.'" target="_blank" title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';">Descargar</a></td><td width="50%" valign="top" align="left"><br><strong>Descripcion</strong><br><div style="width:120px; height:50px; overflow:auto ">'.$descripcion.'</div></td></tr>';
				}elseif($ext=="ppt" || $ext=="PPT"){
					echo '<tr><td onMouseover="this.bgColor=\'#e0e0e0\'" onMouseout="this.bgColor=\'#ffffff\'" width="50%" valign="middle" align="center"><a href="'.$this->ruta.$fichero.'" target="_blank" title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';"><img src="aplicaciones/admon/documentos/img/DocumentoPpt.gif"></a><br><a href="'.$this->ruta.$fichero.'" target="_blank" title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';">Descargar</a></td><td width="50%" valign="top" align="left"><br><strong>Descripcion</strong><br><div style="width:120px; height:50px; overflow:auto ">'.$descripcion.'</div></td></tr>';
				}elseif($ext=="swf" || $ext=="SWF"){
					echo '<tr><td onMouseover="this.bgColor=\'#e0e0e0\'" onMouseout="this.bgColor=\'#ffffff\'" width="50%" valign="middle" align="center"><a href="'.$this->ruta.$fichero.'" target="_blank" title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';"><img src="aplicaciones/admon/documentos/img/DocumentoSwf.gif"></a><br><a href="'.$this->ruta.$fichero.'" target="_blank" title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';">Descargar</a></td><td width="50%" valign="top" align="left"><br><strong>Descripcion</strong><br><div style="width:120px; height:50px; overflow:auto ">'.$descripcion.'</div></td></tr>';
				}elseif($ext=="txt" || $ext=="TXT"){
					echo '<tr><td onMouseover="this.bgColor=\'#e0e0e0\'" onMouseout="this.bgColor=\'#ffffff\'" width="50%" valign="middle" align="center"><a href="'.$this->ruta.$fichero.'" target="_blank" title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';"><img src="aplicaciones/admon/documentos/img/DocumentoTxt.gif"></a><br><a href="'.$this->ruta.$fichero.'" target="_blank" title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';">Descargar</a></td><td width="50%" valign="top" align="left"><br><strong>Descripcion</strong><br><div style="width:120px; height:50px; overflow:auto ">'.$descripcion.'</div></td></tr>';
				}elseif($ext=="doc" || $ext=="DOC"){
					echo '<tr><td onMouseover="this.bgColor=\'#e0e0e0\'" onMouseout="this.bgColor=\'#ffffff\'" width="50%" valign="middle" align="center"><a href="'.$this->ruta.$fichero.'" target="_blank" title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';"><img src="aplicaciones/admon/documentos/img/DocumentoWord.gif"></a><br><a href="'.$this->ruta.$fichero.'" target="_blank" title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';">Descargar</a></td><td width="50%" valign="top" align="left"><br><strong>Descripcion</strong><br><div style="width:120px; height:50px; overflow:auto ">'.$descripcion.'</div></td></tr>';
				}elseif($ext=="zip" || $ext=="ZIP" || $ext=="rar" || $ext=="RAR"){
					echo '<tr><td onMouseover="this.bgColor=\'#e0e0e0\'" onMouseout="this.bgColor=\'#ffffff\'" width="50%" valign="middle" align="center"><a href="'.$this->ruta.$fichero.'" target="_blank" title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';"><img src="aplicaciones/admon/documentos/img/DocumentoZip.gif"></a><br><a href="'.$this->ruta.$fichero.'" target="_blank" title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';">Descargar</a></td><td width="50%" valign="top" align="left"><br><strong>Descripcion</strong><br><div style="width:120px; height:50px; overflow:auto ">'.$descripcion.'</div></td></tr>';
				}elseif($ext=="bmp" || $ext=="BMP"){
					echo '<tr><td onMouseover="this.bgColor=\'#e0e0e0\'" onMouseout="this.bgColor=\'#ffffff\'" width="50%" valign="middle" align="center"><a href="'.$this->ruta.$fichero.'" target="_blank" title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';"><img src="aplicaciones/admon/documentos/img/DocumentoBmp.gif"></a><br><a href="'.$this->ruta.$fichero.'" target="_blank" title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';">Descargar</a></td><td width="50%" valign="top" align="left"><br><strong>Descripcion</strong><br><div style="width:120px; height:50px; overflow:auto ">'.$descripcion.'</div></td></tr>';
				}elseif($ext=="htm" || $ext=="HTM" || $ext=="TML" || $ext=="tml"){
					echo '<tr><td onMouseover="this.bgColor=\'#e0e0e0\'" onMouseout="this.bgColor=\'#ffffff\'" width="50%" valign="middle" align="center"><a href="'.$this->ruta.$fichero.'" target="_blank" title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';"><img src="aplicaciones/admon/documentos/img/DocumentoHtml.gif"></a><br><a href="'.$this->ruta.$fichero.'" target="_blank" title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';">Descargar</a></td><td width="50%" valign="top" align="left"><br><strong>Descripcion</strong><br><div style="width:120px; height:50px; overflow:auto ">'.$descripcion.'</div></td></tr>';
				}else{
					echo '<tr><td onMouseover="this.bgColor=\'#e0e0e0\'" onMouseout="this.bgColor=\'#ffffff\'" width="50%" valign="middle" align="center"><a href="'.$this->ruta.$fichero.'" target="_blank" title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';"><img src="aplicaciones/admon/documentos/img/Documento.gif"></a><br><a href="'.$this->ruta.$fichero.'" target="_blank" title="Descargar" style="cursor:hand; text-decoration:none; font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'000000\';">Descargar</a></td><td width="50%" valign="top" align="left"><br><strong>Descripcion</strong><br><div style="width:120px; height:50px; overflow:auto ">'.$descripcion.'</div></td></tr>';
				}
								
				echo '</table></td>';
				
				if($control==1){
					echo '</tr>';
					$control++;
				}
				
				if($control==2){
					$control=0;
				}else{
					$control++;	
				}				
			
			}
			$j++;
			}
			$write++;
			
			}
			
		}
    } else {
        echo '<tr><td width="100%" ><div align="center">No hay documentos registrados</div></td></tr>';       
    }
	
	if($tabla%2!=0){
		echo '<td></td></tr>';
	}
}

function fecha($fecha_ing){
	if(substr(substr($fecha_ing,5),0,2)=="01"){
		$dia=substr(substr($fecha_ing,8),0,2);
		$ano=substr($fecha_ing,0,4);
		$fechaing="Enero ".$dia." del ".$ano;
	}
	if(substr(substr($fecha_ing,5),0,2)=="02"){
		$dia=substr(substr($fecha_ing,8),0,2);
		$ano=substr($fecha_ing,0,4);
		$fechaing="Febrero ".$dia." del ".$ano;
	}
	if(substr(substr($fecha_ing,5),0,2)=="03"){
		$dia=substr(substr($fecha_ing,8),0,2);
		$ano=substr($fecha_ing,0,4);
		$fechaing="Marzo ".$dia." del ".$ano;
	}
	if(substr(substr($fecha_ing,5),0,2)=="04"){
		$dia=substr(substr($fecha_ing,8),0,2);
		$ano=substr($fecha_ing,0,4);
		$fechaing="Abril ".$dia." del ".$ano;
	}
	if(substr(substr($fecha_ing,5),0,2)=="05"){
		$dia=substr(substr($fecha_ing,8),0,2);
		$ano=substr($fecha_ing,0,4);
		$fechaing="Mayo ".$dia." del ".$ano;
	}
	if(substr(substr($fecha_ing,5),0,2)=="06"){
		$dia=substr(substr($fecha_ing,8),0,2);
		$ano=substr($fecha_ing,0,4);
		$fechaing="Junio ".$dia." del ".$ano;
	}
	if(substr(substr($fecha_ing,5),0,2)=="07"){
		$dia=substr(substr($fecha_ing,8),0,2);
		$ano=substr($fecha_ing,0,4);
		$fechaing="Julio ".$dia." del ".$ano;
	}
	if(substr(substr($fecha_ing,5),0,2)=="08"){
		$dia=substr(substr($fecha_ing,8),0,2);
		$ano=substr($fecha_ing,0,4);
		$fechaing="Agosto ".$dia." del ".$ano;
	}
	if(substr(substr($fecha_ing,5),0,2)=="09"){
		$dia=substr(substr($fecha_ing,8),0,2);
		$ano=substr($fecha_ing,0,4);
		$fechaing="Septiembre ".$dia." del ".$ano;
	}
	if(substr(substr($fecha_ing,5),0,2)=="10"){
		$dia=substr(substr($fecha_ing,8),0,2);
		$ano=substr($fecha_ing,0,4);
		$fechaing="Octubre ".$dia." del ".$ano;
	}
	if(substr(substr($fecha_ing,5),0,2)=="11"){
		$dia=substr(substr($fecha_ing,8),0,2);
		$ano=substr($fecha_ing,0,4);
		$fechaing="Noviembre ".$dia." del ".$ano;
	}
	if(substr(substr($fecha_ing,5),0,2)=="12"){
		$dia=substr(substr($fecha_ing,8),0,2);
		$ano=substr($fecha_ing,0,4);
		$fechaing="Diciembre ".$dia." del ".$ano;
	}
	return $fechaing;
}
function listame($id_actual){
		$db= new DBManager('MySQL');
		$db->connect();
		$sql = "SELECT id,nombre FROM carpeta WHERE tipo='carpeta' ORDER BY nombre ASC";	
		$this->execute($sql);
		if($this->numRows()>0){
			while(list($id, $nombre)=$this->fetchRow()){
				if($id == $id_actual)
					$tphd = "foldinglist";
				else
					$tphd = "foldheader";
				echo '<a href="documentos.php?id_car='.$id.'"style="cursor:hand; text-decoration:none; font-size:11px; font-family:Arial, Helvetica, sans-serif; font-weight:bold; color:#999999" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'999999\';"><li id="'.$tphd.'">'.$nombre.'</a>';
				$sql = "SELECT id,nombre FROM carpeta WHERE parent = $id AND tipo='subcarpeta' ORDER BY nombre ASC";
				$db->execute($sql);
				if($db->numRows()>0){
					echo '<ul style="position:relative; left:-30px">';
					while(list($id_, $nombre_)=$db->fetchRow()){
						if($id_ == $id_actual)
							$tphd = "foldinglist";
						else
							$tphd = "foldheader";
						echo '<span style="position:relative; left:10px"><a href="documentos.php?id_car='.$id_.'" style="cursor:hand; text-decoration:none; font-size:11px; font-family:Arial, Helvetica, sans-serif; font-weight:bold; color:#999999" onMouseover="this.style.color=\'0000FF\'" onMouseOut="this.style.color=\'999999\';"><li id="'.$tphd.'">'.$nombre_.'</li></a></span>';
					}
					echo '</ul>';
				}
			}
		}
	}



}
?>

Anon7 - 2021