6 Commits
1.03 ... 1.04

Author SHA1 Message Date
74fdea8e08 Versión 1.04
- Separado el fichero de configuración del de versión
- Arreglado que el menú de la aplicación colapse en resoluciones pequeñas
- Añadidos los ficheros de fuentes que se habían cambiado
- Arreglado el nombre del fichero FPDF.php para que coincida con el nombre de la clase
- Añadido el puerto a la configuración de MySQL y añadido el puerto y el servidor como parámetros a la copia de seguridad
2014-03-19 03:38:03 +01:00
70cf5eb542 Versión 1.04
- Separado el fichero de configuración del de versión
- Arreglado que el menú de la aplicación colapse en resoluciones pequeñas
- Añadidos los ficheros de fuentes que se habían cambiado
- Arreglado el nombre del fichero FPDF.php para que coincida con el nombre de la clase
2014-03-19 03:26:28 +01:00
b680e3142b problemas con el nombre de FPDF.php 2014-03-19 03:24:56 +01:00
a0dd082434 Versión 1.04
- Separado el fichero de configuración del de versión
- Arreglado que el menú de la aplicación colapse en resoluciones pequeñas
- Añadidos los ficheros de fuentes que se habían cambiado
2014-03-19 03:22:53 +01:00
f6a480f828 #9 Corregido el problema de detectar http y https en el enlace de la url de llamada. 2014-03-17 23:45:13 +01:00
c9a3cd83a5 resolve#9 Creadas las etiquetas de artículos con código qr y paginación. 2014-03-16 21:54:32 +01:00
32 changed files with 6444 additions and 4694 deletions

View File

