|
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/aplicaciones/admon/documentos/fnc/ |
Upload File : |
<?php
class Parametros extends Componente{
/*constructor*/
function Parametros(){
$this->DBManager('MySQL');
$this->connect();
}
function getCarpeta(){
$sql = "SELECT valor FROM parametro WHERE nombre='num_carpeta'";
if($this->execute($sql)){
list($id)=$this->fetchRow();
return $id;
}elseif ($this->isDebuggerEnabled()) {
$msg = "Error ".$this->getException();
return $msg;
}
}
function getSubcarpeta(){
$sql = "SELECT valor FROM parametro WHERE nombre='num_subcarpeta'";
if($this->execute($sql)){
list($id)=$this->fetchRow();
return $id;
}elseif ($this->isDebuggerEnabled()) {
$msg = "Error ".$this->getException();
return $msg;
}
}
function getDocumento(){
$sql = "SELECT valor FROM parametro WHERE nombre='num_documento'";
if($this->execute($sql)){
list($id)=$this->fetchRow();
return $id;
}elseif ($this->isDebuggerEnabled()) {
$msg = "Error ".$this->getException();
return $msg;
}
}
function getArchivo(){
$sql = "SELECT valor FROM parametro WHERE nombre='num_archivo'";
if($this->execute($sql)){
list($id)=$this->fetchRow();
return $id;
}elseif ($this->isDebuggerEnabled()) {
$msg = "Error ".$this->getException();
return $msg;
}
}
function getCarpetaAct(){
$sql = "SELECT count(id) as cantidad FROM carpeta WHERE tipo='carpeta' GROUP BY parent";
$mayor=0;
if($this->execute($sql)){
while(list($cantidad)=$this->fetchRow()){
if($cantidad>$mayor){
$mayor=$cantidad;
}
}
return $mayor;
}elseif ($this->isDebuggerEnabled()) {
$msg = "Error ".$this->getException();
return $msg;
}
}
function getSubcarpetaAct(){
$sql = "SELECT count(id) as cantidad FROM carpeta WHERE tipo='subcarpeta' GROUP BY parent";
$mayor=0;
if($this->execute($sql)){
while(list($cantidad)=$this->fetchRow()){
if($cantidad>$mayor){
$mayor=$cantidad;
}
}
return $mayor;
}elseif ($this->isDebuggerEnabled()) {
$msg = "Error ".$this->getException();
return $msg;
}
}
function getDocumentoAct(){
$sql = "SELECT count(id) as cantidad FROM documentos GROUP BY carpeta";
$mayor=0;
if($this->execute($sql)){
while(list($cantidad)=$this->fetchRow()){
if($cantidad>$mayor){
$mayor=$cantidad;
}
}
return $mayor;
}elseif ($this->isDebuggerEnabled()) {
$msg = "Error ".$this->getException();
return $msg;
}
}
function getArchivoAct(){
$sql = "SELECT count(id) as cantidad FROM archivo GROUP BY documento";
$mayor=0;
if($this->execute($sql)){
while(list($cantidad)=$this->fetchRow()){
if($cantidad>$mayor){
$mayor=$cantidad;
}
}
return $mayor;
}elseif ($this->isDebuggerEnabled()) {
$msg = "Error ".$this->getException();
return $msg;
}
}
}
?>