23 Commits
1.06 ... 1.082

Author SHA1 Message Date
a25e8a6c1a Merge branch 'hotfix/Fix#30BotonBuscarImg.data' 2014-04-09 13:09:29 +02:00
rmontanana
a34058f1c5 Actualización de Changelog y de la versión 2014-04-09 13:09:12 +02:00
rmontanana
91c55fd3f6 Fix #30. Arreglado el que no hacía nada el botón de buscar y cambiado el texto por el icono.
Arreglado un problema con los directorios tmp e img.data que no estaban en git y no se creaban.
2014-04-09 13:06:38 +02:00
25e0264b27 Cambiado .gitignore para ignorar las imágenes dentro de img.data 2014-04-08 23:24:33 +02:00
f0e76f92b5 Eliminada la imagen de ejemplo 2014-04-08 23:16:35 +02:00
f6fec3bdf3 Merge branch 'release/1.081'
* release/1.081:
  -Fix #29. Añade el programa instalar.php en el proceso de instalación en README.md -Fix #29. Añadida la tabla de módulos/bibliotecas utilizados en los créditos. -Fix #28. Corrige que el informe pedido desde matenimiento salga en una ventana nueva.
2014-04-08 22:01:29 +02:00
336cab29ef -Fix #29. Añade el programa instalar.php en el proceso de instalación en README.md
-Fix #29. Añadida la tabla de módulos/bibliotecas utilizados en los créditos.
-Fix #28. Corrige que el informe pedido desde matenimiento salga en una ventana nueva.
2014-04-08 21:06:31 +02:00
4cf4354dbc Merge branch 'hotfix/errorInformeManten#27' 2014-04-07 23:54:10 +02:00
17c907795f Merge branch 'hotfix/errorInformeManten#27' into develop 2014-04-07 23:54:10 +02:00
rmontanana
a8cad22add Corregido el problema de que no funciona la impresión de informes desde el mantenimiento. Close #27 2014-04-07 23:52:38 +02:00
70ee68d14d Merge branch 'release/1.08' 2014-04-07 23:13:10 +02:00
1bfeb891e6 Merge branch 'release/1.08' into develop 2014-04-07 23:13:10 +02:00
rmontanana
4b5c927081 Actualizada la versión 2014-04-07 23:10:23 +02:00
a3a8cd69b2 Merge branch 'feature/instalador' into develop 2014-04-07 23:02:23 +02:00
rmontanana
aa84cabf83 Quitados los comentarios y el código anteriormente utilizado 2014-04-07 23:01:25 +02:00
rmontanana
911af4825f -Los informes aparecen ahora en la pantalla de la aplicación embebidos.
-Añadido un calendario al pulsar sobre la fecha en la cabecera de la aplicación.
-Corregido pequeño problema de margen en resoluciones pequeñas donde se solapaba parte del menú.
-Quitados los logos de GPLv3, MySQL y Apache
-Inventario.php llama al instalador si la aplicación no está instalada
2014-04-07 22:56:09 +02:00
rmontanana
1a5266d201 solve #23 Arreglado añadiendo en insertar un valor null en el caso de "NOHACERNADA"
Arreglado pequeño problema de formato del grid bootstrap en resoluciones pequeñas.
2014-04-06 04:15:32 +02:00
ce08900d13 Programa de instalación casi terminado. Incluido validador de formularios javascript. 2014-04-05 04:33:06 +02:00
33d8648eff Primer paso del programa de instalación 2014-04-01 01:54:58 +02:00
1a39a4589a Merge branch 'release/1.07'
* release/1.07:
  Versión 1.07
  -Añadido bootstrap-select a la solicitud de informes de inventario de esta forma se pueden buscar artículos o ubicaciones en el select -Añadido bootstrap-select al mantenimiento para que en el alta de elementos se puedan buscar artículos o ubicaciones en el el select -Corregido un problema que permitía cambiar fechas en el formulario de bajas
2014-03-31 18:41:41 +02:00
fce2119543 Versión 1.07 2014-03-31 18:39:54 +02:00
2bab18ec4a -Añadido bootstrap-select a la solicitud de informes de inventario de esta forma se pueden buscar artículos o ubicaciones en el select
-Añadido bootstrap-select al mantenimiento para que en el alta de elementos se puedan buscar artículos o ubicaciones en el el select
-Corregido un problema que permitía cambiar fechas en el formulario de bajas
2014-03-30 19:32:09 +02:00
72557aab64 Merge branch 'release/1.06' into develop
* release/1.06:
  Añadido el campo id como ordenable en la creación de la base de datos (articulos y ubicaciones) y en los mantenimientos de usuarios y elementos.
2014-03-29 00:26:32 +01:00
29 changed files with 940 additions and 101 deletions

2
.gitignore vendored
View File