@@ -118,14 +118,14 @@ class AportaContenido {
public function __call($metodo, $parametros) { public function __call($metodo, $parametros) {
switch ($metodo) { // Dependiendo del método invocado switch ($metodo) { // Dependiendo del método invocado
case 'titulo': // devolvemos el título case 'titulo': // devolvemos el título
return APLICACION; return PROGRAMA.VERSION;
case 'usuario': case 'usuario':
if ($this->registrado) if ($this->registrado)
return "Usuario=$this->usuario"; return "Usuario=$this->usuario";
else else
return ''; return '';
case 'fecha': return $this->fechaActual(); case 'fecha': return $this->fechaActual();
case 'aplicacion': return APLICACION; case 'aplicacion': return PROGRAMA.VERSION;
case 'menu': // el menú case 'menu': // el menú
if ($this->registrado) { if ($this->registrado) {
return $this->miMenu->insertaMenu(); return $this->miMenu->insertaMenu();
@@ -237,7 +237,7 @@ class AportaContenido {
if (file_exists($archivo)) { if (file_exists($archivo)) {
unlink($archivo); unlink($archivo);
} }
$comando = escapeshellcmd(MYSQLDUMP . ' -u ' . USUARIO . ' --password=' . CLAVE . ' --result-file=' . $archivo_sql . ' ' . BASEDATOS); $comando = escapeshellcmd(MYSQLDUMP . ' -h ' . SERVIDOR . ' -P ' . PUERTO . ' -u ' . USUARIO . ' --password=' . CLAVE . ' --result-file=' . $archivo_sql . ' ' . BASEDATOS);
$comando2 = escapeshellcmd(GZIP . ' -9f ' . $archivo_sql); $comando2 = escapeshellcmd(GZIP . ' -9f ' . $archivo_sql);
exec($comando); exec($comando);
exec($comando2); exec($comando2);

View File

@@ -1,231 +1,165 @@
<?php <?php
/**
* @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 <http://www.gnu.org/licenses/>.
*
*/
class Configuracion {
private $nombreCentro;
private $numFilas;
private $estilo;
private $servidor;
private $baseDatos;
private $usuario;
private $clave;
private $configuracion="inc/configuracion.inc";
private $confNueva="inc/configuracion.new";
private $confAnterior="inc/configuracion.ant";
private $plantilla;
private $colorLateral;
private $colorFondo;
private $mysqldump; //comando mysqldump para la copia de seguridad
private $gzip; //comando gzip para comprimir la copia de seguridad
public function ejecuta() /**
{ * @package Inventario
$fichero=file_get_contents($this->configuracion,FILE_TEXT); * @copyright Copyright (c) 2008, Ricardo Montañana Gómez
$datos=explode("\n",$fichero); * @license http://www.gnu.org/licenses/gpl-3.0.txt
$grabar=isset($_POST['servidor']); * This file is part of Inventario.
if ($grabar) { * Inventario is free software: you can redistribute it and/or modify
$fsalida=@fopen($this->confNueva,"wb"); * it under the terms of the GNU General Public License as published by
} * the Free Software Foundation, either version 3 of the License, or
foreach($datos as $linea) { * (at your option) any later version.
if (stripos($linea,"DEFINE")!==false) { *
$filtro=str_replace("'","",$linea); * Inventario is distributed in the hope that it will be useful,
list($clave,$valor)=explode(",",$filtro); * but WITHOUT ANY WARRANTY; without even the implied warranty of
list($resto,$campo)=explode("(",$clave); * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
list($valor,$resto)=explode(")",$valor); * GNU General Public License for more details.
//$salida.="[$campo]=[$valor]<br>\n"; *
switch ($campo) { * You should have received a copy of the GNU General Public License
case 'CENTRO': * along with Inventario. If not, see <http://www.gnu.org/licenses/>.
$this->nombreCentro=$valor; *
if ($grabar) { */
$linea=str_replace($valor, $_POST['centro'],$linea); class Configuracion {
$this->nombreCentro=$_POST['centro']; private $configuracion = "inc/configuracion.inc";
} private $confNueva = "inc/configuracion.new";
break; private $confAnterior = "inc/configuracion.ant";
case 'NUMFILAS': private $datosConf;
$this->numFilas=$valor; //Campos del fichero de configuración que se van a editar.
if ($grabar) { private $lista = array('SERVIDOR', 'PUERTO', 'BASEDATOS', 'BASEDATOSTEST', 'USUARIO', 'CLAVE', 'CENTRO', 'NUMFILAS', 'ESTILO', 'PLANTILLA', 'COLORLAT', 'COLORFON', 'MYSQLDUMP', 'GZIP');
$linea=str_replace($valor, $_POST['filas'],$linea); private $campos;
$this->numFilas=$_POST['filas'];
} public function __construct()
break; {
case 'ESTILO': $this->campos = implode(",", $this->lista);
$this->estilo=$valor; }
if ($grabar) {
$linea=str_replace($valor, $_POST['estilo'],$linea); //Hecho público para poder efectuar los tests correspondientes.
$this->estilo=$_POST['estilo']; public function obtieneFichero()
} {
break; return file_get_contents($this->configuracion, FILE_TEXT);
case 'PLANTILLA': }
$this->plantilla=$valor;
if ($grabar) { public function obtieneLista()
$linea=str_replace($valor, $_POST['plantilla'],$linea); {
$this->plantilla=$_POST['plantilla']; return $this->lista;
} }
break;
case 'SERVIDOR': public function obtieneDatos($linea, &$clave, &$valor)
$this->servidor=$valor; {
if ($grabar) { $filtro = str_replace("'", "", $linea);
$linea=str_replace($valor, $_POST['servidor'],$linea); list($clave, $valor) = explode(",", $filtro);
$this->servidor=$_POST['servidor']; list($resto, $campo) = explode("(", $clave);
} list($valor, $resto) = explode(")", $valor);
break; list($resto, $clave) = explode("(", $clave);
case 'BASEDATOS': $valor = trim($valor);
$this->baseDatos=$valor; }
if ($grabar) {
$linea=str_replace($valor, $_POST['baseDatos'],$linea); public function ejecuta() {
$this->baseDatos=$_POST['baseDatos']; $fichero = $this->obtieneFichero();
} $datos = explode("\n", $fichero);
break; $grabar = isset($_POST['SERVIDOR']);
case 'USUARIO': if ($grabar) {
$this->usuario=$valor; $fsalida = @fopen($this->confNueva, "wb");
if ($grabar) {
$linea=str_replace($valor, $_POST['usuario'],$linea);
$this->usuario=$_POST['usuario'];
}
break;
case 'CLAVE':
$this->clave=$valor;
if ($grabar) {
$linea=str_replace($valor, $_POST['clave'],$linea);
$this->clave=$_POST['clave'];
}
break;
case 'COLORLAT':
$valor = trim($valor);
$this->colorLateral = $valor;
if ($grabar) {
$linea=str_replace($valor,$_POST['colorLat'],$linea);
$this->colorLateral=$_POST['colorLat'];
}
break;
case 'COLORFON':
$valor = trim($valor);
$this->colorFondo = $valor;
if ($grabar) {
$linea=str_replace($valor,$_POST['colorFon'],$linea);
$this->colorFondo=$_POST['colorFon'];
}
break;
case 'MYSQLDUMP':
$valor = trim($valor);
$this->mysqldump = $valor;
if ($grabar) {
$linea=str_replace($valor,$_POST['mysqldump'],$linea);
$this->mysqldump=$_POST['mysqldump'];
}
break;
case 'GZIP':
$valor = trim($valor);
$this->gzip = $valor;
if ($grabar) {
$linea=str_replace($valor,$_POST['gzip'],$linea);
$this->gzip=$_POST['gzip'];
}
break;
}
}
if ($grabar) {
$registro=substr($linea,0,2)=="?>"?$linea:$linea."\n";
fwrite($fsalida,$registro);
}
}
$salida.=$this->formulario();
if ($grabar) {
//$salida.='<label class="warn">Configuraci&oacute;n guardada correctamente</label>';
$salida.='<p class="bg-primary">Configuraci&oacute;n guardada correctamente</p>';
fclose($fsalida);
//unlink($this->confAnterior);
rename($this->configuracion,$this->confAnterior);
rename($this->confNueva,$this->configuracion);
unlink($this->confAnterior);
}
return $salida;
} }
private function formulario() foreach ($datos as $linea) {
{ if (stripos($linea, "DEFINE") !== false) {
$coloresLateral = array( "Original" => "#C4FAEC", "Verde" => "#7bd148", "Azul marino" => "#5484ed", "Azul" => "#a4bdfc", "Turquesa" => "#46d6db", //Comprueba que tenga una definición correcta
"Verde claro" => "#7ae7bf", "Verde oscuro" => "#51b749", "Amarillo" => "#fbd75b", "Naranja" => "#ffb878", "Morado" => "#6633FF", $this->obtieneDatos($linea, $clave, $valor);
"Rojo oscuro" => "#dc2127", "P&uacute;rpura" => "#dbadff", "Gris" => "#e1e1e1"); $this->datosConf[$clave] = $valor;
$coloresFondo = array( "Verde" => "#7bd148", "Azul marino" => "#5484ed", "Azul" => "#a4bdfc", "Turquesa" => "#46d6db", if ($grabar && stripos($this->campos, $clave) !== false) {
"Verde claro" => "#7ae7bf", "Verde oscuro" => "#51b749", "Amarillo" => "#fbd75b", "Naranja" => "#ffb878", "Rojo" => "#ff887c", $linea = str_replace($valor, $_POST[$clave], $linea);
"Rojo oscuro" => "#dc2127", "P&uacute;rpura" => "#dbadff", "Gris" => "#e1e1e1", "Original" => '#F3FEC8'); $this->datosConf[$clave] = $_POST[$clave];
$personal=$this->estilo=="personal"?'selected':' ';
$bluecurve=$this->estilo=="bluecurve"?'selected':' ';
$cristal=$this->estilo=="cristal"?'selected':' ';
$normal=$this->plantilla=="normal"? 'selected':' ';
$bootstrap=$this->plantilla=="bootstrap" ? 'selected':' ';
$salida='<center><div class="col-sm-8 col-md-8"><form name="configura" method="post">';
//$salida.='<p align="center"><table border=1 class="tablaDatos"><tbody>';
$salida.='<p align="center"><table border=2 class="table table-hover"><tbody>';
$salida.='<th colspan=2 class="info"><center><b>Preferencias</b></center></th>';
$salida.='<tr><td>Nombre del Centro</td><td><input type="text" name="centro" value="'.$this->nombreCentro.'" size="30" /></td></tr>';
$salida.='<tr><td>N&uacute;mero de filas</td><td><input type="text" name="filas" value="'.$this->numFilas.'" size="3" /></td></tr>';
$salida.='<tr><td style="vertical-align:middle">Plantilla</td><td><select name="plantilla" class="form-control">';
$salida.='<option value="normal" '.$normal.'>normal</option>';
$salida.='<option '.$bootstrap.'>bootstrap</option></select></td></tr>';
$salida.='<tr><td style="vertical-align:middle">Estilo</td><td><select name="estilo" class="form-control">';
$salida.='<option value="personal" '.$personal.'>personal</option>';
$salida.='<option '.$bluecurve.'>bluecurve</option>';
$salida.='<option '.$cristal.'>cristal</option></select></td></tr>';
$salida.='<tr><td style="vertical-align:middle">Color Lateral (bootstrap)</td><td style="vertical-align:middle"><select name="colorLat" id="colorLat" class="form-control">';
foreach ($coloresLateral as $color => $codigo) {
$selec = "";
if ($this->colorLateral == $codigo) {
$selec = "selected";
} }
$salida.='<option value="'.$codigo.'" '.$selec.' >'.$color.'</option>'; //$salida = "DatosConf=".var_export($this->datosConf, true) . "stripos = " . stripos($campos, "GZIP");
//$salida .= "Post=" . var_export($_POST, true);
} }
$salida.='</select></td></tr>'; if ($grabar) {
$salida.='<tr><td style="vertical-align:middle">Color Fondo (bootstrap)</td><td style="vertical-align:middle"><select name="colorFon" id="colorFon" class="form-control">'; $registro = substr($linea, 0, 2) == "?>" ? $linea : $linea . "\n";
foreach ($coloresFondo as $color => $codigo) { fwrite($fsalida, $registro);
$selec = "";
if ($this->colorFondo == $codigo) {
$selec = "selected";
}
$salida.='<option value="'.$codigo.'" '.$selec.' >'.$color.'</option>';
} }
$salida.='</select></td></tr>'; }
$salida.='<th colspan=2 class="danger"><center><b>Base de datos</b></center></th>'; $salida.=$this->formulario();
$salida.='<tr><td>Servidor</td><td><input type="text" name="servidor" value="'.$this->servidor.'" size="30" /></td></tr>'; if ($grabar) {
$salida.='<tr><td>Base de datos</td><td><input type="text" name="baseDatos" value="'.$this->baseDatos.'" size="30" /></td></tr>'; $salida.='<p class="bg-primary">Configuraci&oacute;n guardada correctamente</p>';
$salida.='<tr><td>Usuario</td><td><input type="text" name="usuario" value="'.$this->usuario.'" size="30" /></td></tr>'; fclose($fsalida);
$salida.='<tr><td>Clave</td><td><input type="text" name="clave" value="'.$this->clave.'" size="30" /></td></tr>'; //unlink($this->confAnterior);
$salida.='<tr><td>mysqldump</td><td><input type="text" name="mysqldump" value="'.$this->mysqldump.'" size="30" /></td></tr>'; rename($this->configuracion, $this->confAnterior);
$salida.='<tr><td>gzip</td><td><input type="text" name="gzip" value="'.$this->gzip.'" size="30" /></td></tr>'; rename($this->confNueva, $this->configuracion);
$salida.='<tr align=center><td colspan=2><input type="submit" class="btn btn-primary" align="center" value="Aceptar" name="aceptar" /></td></tr></p>'; unlink($this->confAnterior);
$salida.='</form></div></center>'; }
$salida.="<script> return $salida;
}
private function formulario() {
$coloresLateral = array("Original" => "#C4FAEC", "Verde" => "#7bd148", "Azul marino" => "#5484ed", "Azul" => "#a4bdfc", "Turquesa" => "#46d6db",
"Verde claro" => "#7ae7bf", "Verde oscuro" => "#51b749", "Amarillo" => "#fbd75b", "Naranja" => "#ffb878", "Morado" => "#6633FF",
"Rojo oscuro" => "#dc2127", "P&uacute;rpura" => "#dbadff", "Gris" => "#e1e1e1");
$coloresFondo = array("Verde" => "#7bd148", "Azul marino" => "#5484ed", "Azul" => "#a4bdfc", "Turquesa" => "#46d6db",
"Verde claro" => "#7ae7bf", "Verde oscuro" => "#51b749", "Amarillo" => "#fbd75b", "Naranja" => "#ffb878", "Rojo" => "#ff887c",
"Rojo oscuro" => "#dc2127", "P&uacute;rpura" => "#dbadff", "Gris" => "#e1e1e1", "Original" => '#F3FEC8');
$personal = $this->datosConf['ESTILO'] == "personal" ? 'selected' : ' ';
$bluecurve = $this->datosConf['ESTILO'] == "bluecurve" ? 'selected' : ' ';
$cristal = $this->datosConf['ESTILO'] == "cristal" ? 'selected' : ' ';
$normal = $this->datosConf['PLANTILLA'] == "normal" ? 'selected' : ' ';
$bootstrap = $this->datosConf['PLANTILLA'] == "bootstrap" ? 'selected' : ' ';
$salida = '<center><div class="col-sm-4 col-md-6"><form name="configura" method="post">';
//$salida.='<p align="center"><table border=1 class="tablaDatos"><tbody>';
$salida.='<p align="center"><table border=2 class="table table-hover"><tbody>';
$salida.='<th colspan=2 class="info"><center><b>Preferencias</b></center></th>';
$salida.='<tr><td>Nombre del Centro</td><td><input type="text" name="CENTRO" value="' . $this->datosConf['CENTRO'] . '" size="30" /></td></tr>';
$salida.='<tr><td>N&uacute;mero de filas</td><td><input type="text" name="NUMFILAS" value="' . $this->datosConf['NUMFILAS'] . '" size="3" /></td></tr>';
$salida.='<tr><td style="vertical-align:middle">Plantilla</td><td><select name="PLANTILLA" class="form-control">';
$salida.='<option value="normal" ' . $normal . '>normal</option>';
$salida.='<option ' . $bootstrap . '>bootstrap</option></select></td></tr>';
$salida.='<tr><td style="vertical-align:middle">Estilo</td><td><select name="ESTILO" class="form-control">';
$salida.='<option value="personal" ' . $personal . '>personal</option>';
$salida.='<option ' . $bluecurve . '>bluecurve</option>';
$salida.='<option ' . $cristal . '>cristal</option></select></td></tr>';
$salida.='<tr><td style="vertical-align:middle">Color Lateral (bootstrap)</td><td style="vertical-align:middle"><select name="COLORLAT" id="COLORLAT" class="form-control">';
foreach ($coloresLateral as $color => $codigo) {
$selec = "";
if (trim($this->datosConf['COLORLAT']) == $codigo) {
$selec = "selected";
}
$salida.='<option value="' . $codigo . '" ' . $selec . ' >' . $color . '</option>';
}
$salida.='</select></td></tr>';
$salida.='<tr><td style="vertical-align:middle">Color Fondo (bootstrap)</td><td style="vertical-align:middle"><select name="COLORFON" id="COLORFON" class="form-control">';
foreach ($coloresFondo as $color => $codigo) {
$selec = "";
if (trim($this->datosConf['COLORFON']) == $codigo) {
$selec = "selected";
}
$salida.='<option value="' . $codigo . '" ' . $selec . ' >' . $color . '</option>';
}
$salida.='</select></td></tr>';
$salida.='<th colspan=2 class="danger"><center><b>Base de datos</b></center></th>';
$salida.='<tr><td>Servidor</td><td><input type="text" name="SERVIDOR" value="' . $this->datosConf['SERVIDOR'] . '" size="30" /></td></tr>';
$salida.='<tr><td>Puerto</td><td><input type="text" name="PUERTO" value="' . $this->datosConf['PUERTO'] . '" size="30" /></td></tr>';
$salida.='<tr><td>Base de datos</td><td><input type="text" name="BASEDATOS" value="' . $this->datosConf['BASEDATOS'] . '" size="30" /></td></tr>';
$salida.='<tr><td>Base de datos Tests</td><td><input type="text" name="BASEDATOSTEST" value="' . $this->datosConf['BASEDATOSTEST'] . '" size="30" /></td></tr>';
$salida.='<tr><td>Usuario</td><td><input type="text" name="USUARIO" value="' . $this->datosConf['USUARIO'] . '" size="30" /></td></tr>';
$salida.='<tr><td>Clave</td><td><input type="text" name="CLAVE" value="' . $this->datosConf['CLAVE'] . '" size="30" /></td></tr>';
$salida.='<tr><td>mysqldump</td><td><input type="text" name="MYSQLDUMP" value="' . $this->datosConf['MYSQLDUMP'] . '" size="30" /></td></tr>';
$salida.='<tr><td>gzip</td><td><input type="text" name="GZIP" value="' . $this->datosConf['GZIP'] . '" size="30" /></td></tr>';
$salida.='<tr align=center><td colspan=2><input type="submit" class="btn btn-primary" align="center" value="Aceptar" name="aceptar" /></td></tr></p>';
$salida.='</form></div></center>';
$salida.="<script>
$(document).ready(function() { $(document).ready(function() {
$('select[name=" .'"colorFon"'. "]').on('change', function() { $('select[name=" . '"COLORFON"' . "]').on('change', function() {
$(document.body).css('background-color', $('select[name=" .'"colorFon"'. "]').val()); $(document.body).css('background-color', $('select[name=" . '"COLORFON"' . "]').val());
$('.main').css('background-color', $('select[name=" .'"colorFon"'. "]').val()); $('.main').css('background-color', $('select[name=" . '"COLORFON"' . "]').val());
}); });
$('select[name=" .'"colorLat"'. "]').on('change', function() { $('select[name=" . '"COLORLAT"' . "]').on('change', function() {
$('.sidebar').css('background-color', $('select[name=" .'"colorLat"'. "]').val()); $('.sidebar').css('background-color', $('select[name=" . '"COLORLAT"' . "]').val());
}); });
$('select[name=". '"colorLat"' ."]').simplecolorpicker({theme: 'glyphicons'}); $('select[name=" . '"COLORLAT"' . "]').simplecolorpicker({theme: 'glyphicons'});
$('select[name=" .'"colorFon"' ."]').simplecolorpicker({theme: 'glyphicons'}); $('select[name=" . '"COLORFON"' . "]').simplecolorpicker({theme: 'glyphicons'});
}); });
</script>"; </script>";
//$salida.="<br>fondo=[$this->colorFondo] lateral=[$this->colorLateral]<br>"; return $salida;
return $salida;
}
} }
}
?> ?>

179
EtiquetasPDF.php Normal file
View File

@@ -0,0 +1,179 @@
<?php
/**
* genera un documento PDF a partir de una descripción dada en un archivo XML
* @author Ricardo Montañana <rmontanana@gmail.com>
* @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 <http://www.gnu.org/licenses/>.
*
*/
require_once 'phpqrcode.php';
class EtiquetasPDF {
/**
*
* @var basedatos Controlador de la base de datos
*/
private $bdd;
private $docu;
private $pdf;
private $def;
private $nombreFichero = "tmp/informeEtiquetas.pdf";
/**
* 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
* todo: cambiar este comentario
*/
public function __construct($bdd, $definicion, $registrado)
{
if (!$registrado) {
return 'Debe registrarse para acceder a este apartado';
}
// Recuperamos la definición del informe
$this->def = simplexml_load_file($definicion);
$this->bdd = $bdd;
$this->pdf = new FPDF();
$this->pdf->SetMargins(0.2, 0.2, 0.2);
$this->pdf->SetFont('Arial', '', 11);
$this->pdf->setAutoPageBreak(false);
//echo $def->Titulo.$def->Cabecera;
$this->pdf->setAuthor(AUTOR, true);
$creador = CENTRO . " " . PROGRAMA . VERSION;
$this->pdf->setCreator(html_entity_decode($creador), true);
$this->pdf->setSubject($this->def->Titulo, true);
//$this->pdf->setAutoPageBreak(true, 10);
}
public function crea($definicion)
{
//print_r($def);echo $bdd;die();
// Iniciamos la creación del documento
$this->def = simplexml_load_file($definicion);
//Ejecuta la consulta y prepara las variables de la base de datos.
$this->bdd->ejecuta(trim($this->def->Datos->Consulta));
//Inicializa las variables para el control de las etiquetas.
$this->pdf->AddPage();
$tamLinea = 5;
$fila = -1;
$primero = true; $i = 0;
$url = explode("/", $_SERVER['SCRIPT_NAME']);
$aplicacion = $url[1];
$protocolo = !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443 ? "https://" : "http://";
$enlace = $protocolo . $_SERVER['SERVER_NAME'] . "/" . $aplicacion . "/index.php?elementos&opc=editar&id=";
while($tupla = $this->bdd->procesaResultado()) {
if ($i % 2) {
//Columna 2
$etiq1 = 136;
$etiq2 = 105;
} else {
//Columna 1
$etiq1 = 30;
$etiq2 = 1;
$fila++;
}
if ($i % 14 == 0) {
if (!$primero) {
$this->pdf->AddPage();
$fila = 0;
}
$primero = false;
}
$py = 6 + 41 * $fila;
$enlace2=$enlace.$tupla['idEl'];
$fichero = "tmp/etiq".rand(1000,9999).".png";
QRcode::png($enlace2, $fichero);
$this->pdf->image($fichero, $etiq2, $py, 30, 30);
unlink($fichero);
$this->pdf->setxy($etiq1, $py);
$this->pdf->Cell(30, 10, utf8_decode($tupla['articulo']));
$py+=$tamLinea;
$this->pdf->setxy($etiq1, $py);
$this->pdf->Cell(30, 10, utf8_decode($tupla['marca']));
$py+=$tamLinea;
$this->pdf->setxy($etiq1, $py);
$this->pdf->Cell(30, 10, utf8_decode($tupla['modelo']));
$py+=$tamLinea;
$this->pdf->setxy($etiq1, $py);
$this->pdf->Cell(30, 10, utf8_decode($tupla['numserie']));
$py+=$tamLinea;
$this->pdf->setxy($etiq1, $py);
$this->pdf->Cell(30, 10, $tupla['fechaCompra']);
$py+=$tamLinea-1;
$this->pdf->setxy($etiq2, $py);
$this->pdf->Cell(30, 10, utf8_decode($tupla['ubicacion']));
$py+=$tamLinea-1;
$this->pdf->setxy($etiq2, $py);
$cadena = "idElemento=" . $tupla['idEl'] . " / idArticulo=" . $tupla['idArt'] . " / idUbicacion=" . $tupla['idUbic'];
$this->pdf->Cell(30, 10, $cadena);
$i++;
}
//$this->pdf->MultiCell(0,30,var_export($filas,true));
}
public function cierraPDF()
{
$this->pdf->Close();
$this->docu = $this->pdf->Output('', 'S');
}
public function getContenido()
{
return $this->docu;
}
public function getCabecera()
{
$cabecera = "Content-type: application/pdf";
$cabecera = $cabecera . "Content-length: " . strlen($this->docu);
$cabecera = $cabecera . "Content-Disposition: inline; filename=" . $this->nombreFichero;
return $cabecera;
}
public function guardaArchivo($nombre = "tmp/Informe.pdf")
{
$fichero = fopen($nombre, "w");
fwrite($fichero, $this->getCabecera());
fwrite($fichero, $this->getContenido(), strlen($this->getContenido()));
$this->nombreFichero = $nombre;
fclose($fichero);
}
public function enviaCabecera()
{
header("Content-type: application/pdf");
$longitud = strlen($this->docu);
header("Content-length: $longitud");
header("Content-Disposition: inline; filename=" . $this->nombreFichero);
}
public function imprimeInforme()
{
$this->enviaCabecera();
echo $this->docu;
}
}
?>

View File

View File

@@ -40,12 +40,19 @@ class InformeInventario {
private function listarUbicacion() { private function listarUbicacion() {
$salidaInforme = isset($_POST['salida']) ? $_POST['salida'] : 'pantalla'; $salidaInforme = isset($_POST['salida']) ? $_POST['salida'] : 'pantalla';
if ($salidaInforme == "pantalla") { switch ($salidaInforme) {
$fichero = "xml/inventarioUbicacion.xml"; case "pantalla":
$salida = "tmp/inventarioUbicacion.xml"; $fichero = "xml/inventarioUbicacion.xml";
} else { $salida = "tmp/inventarioUbicacion.xml";
$fichero = "xml/inventarioUbicacionCSV.xml"; break;
$salida = "tmp/inventarioUbicacionCSV.xml"; case "csv":
$fichero = "xml/inventarioUbicacionCSV.xml";
$salida = "tmp/inventarioUbicacionCSV.xml";
break;
case "etiquetas":
$fichero = "xml/inventarioUbicacionEtiquetas.xml";
$salida = "tmp/inventarioUbicacionEtiquetas.xml";
break;
} }
$plantilla = file_get_contents($fichero) or die('Fallo en la apertura de la plantilla ' . $fichero); $plantilla = file_get_contents($fichero) or die('Fallo en la apertura de la plantilla ' . $fichero);
$id = $_POST['id'] == NULL ? $_GET['id'] : $_POST['id']; $id = $_POST['id'] == NULL ? $_GET['id'] : $_POST['id'];
@@ -58,30 +65,47 @@ class InformeInventario {
$plantilla = str_replace("{id}", $id, $plantilla); $plantilla = str_replace("{id}", $id, $plantilla);
$plantilla = str_replace("{Descripcion}", $fila['Descripcion'], $plantilla); $plantilla = str_replace("{Descripcion}", $fila['Descripcion'], $plantilla);
file_put_contents($salida, $plantilla) or die('Fallo en la escritura de la plantilla ' . $salida); file_put_contents($salida, $plantilla) or die('Fallo en la escritura de la plantilla ' . $salida);
if ($salidaInforme == "pantalla") { switch ($salidaInforme) {
$informe = new InformePDF($this->bdd, $salida, true); case "pantalla":
$informe->crea($salida); $informe = new InformePDF($this->bdd, $salida, true);
$informe->cierraPDF(); $informe->crea($salida);
$informe->guardaArchivo("tmp/Informe.pdf"); $informe->cierraPDF();
echo '<script type="text/javascript"> window.open( "tmp/Informe.pdf" ) </script>'; $informe->guardaArchivo("tmp/Informe.pdf");
} else { echo '<script type="text/javascript"> window.open( "tmp/Informe.pdf" ) </script>';
//Genera una hoja de cálculo en formato csv break;
$nombre = "tmp/Ubicacion" . strftime("%Y%m%d") . rand(100, 999) . ".csv"; case "csv":
$hoja = new Csv($this->bdd); //Genera una hoja de cálculo en formato csv
$hoja->crea($nombre); $nombre = "tmp/Ubicacion" . strftime("%Y%m%d") . rand(100, 999) . ".csv";
$hoja->ejecutaConsulta($salida); $hoja = new Csv($this->bdd);
echo '<script type="text/javascript"> window.open( "' . $nombre . '" ) </script>'; $hoja->crea($nombre);
$hoja->ejecutaConsulta($salida);
echo '<script type="text/javascript"> window.open( "' . $nombre . '" ) </script>';
break;
case "etiquetas":
$etiquetas = new EtiquetasPDF($this->bdd, $salida, true);
$etiquetas->crea($salida);
$etiquetas->cierraPDF();
$etiquetas->guardaArchivo("tmp/EtiquetasUbicacion.pdf");
echo '<script type="text/javascript"> window.open( "tmp/EtiquetasUbicacion.pdf" ) </script>';
break;
} }
} }
private function listarArticulo() { private function listarArticulo() {
$salidaInforme = isset($_POST['salida']) ? $_POST['salida'] : 'pantalla'; $salidaInforme = isset($_POST['salida']) ? $_POST['salida'] : 'pantalla';
if ($salidaInforme == "pantalla") { switch ($salidaInforme) {
$fichero = "xml/inventarioArticulo.xml"; case "pantalla":
$salida = "tmp/inventarioArticulo.xml"; $fichero = "xml/inventarioArticulo.xml";
} else { $salida = "tmp/inventarioArticulo.xml";
$fichero = "xml/inventarioArticuloCSV.xml"; break;
$salida = "tmp/inventarioArticuloCSV.xml"; case "csv":
$fichero = "xml/inventarioArticuloCSV.xml";
$salida = "tmp/inventarioArticuloCSV.xml";
break;
case "etiquetas":
$fichero = "xml/inventarioArticuloEtiquetas.xml";
$salida = "tmp/inventarioArticuloEtiquetas.xml";
break;
} }
$plantilla = file_get_contents($fichero) or die('Fallo en la apertura de la plantilla ' . $fichero); $plantilla = file_get_contents($fichero) or die('Fallo en la apertura de la plantilla ' . $fichero);
$id = $_POST['id'] == NULL ? $_GET['id'] : $_POST['id']; $id = $_POST['id'] == NULL ? $_GET['id'] : $_POST['id'];
@@ -96,21 +120,30 @@ class InformeInventario {
$plantilla = str_replace("{Marca}", $fila['marca'], $plantilla); $plantilla = str_replace("{Marca}", $fila['marca'], $plantilla);
$plantilla = str_replace("{Modelo}", $fila['modelo'], $plantilla); $plantilla = str_replace("{Modelo}", $fila['modelo'], $plantilla);
file_put_contents($salida, $plantilla) or die('Fallo en la escritura de la plantilla ' . $salida); file_put_contents($salida, $plantilla) or die('Fallo en la escritura de la plantilla ' . $salida);
if ($salidaInforme == "pantalla") { switch ($salidaInforme) {
$informe = new InformePDF($this->bdd, $salida, true); case "pantalla":
$informe->crea($salida); $informe = new InformePDF($this->bdd, $salida, true);
$informe->cierraPDF(); $informe->crea($salida);
$informe->guardaArchivo("tmp/Informe.pdf"); $informe->cierraPDF();
echo '<script type="text/javascript"> window.open( "tmp/Informe.pdf" ) </script>'; $informe->guardaArchivo("tmp/Informe.pdf");
} else { echo '<script type="text/javascript"> window.open( "tmp/Informe.pdf" ) </script>';
//Genera una hoja de cálculo en formato csv break;
$nombre = "tmp/Articulo" . strftime("%Y%m%d") . rand(100, 999) . ".csv"; case "csv":
$hoja = new Csv($this->bdd); //Genera una hoja de cálculo en formato csv
$hoja->crea($nombre); $nombre = "tmp/Articulo" . strftime("%Y%m%d") . rand(100, 999) . ".csv";
$hoja->ejecutaConsulta($salida); $hoja = new Csv($this->bdd);
echo '<script type="text/javascript"> window.open( "' . $nombre . '" ) </script>'; $hoja->crea($nombre);
$hoja->ejecutaConsulta($salida);
echo '<script type="text/javascript"> window.open( "' . $nombre . '" ) </script>';
break;
case "etiquetas":
$etiquetas = new EtiquetasPDF($this->bdd, $salida, true);
$etiquetas->crea($salida);
$etiquetas->cierraPDF();
$etiquetas->guardaArchivo("tmp/EtiquetasArticulo.pdf");
echo '<script type="text/javascript"> window.open( "tmp/EtiquetasArticulo.pdf" ) </script>';
break;
} }
//header('Location: index.php');
} }
private function listaUbicaciones() { private function listaUbicaciones() {
@@ -149,6 +182,7 @@ class InformeInventario {
$salida.="<br><br><label for='salida'>Salida del informe por:</label>"; $salida.="<br><br><label for='salida'>Salida del informe por:</label>";
$salida.='<div class="radio"><label><input type="radio" name="salida" value="pantalla" checked>Pantalla</label></div>'; $salida.='<div class="radio"><label><input type="radio" name="salida" value="pantalla" checked>Pantalla</label></div>';
$salida.='<div class="radio"><label><input type="radio" name="salida" value="csv">Archivo CSV</label></div>'; $salida.='<div class="radio"><label><input type="radio" name="salida" value="csv">Archivo CSV</label></div>';
$salida.='<div class="radio"><label><input type="radio" name="salida" value="etiquetas">Etiquetas</label></div>';
$salida.="<br><br></fieldset><p>"; $salida.="<br><br></fieldset><p>";
$salida.='<p align="center"><button type=submit class="btn btn-primary">Aceptar</button></p><br></div>' . "\n"; $salida.='<p align="center"><button type=submit class="btn btn-primary">Aceptar</button></p><br></div>' . "\n";
return $salida; return $salida;
@@ -192,7 +226,6 @@ class InformeInventario {
$informe->cierraPDF(); $informe->cierraPDF();
$informe->imprimeInforme(); $informe->imprimeInforme();
} }
} }
?> ?>

View File

@@ -55,7 +55,7 @@ class InformePDF {
//echo $def->Titulo.$def->Cabecera; //echo $def->Titulo.$def->Cabecera;
$this->pdf->Open(); $this->pdf->Open();
$this->pdf->setAuthor(AUTOR,true); $this->pdf->setAuthor(AUTOR,true);
$creador = CENTRO . " " . APLICACION; $creador = CENTRO . " " . PROGRAMA.VERSION;
$this->pdf->setCreator(html_entity_decode($creador),true); $this->pdf->setCreator(html_entity_decode($creador),true);
$this->pdf->setSubject($this->def->Titulo,true); $this->pdf->setSubject($this->def->Titulo,true);
$this->pdf->setAutoPageBreak(true, 10); $this->pdf->setAutoPageBreak(true, 10);

View File

@@ -276,7 +276,7 @@ class Mantenimiento {
private function enlaceBusqueda($pagina) private function enlaceBusqueda($pagina)
{ {
$valor = isset($this->cadenaBusqueda) ? 'value="' . $this->cadenaBusqueda . '"' : ''; $valor = isset($this->cadenaBusqueda) ? 'value="' . $this->cadenaBusqueda . '"' : '';
$salida = '<form name="busqueda" method="POST"><div class="col-sm-4 col-lg-6"><div class="input-group"> $salida = '<form name="busqueda" method="POST"><div class="col-xs-6 col-sm-4 col-md-6 col-lg-6"><div class="input-group">
<input type="text" name="buscar" placeholder="Descripci&oacute;n" class="form-control" ' . $valor . '> <input type="text" name="buscar" placeholder="Descripci&oacute;n" class="form-control" ' . $valor . '>
<span class="input-group-btn"><button class="btn btn-primary" type="button">Buscar</button> <span class="input-group-btn"><button class="btn btn-primary" type="button">Buscar</button>
</span></div></div></form>'; </span></div></div></form>';

View File

@@ -61,7 +61,7 @@ class Pdf_mysql_table extends Fpdf
//Titulo //Titulo
$fecha=strftime("%d-%b-%Y %H:%M"); $fecha=strftime("%d-%b-%Y %H:%M");
$this->SetFont('Arial','',8); $this->SetFont('Arial','',8);
$this->Cell(0,4,html_entity_decode(CENTRO . " " . APLICACION,ENT_COMPAT | ENT_HTML401,'ISO-8859-1'),0,1,'L'); $this->Cell(0,4,html_entity_decode(CENTRO . " " . PROGRAMA . VERSION,ENT_COMPAT | ENT_HTML401,'ISO-8859-1'),0,1,'L');
$this->SetFont('Arial','',18); $this->SetFont('Arial','',18);
$this->Cell(0,6,utf8_decode($this->titulo),0,1,'C'); $this->Cell(0,6,utf8_decode($this->titulo),0,1,'C');
$this->SetFont('Arial','',8); $this->SetFont('Arial','',8);

View File

@@ -3,100 +3,112 @@ include('../inc/configuracion.inc');
header("Content-type: text/css"); header("Content-type: text/css");
?> ?>
/* /*
* Base structure * Base structure
*/ */
/* Move down content because we have a fixed navbar that is 50px tall */ /* Move down content because we have a fixed navbar that is 50px tall */
body { body {
padding-top: 50px; padding-top: 50px;
background-color: <?php echo COLORFON; ?>; /*Fondo*/ background-color: <?php echo COLORFON; ?>; /*Fondo*/
} }
/* /*
* Global add-ons * Global add-ons
*/ */
.sub-header { .sub-header {
padding-bottom: 10px; padding-bottom: 10px;
border-bottom: 1px solid #eee; border-bottom: 1px solid #eee;
} }
/* /*
* Sidebar * Sidebar
*/ */
/* Hide for mobile, show later */ /* Hide for mobile, show later */
.sidebar { .sidebar {
display: none; display: none;
}
@media (max-width: 767px) {
.sidebar {
top: 50px;
bottom: 150px;
background-color: <?php echo COLORLAT; ?>
}
} }
@media (min-width: 768px) { @media (min-width: 768px) {
.sidebar { .sidebar {
position: fixed; position: fixed;
top: 51px; top: 51px;
bottom: 0; bottom: 0;
left: 0; left: 0;
z-index: 1000; z-index: 1000;
display: block; display: block;
padding: 5px; padding: 5px;
overflow-x: hidden; overflow-x: hidden;
overflow-y: auto; /* Scrollable contents if viewport is shorter than content. */ overflow-y: auto; /* Scrollable contents if viewport is shorter than content. */
background-color: <?php echo COLORLAT; ?>;/*Lateral*/ background-color: <?php echo COLORLAT; ?>;/*Lateral*/
border-right: 1px solid #eee; border-right: 1px solid #eee;
} }
} }
/* Sidebar navigation */ /* Sidebar navigation */
.nav-sidebar { .nav-sidebar {
margin-right: -6px; /* 20px padding + 1px border */ margin-right: -6px; /* 20px padding + 1px border */
margin-bottom: 1px; margin-bottom: 1px;
margin-left: -1px; margin-left: -1px;
} }
.nav-sidebar > li > a { .nav-sidebar > li > a {
padding-right: 5px; padding-right: 5px;
padding-left: 5px; padding-left: 5px;
} }
.nav-sidebar > .active > a { .nav-sidebar > .active > a {
color: #fff; color: #fff;
background-color: #428bca; background-color: #428bca;
} }
/* /*
* Main content * Main content
*/ */
.main { .main {
padding: 10px; padding: 10px;
}
@media (max-width: 767px) {
.main{
margin-top: 50px;
}
} }
@media (min-width: 768px) { @media (min-width: 768px) {
.main { .main {
padding-right: 20px; padding-right: 20px;
padding-left: 20px; padding-left: 20px;
} }
} }
.main .page-header { .main .page-header {
margin-top: 0; margin-top: 0;
} }
/* /*
* Placeholder dashboard ideas * Placeholder dashboard ideas
*/ */
.placeholders { .placeholders {
margin-bottom: 5px; margin-bottom: 5px;
text-align: center; text-align: center;
} }
.placeholders h4 { .placeholders h4 {
margin-bottom: 0; margin-bottom: 0;
} }
.placeholder { .placeholder {
margin-bottom: 5px; margin-bottom: 5px;
} }
.placeholder img { .placeholder img {
display: inline-block; display: inline-block;
border-radius: 25%; border-radius: 25%;
} }

1804
fpdf.php

File diff suppressed because it is too large Load Diff

View File

@@ -1,39 +1,41 @@
<?php <?php
/**
* Fichero de configuración donde se introducirán los valores para /**
* la conexión con el servidor MySQL y otros para personalizar la aplicación. * Fichero de configuración donde se introducirán los valores para
* @package Inventario * la conexión con el servidor MySQL y otros para personalizar la aplicación.
* @copyright Copyright (c) 2008, Ricardo Montañana Gómez * @package Inventario
* @license http://www.gnu.org/licenses/gpl-3.0.txt * @copyright Copyright (c) 2008, Ricardo Montañana Gómez
* This file is part of Inventario. * @license http://www.gnu.org/licenses/gpl-3.0.txt
* Inventario is free software: you can redistribute it and/or modify * This file is part of Inventario.
* it under the terms of the GNU General Public License as published by * Inventario is free software: you can redistribute it and/or modify
* the Free Software Foundation, either version 3 of the License, or * it under the terms of the GNU General Public License as published by
* (at your option) any later version. * 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 * Inventario is distributed in the hope that it will be useful,
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * but WITHOUT ANY WARRANTY; without even the implied warranty of
* GNU General Public License for more details. * 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 <http://www.gnu.org/licenses/>. * You should have received a copy of the GNU General Public License
* * along with Inventario. If not, see <http://www.gnu.org/licenses/>.
*/ *
define('AUTOR','Ricardo Montañana Gómez'); */
define('SERVIDOR','localhost'); //Ubicación del servidor MySQL require_once 'version.inc';
define('BASEDATOS','Inventario2'); //Nombre de la base de datos.
define('USUARIO','test'); //Usuario con permisos de lectura/escritura en la base de datos define('SERVIDOR', 'localhost'); //Ubicación del servidor MySQL
define('CLAVE','tset'); //contraseña del usuario. define('PUERTO', '3306'); //Puerto donde se conecta a MySQL
define('VERSION','1.03'); define('BASEDATOS', 'Inventario2'); //Nombre de la base de datos.
define('PROGRAMA','Gesti&oacute;n de Inventario.'); define('BASEDATOSTEST', 'Inventario_test'); //Base de datos para los tests.
define('CENTRO','I.E.S.O. Pascual Serrano'); define('USUARIO', 'test'); //Usuario con permisos de lectura/escritura en la base de datos
define('APLICACION',PROGRAMA.VERSION); define('CLAVE', 'tset'); //contraseña del usuario.
define('NUMFILAS',17); // Número de registros a mostrar en las pantallas de consulta iniciales define('PROGRAMA', 'Gesti&oacute;n de Inventario.');
define('PAUSA',2);//Nº segundos de pausa para mostrar mensaje id insertado define('CENTRO', 'I.E.S.O. Pascual Serrano');
define('ESTILO','personal'); //Estilo de los iconos de edición (personal, personal, personal) define('NUMFILAS', '17'); // Número de registros a mostrar en las pantallas de consulta iniciales
define('PLANTILLA','bootstrap'); //Estilo de la plantilla y recursos a utilizar define('PAUSA', '2'); //Nº segundos de pausa para mostrar mensaje id insertado
define('COLORLAT', '#7ae7bf'); //Color de la barra de menú lateral define('ESTILO', 'personal'); //Estilo de los iconos de edición (personal, personal, personal)
define('PLANTILLA', 'bootstrap'); //Estilo de la plantilla y recursos a utilizar
define('COLORLAT', '#46d6db'); //Color de la barra de menú lateral
define('COLORFON', '#a4bdfc'); //Color del fondo de la pantalla define('COLORFON', '#a4bdfc'); //Color del fondo de la pantalla
define('MYSQLDUMP', '/usr/local/bin/mysqldump'); //camino a mysqldump define('MYSQLDUMP', '/usr/local/bin/mysqldump'); //camino a mysqldump
define('GZIP', '/usr/bin/gzip'); //Camino a gzip define('GZIP', '/usr/bin/gzip'); //Camino a gzip

27
inc/version.inc Normal file
View File

@@ -0,0 +1,27 @@
<?php
/**
* Fichero de configuración donde se introducirán los valores
* de autor y de la versión
* @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 <http://www.gnu.org/licenses/>.
*
*/
define('AUTOR', 'Ricardo Montañana Gómez');
define('VERSION', '1.04');
?>

3312
phpqrcode.php Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -24,7 +24,7 @@
<div class="navbar navbar-inverse navbar-fixed-top" role="navigation"> <div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container-fluid"> <div class="container-fluid">
<div class="navbar-header"> <div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".sidebar">
<span class="sr-only">Toggle navigation</span> <span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span> <span class="icon-bar"></span>
<span class="icon-bar"></span> <span class="icon-bar"></span>
@@ -38,7 +38,7 @@
</div> </div>
<div class="navbar-collapse collapse"> <div class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
<li><a href="#">{usuario}</a></li> <!--<li><a href="#">{usuario}</a></li>-->
<li><a href="#">{fecha}</a></li> <li><a href="#">{fecha}</a></li>
<li>{control}</li> <li>{control}</li>
</ul> </ul>

View File

@@ -0,0 +1,26 @@
<?xml version="1.0"?>
<Informe>
<Titulo Texto="{Descripcion}" id="{id}"/>
<Datos>
<Consulta>
select A.id as id, A.Descripcion as articulo, A.Marca as marca, A.Modelo as modelo, E.id as idEl, U.id as idUbic,U.Descripcion as ubicacion,E.numserie as numserie,
E.fechaCompra as fechaCompra,E.Cantidad as cantidad, E.Cantidad as cantReal, 'N' as Baja
from Elementos E, Articulos A, Ubicaciones U where A.id=E.id_Articulo and U.id=E.id_Ubicacion
and A.id='{id}' order by U.Descripcion,numserie;
</Consulta>
</Datos>
<Pagina Orientacion="P" Formato="A4">
<Cabecera>Articulo</Cabecera>
<Cuerpo>
<Col Nombre="Baja" Titulo="Baja"/>
<Col Nombre="idEl" Titulo="idElem"/>
<Col Nombre="idUbic" Titulo="idUbic"/>
<Col Nombre="articulo" Titulo="Articulo"/>
<Col Nombre="ubicacion" Titulo="Ubicación"/>
<Col Nombre="numserie" Titulo="N Serie"/>
<Col Nombre="fechaCompra" Titulo="Fecha C." />
<Col Nombre="cantidad" Titulo="Cantidad"/>
<Col Nombre="cantReal" Titulo="Cant. Real"/>
</Cuerpo>
</Pagina>
</Informe>

View File

@@ -0,0 +1,29 @@
<?xml version="1.0"?>
<Informe>
<Titulo Texto="{Descripcion}" id="{id}"/>
<Datos>
<Consulta>
select A.id as idArt,E.id as idEl,U.id as idUbic,U.Descripcion as ubicacion,A.Marca as marca,A.Modelo as modelo,E.numSerie as numserie,
E.fechaCompra as fechaCompra,A.Descripcion as articulo,E.Cantidad as cantidad, E.Cantidad as cantReal, 'N' as Baja
from Elementos E, Articulos A, Ubicaciones U where A.id=E.id_Articulo and U.id=E.id_Ubicacion
and U.id='{id}' order by A.descripcion;
</Consulta>
</Datos>
<Pagina Horizontal="2" Vertical="7">
<Cabecera>Ubicacion</Cabecera>
<Cuerpo>
<Col Nombre="Qr" Valor="{url}"/>
<Col Nombre="idEl" Titulo="idElem"/>
<Col Nombre="idArt" Titulo="idArt"/>
<Col Nombre="idUbic" Titulo="idUbic"/>
<Col Nombre="ubicacion" Titulo="Ubicacion"/>
<Col Nombre="articulo" Titulo="Artículo"/>
<Col Nombre="marca" Titulo="Marca"/>
<Col Nombre="modelo" Titulo="Modelo"/>
<Col Nombre="numserie" Titulo="N Serie"/>
<Col Nombre="fechaCompra" Titulo="Fecha C." />
<Col Nombre="cantidad" Titulo="Cantidad"/>
<Col Nombre="cantReal" Titulo="Cant. Real"/>
</Cuerpo>
</Pagina>
</Informe>