diff --git a/InformeInventario2.php b/InformeInventario2.php deleted file mode 100644 index f34b6bd..0000000 --- a/InformeInventario2.php +++ /dev/null @@ -1,147 +0,0 @@ -. - * - */ - class InformeInventario { - private $bdd; - public function __construct($baseDatos) - { - $this->bdd=$baseDatos; - } - public function ejecuta() - { - $opc=$_GET['opc']; - switch ($opc) { - case 'Ubicacion':return $this->formularioUbicacion(); - case 'listarUbicacion':return $this->listarUbicacion(); - case 'listarArticulo':return $this->listarArticulo(); - case 'Articulo':return $this->formularioArticulo(); - case 'Total':return $this->inventarioTotal(); - } - } - private function listarUbicacion() - { - $fichero="xml/inventarioUbicacion.xml"; - $salida="tmp/inventarioUbicacion.xml"; - $plantilla=file_get_contents($fichero) - or die('Fallo en la apertura de la plantilla '.$fichero); - $comando="select * from Ubicaciones where id='".$_POST['id']."';"; - $resultado=$this->bdd->ejecuta($comando); - if (!$resultado) { - return $this->bdd->mensajeError($comando); - } - $fila=$this->bdd->procesaResultado(); - $plantilla=str_replace("{id}",$_POST['id'],$plantilla); - $plantilla=str_replace("{Descripcion}",utf8_encode($fila['Descripcion']),$plantilla); - file_put_contents($salida,$plantilla) - or die('Fallo en la escritura de la plantilla '.$salida); - $informe=new InformePDF($this->bdd,$salida,true); - } - private function listarArticulo() - { - $fichero="xml/inventarioArticulo.xml"; - $salida="tmp/inventarioArticulo.xml"; - $plantilla=file_get_contents($fichero) - or die('Fallo en la apertura de la plantilla '.$fichero); - $comando="select * from Articulos where id='".$_POST['id']."';"; - $resultado=$this->bdd->ejecuta($comando); - if (!$resultado) { - return $this->bdd->mensajeError($comando); - } - $fila=$this->bdd->procesaResultado(); - $plantilla=str_replace("{id}",$_POST['id'],$plantilla); - $plantilla=str_replace("{Descripcion}",utf8_encode($fila['descripcion']),$plantilla); - $plantilla=str_replace("{Marca}",utf8_encode($fila['marca']),$plantilla); - $plantilla=str_replace("{Modelo}",utf8_encode($fila['modelo']),$plantilla); - file_put_contents($salida,$plantilla) - or die('Fallo en la escritura de la plantilla '.$salida); - $informe=new InformePDF($this->bdd,$salida,true); - } - private function listaUbicaciones() - { - $salida="\n"; - return $salida; - } - private function listaArticulos() - { - $salida="\n"; - return $salida; - } - private function formulario($accion,$etiqueta,$lista) - { - $salida='
'."\n"; - $salida.="

Elige $etiqueta\n"; - $salida.="

"; - $salida.=$lista; - $salida.="

"; - $salida.='


'."\n"; - return $salida; - } - private function formularioUbicacion() - { - //Genera un formulario con las ubicaciones disponibles. - $accion="index.php?informeInventario&opc=listarUbicacion"; - return $this->formulario($accion,'Ubicación',$this->listaUbicaciones()); - } - private function formularioArticulo() - { - $accion="index.php?informeInventario&opc=listarArticulo"; - return $this->formulario($accion,'Artículo',$this->listaArticulos()); - } - private function inventarioTotal() - { - $fichero="xml/inventarioUbicacion.xml"; - $salida="tmp/inventarioUbicacion.xml"; - $comando="select * from Ubicaciones where id='".$_POST['id']."';"; - $resultado=$this->bdd->ejecuta($comando); - if (!$resultado) { - return $this->bdd->mensajeError($comando); - } - $salidaTotal=''; - while ($fila=$this->bdd->procesaResultado()) { - $plantilla=file_get_contents($fichero) - or die('Fallo en la apertura de la plantilla '.$fichero); - $plantilla=str_replace("{id}",$_POST['id'],$plantilla); - $plantilla=str_replace("{Descripcion}",utf8_encode($fila['Descripcion']),$plantilla); - file_put_contents($salida,$plantilla) - or die('Fallo en la escritura de la plantilla '.$salida); - $salidaTotal+=$salida; - } - $informe=new InformePDF($this->bdd,$salidaTotal,true); - } - } -?> diff --git a/InformePDF2.php b/InformePDF2.php deleted file mode 100644 index 11106af..0000000 --- a/InformePDF2.php +++ /dev/null @@ -1,85 +0,0 @@ - - * @version 1.0 - * @package Inventario - * @copyright Copyright (c) 2008, Ricardo Montañana - * @package Inventario - * @copyright Copyright (c) 2008, Ricardo Montañana Gómez - * @license http://www.gnu.org/licenses/gpl-3.0.txt - * This file is part of Inventario. - * Inventario is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Inventario is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Inventario. If not, see . - * - */ - - class InformePDF - { - /** - * - * @var basedatos Controlador de la base de datos - */ - private $bdd; - /** - * El constructor recibe como argumento el nombre del archivo XML con la definición, encargándose de recuperarla y guardar toda la información localmente - * @param basedatos $bdd manejador de la base de datos - * @param string $definicion fichero con la definición del informe en XML - * @param boolean $registrado usuario registrado si/no - * @return ficheroPDF - */ - public function __construct($bdd,$definicion,$registrado) - { - if (!$registrado) { - return 'Debe registrarse para acceder a este apartado'; - } - $this->bdd=$bdd; - // Recuperamos la definición del informe - $def=simplexml_load_file($definicion); - //print_r($def);echo $bdd;die(); - // Iniciamos la creación del documento - $pdf=new Pdf_mysql_table($this->bdd->obtieneManejador(),(string)$def->Pagina['Orientacion'], - (string)$def->Pagina['Formato'], - (string)$def->Titulo['Texto'],(string)$def->Pagina->Cabecera); - echo $def->Titulo.$def->Cabecera; - $pdf->Open(); - $pdf->setAuthor(utf8_decode(AUTOR)); - $pdf->setCreator(html_entity_decode(APLICACION)); - $pdf->setSubject(utf8_decode($def->Titulo)); - $pdf->setAutoPageBreak(true,10); - $this->bdd->ejecuta(trim($def->Datos->Consulta)); - $filas=$this->bdd->procesaResultado(); - $pdf->AddPage(); - // Recuperamos los datos del cuerpo - foreach($def->Pagina->Cuerpo->Col as $columna) { - $pdf->AddCol((string)$columna['Nombre'],(string)$columna['Ancho'], - (string)$columna['Titulo'],(string)$columna['Ajuste'], - (string)$columna['Total']); - } - $prop=array('HeaderColor'=>array(255,150,100), - 'color1'=>array(210,245,255), - 'color2'=>array(255,255,210), - 'padding'=>2); - $pdf->Table($def->Datos->Consulta,$prop); - $pdf->Close(); - // Obtenemos el documento y su longitud - $documento=$pdf->Output('','S'); - $longitud=strlen($documento); - // y lo enviamos como resultado - header("Content-type: application/pdf"); - header("Content-length: $longitud"); - header("Content-Disposition: inline; filename=Informe.pdf"); - echo $documento; - } - } -?> \ No newline at end of file diff --git a/inc/configuracion.inc b/inc/configuracion.inc index ba527a2..e5add85 100644 --- a/inc/configuracion.inc +++ b/inc/configuracion.inc @@ -25,7 +25,7 @@ define('SERVIDOR','localhost'); //Ubicación del servidor MySQL define('BASEDATOS','Inventario2'); //Nombre de la base de datos. define('USUARIO','test'); //Usuario con permisos de lectura/escritura en la base de datos define('CLAVE','tset'); //contraseña del usuario. -define('VERSION','1.02b'); +define('VERSION','1.03'); define('PROGRAMA','Gestión de Inventario.'); define('CENTRO','I.E.S.O. Pascual Serrano'); define('APLICACION',PROGRAMA.VERSION); diff --git a/phpinfo.php b/phpinfo.php deleted file mode 100644 index 1442a01..0000000 --- a/phpinfo.php +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/upgrade.php b/sql/upgrade.php similarity index 99% rename from upgrade.php rename to sql/upgrade.php index c20c245..7b8561c 100644 --- a/upgrade.php +++ b/sql/upgrade.php @@ -22,8 +22,8 @@ $host="localhost"; $baseAnt="Inventario"; $baseNueva="Inventario2"; -$usuario="root"; -$claveUsuario="galeote"; +$usuario="test"; +$claveUsuario="tset"; $probar=false; diff --git a/testbd.php b/testbd.php deleted file mode 100644 index 967ba66..0000000 --- a/testbd.php +++ /dev/null @@ -1,55 +0,0 @@ -error()) { - die("Error al conectar\n"); - } - if (!$bd->ejecuta("select * from Articulos limit 0,10")) { - die("No pudo ejecutar consulta. ".$bd->mensajeError()."\n"); - - } - echo "Hay ".$bd->numeroTuplas()." registros.
\n"; - while ($datos=$bd->procesaResultado()) { - - foreach($datos as $clave => $valor) { - echo "[$clave]=[$valor] "; - } - echo "
\n"; - - } - $datos=$bd->estructura("Elementos"); - for ($i=0;$i $valor) { - $trozos=explode(",",$valor["Comment"]); - //echo "Trozos=";print_r($trozos);//print_r($campos); - foreach($trozos as $trozo) { - if (strstr($trozo,"foreign")) { - $temp=substr($trozo,8,-1); - list($tabla,$atributo)=explode(";",$temp); - $salida[$clave]=$tabla.",".$atributo; - echo "[$clave],[$tabla],[$atributo]
\n"; - $existen=true; - } - } - } - /*for ($i=0;$i"; - - /*foreach($datos[$i] as $clave => $valor) { - echo "[$clave]=[$valor] "; - } - echo "
\n"; - }*/ - if ($bd->error()) { - echo $bd->mensajeError(); - } - - -?> diff --git a/timerbar.js b/timerbar.js deleted file mode 100755 index da5998b..0000000 --- a/timerbar.js +++ /dev/null @@ -1,118 +0,0 @@ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ - -// Timer Bar - Version 1.0 -// Author: Brian Gosselin of http://scriptasylum.com -// Script featured on http://www.dynamicdrive.com - -var loadedcolor='darkgray' ; // PROGRESS BAR COLOR -var unloadedcolor='lightgrey'; // COLOR OF UNLOADED AREA -var bordercolor='navy'; // COLOR OF THE BORDER -var barheight=15; // HEIGHT OF PROGRESS BAR IN PIXELS -var barwidth=300; // WIDTH OF THE BAR IN PIXELS -var waitTime=5; // NUMBER OF SECONDS FOR PROGRESSBAR - -// THE FUNCTION BELOW CONTAINS THE ACTION(S) TAKEN ONCE BAR REACHES 100%. -// IF NO ACTION IS DESIRED, TAKE EVERYTHING OUT FROM BETWEEN THE CURLY BRACES ({}) -// BUT LEAVE THE FUNCTION NAME AND CURLY BRACES IN PLACE. -// PRESENTLY, IT IS SET TO DO NOTHING, BUT CAN BE CHANGED EASILY. -// TO CAUSE A REDIRECT TO ANOTHER PAGE, INSERT THE FOLLOWING LINE: -// window.location="http://redirect_page.html"; -// JUST CHANGE THE ACTUAL URL OF COURSE :) -// @todo prueba -/** - *@todo prueba - *TODO prueba - *@todo: prueba - */ - -var action=function() -{ -alert("Welcome to Dynamic Drive!"); -//window.location="http://www.dynamicdrive.com -} - -//*****************************************************// -//********** DO NOT EDIT BEYOND THIS POINT **********// -//*****************************************************// - -var ns4=(document.layers)?true:false; -var ie4=(document.all)?true:false; -var blocksize=(barwidth-2)/waitTime/10; -var loaded=0; -var PBouter; -var PBdone; -var PBbckgnd; -var Pid=0; -var txt=''; -if(ns4){ -txt+='
'; -txt+=''; -txt+=''; -txt+=''; -txt+=''; -txt+=''; -txt+='
'; -}else{ -txt+=''; -} - -document.write(txt); - -function incrCount(){ -window.status="Loading..."; -loaded++; -if(loaded<0)loaded=0; -if(loaded>=waitTime*10){ -clearInterval(Pid); -loaded=waitTime*10; -setTimeout('hidebar()',100); -} -resizeEl(PBdone, 0, blocksize*loaded, barheight-2, 0); -} - -function hidebar(){ -clearInterval(Pid); -window.status=''; -//if(ns4)PBouter.visibility="hide"; -//else PBouter.style.visibility="hidden"; -action(); -} - -//THIS FUNCTION BY MIKE HALL OF BRAINJAR.COM -function findlayer(name,doc){ -var i,layer; -for(i=0;i0) -if((layer=findlayer(name,layer.document))!=null) -return layer; -} -return null; -} - -function progressBarInit(){ -PBouter=(ns4)?findlayer('PBouter',document):(ie4)?document.all['PBouter']:document.getElementById('PBouter'); -PBdone=(ns4)?PBouter.document.layers['PBdone']:(ie4)?document.all['PBdone']:document.getElementById('PBdone'); -resizeEl(PBdone,0,0,barheight-2,0); -if(ns4)PBouter.visibility="show"; -else PBouter.style.visibility="visible"; -Pid=setInterval('incrCount()',95); -} - -function resizeEl(id,t,r,b,l){ -if(ns4){ -id.clip.left=l; -id.clip.top=t; -id.clip.right=r; -id.clip.bottom=b; -}else id.style.width=r+'px'; -} - -window.onload=progressBarInit; \ No newline at end of file