@@ -1,4 +1,2 @@
nbproject nbproject
tmp/*
.DS_Store .DS_Store
/img.data/

View File

@@ -28,6 +28,40 @@ define('FORMULARIO_ACCESO', '<form name="formulario_acceso" action="index.php?re
'<br><br><button type="submit" name="iniciar" class="btn btn-primary">Iniciar <span class="glyphicon glyphicon-log-in"></span></button></form>'); '<br><br><button type="submit" name="iniciar" class="btn btn-primary">Iniciar <span class="glyphicon glyphicon-log-in"></span></button></form>');
define('MENSAJE_DEMO', 'Puede Iniciar sesi&oacute;n con<br>usuario <i><b>demo</b></i><br>contrase&ntilde;a <i>demo</i><br>'); define('MENSAJE_DEMO', 'Puede Iniciar sesi&oacute;n con<br>usuario <i><b>demo</b></i><br>contrase&ntilde;a <i>demo</i><br>');
define('USUARIO_INCORRECTO', '<label class="error">Usuario y clave incorrectos!</label><br><br>'); define('USUARIO_INCORRECTO', '<label class="error">Usuario y clave incorrectos!</label><br><br>');
define('CREDITOS', '<div class="modal fade" tabindex="-1" id="creditos" role="dialog" aria-labelledby="modalCreditos" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4>Créditos</h4>
</div>
<div class="modal-body">
<div class="jumbotron">
<img src="img/logo.png" class="img-responsive img-rounded" style="float:left">
<h1>Inventario2</h1>
<p> Aplicación para controlar el inventario de un centro educativo.</p>
<p>En la aplicación se hace uso de los siguientes módulos y/o bibliotecas</p>
<table class="table table-condensed">
<thead><tr><th>Biblioteca/Módulo</th><th>Licencia</th></tr></thead>
<tbody>
<tr><td><a href="http://getbootstrap.com/" target="_blank">Twitter Bootstrap</a></td><td><a target="_blank" href="https://github.com/twbs/bootstrap/blob/master/LICENSE">MIT</a></td>
<tr><td><a href="http://www.fpdf.org/" target="_blank">FPDF</a></td><td>Libre</td>
<tr><td><a href="http://phpqrcode.sourceforge.net/" target="_blank">PHP QR Code Enconder</a></td><td><a target="_blank" href="http://www.gnu.org/licenses/lgpl-3.0.txt">LGPL</a></td>
<tr><td><a href="http://stefangabos.ro/php-libraries/zebra-image/" target="_blank">Zebra_Image</a></td><td><a target="_blank" href="http://www.gnu.org/licenses/lgpl-3.0.txt">LGPL</a></td>
<tr><td><a href="http://jasny.github.io/bootstrap/" target="_blank">Jasny Bootstrap</a></td><td><a target="_blank" href="http://www.apache.org/licenses/LICENSE-2.0">Apache 2.0</a></td>
<tr><td><a href="http://1000hz.github.io/bootstrap-validator/" target="_blank">Bootstrap Validator</a></td><td><a target="_blank" href="https://github.com/1000hz/bootstrap-validator/blob/master/LICENSE">MIT</a></td>
<tr><td><a href="https://github.com/tkrotoff/jquery-simplecolorpicker" target="_blank">jquery-simplecolorpicker</a></td><td><a target="_blank" href="https://github.com/tkrotoff/jquery-simplecolorpicker/blob/master/LICENSE.txt">MIT</a></td>
<tr><td><a href="http://eonasdan.github.io/bootstrap-datetimepicker/" target="_blank">Bootstrap datetimepicker</a></td><td><a target="_blank" href="https://github.com/Eonasdan/bootstrap-datetimepicker/blob/master/src/js/bootstrap-datetimepicker.js">MIT</a></td>
<tr><td><a href="http://silviomoreto.github.io/bootstrap-select/" target="_blank">Bootstrap-select</a></td><td><a target="_blank" href="https://github.com/silviomoreto/bootstrap-select">MIT</a></td>
</tbody>
</table>
<p><h5>Copyright &copy; 2008-2014 Ricardo Montañana Gómez</h4>
<h5><small>Esta aplicación se distribuye con licencia <a target="_blank" href="http://www.gnu.org/licenses/gpl-3.0.html">GPLv3 </a></small></h5></p>
</div>
</div>
</div>
</div>
</div>');
// Esta clase aportará el contenido a la plantilla // Esta clase aportará el contenido a la plantilla
class AportaContenido { class AportaContenido {
@@ -67,7 +101,7 @@ class AportaContenido {
* @var array Permisos del usuario * @var array Permisos del usuario
*/ */
private $perfil; private $perfil;
/** /**
* *
* @var array Datos pasados en la URL * @var array Datos pasados en la URL
@@ -83,7 +117,8 @@ class AportaContenido {
* @param array $perfil Permisos de acceso del usuario * @param array $perfil Permisos de acceso del usuario
* @param String $opcion Opción elegida por el usuario * @param String $opcion Opción elegida por el usuario
*/ */
public function __construct($baseDatos, $registrado, $usuario, $perfil, $opcion) { public function __construct($baseDatos, $registrado, $usuario, $perfil, $opcion)
{
$this->bdd = $baseDatos; $this->bdd = $baseDatos;
$this->miMenu = new Menu('inc/inventario.menu'); $this->miMenu = new Menu('inc/inventario.menu');
$this->registrado = $registrado; $this->registrado = $registrado;
@@ -98,7 +133,8 @@ class AportaContenido {
* @param string $idioma idioma para formatear la fecha, p.ej. es_ES * @param string $idioma idioma para formatear la fecha, p.ej. es_ES
* @return string * @return string
*/ */
public function fechaActual($formato = '', $idioma = 'es_ES') { public function fechaActual($formato = '', $idioma = 'es_ES')
{
if ($formato == '') if ($formato == '')
$formato = "%d-%b-%y"; $formato = "%d-%b-%y";
setlocale(LC_TIME, $idioma); setlocale(LC_TIME, $idioma);
@@ -109,7 +145,8 @@ class AportaContenido {
* *
* @return string Mensaje el usuario debe registrarse. * @return string Mensaje el usuario debe registrarse.
*/ */
private function mensajeRegistro() { private function mensajeRegistro()
{
return 'Debe registrarse para acceder a este apartado'; return 'Debe registrarse para acceder a este apartado';
} }
@@ -121,17 +158,30 @@ class AportaContenido {
* @param string $parametros Parámetros del método * @param string $parametros Parámetros del método
* @return string Contenido devuelto por el método * @return string Contenido devuelto por el método
*/ */
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 PROGRAMA." v".VERSION; return PROGRAMA . " v" . 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':
case 'aplicacion': return PROGRAMA." v".VERSION; $script = '<script type="text/javascript">
$(function () {
$(' . "'#fechaCabecera'" . ").datetimepicker({
pick12HourFormat: false,
language: 'es',
pickTime: false
});
});
</script>";
$campo = '<input type="hidden" name="fechaCabecera" id="fechaCabecera" value="' . $this->fechaActual("%d/%m/%Y") . '">';
$etiqueta = '<label for="fechaCabecera" onClick="$(' . "'#fechaCabecera'" . ").data('DateTimePicker').show();" . '">' . $this->fechaActual() . '</label>';
return $etiqueta . $campo . $script;
case 'aplicacion': return PROGRAMA . " v" . VERSION;
case 'menu': // el menú case 'menu': // el menú
if ($this->registrado) { if ($this->registrado) {
return $this->miMenu->insertaMenu(); return $this->miMenu->insertaMenu();
@@ -180,14 +230,19 @@ class AportaContenido {
// } // }
list($opcion, $parametro) = explode("&", $this->opcionActual); list($opcion, $parametro) = explode("&", $this->opcionActual);
switch ($opcion) { switch ($opcion) {
case 'bienvenido':
$mensaje = '<div class="alert alert-success">';
$mensaje .= 'Bienvenid@ ' . $this->usuario . '</div>';
case 'principal': // contenido inicial case 'principal': // contenido inicial
return '<br><br><center><img src="img/logo.png" alt="' . PROGRAMA . '">' .
'<br><label>' . CENTRO . '</label></center><br><br>' . PIE; $creditos = "$('#creditos').modal({keyboard: false});";
return $mensaje . '<br><br><center><img src="img/logo.png" alt="' . PROGRAMA . '" onClick="' . $creditos . '" >' .
'<br><br><label onClick="' . $creditos . '">' . CENTRO . '</label></center><br><br>' . CREDITOS;
case 'articulos': case 'articulos':
case 'ubicaciones': case 'ubicaciones':
case 'test': case 'test':
case 'elementos': case 'elementos':
$this->DatosURL(); $this->cargaDatosURL();
if ($this->datosURL['opc'] == "informe") { if ($this->datosURL['opc'] == "informe") {
if (!$this->pefil['Informe']) { if (!$this->pefil['Informe']) {
$this->procesaURL(); $this->procesaURL();
@@ -204,8 +259,7 @@ class AportaContenido {
$informe = new InformePDF($this->bdd, $salida, $this->registrado); $informe = new InformePDF($this->bdd, $salida, $this->registrado);
$informe->crea($salida); $informe->crea($salida);
$informe->cierraPDF(); $informe->cierraPDF();
$informe->imprimeInforme(); return $this->devuelveInforme($informe);
return;
} else { } else {
return $this->mensajePermisos("Informes"); return $this->mensajePermisos("Informes");
} }
@@ -235,8 +289,7 @@ class AportaContenido {
$informe = new InformePDF($this->bdd, $salida, $this->registrado); $informe = new InformePDF($this->bdd, $salida, $this->registrado);
$informe->crea($salida); $informe->crea($salida);
$informe->cierraPDF(); $informe->cierraPDF();
$informe->imprimeInforme(); return $this->devuelveInforme($informe);
return;
} else { } else {
return $this->mensajePermisos("Informes"); return $this->mensajePermisos("Informes");
} }
@@ -246,12 +299,6 @@ class AportaContenido {
} else { } else {
return $this->mensajePermisos('Usuarios'); return $this->mensajePermisos('Usuarios');
} }
case 'bienvenido': // El usuario quiere iniciar sesión
$mensaje = '<div class="alert alert-success">';
$mensaje .= 'Bienvenid@ ' . $this->usuario . '</div><br><br><center><img src="img/codigoBarras.png" alt="' . PROGRAMA . '">' .
'<br><label>' . CENTRO . '</label></center><br><br>' . PIE;;
return $mensaje;
case 'configuracion': case 'configuracion':
if ($this->perfil['Config']) { if ($this->perfil['Config']) {
$conf = new Configuracion(); $conf = new Configuracion();
@@ -266,17 +313,6 @@ class AportaContenido {
} else { } else {
return $this->mensajePermisos('Informes'); return $this->mensajePermisos('Informes');
} }
case 'descuadres':
if ($this->perfil['Informe']) {
$enlace = 'xml/informe' . ucfirst($opcion) . '.xml';
$informe = new InformePDF($this->bdd, $enlace, $this->registrado);
$informe->crea($enlace);
$informe->cierraPDF();
$informe->imprimeInforme();
return;
} else {
return $this->mensajePermisos('Informes');
}
case 'importacion': case 'importacion':
if ($this->perfil['Modificacion'] && $this->perfil['Borrado']) { if ($this->perfil['Modificacion'] && $this->perfil['Borrado']) {
$import = new Importacion($this->bdd, $this->registrado); $import = new Importacion($this->bdd, $this->registrado);
@@ -318,6 +354,7 @@ class AportaContenido {
return "Marca {$metodo} queda sin procesar"; return "Marca {$metodo} queda sin procesar";
} }
} }
public function cargaDatosURL() public function cargaDatosURL()
{ {
$this->datosURL['opc'] = isset($_GET['opc']) ? $_GET['opc'] : 'inicial'; $this->datosURL['opc'] = isset($_GET['opc']) ? $_GET['opc'] : 'inicial';
@@ -327,16 +364,31 @@ class AportaContenido {
$this->datosURL['buscar'] = isset($_GET['buscar']) ? $_GET['buscar'] : null; $this->datosURL['buscar'] = isset($_GET['buscar']) ? $_GET['buscar'] : null;
$this->datosURL['id'] = isset($_GET['id']) ? $_GET['id'] : null; $this->datosURL['id'] = isset($_GET['id']) ? $_GET['id'] : null;
} }
/** /**
* *
* @param string $tipo * @param string $tipo
* @return string * @return string
*/ */
public function mensajePermisos($tipo) { public function mensajePermisos($tipo)
{
return $this->panel("ERROR", "No tiene permiso para acceder a $tipo", "danger"); return $this->panel("ERROR", "No tiene permiso para acceder a $tipo", "danger");
} }
public function panel($cabecera, $mensaje, $tipo) { private function devuelveInforme($informe)
{
$letras = "abcefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
$nombre = "tmp/informe" . substr(str_shuffle($letras), 0, 10) . ".pdf";
$informe->guardaArchivo($nombre);
return '<div class="container">
<!--<a href="' . $nombre . '" target="_blank"><span class="glyphicon glyphicon-cloud-download" style="font-size:1.5em;"></span>Descargar Informe</a>-->
<object data="' . $nombre . '" type="application/pdf" width="100%" height="700" style="float:left;">
</object>
</div>';
}
public function panel($cabecera, $mensaje, $tipo)
{
$panel = '<div class="panel panel-' . $tipo . '"><div class="panel-heading">'; $panel = '<div class="panel panel-' . $tipo . '"><div class="panel-heading">';
$panel .= '<h3 class="panel-title">' . $cabecera . '</h3></div>'; $panel .= '<h3 class="panel-title">' . $cabecera . '</h3></div>';
$panel .= '<div class="panel-body">'; $panel .= '<div class="panel-body">';
@@ -344,7 +396,6 @@ class AportaContenido {
$panel .= '</div>'; $panel .= '</div>';
return $panel; return $panel;
} }
} }
?> ?>

View File

@@ -1,3 +1,28 @@
Versión 1.082 09-04-2014
-Ahora git tiene en cuenta los directorios tmp e img.data y no tiene en cuenta su contenido
-Fix #30. Arreglado el botón de buscar que no enviaba los datos. Cambiado el texto por la lupa.
Versión 1.081 08-04-2014
-Fix #29. Añade el programa instalar.php en el proceso de instalación en README.md
-Fix #29. Añadida la tabla de módulos/bibliotecas utilizados en los créditos.
-Fix #28. Corrige que el informe pedido desde matenimiento salga en una ventana nueva.
Versión 1.08 07-04-2014
-Los informes aparecen ahora en la pantalla de la aplicación embebidos.
-Añadido un calendario al pulsar sobre la fecha en la cabecera de la aplicación.
-Corregido pequeño problema de margen en resoluciones pequeñas donde se solapaba parte del menú.
-Quitados los logos de GPLv3, MySQL y Apache
-Inventario.php llama al instalador si la aplicación no está instalada
-Añadido dialogo modal de Créditos cuando se pulsa sobre el gráfico de código de barras de la aplicación o sobre el nombre del centro
-Quitados los usuarios de ejemplo en el archivo setup.sql
-Creado el programa instalar.php que permitirá configurar el acceso a la base de datos, comprobar la configuración del servidor y la creación del usuario administrador
-Añadido un parámetro en el archivo configuracion.inc que permite o no ejecutar el programa instalar.php
Versión 1.07 31-03-2014
-Añadido bootstrap-select a la solicitud de informes de inventario de esta forma se pueden buscar artículos o ubicaciones en el select
-Añadido bootstrap-select al mantenimiento para que en el alta de elementos se puedan buscar artículos o ubicaciones en el el select
-Corregido un problema que permitía cambiar fechas en el formulario de bajas
Versión 1.06 28-03-2014 Versión 1.06 28-03-2014
-Configuracion: Añadido icono en el botón de aceptar. -Configuracion: Añadido icono en el botón de aceptar.
Cambiado el mensaje de éxito en la grabación de los cambios. Cambiado el mensaje de éxito en la grabación de los cambios.

View File

@@ -23,11 +23,13 @@ class InformeInventario {
private $bdd; private $bdd;
public function __construct($baseDatos) { public function __construct($baseDatos)
{
$this->bdd = $baseDatos; $this->bdd = $baseDatos;
} }
public function ejecuta() { public function ejecuta()
{
$opc = $_GET['opc']; $opc = $_GET['opc'];
switch ($opc) { switch ($opc) {
case 'Ubicacion':return $this->formularioUbicacion(); case 'Ubicacion':return $this->formularioUbicacion();
@@ -35,10 +37,33 @@ class InformeInventario {
case 'listarArticulo':return $this->listarArticulo(); case 'listarArticulo':return $this->listarArticulo();
case 'Articulo':return $this->formularioArticulo(); case 'Articulo':return $this->formularioArticulo();
case 'Total':return $this->inventarioTotal(); case 'Total':return $this->inventarioTotal();
case 'descuadres': return $this->inventarioDescuadres();
} }
} }
private function listarUbicacion() { private function inventarioDescuadres()
{
$enlace = 'xml/informeDescuadres.xml';
$informe = new InformePDF($this->bdd, $enlace, true);
$informe->crea($enlace);
$informe->cierraPDF();
return $this->devuelveInforme($informe);
}
private function devuelveInforme($informe)
{
$letras = "abcefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
$nombre = "tmp/informe" . substr(str_shuffle($letras), 0, 10) . ".pdf";
$informe->guardaArchivo($nombre);
return '<div class="container">
<!--<a href="' . $nombre . '" target="_blank"><span class="glyphicon glyphicon-cloud-download" style="font-size:1.5em;"></span>Descargar Informe</a>-->
<object data="' . $nombre . '" type="application/pdf" width="100%" height="700" style="float:left;">
</object>
</div>';
}
private function listarUbicacion()
{
$salidaInforme = isset($_POST['salida']) ? $_POST['salida'] : 'pantalla'; $salidaInforme = isset($_POST['salida']) ? $_POST['salida'] : 'pantalla';
switch ($salidaInforme) { switch ($salidaInforme) {
case "pantalla": case "pantalla":
@@ -70,9 +95,7 @@ class InformeInventario {
$informe = new InformePDF($this->bdd, $salida, true); $informe = new InformePDF($this->bdd, $salida, true);
$informe->crea($salida); $informe->crea($salida);
$informe->cierraPDF(); $informe->cierraPDF();
$informe->guardaArchivo("tmp/Informe.pdf"); return $this->devuelveInforme($informe);
echo '<script type="text/javascript"> window.open( "tmp/Informe.pdf" ) </script>';
break;
case "csv": case "csv":
//Genera una hoja de cálculo en formato csv //Genera una hoja de cálculo en formato csv
$nombre = "tmp/Ubicacion" . strftime("%Y%m%d") . rand(100, 999) . ".csv"; $nombre = "tmp/Ubicacion" . strftime("%Y%m%d") . rand(100, 999) . ".csv";
@@ -85,13 +108,12 @@ class InformeInventario {
$etiquetas = new EtiquetasPDF($this->bdd, $salida, true); $etiquetas = new EtiquetasPDF($this->bdd, $salida, true);
$etiquetas->crea($salida); $etiquetas->crea($salida);
$etiquetas->cierraPDF(); $etiquetas->cierraPDF();
$etiquetas->guardaArchivo("tmp/EtiquetasUbicacion.pdf"); return $this->devuelveInforme($etiquetas);
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';
switch ($salidaInforme) { switch ($salidaInforme) {
case "pantalla": case "pantalla":
@@ -125,9 +147,7 @@ class InformeInventario {
$informe = new InformePDF($this->bdd, $salida, true); $informe = new InformePDF($this->bdd, $salida, true);
$informe->crea($salida); $informe->crea($salida);
$informe->cierraPDF(); $informe->cierraPDF();
$informe->guardaArchivo("tmp/Informe.pdf"); return $this->devuelveInforme($informe);
echo '<script type="text/javascript"> window.open( "tmp/Informe.pdf" ) </script>';
break;
case "csv": case "csv":
//Genera una hoja de cálculo en formato csv //Genera una hoja de cálculo en formato csv
$nombre = "tmp/Articulo" . strftime("%Y%m%d") . rand(100, 999) . ".csv"; $nombre = "tmp/Articulo" . strftime("%Y%m%d") . rand(100, 999) . ".csv";
@@ -140,14 +160,13 @@ class InformeInventario {
$etiquetas = new EtiquetasPDF($this->bdd, $salida, true); $etiquetas = new EtiquetasPDF($this->bdd, $salida, true);
$etiquetas->crea($salida); $etiquetas->crea($salida);
$etiquetas->cierraPDF(); $etiquetas->cierraPDF();
$etiquetas->guardaArchivo("tmp/EtiquetasArticulo.pdf"); return $this->devuelveInforme($etiquetas);
echo '<script type="text/javascript"> window.open( "tmp/EtiquetasArticulo.pdf" ) </script>';
break;
} }
} }
private function listaUbicaciones() { private function listaUbicaciones()
$salida = "<select class=\"form-control\" name=\"id\">\n"; {
$salida = "<select class=\"selectpicker show-tick\" name=\"id\" data-live-search=\"true\" data-width=\"auto\">\n";
$comando = "select * from Ubicaciones order by Descripcion"; $comando = "select * from Ubicaciones order by Descripcion";
$resultado = $this->bdd->ejecuta($comando); $resultado = $this->bdd->ejecuta($comando);
if (!$resultado) { if (!$resultado) {
@@ -160,8 +179,9 @@ class InformeInventario {
return $salida; return $salida;
} }
private function listaArticulos() { private function listaArticulos()
$salida = "<select class=\"form-control\" name=\"id\">\n"; {
$salida = "<select class=\"selectpicker show-tick\" name=\"id\" data-live-search=\"true\" data-width=\"auto\">\n";
$comando = "select * from Articulos order by descripcion, marca, modelo"; $comando = "select * from Articulos order by descripcion, marca, modelo";
$resultado = $this->bdd->ejecuta($comando); $resultado = $this->bdd->ejecuta($comando);
if (!$resultado) { if (!$resultado) {
@@ -174,10 +194,11 @@ class InformeInventario {
return $salida; return $salida;
} }
private function formulario($accion, $etiqueta, $lista) { private function formulario($accion, $etiqueta, $lista)
$salida ='<div class="col-sm-6 col-md-6"><form name="informeInventario.form" method="post" action="' . $accion . '">' . "\n"; {
$salida = '<div class="col-sm-6 col-md-6"><form name="informeInventario.form" method="post" action="' . $accion . '">' . "\n";
$salida.="<fieldset style=\"width: 96%;\"><p><legend style=\"color: red;\"><b>Elige $etiqueta</b></legend>\n"; $salida.="<fieldset style=\"width: 96%;\"><p><legend style=\"color: red;\"><b>Elige $etiqueta</b></legend>\n";
$salida.="<br><br><label>$etiqueta</label>"; $salida.="<br><br><label>$etiqueta </label>";
$salida.=$lista; $salida.=$lista;
$salida.="<br><br> $salida.="<br><br>
<label for='salida'>Salida del informe por:</label>"; <label for='salida'>Salida del informe por:</label>";
@@ -186,21 +207,25 @@ class InformeInventario {
$salida.='<div class="radio"><label><input type="radio" name="salida" value="etiquetas"><span class="glyphicon glyphicon-qrcode"></span> Etiquetas</label></div>'; $salida.='<div class="radio"><label><input type="radio" name="salida" value="etiquetas"><span class="glyphicon glyphicon-qrcode"></span> Etiquetas</label></div>';
$salida.="<br><br></fieldset><p>"; $salida.="<br><br></fieldset><p>";
$salida.='<p align="center"><button type=submit class="btn btn-primary"><span class="glyphicon glyphicon-ok"></span> Aceptar</button></p><br></div>' . "\n"; $salida.='<p align="center"><button type=submit class="btn btn-primary"><span class="glyphicon glyphicon-ok"></span> Aceptar</button></p><br></div>' . "\n";
$salida.="<script>$('.selectpicker').selectpicker();</script>";
return $salida; return $salida;
} }
private function formularioUbicacion() { private function formularioUbicacion()
{
//Genera un formulario con las ubicaciones disponibles. //Genera un formulario con las ubicaciones disponibles.
$accion = "index.php?informeInventario&opc=listarUbicacion"; $accion = "index.php?informeInventario&opc=listarUbicacion";
return $this->formulario($accion, 'Ubicaci&oacute;n', $this->listaUbicaciones()); return $this->formulario($accion, 'Ubicaci&oacute;n', $this->listaUbicaciones());
} }
private function formularioArticulo() { private function formularioArticulo()
{
$accion = "index.php?informeInventario&opc=listarArticulo"; $accion = "index.php?informeInventario&opc=listarArticulo";
return $this->formulario($accion, 'Art&iacute;culo', $this->listaArticulos()); return $this->formulario($accion, 'Art&iacute;culo', $this->listaArticulos());
} }
private function inventarioTotal() { private function inventarioTotal()
{
$fichero = "xml/inventarioUbicacion.xml"; $fichero = "xml/inventarioUbicacion.xml";
$salida = "tmp/inventarioUbicacion.xml"; $salida = "tmp/inventarioUbicacion.xml";
$comando = "select * from Ubicaciones ;"; $comando = "select * from Ubicaciones ;";
@@ -212,7 +237,6 @@ class InformeInventario {
$bdatos = new Sql(SERVIDOR, USUARIO, CLAVE, BASEDATOS); $bdatos = new Sql(SERVIDOR, USUARIO, CLAVE, BASEDATOS);
$primero = true; $primero = true;
while ($fila = $this->bdd->procesaResultado()) { while ($fila = $this->bdd->procesaResultado()) {
//$fila=$this->bdd->procesaResultado();
$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);
$plantilla = str_replace("{id}", $fila['id'], $plantilla); $plantilla = str_replace("{id}", $fila['id'], $plantilla);
$plantilla = str_replace("{Descripcion}", $fila['Descripcion'], $plantilla); $plantilla = str_replace("{Descripcion}", $fila['Descripcion'], $plantilla);
@@ -223,10 +247,10 @@ class InformeInventario {
} }
$informe->crea($salida); $informe->crea($salida);
} }
$nombre = "tmp/total.pdf";
$informe->cierraPDF(); $informe->cierraPDF();
$informe->imprimeInforme(); return $this->devuelveInforme($informe);
} }
} }
?> ?>

559
Instalar.php Normal file
View File

@@ -0,0 +1,559 @@
<?php
/**
* Programa de instalación que genera el entorno de ejecución
* tanto el fichero de configuración como la base de datos
* @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/>.
*
*/
//Se incluyen los módulos necesarios
function __autoload($class_name) {
require_once $class_name . '.php';
}
require_once 'inc/configuracion.inc';
define('NUMPASOS', 3);
//Para el Paso 1
define('MINBYTES', 4096000); // post_max_size y max_upload van con esto
define('CADENAMINBYTES', '4M');
define('CONFIGURACION', 'inc/configuracion.inc');
define('CONFIGTMP', 'tmp/config.tmp');
define('TMP', './tmp');
define('INC', './inc');
$instalar = new Instalar();
if ($instalar->error) {
echo $instalar->panelError();
return;
}
echo $instalar->ejecuta();
class Instalar {
private $contenido;
private $plant;
public $error;
public $error_msj;
public function __construct()
{
//Selecciona la plantilla a utilizar
$this->plant='plant/';
$this->plant.=PLANTILLA;
$this->plant.='.html';
$this->error = false;
$this->eror_msj = '';
if (INSTALADO != 'no') {
$this->error = true;
$this->error_msj = 'El programa ya está instalado';
}
/*if ($this->existenDatos()) {
$this->error = true;
$this->error_msj = "El indicador de instalación tiene 'no' pero la base de datos " . BASEDATOS . " contiene la tabla Articulos.";
}*/
}
private function existenDatos()
{
//Comprueba si existe la tabla Articulos
$sql = new Sql(SERVIDOR, USUARIO, CLAVE, BASEDATOS);
if ($sql->error())
return false;
$sql->ejecuta('select * from Articulos;');
if ($sql->error())
return false;
return true;
}
public function ejecuta()
{
$paso = isset($_GET['paso']) ? $_GET['paso'] : 0;
$paso = $paso > NUMPASOS ? '0' : $paso;
$i=0;
//Si quiere ir a un determinado paso se asegura que estén completos los anteriores
for ($i = 0; $i < $paso; $i++) {
$funcion = "validaPaso" . $i;
if (!$this->$funcion()) {
break;
}
}
$funcion = "paso" . $i;
$this->contenido = $this->$funcion();
$salida = new Distribucion($this->plant, $this);
return $salida->procesaPlantilla();
}
// Cuestiones relacionadas con el servidor
private function paso0()
{
$info = '<ul class="list-group">';
$info .= '<li class="list-group-item list-group-item-info">Configuración de PHP (php.ini)</li>';
// display_errors
$displayErr = ini_get('display_errors');
$displayErr = $displayErr == "1" || $displayErr == "on" ? "on" : "off";
$mensaje = $displayErr == "off" ? $this->retornaLabel(false,'Se debe deshabilitar la impresión de errores') :
$this->retornaLabel(true, 'Se debe deshabilitar la impresión de errores', "warning");
$info .= $this->retornaElemento($mensaje, 'display_errors', $displayErr);
// post_max_size
$postMax = ini_get('post_max_size');
$mensaje = $this->retornaBytes($postMax) >= MINBYTES ? $this->retornaLabel(false, 'Mínimo: ' . CADENAMINBYTES) :
$this->retornaLabel(true, 'Mínimo: ' . CADENAMINBYTES);
$info .= $this->retornaElemento($mensaje, 'post_max_size', $postMax);
// upload_max_filesize
$uploadMax = ini_get('upload_max_filesize');
$mensaje = $this->retornaBytes($uploadMax) >= MINBYTES ? $this->retornaLabel(false, 'Mínimo: ' . CADENAMINBYTES) :
$this->retornaLabel(true, 'Mínimo: ' . CADENAMINBYTES);
$info .= $this->retornaElemento($mensaje, 'upload_max_filesize', $uploadMax);
// mysqli
$mysql = extension_loaded('mysqli');
$mysql = $mysql ? "on" : "off";
$mensaje = $mysql ? $this->retornaLabel(false, 'Tiene que estar cargada la extensión MySQLi para poder funcionar') :
$this->retornaLabel(true, 'Tiene que estar cargada la extensión MySQLi para poder funcionar');
$info .= $this->retornaElemento($mensaje, 'extensión MySQLi', $mysql);
$info .= '<li class="list-group-item list-group-item-info">Configuración de la Aplicación</li>';
// img.dat
$mensaje = is_writable(IMAGEDATA) ? $this->retornaLabel(false, "Se debe poder escribir en el directorio " . IMAGEDATA) :
$this->retornaLabel(true, "Se debe poder escribir en el directorio " . IMAGEDATA);
$valor = is_writable(IMAGEDATA) ? "" : "No";
$info .= $this->retornaElemento($mensaje, 'Se puede escribir en ' . IMAGEDATA, $valor);
// tmp
$mensaje = is_writable(TMP) ? $this->retornaLabel(false, "Se debe poder escribir en el directorio " . TMP) :
$this->retornaLabel(true, "Se debe poder escribir en el directorio " . TMP);
$valor = is_writable(TMP) ? "" : "No";
$info .= $this->retornaElemento($mensaje, 'Se puede escribir en ' . TMP, $valor);
// inc
$mensaje = is_writable(INC) ? $this->retornaLabel(false, "Se debe poder escribir en el directorio " . INC) :
$this->retornaLabel(true, "Se debe poder escribir en el directorio " . INC);
$valor = is_writable(INC) ? "" : "No";
$info .= $this->retornaElemento($mensaje, 'Se puede escribir en ' . INC, $valor);
// configuracion.inc
$mensaje = is_writable(CONFIGURACION) ? $this->retornaLabel(false, "Se debe poder escribir en el fichero de configuración ". CONFIGURACION) :
$this->retornaLabel(true, "Se debe poder escribir en el fichero de configuración ". CONFIGURACION);
$valor = is_writable(CONFIGURACION) ? "" : "No";
$info .= $this->retornaElemento($mensaje, 'Se puede escribir en ' . CONFIGURACION, $valor);
// Final del paso
$info .='</ul>';
$info .= $this->validaPaso0() ? $this->retornaBoton(false, "instalar.php?paso=1") : $this->retornaBoton(true, "instalar.php");
$panel = $this->panelMensaje($info, 'primary', 'PASO 1: Configuración del servidor y la aplicación');
return $panel;
}
private function retornaElemento($validacion, $mensaje, $valor)
{
$info = '<li class="list-group-item">';
$info .= $validacion . ' ' . $mensaje . ': <span class="badge">' . $valor . '</span>';
$info .= '</li>';
return $info;
}
private function retornaBoton($error, $paso, $javascript = true)
{
$anadido = $javascript ? 'onclick="location.href=' . "'" . $paso . "'". '"' : '';
if (!$error) {
return '<button ' . $anadido . ' type="submit" class="btn btn-success btn-lg pull-right">Continuar <span class="glyphicon glyphicon-arrow-right"></span></button>';
} else {
return '<button ' . $anadido . ' type="submit" class="btn btn-danger btn-lg pull-right">Comprobar de nuevo <span class="glyphicon glyphicon-repeat"></span></button>';
}
}
private function botonVolver($enlace)
{
$boton = '<button type="button" onClick="location.href=' . "'$enlace'" . '" class="btn btn-success btn-lg pull-left">Paso anterior <span class="glyphicon glyphicon-arrow-left"></span></button>';
return $boton;
}
private function retornaLabel($error, $mensaje, $tipo = "danger")
{
if ($error) {
$nombre1 = $tipo; $nombre2 = "remove";
} else {
$nombre1 = "success"; $nombre2 = "ok";
}
$mensaje = '<a href="#" data-placement="right" data-toggle="popover" data-content="' . $mensaje .
'"><span class="label label-' . $nombre1 . '"><span class="glyphicon glyphicon-' . $nombre2 .
'"></span></a>';
$mensaje .='<script>$(function () { $("[data-toggle=\'popover\']").popover(); });</script>';
return $mensaje;
}
private function retornaBytes($val)
{
$val = trim($val);
$last = strtolower($val[strlen($val)-1]);
switch($last) {
// El modificador 'G' está disponble desde PHP 5.1.0
case 'g':
$val *= 1024;
case 'm':
$val *= 1024;
case 'k':
$val *= 1024;
}
return $val;
}
private function validaPaso0()
{
$validar = true;
$postMax = ini_get('post_max_size');
$uploadMax = ini_get('upload_max_filesize');
$mysql = extension_loaded('mysqli');
$escConfig = is_writable(CONFIGURACION);
$escInc = is_writable(INC);
$escTMP = is_writable(TMP);
$escIMG = is_writable(IMAGEDATA);
if ($this->retornaBytes($postMax) < MINBYTES)
$validar = false;
if ($this->retornaBytes($uploadMax) < MINBYTES)
$validar = false;
if (!$mysql)
$validar = false;
if (!$escConfig)
$validar = false;
if (!$escTMP)
$validar = false;
if (!$escIMG)
$validar = false;
if (!$escInc)
$validar = false;
return $validar;
}
private function actualizaConfiguracion($grabar, $campos, &$datos)
{
$conf = new Configuracion();
$fichero = $conf->obtieneFichero();
$datosFichero = explode("\n", $fichero);
if ($grabar) {
$fsalida = @fopen(CONFIGTMP, "wb");
}
foreach ($datosFichero as $linea) {
if (stripos($linea, "DEFINE") !== false) {
$conf->obtieneDatos($linea, $clave, $valor);
if (stripos($campos, $clave) !== false) {
if ($grabar) {
$linea = str_replace($valor, $datos[$clave], $linea);
$valor = $datos[$clave];
}
}
$datos[$clave] = $valor;
}
$registro = substr($linea, 0, 2) == "?>" ? $linea : $linea . "\n";
if ($grabar) {
fwrite($fsalida, $registro);
}
}
if ($grabar) {
fclose($fsalida);
unlink(CONFIGURACION);
rename(CONFIGTMP, CONFIGURACION);
}
}
// Cuestiones de la base de datos
private function paso1()
{
$grabar = isset($_POST['SERVIDOR']);
$campos = 'SERVIDOR,PUERTO,BASEDATOS,USUARIO,CLAVE';
//Lee y si hace falta actualiza los datos del formulario en el fichero de configuración
if ($grabar) {
foreach ($_POST as $clave => $valor) {
$datos[$clave] = $valor;
}
} else {
$datos = array();
}
$this->actualizaConfiguracion($grabar, $campos, $datos);
if ($grabar && $this->validaPaso1()) {
//Pasa al paso siguiente
return $this->paso2();
}
$info = '<form method="post" name="conf" action="instalar.php?paso=1">';
$info .= '<ul class="list-group">';
$info .= '<li class="list-group-item list-group-item-info">Datos de configuración</li>';
$info .= '<li class="list-group-item">Servidor <input type="text" name="SERVIDOR" class="form-control" placeholder="Nombre del servidor o dirección IP" value="'. $datos['SERVIDOR'] .'"></li>';
$info .= '<li class="list-group-item">Puerto <input type="text" name="PUERTO" class="form-control" placeholder="Puerto de conexión" value="'. $datos['PUERTO'] .'"></li>';
$info .= '<li class="list-group-item">Base de Datos <input type="text" name="BASEDATOS" class="form-control" placeholder="Nombre de la Base de Datos" value="'. $datos['BASEDATOS'] .'"></li>';
$info .= '<li class="list-group-item">Usuario <input type="text" name="USUARIO" class="form-control" placeholder="Usuario" value="'. $datos['USUARIO'] .'"></li>';
$info .= '<li class="list-group-item">Contraseña <input type="text" name="CLAVE" class="form-control" placeholder="Contraseña" value="'. $datos['CLAVE'] .'"></li>';
$info .= '</ul>';
$info .= $this->botonVolver("instalar.php");
$info .= $this->validaPaso1() ? $this->retornaBoton(false, "instalar.php?paso=1", false) : $this->retornaBoton(true, "instalar.php?paso=1", false);
$info .= '</form>';
$panel = $this->panelMensaje($info, 'primary', 'PASO 2: Configuración de la Base de Datos.');
return $panel;
}
private function validaPaso1()
{
$sql = new Sql(SERVIDOR, USUARIO, CLAVE, '');
if ($sql->error())
return false;
$sql = new Sql(SERVIDOR, USUARIO, CLAVE, BASEDATOS);
if ($sql->error()) {
return false;
}
$comando = 'create table test2 (id int(10));';
$sql->ejecuta($comando);
if ($sql->error()) {
return false;
}
$comando = 'drop table test2;';
$sql->ejecuta($comando);
if ($sql->error()) {
return false;
}
return true;
}
// Usuario administrador
private function paso2()
{
if (isset($_POST['usuario'])) {
//ha enviado el formulario.
//Crea la base de datos
$borra_database = "DROP DATABASE " . BASEDATOS . " ;";
$database = "CREATE DATABASE " . BASEDATOS . " DEFAULT CHARACTER SET utf8;";
$articulos = "CREATE TABLE `Articulos` (
`id` smallint(6) NOT NULL auto_increment COMMENT 'ordenable',
`descripcion` varchar(60) NOT NULL COMMENT 'ordenable,link/Articulo',
`marca` varchar(20) default NULL COMMENT 'ordenable',
`modelo` varchar(20) default NULL COMMENT 'ordenable',
`cantidad` int(11) default NULL COMMENT 'ordenable',
`imagen` varchar(45) default NULL COMMENT 'imagen',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=769 DEFAULT CHARSET=utf8;
";
$ubicaciones = "CREATE TABLE `Ubicaciones` (
`id` smallint(5) unsigned NOT NULL auto_increment COMMENT 'ordenable',
`Descripcion` varchar(50) NOT NULL COMMENT 'ordenable,link/Ubicacion',
`imagen` varchar(45) DEFAULT NULL COMMENT 'imagen',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=179 DEFAULT CHARSET=utf8;
";
$elementos = "CREATE TABLE `Elementos` (
`id` int(10) unsigned NOT NULL auto_increment COMMENT 'ordenable',
`id_Articulo` smallint(6) NOT NULL COMMENT 'foreign(Articulos;id),ordenable',
`id_Ubicacion` smallint(5) unsigned NOT NULL COMMENT 'foreign(Ubicaciones;id),ordenable',
`numserie` varchar(30) default NULL COMMENT 'ordenable',
`cantidad` int(10) unsigned default NULL COMMENT 'ordenable',
`fechaCompra` date NOT NULL COMMENT 'ordenable',
`imagen` varchar(45) default NULL COMMENT 'imagen',
PRIMARY KEY (`id`),
KEY `id` (`id`),
KEY `id_Articulo` (`id_Articulo`),
KEY `id_Ubicacion` (`id_Ubicacion`),
CONSTRAINT `Elementos_ibfk_1` FOREIGN KEY (`id_Articulo`) REFERENCES `Articulos` (`id`) ON DELETE CASCADE,
CONSTRAINT `Elementos_ibfk_2` FOREIGN KEY (`id_Ubicacion`) REFERENCES `Ubicaciones` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=1789 DEFAULT CHARSET=utf8;
";
$usuarios = "CREATE TABLE `Usuarios` (
`id` int(10) unsigned NOT NULL auto_increment COMMENT 'ordenable',
`nombre` varchar(16) NOT NULL default '',
`clave` varchar(32) NOT NULL default '',
`idSesion` varchar(20) NOT NULL default '',
`alta` tinyint(1) NOT NULL default '0',
`modificacion` tinyint(1) NOT NULL default '0',
`borrado` tinyint(1) NOT NULL default '0',
`consulta` tinyint(1) NOT NULL default '1',
`informe` tinyint(1) NOT NULL default '1',
`usuarios` tinyint(1) NOT NULL default '0',
`config` tinyint(1) NOT NULL default '0',
PRIMARY KEY (`id`),
KEY `nombre` (`nombre`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
";
$letras = "abcefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
$sesion = substr(str_shuffle($letras), 0, 8);
$usuario = $_POST['usuario'];
$clave = $_POST['clave'];
$administrador = "insert into Usuarios values (null,'$usuario','$clave','$sesion','1','1','1','1','1','1','1');";
@mysqli_query($borra_database);
@mysqli_query($database);
$sql = new Sql(SERVIDOR, USUARIO, CLAVE, BASEDATOS);
$sql->ejecuta($ubicaciones);
if ($sql->error()) {
return $this->panelMensaje($sql->mensajeError(), "danger", "ERROR");
}
$sql->ejecuta($articulos);
if ($sql->error()) {
return $this->panelMensaje($sql->mensajeError(), "danger", "ERROR");
}
$sql->ejecuta($elementos);
if ($sql->error()) {
return $this->panelMensaje($sql->mensajeError(), "danger", "ERROR");
}
$sql->ejecuta($usuarios);
if ($sql->error()) {
return $this->panelMensaje($sql->mensajeError(), "danger", "ERROR");
}
$sql->ejecuta($administrador);
if ($sql->error()) {
return $this->panelMensaje($sql->mensajeError(), "danger", "ERROR");
}
$campos="INSTALADO";
$datos['INSTALADO'] = "";
$this->actualizaConfiguracion(true, $campos, $datos);
return $this->resumen();
}
$info = '
<form data-toggle="validator" role="form" class="form-horizontal" method="post" action="instalar.php?paso=2">
<div class="form-group">
<label for="usuario" class="control-label col-sm-2">Usuario</label>
<div class="form-group col-sm-10">
<input type="text" class="form-control" id="usuario" name="usuario" placeholder="nombre de usuario" data-minlength="5" data-minlength-error="Mínimo 5 caracteres" required>
<div class="help-block with-errors">Mínimo 5 caracteres</div>
</div>
</div>
<div class="form-group">
<label for="clave" class="control-label col-sm-2">Contraseña</label>
<div class="form-group col-sm-10">
<input type="password" data-toggle="validator" data-minlength="6" class="form-control" id="clave" name="clave" placeholder="Contraseña" data-minlength-error="Mínimo 6 caracteres" required>
<span class="help-block with-errors">Mínimo 6 caracteres</span>
<input type="password" class="form-control" id="claverepetida" data-match="#clave" data-match-error="No coincide" data-minlength-error="Mínimo 6 caracteres" placeholder="Confirmar contraseña" required>
<div class="help-block with-errors">Mínimo 6 caracteres</div>
</div>
</div>
<div class="form-group col-sm-12">
' . $this->botonVolver("instalar.php?paso=1") . '
<button type="submit" class="btn btn-primary pull-right btn-lg" disabled="disabled">Crear base de datos y usuario <span class="glyphicon glyphicon-arrow-right"></button>
</div>
</div>
</form>
<script type="text/javascript" src="./css/validator.min.js"></script>';
$panel = $this->panelMensaje($info, 'primary', 'PASO 3: Creación de la base de datos y el usuario administrador.');
return $panel;
}
private function validaPaso2()
{
//La validación de este paso se hace con la del formulario en javascript
return true;
}
public function panelMensaje($info, $tipo = "info", $cabecera = "&iexcl;Atenci&oacute;n!") {
$mensaje = '<div class="panel panel-' . $tipo . ' col-sm-6"><div class="panel-heading">';
$mensaje .= '<h3 class="panel-title">' . $cabecera . '</h3></div>';
$mensaje .= '<div class="panel-body">';
$mensaje .= $info;
$mensaje .= '</div>';
$mensaje .= '</div>';
return $mensaje;
}
public function contenido()
{
return $this->contenido;
}
public function menu()
{
return '';
}
public function opcion()
{
return 'INSTALACI&Oacute;N';
}
public function control()
{
return '';
}
public function aplicacion()
{
return PROGRAMA . ' v' . VERSION;
}
public function usuario()
{
return '';
}
public function fecha()
{
$idioma = 'es_ES';
$formato = "%d-%b-%y";
setlocale(LC_TIME, $idioma);
return strftime($formato);
}
public function cabecera()
{
return '<!DOCTYPE html>
<html lang="es">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="Ricardo Montañana">
<link rel="shortcut icon" href="img/tux.ico">
<title>Inventario</title>
<!-- Bootstrap core CSS -->
<link href="css/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="css/dashboard.php" rel="stylesheet">
<link href="css/bootstrap-datetimepicker.min.css" rel="stylesheet">
<link rel="stylesheet" href="css/jquery.simplecolorpicker.css">
<link rel="stylesheet" href="css/jquery.simplecolorpicker-glyphicons.css">
<link rel="stylesheet" href="css/jasny-bootstrap.min.css">
<link rel="stylesheet" href="css/bootstrap-select/bootstrap-select.min.css">
<style type="text/css"></style>
<script type="text/javascript" src="./css/jquery.min.js"></script>
<script type="text/javascript" src="./css/bootstrap-select/bootstrap-select.min.js"></script>
</head>
<body>';
}
public function panelError()
{
$mensaje = $this->cabecera();
$mensaje .= $this->panelMensaje($this->error_msj, "danger", "&iexcl;ERROR!");
$mensaje .= "</body></html>";
return $mensaje;
}
private function resumen()
{
$info = '<ul class="list-group">';
$info .= '<li class="list-group-item list-group-item-info">Paso 1</li>';
$info .= $this->retornaElemento($this->retornaLabel(false, ""), "Configuración de PHP");
$info .= $this->retornaElemento($this->retornaLabel(false, ""), "Configuración de la aplicación");
$info .= '<li class="list-group-item list-group-item-info">Paso 2</li>';
$info .= $this->retornaElemento($this->retornaLabel(false, ""), "Configuración de la base de datos");
$info .= '<li class="list-group-item list-group-item-info">Paso 3</li>';
$info .= $this->retornaElemento($this->retornaLabel(false, ""), "Creación de Base de datos");
$info .= $this->retornaElemento($this->retornaLabel(false, ""), "Creación del usuario administrador");
$info .= '</ul>';
$info .= $this->retornaBoton(false, "index.php", true);
$panel = $this->panelMensaje($info, 'success', 'Instalación finalizada.');
return $panel;
}
}
?>

View File

@@ -40,14 +40,19 @@ class Inventario {
// Analizamos la cadena de solicitud para saber // Analizamos la cadena de solicitud para saber
// qué opción es la actual // qué opción es la actual
$this->opcActual = $_SERVER['QUERY_STRING'] == '' ? 'principal' : $_SERVER['QUERY_STRING']; $this->opcActual = $_SERVER['QUERY_STRING'] == '' ? 'principal' : $_SERVER['QUERY_STRING'];
//Si el programa no está instalado, llama al instalador.
if (INSTALADO == "no") {
header('location: instalar.php');
return;
}
// Iniciamos una sesión // Iniciamos una sesión
session_start(); session_start();
//Conexión con la base de datos. //Conexión con la base de datos.
$this->bdd = new Sql(SERVIDOR, USUARIO, CLAVE, BASEDATOS); $this->bdd = new Sql(SERVIDOR, USUARIO, CLAVE, BASEDATOS);
if ($this->bdd->error()) { if ($this->bdd->error()) {
echo '<h1>Fallo al conectar con el servidor MySQL.</h1>'; echo '<h1>Fallo al conectar con el servidor MySQL.</h1>';
echo SERVIDOR; echo "Servidor [ " . SERVIDOR . " ] base de datos [" . BASEDATOS . "]";
echo "Servidor [ " . SERVIDOR . " ] usuario [" . USUARIO . "] clave [" . CLAVE . "] base [" . BASEDATOS . "]";
$this->estado = false; $this->estado = false;
return; return;
} else { } else {
@@ -198,7 +203,6 @@ class Inventario {
$_SESSION['Perfil'] = $this->perfil; $_SESSION['Perfil'] = $this->perfil;
} }
} }
} }
?> ?>

View File

@@ -262,7 +262,7 @@ class Mantenimiento {
if ($this->perfil['Informe']) { if ($this->perfil['Informe']) {
$this->datosURL['opc'] = "informe"; $this->datosURL['opc'] = "informe";
$inf = $this->montaURL(); $inf = $this->montaURL();
$informe = '<a href="' . $inf . '" target="_blank"><img src="img/' . ESTILO . '/informe.png" alt="informe" title="Informe pdf"></a>'; $informe = '<a href="' . $inf . '"><img src="img/' . ESTILO . '/informe.png" alt="informe" title="Informe pdf"></a>';
} else { } else {
$informe = ""; $informe = "";
} }
@@ -285,7 +285,7 @@ class Mantenimiento {
$valor = isset($this->cadenaBusqueda) ? 'value="' . $this->cadenaBusqueda . '"' : ''; $valor = isset($this->cadenaBusqueda) ? 'value="' . $this->cadenaBusqueda . '"' : '';
$salida = '<form name="busqueda" method="POST"><div class="col-xs-6 col-sm-4 col-md-6 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="submit"><span class="glyphicon glyphicon-search"></span></button>
</span></div></div></form>'; </span></div></div></form>';
$salida .= '<button class="btn btn-info pull-right" type="button">P&aacute;gina <span class="badge">' $salida .= '<button class="btn btn-info pull-right" type="button">P&aacute;gina <span class="badge">'
. $pagina . '</span></button>'; . $pagina . '</span></button>';
@@ -479,7 +479,8 @@ class Mantenimiento {
//tabla a la cual pertenece la clave foránea. //tabla a la cual pertenece la clave foránea.
protected function generaLista($datos, $campo, $valorInicial, $modo) protected function generaLista($datos, $campo, $valorInicial, $modo)
{ {
$salida = "<select class=\"form-control\" name=\"$campo\">\n"; $modoEfectivo = $modo == "readonly" ? "disabled" : "";
$salida = "<select class=\"selectpicker show-tick\" data-live-search=\"true\" data-width=\"auto\" name=\"$campo\" $modoEfectivo>\n";
list($tabla, $atributos) = explode(",", $datos); list($tabla, $atributos) = explode(",", $datos);
$atributos = str_replace("/", ",", $atributos); $atributos = str_replace("/", ",", $atributos);
// Elimina las llaves // Elimina las llaves
@@ -489,7 +490,6 @@ class Mantenimiento {
if (!$resultado) { if (!$resultado) {
return $this->errorBD($comando); return $this->errorBD($comando);
} }
$modoEfectivo = $modo == "readonly" ? "disabled" : "";
$primero = true; $primero = true;
while ($fila = $this->bdd->procesaResultado()) { while ($fila = $this->bdd->procesaResultado()) {
foreach ($fila as $clave => $valor) { foreach ($fila as $clave => $valor) {
@@ -508,6 +508,7 @@ class Mantenimiento {
} }
} }
$salida.="</select>\n<br><br>"; $salida.="</select>\n<br><br>";
$salida.="<script>$('.selectpicker').selectpicker();</script>";
return $salida; return $salida;
} }
@@ -636,15 +637,17 @@ class Mantenimiento {
<input type="text" name="' . $campo . '" data-format="YYYY/MM/DD" value="' . $valorDato . '" ' . $modoEfectivo . ' class="form-control" /> <input type="text" name="' . $campo . '" data-format="YYYY/MM/DD" value="' . $valorDato . '" ' . $modoEfectivo . ' class="form-control" />
<span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span> <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
</div>'; </div>';
$salida .= '<script type="text/javascript"> if ($modo != "readonly") {
$(function () { $salida .= '<script type="text/javascript">
$(' . "'#datetimepicker" . $nfechas . "').datetimepicker({ $(function () {
pick12HourFormat: false, $(' . "'#datetimepicker" . $nfechas . "').datetimepicker({
language: 'es', pick12HourFormat: false,
pickTime: false language: 'es',
}); pickTime: false
}); });
</script>"; });
</script>";
}
$salida .= "</div></div>"; $salida .= "</div></div>";
continue; continue;
} else { } else {

View File

@@ -38,14 +38,12 @@ Para instalar la aplicación basta con seguir estos pasos:
grant all on Inventario.* to usuario identified by "contraseña"; grant all on Inventario.* to usuario identified by "contraseña";
###5. Crear la estructura de la base de datos para poder comenzar a trabajar: ###5. Conectarse a la aplicación en la url donde se ha instalado:
mysql -u usuario --password=contraseña <sql/setup.sql http://<url>
Con esto queda instalado el programa. Se crean en este proceso dos usuarios: Al hacer esto se arrancará automáticamente el programa de instalación con el que terminaremos de configurar la aplicación.
Usuario: admin Usuario: demo
Contraseña: pruebas Contraseña: pruebas
##Modelo de datos ##Modelo de datos
El modelo de datos que se ha utilizado ha sido: El modelo de datos que se ha utilizado ha sido:

View File

@@ -63,7 +63,7 @@ class Sql {
*/ */
public function __construct($servidor,$usuario,$clave,$baseDatos) public function __construct($servidor,$usuario,$clave,$baseDatos)
{ {
$this->bdd=new mysqli($servidor,$usuario,$clave,$baseDatos); $this->bdd = @new mysqli($servidor,$usuario,$clave,$baseDatos);
if (mysqli_connect_errno()) { if (mysqli_connect_errno()) {
$this->mensajeError='<h1>Fallo al conectar con el servidor MySQL.</h1>'; $this->mensajeError='<h1>Fallo al conectar con el servidor MySQL.</h1>';
$this->mensajeError.="Servidor [".$servidor ."] usuario=[".$usuario."] clave [".$clave."] base [".$baseDatos."]"; $this->mensajeError.="Servidor [".$servidor ."] usuario=[".$usuario."] clave [".$clave."] base [".$baseDatos."]";

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,29 @@
/*
* Translated default messages for bootstrap-select.
* Locale: ES (Spanish)
* Region: CL (Chile)
*/
(function($) {
$.fn.selectpicker.defaults = {
style: 'btn-default',
size: 'auto',
title: null,
selectedTextFormat : 'values',
noneSelectedText : 'No hay selección',
noneResultsText : 'No hay resultados',
countSelectedText : 'Seleccionados {0} de {1}',
maxOptionsText: ['Límite alcanzado ({n} {var} max)', 'Límite del grupo alcanzado({n} {var} max)', ['elementos','element']],
width: false,
container: false,
hideDisabled: false,
showSubtext: false,
showIcon: true,
showContent: true,
dropupAuto: true,
header: false,
liveSearch: false,
multipleSeparator: ', ',
iconBase: 'glyphicon',
tickIcon: 'glyphicon-ok'
};
}(jQuery));

View File

@@ -0,0 +1,6 @@
/*
* Translated default messages for bootstrap-select.
* Locale: ES (Spanish)
* Region: CL (Chile)
*/
(function(e){e.fn.selectpicker.defaults={style:"btn-default",size:"auto",title:null,selectedTextFormat:"values",noneSelectedText:"No hay selección",noneResultsText:"No hay resultados",countSelectedText:"Seleccionados {0} de {1}",maxOptionsText:["Límite alcanzado ({n} {var} max)","Límite del grupo alcanzado({n} {var} max)",["elementos","element"]],width:false,container:false,hideDisabled:false,showSubtext:false,showIcon:true,showContent:true,dropupAuto:true,header:false,liveSearch:false,multipleSeparator:", ",iconBase:"glyphicon",tickIcon:"glyphicon-ok"}})(jQuery)

View File

@@ -0,0 +1,30 @@
/*
* Translated default messages for bootstrap-select.
* Locale: EU (Basque)
* Region:
*/
(function($) {
$.fn.selectpicker.defaults = {
style: 'btn-default',
size: 'auto',
title: null,
selectedTextFormat : 'values',
noneSelectedText : 'Hautapenik ez',
noneResultsText : 'Emaitzarik ez',
countSelectedText : '{1}(e)tik {0} hautatuta',
maxOptionsText: ['Mugara iritsita ({n} {var} gehienez)', 'Taldearen mugara iritsita ({n} {var} gehienez)', ['elementu','elementu']],
width: false,
container: false,
hideDisabled: false,
showSubtext: false,
showIcon: true,
showContent: true,
dropupAuto: true,
header: false,
liveSearch: false,
multipleSeparator: ', ',
iconBase: 'glyphicon',
tickIcon: 'glyphicon-ok'
};
}(jQuery));

View File

@@ -0,0 +1,6 @@
/*
* Translated default messages for bootstrap-select.
* Locale: EU (Basque)
* Region:
*/
(function(e){e.fn.selectpicker.defaults={style:"btn-default",size:"auto",title:null,selectedTextFormat:"values",noneSelectedText:"Hautapenik ez",noneResultsText:"Emaitzarik ez",countSelectedText:"{1}(e)tik {0} hautatuta",maxOptionsText:["Mugara iritsita ({n} {var} gehienez)","Taldearen mugara iritsita ({n} {var} gehienez)",["elementu","elementu"]],width:false,container:false,hideDisabled:false,showSubtext:false,showIcon:true,showContent:true,dropupAuto:true,header:false,liveSearch:false,multipleSeparator:", ",iconBase:"glyphicon",tickIcon:"glyphicon-ok"}})(jQuery)

View File

@@ -0,0 +1,33 @@
/*
* Translated default messages for bootstrap-select.
* Locale: PT (Portuguese; português)
* Region: BR (Brazil; Brasil)
* Author: Rodrigo de Avila <rodrigo@avila.net.br>
*/
(function($) {
$.fn.selectpicker.defaults = {
style: 'btn-default',
size: 'auto',
title: null,
selectedTextFormat : 'values',
noneSelectedText : 'Nada selecionado',
noneResultsText : 'Nada encontrado contendo',
countSelectedText : 'Selecionado {0} de {1}',
maxOptionsText: ['Limite excedido (máx. {n} {var})', 'Limite do grupo excedido (máx. {n} {var})', ['itens','item']],
width: false,
container: false,
hideDisabled: false,
showSubtext: false,
showIcon: true,
showContent: true,
dropupAuto: true,
header: false,
liveSearch: false,
actionsBox: false,
multipleSeparator: ', ',
iconBase: 'glyphicon',
tickIcon: 'glyphicon-ok',
maxOptions: false
};
}(jQuery));

View File

@@ -0,0 +1,7 @@
/*
* Translated default messages for bootstrap-select.
* Locale: PT (Portuguese; português)
* Region: BR (Brazil; Brasil)
* Author: Rodrigo de Avila <rodrigo@avila.net.br>
*/
!function(a){a.fn.selectpicker.defaults={style:"btn-default",size:"auto",title:null,selectedTextFormat:"values",noneSelectedText:"Nada selecionado",noneResultsText:"Nada encontrado contendo",countSelectedText:"Selecionado {0} de {1}",maxOptionsText:["Limite excedido (m\xe1x. {n} {var})","Limite do grupo excedido (m\xe1x. {n} {var})",["itens","item"]],width:!1,container:!1,hideDisabled:!1,showSubtext:!1,showIcon:!0,showContent:!0,dropupAuto:!0,header:!1,liveSearch:!1,actionsBox:!1,multipleSeparator:", ",iconBase:"glyphicon",tickIcon:"glyphicon-ok",maxOptions:!1}}(jQuery);

View File

@@ -0,0 +1,31 @@
/*
* Translated default messages for bootstrap-select.
* Locale: RU (Russian; русский)
* Region: RU (Russian Federation)
*/
(function($) {
$.fn.selectpicker.defaults = {
style: 'btn-default',
size: 'auto',
title: null,
selectedTextFormat : 'values',
noneSelectedText : 'Ничего не выбрано',
noneResultsText : 'Не нейдено совпадений',
countSelectedText : 'Выбрано {0} из {1}',
maxOptionsText: ['Достигнут предел ({n} {var} максимум)', 'Достигнут предел в группе ({n} {var} максимум)', ['items','item']],
width: false,
container: false,
hideDisabled: false,
showSubtext: false,
showIcon: true,
showContent: true,
dropupAuto: true,
header: false,
liveSearch: false,
actionsBox: false,
multipleSeparator: ', ',
iconBase: 'glyphicon',
tickIcon: 'glyphicon-ok',
maxOptions: false
};
}(jQuery));

View File

@@ -0,0 +1,6 @@
/*
* Translated default messages for bootstrap-select.
* Locale: RU (Russian; русский)
* Region: RU (Russian Federation)
*/
(function(e){e.fn.selectpicker.defaults={style:"btn-default",size:"auto",title:null,selectedTextFormat:"values",noneSelectedText:"Ничего не выбрано",noneResultsText:"Не нейдено совпадений",countSelectedText:"Выбрано {0} из {1}",maxOptionsText:["Достигнут предел ({n} {var} максимум)","Достигнут предел в группе ({n} {var} максимум)",["items","item"]],width:false,container:false,hideDisabled:false,showSubtext:false,showIcon:true,showContent:true,dropupAuto:true,header:false,liveSearch:false,actionsBox:false,multipleSeparator:", ",iconBase:"glyphicon",tickIcon:"glyphicon-ok",maxOptions:false}})(jQuery)

View File

@@ -33,7 +33,7 @@ display: none;
} }
@media (max-width: 767px) { @media (max-width: 767px) {
.sidebar { .sidebar {
top: 50px; top: 60px;
bottom: 150px; bottom: 150px;
background-color: <?php echo COLORLAT; ?> background-color: <?php echo COLORLAT; ?>
} }

9
css/validator.min.js vendored Executable file
View File

@@ -0,0 +1,9 @@
/*!
* Validator v0.2.1 for Bootstrap 3, by @1000hz
* Copyright 2014 Spiceworks, Inc.
* Licensed under http://opensource.org/licenses/MIT
*
* https://github.com/1000hz/bootstrap-validator
*/
+function(a){"use strict";var b=function(b,c){this.$element=a(b),this.options=c,this.toggleSubmit(),this.$element.on("input.bs.validator blur.bs.validator",":input",a.proxy(this.validateInput,this)),this.$element.find("[data-match]").each(function(){var b=a(this),c=b.data("match");a(c).on("input.bs.validator",function(){b.val()&&b.trigger("input")})})};b.DEFAULTS={delay:500,errors:{match:"Does not match",minlength:"Not long enough"}},b.VALIDATORS={"native":function(a){var b=a[0];return b.checkValidity?b.checkValidity():!0},match:function(b){var c=b.data("match");return!b.val()||b.val()===a(c).val()},minlength:function(a){var b=a.data("minlength");return!a.val()||a.val().length>=b}},b.prototype.validateInput=function(b){var c,d=a(b.target),e=d.data("bs.errors");this.$element.trigger(b=a.Event("validate.bs.validator",{relatedTarget:d[0]})),b.isDefaultPrevented()||(d.data("bs.errors",c=this.runValidators(d)),c.length?this.showErrors(d):this.clearErrors(d),e&&c.toString()===e.toString()||(b=c.length?a.Event("invalid.bs.validator",{relatedTarget:d[0],detail:c}):a.Event("valid.bs.validator",{relatedTarget:d[0],detail:e}),this.$element.trigger(b)),this.toggleSubmit(),this.$element.trigger(a.Event("validated.bs.validator",{relatedTarget:d[0]})))},b.prototype.runValidators=function(c){{var d=[];[b.VALIDATORS.native]}return a.each(b.VALIDATORS,a.proxy(function(a,b){if((c.data(a)||"native"==a)&&!b.call(this,c)){var e=c.data(a+"-error")||c.data("error")||"native"==a&&c[0].validationMessage||this.options.errors[a];!~d.indexOf(e)&&d.push(e)}},this)),d},b.prototype.validate=function(){var a=this.options.delay;return this.options.delay=0,this.$element.find(":input").trigger("input"),this.options.delay=a,this},b.prototype.showErrors=function(b){function c(){var c=b.closest(".form-group"),d=c.find(".help-block.with-errors"),e=b.data("bs.errors");e.length&&(e=a("<ul/>").addClass("list-unstyled").append(a.map(e,function(b){return a("<li/>").text(b)})),void 0===d.data("bs.originalContent")&&d.data("bs.originalContent",d.html()),d.empty().append(e),c.addClass("has-error"))}this.options.delay?(window.clearTimeout(b.data("bs.timeout")),b.data("bs.timeout",window.setTimeout(c,this.options.delay))):c()},b.prototype.clearErrors=function(a){var b=a.closest(".form-group"),c=b.find(".help-block.with-errors");c.html(c.data("bs.originalContent")),b.removeClass("has-error")},b.prototype.hasErrors=function(){function b(){return!!(a(this).data("bs.errors")||[]).length}return!!this.$element.find(":input").filter(b).length},b.prototype.isIncomplete=function(){function b(){return""===a.trim(this.value)}return!!this.$element.find("[required]").filter(b).length},b.prototype.toggleSubmit=function(){var a=this.$element.find(":submit");a.attr("disabled",this.isIncomplete()||this.hasErrors())};var c=a.fn.validator;a.fn.validator=function(c){return this.each(function(){var d=a(this),e=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c),f=d.data("bs.validator");f||d.data("bs.validator",f=new b(this,e)),"string"==typeof c&&f[c]()})},a.fn.validator.Constructor=b,a.fn.validator.noConflict=function(){return a.fn.validator=c,this},a(window).on("load",function(){a('form[data-toggle="validator"]').each(function(){var b=a(this);b.validator(b.data())})})}(jQuery);

5
img.data/.gitignore vendored Normal file
View File

@@ -0,0 +1,5 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore

Binary file not shown.

Before

Width:  |  Height:  |  Size: 210 KiB

View File

@@ -40,4 +40,5 @@ define('COLORFON', '#ffb878'); //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
define('IMAGEDATA', 'img.data'); //Directorio donde se almacenarán las imágenes define('IMAGEDATA', 'img.data'); //Directorio donde se almacenarán las imágenes
define('INSTALADO', 'sí') //Indicador que permite ejecutar instalar.php
?> ?>

View File

@@ -6,8 +6,8 @@
1|Inventario||| 1|Inventario|||
2|Ubicaci&oacute;n|index.php?informeInventario&opc=Ubicacion|_self|Inventario de una ubicaci&oacute;n 2|Ubicaci&oacute;n|index.php?informeInventario&opc=Ubicacion|_self|Inventario de una ubicaci&oacute;n
2|Art&iacute;culo|index.php?informeInventario&opc=Articulo|_self|Inventario de un Art&iacute;culo 2|Art&iacute;culo|index.php?informeInventario&opc=Articulo|_self|Inventario de un Art&iacute;culo
2|Total|index.php?informeInventario&opc=Total|_blank|Inventario de todas las ubicaciones 2|Total|index.php?informeInventario&opc=Total|_self|Inventario de todas las ubicaciones
2|Descuadres|index.php?descuadres|_blank|Diferencias entre art&iacute;culos y elementos 2|Descuadres|index.php?informeInventario&opc=descuadres|_self|Diferencias entre art&iacute;culos y elementos
1|Varios||| 1|Varios|||
2|Configuraci&oacute;n|index.php?configuracion|_self|Opciones configurables de la aplicaci&oacute;n 2|Configuraci&oacute;n|index.php?configuracion|_self|Opciones configurables de la aplicaci&oacute;n
2|Importaci&oacute;n|index.php?importacion&opc=form|_self|Importa datos de una hoja de c&aacute;lculo 2|Importaci&oacute;n|index.php?importacion&opc=form|_self|Importa datos de una hoja de c&aacute;lculo

View File

@@ -23,5 +23,5 @@
*/ */
define('AUTOR', 'Ricardo Montañana Gómez'); define('AUTOR', 'Ricardo Montañana Gómez');
define('VERSION', '1.06'); define('VERSION', '1.082');
?> ?>

View File

@@ -17,9 +17,11 @@
<link rel="stylesheet" href="css/jquery.simplecolorpicker.css"> <link rel="stylesheet" href="css/jquery.simplecolorpicker.css">
<link rel="stylesheet" href="css/jquery.simplecolorpicker-glyphicons.css"> <link rel="stylesheet" href="css/jquery.simplecolorpicker-glyphicons.css">
<link rel="stylesheet" href="css/jasny-bootstrap.min.css"> <link rel="stylesheet" href="css/jasny-bootstrap.min.css">
<link rel="stylesheet" href="css/bootstrap-select/bootstrap-select.min.css">
<style type="text/css"></style> <style type="text/css"></style>
<script type="text/javascript" src="./css/jquery.min.js"></script> <script type="text/javascript" src="./css/jquery.min.js"></script>
<script type="text/javascript" src="./css/bootstrap-select/bootstrap-select.min.js"></script>
</head> </head>
<body> <body>
<!--<body style="background-image:url(img/fondos/old_map.png); background-repeat:repeat">--> <!--<body style="background-image:url(img/fondos/old_map.png); background-repeat:repeat">-->

View File

@@ -98,15 +98,7 @@ CREATE TABLE `Usuarios` (
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client; SET character_set_client = @saved_cs_client;
--
-- Usuarios iniciales
--
LOCK TABLES `Usuarios` WRITE;
/*!40000 ALTER TABLE `Usuarios` DISABLE KEYS */;
INSERT INTO `Usuarios` VALUES (1,'admin','pruebas','s3LUSqxg{s',1,1,1,1,1,1,1),(2,'demo','pruebas','NogP_U0Byi',0,0,0,1,1,0,0);
/*!40000 ALTER TABLE `Usuarios` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

5
tmp/.gitignore vendored Normal file
View File

@@ -0,0 +1,5 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore