mirror of
https://github.com/rmontanana/inventario2.git
synced 2025-08-16 16:05:58 +00:00
Compare commits
17 Commits
Author | SHA1 | Date | |
---|---|---|---|
26048fc889 | |||
a853991146 | |||
|
99a929ec1f | ||
|
8b1ff91491 | ||
c1b4141606 | |||
e6db3c334b | |||
|
a85669a456 | ||
|
14335770df | ||
|
cd9762f4a9 | ||
|
6538402953 | ||
4aa32ff705 | |||
|
2a6680173a | ||
|
5f808b3d12 | ||
|
1441d972ab | ||
5ebd4ecf35 | |||
|
86125e0a79 | ||
3547cf5b2e |
@@ -94,7 +94,7 @@ class AportaContenido {
|
||||
*/
|
||||
public function fechaActual($formato = '', $idioma = 'es_ES') {
|
||||
if ($formato == '')
|
||||
$formato = "%d-%b-%Y %H:%M";
|
||||
$formato = "%d-%b-%y";
|
||||
setlocale(LC_TIME, $idioma);
|
||||
return strftime($formato);
|
||||
}
|
||||
@@ -145,7 +145,7 @@ class AportaContenido {
|
||||
case 'principal':
|
||||
return "Pantalla Inicial";
|
||||
case 'elementos':
|
||||
case 'articulos': $opcion="artículos";
|
||||
case 'articulos': $opcion = "artículos";
|
||||
case 'ubicaciones':
|
||||
case 'usuarios':
|
||||
case 'test':
|
||||
@@ -155,6 +155,7 @@ class AportaContenido {
|
||||
case 'informeInventario':return "Informe de Inventario";
|
||||
case 'descuadres':return 'Informe de descuadres';
|
||||
case 'importacion': return 'Importación de datos';
|
||||
case 'copiaseg': return 'Copia de seguridad de datos';
|
||||
}
|
||||
return '';
|
||||
case 'control':
|
||||
@@ -175,7 +176,7 @@ class AportaContenido {
|
||||
switch ($opcion) {
|
||||
case 'principal': // contenido inicial
|
||||
return '<br><br><center><img src="img/logo.png" alt="' . PROGRAMA . '">' .
|
||||
'<br><label>' . PROGRAMA . '</label></center><br><br>' . PIE;
|
||||
'<br><label>' . CENTRO . '</label></center><br><br>' . PIE;
|
||||
case 'articulos':
|
||||
case 'ubicaciones':
|
||||
case 'test':
|
||||
@@ -196,7 +197,7 @@ class AportaContenido {
|
||||
|
||||
case 'bienvenido': // El usuario quiere iniciar sesión
|
||||
return 'Bienvenid@ ' . $this->usuario . '<br><br><center><img src="img/codigoBarras.png" alt="' . PROGRAMA . '">' .
|
||||
'<br><label>' . PROGRAMA . '</label></center><br><br>' . PIE;
|
||||
'<br><label>' . CENTRO . '</label></center><br><br>' . PIE;
|
||||
case 'configuracion':
|
||||
if ($this->perfil['Config']) {
|
||||
$conf = new Configuracion();
|
||||
@@ -229,6 +230,36 @@ class AportaContenido {
|
||||
} else {
|
||||
return $this->mensajePermisos("Actualización, creación y borrado de elementos");
|
||||
}
|
||||
case 'copiaseg':
|
||||
if ($this->perfil['Config']) {
|
||||
$archivo_sql = "tmp/copiaseg.sql";
|
||||
$archivo = $archivo_sql . ".gz";
|
||||
if (file_exists($archivo)) {
|
||||
unlink($archivo);
|
||||
}
|
||||
$comando = escapeshellcmd(MYSQLDUMP . ' -u ' . USUARIO . ' --password=' . CLAVE . ' --result-file=' . $archivo_sql . ' ' . BASEDATOS);
|
||||
$comando2 = escapeshellcmd(GZIP . ' -9f ' . $archivo_sql);
|
||||
exec($comando);
|
||||
exec($comando2);
|
||||
if (filesize($archivo) < 1024) {
|
||||
//No se ha realizado la copia de seguridad
|
||||
$mensaje = "La copia de seguridad no se ha realizado correctamente.<br><br>";
|
||||
$mensaje .= "Compruebe que las rutas a los programas mysqldump y gzip en configuración están correctamente establecidas ";
|
||||
$mensaje .= "y que los datos de acceso a la base de datos sean correctos.<br>";
|
||||
$mensaje .= "mysqldump=[" . MYSQLDUMP . "]<br>";
|
||||
$mensaje .= "gzip=[" . GZIP . "]";
|
||||
$cabecera = "ERROR";
|
||||
$tipo = "danger";
|
||||
} else {
|
||||
$mensaje .= 'Copia de seguridad realizada con éxito.<br><br>Pulse sobre el siguiente enlace para descargar:<br><br>';
|
||||
$mensaje .= '<a href="' . $archivo . '">Descargar Copia de Seguridad de Datos</a><br>';
|
||||
$cabecera = "Información";
|
||||
$tipo = "success";
|
||||
}
|
||||
return $this->panel($cabecera,$mensaje,$tipo);
|
||||
} else {
|
||||
return $this->mensajePermisos("Copias de seguridad");
|
||||
}
|
||||
} // Fin del contenido
|
||||
case 'usuario_incorrecto':
|
||||
$this->usuario_inc = true;
|
||||
@@ -252,7 +283,16 @@ class AportaContenido {
|
||||
* @return string
|
||||
*/
|
||||
public function mensajePermisos($tipo) {
|
||||
return "<center><h1>No tiene permiso para acceder a " . $tipo . "</h1></center>";
|
||||
return $this->panel("ERROR", "No tiene permiso para acceder a $tipo", "danger");
|
||||
}
|
||||
|
||||
public function panel($cabecera, $mensaje, $tipo) {
|
||||
$panel = '<div class="panel panel-' . $tipo . '"><div class="panel-heading">';
|
||||
$panel .= '<h3 class="panel-title">' . $cabecera . '</h3></div>';
|
||||
$panel .= '<div class="panel-body">';
|
||||
$panel .= $mensaje;
|
||||
$panel .= '</div>';
|
||||
return $panel;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -30,6 +30,10 @@
|
||||
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()
|
||||
{
|
||||
@@ -103,6 +107,38 @@
|
||||
$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) {
|
||||
@@ -115,40 +151,81 @@
|
||||
//$salida.='<label class="warn">Configuración guardada correctamente</label>';
|
||||
$salida.='<p class="bg-primary">Configuración guardada correctamente</p>';
|
||||
fclose($fsalida);
|
||||
unlink($this->confAnterior);
|
||||
//unlink($this->confAnterior);
|
||||
rename($this->configuracion,$this->confAnterior);
|
||||
rename($this->confNueva,$this->configuracion);
|
||||
rename($this->confNueva,$this->configuracion);
|
||||
unlink($this->confAnterior);
|
||||
}
|
||||
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ú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úrpura" => "#dbadff", "Gris" => "#e1e1e1", "Original" => '#F3FEC8');
|
||||
$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-2 col-md-6"><form name="configura" method="post">';
|
||||
$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->nombreCentro.'" size="30" /></td></tr>';
|
||||
$salida.='<tr><td>Número de filas</td><td><input type="text" name="filas" value="'.$this->numFilas.'" size="3" /></td></tr>';
|
||||
$salida.='<tr><td>Plantilla</td><td><select name="plantilla">';
|
||||
$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>Estilo</td><td><select name="estilo">';
|
||||
$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.='</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 ($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.='<tr><td>Servidor</td><td><input type="text" name="servidor" value="'.$this->servidor.'" size="30" /></td></tr>';
|
||||
$salida.='<tr><td>Base de datos</td><td><input type="text" name="baseDatos" value="'.$this->baseDatos.'" size="30" /></td></tr>';
|
||||
$salida.='<tr><td>Usuario</td><td><input type="text" name="usuario" value="'.$this->usuario.'" size="30" /></td></tr>';
|
||||
$salida.='<tr><td>Clave</td><td><input type="text" name="clave" value="'.$this->clave.'" size="30" /></td></tr>';
|
||||
$salida.='<tr><td>mysqldump</td><td><input type="text" name="mysqldump" value="'.$this->mysqldump.'" size="30" /></td></tr>';
|
||||
$salida.='<tr><td>gzip</td><td><input type="text" name="gzip" value="'.$this->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() {
|
||||
$('select[name=" .'"colorFon"'. "]').on('change', function() {
|
||||
$(document.body).css('background-color', $('select[name=" .'"colorFon"'. "]').val());
|
||||
$('.main').css('background-color', $('select[name=" .'"colorFon"'. "]').val());
|
||||
});
|
||||
$('select[name=" .'"colorLat"'. "]').on('change', function() {
|
||||
$('.sidebar').css('background-color', $('select[name=" .'"colorLat"'. "]').val());
|
||||
});
|
||||
$('select[name=". '"colorLat"' ."]').simplecolorpicker({theme: 'glyphicons'});
|
||||
$('select[name=" .'"colorFon"' ."]').simplecolorpicker({theme: 'glyphicons'});
|
||||
});
|
||||
</script>";
|
||||
//$salida.="<br>fondo=[$this->colorFondo] lateral=[$this->colorLateral]<br>";
|
||||
return $salida;
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
6
Csv.php
6
Csv.php
@@ -114,7 +114,7 @@ class Csv {
|
||||
// Escribe la cabecera del fichero
|
||||
$this->escribeLinea(array($consulta->Pagina->Cabecera, $consulta->Titulo['id'], $consulta->Titulo['Texto']));
|
||||
foreach ($consulta->Pagina->Cuerpo->Col as $campo) {
|
||||
$campos[] = utf8_decode($campo['Titulo']);
|
||||
$campos[] = $campo['Titulo'];
|
||||
}
|
||||
$this->escribeLinea($campos);
|
||||
// Escribe los datos de los campos
|
||||
@@ -151,8 +151,8 @@ class Csv {
|
||||
*/
|
||||
public function resumen() {
|
||||
//$mensaje .=
|
||||
$mensaje = "<center><h1>Archivo [inventario" . utf8_decode($this->cabecera[0]) . "]</h1>";
|
||||
$mensaje .= "<h2>id=[" . $this->cabecera[1] . "] Descripción=[" . utf8_decode($this->cabecera[2]) . "]</h2><br>";
|
||||
$mensaje = "<center><h1>Archivo [inventario" . $this->cabecera[0] . "]</h1>";
|
||||
$mensaje .= "<h2>id=[" . $this->cabecera[1] . "] Descripción=[" . $this->cabecera[2] . "]</h2><br>";
|
||||
$mensaje .= '<table border=1 class="table table-striped table-bordered table-condensed table-hover"><theader>';
|
||||
foreach ($this->datosFichero[0] as $campo) {
|
||||
$dato = $campo;
|
||||
|
@@ -56,7 +56,7 @@ class InformeInventario {
|
||||
}
|
||||
$fila = $this->bdd->procesaResultado();
|
||||
$plantilla = str_replace("{id}", $id, $plantilla);
|
||||
$plantilla = str_replace("{Descripcion}", utf8_encode($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);
|
||||
if ($salidaInforme == "pantalla") {
|
||||
$informe = new InformePDF($this->bdd, $salida, true);
|
||||
@@ -92,9 +92,9 @@ class InformeInventario {
|
||||
}
|
||||
$fila = $this->bdd->procesaResultado();
|
||||
$plantilla = str_replace("{id}", $id, $plantilla);
|
||||
$plantilla = str_replace("{Descripcion}", utf8_encode($fila['descripcion']), $plantilla);
|
||||
$plantilla = str_replace("{Marca}", utf8_encode($fila['marca']), $plantilla);
|
||||
$plantilla = str_replace("{Modelo}", utf8_encode($fila['modelo']), $plantilla);
|
||||
$plantilla = str_replace("{Descripcion}", $fila['descripcion'], $plantilla);
|
||||
$plantilla = str_replace("{Marca}", $fila['marca'], $plantilla);
|
||||
$plantilla = str_replace("{Modelo}", $fila['modelo'], $plantilla);
|
||||
file_put_contents($salida, $plantilla) or die('Fallo en la escritura de la plantilla ' . $salida);
|
||||
if ($salidaInforme == "pantalla") {
|
||||
$informe = new InformePDF($this->bdd, $salida, true);
|
||||
@@ -180,7 +180,7 @@ class InformeInventario {
|
||||
//$fila=$this->bdd->procesaResultado();
|
||||
$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("{Descripcion}", utf8_encode($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);
|
||||
if ($primero) {
|
||||
$primero = false;
|
||||
|
@@ -51,12 +51,13 @@ class InformePDF {
|
||||
// Recuperamos la definición del informe
|
||||
$this->def = simplexml_load_file($definicion);
|
||||
$this->bdd = $bdd;
|
||||
$this->pdf = new Pdf_mysql_table($this->bdd->obtieneManejador(), (string) $this->def->Pagina['Orientacion'], (string) $this->def->Pagina['Formato'], (string) $this->def->Titulo['Texto'], (string) $this->def->Pagina->Cabecera);
|
||||
$this->pdf = new Pdf_mysql_table($this->bdd->obtieneManejador(), (string) $this->def->Pagina['Orientacion'], (string) $this->def->Pagina['Formato'], (string) utf8_decode($this->def->Titulo['Texto']), (string) $this->def->Pagina->Cabecera);
|
||||
//echo $def->Titulo.$def->Cabecera;
|
||||
$this->pdf->Open();
|
||||
$this->pdf->setAuthor(utf8_decode(AUTOR));
|
||||
$this->pdf->setCreator(html_entity_decode(APLICACION));
|
||||
$this->pdf->setSubject(utf8_decode($this->def->Titulo));
|
||||
$this->pdf->setAuthor(AUTOR,true);
|
||||
$creador = CENTRO . " " . APLICACION;
|
||||
$this->pdf->setCreator(html_entity_decode($creador),true);
|
||||
$this->pdf->setSubject($this->def->Titulo,true);
|
||||
$this->pdf->setAutoPageBreak(true, 10);
|
||||
}
|
||||
|
||||
|
@@ -142,6 +142,7 @@ class Mantenimiento {
|
||||
}
|
||||
//$salida.=print_r($this->perfil);
|
||||
//$salida.=$comando;
|
||||
//var_dump($this->campos);
|
||||
while ($fila = $this->bdd->procesaResultado()) {
|
||||
$salida.='<tr align="center" bottom="middle">';
|
||||
foreach ($fila as $clave => $valor) {
|
||||
@@ -160,6 +161,10 @@ class Mantenimiento {
|
||||
$this->campoBusca = $dato[1];
|
||||
$valor = '<a title="Inventario de ' . $valor . '" $target="_blank" href="index.php?informeInventario&opc=listar' . $datoEnlace . '&id=' . $id . '">' . $valor;
|
||||
}
|
||||
if ($this->campos[$clave]['Type'] == "Boolean(1)") {
|
||||
$checked = $valor == '1' ? 'checked' : '';
|
||||
$valor = '<input type="checkbox" disabled ' . $checked . '>';
|
||||
}
|
||||
$salida.="<td>$valor</td>\n";
|
||||
}
|
||||
//Añade el icono de editar
|
||||
@@ -211,7 +216,7 @@ class Mantenimiento {
|
||||
//$salida .='"Buscar" />';
|
||||
//$salida .= '</form></center>';
|
||||
//$salida.='</p>';
|
||||
$salida = '<form name="busqueda" method="POST"><div class="col-lg-6"><div class="input-group">
|
||||
$salida = '<form name="busqueda" method="POST"><div class="col-sm-4 col-lg-6"><div class="input-group">
|
||||
<input type="text" name="buscar" placeholder="Descripción" class="form-control">
|
||||
<span class="input-group-btn"><button class="btn btn-primary" type="button">Buscar</button>
|
||||
</span></div></div></form>';
|
||||
@@ -265,7 +270,15 @@ class Mantenimiento {
|
||||
} else {
|
||||
$coma = ",";
|
||||
}
|
||||
$valor = $_POST[$campo] == "" ? "null" : '"' . $_POST[$campo] . '"';
|
||||
if ($this->campos[$campo]['Type'] == 'Boolean(1)') {
|
||||
$valor = "";
|
||||
if (empty($_POST[$campo])) {
|
||||
$valor = "0";
|
||||
}
|
||||
$valor = $_POST[$campo] == "on" ? '1' : $valor;
|
||||
} else {
|
||||
$valor = $_POST[$campo] == "" ? "null" : '"' . $_POST[$campo] . '"';
|
||||
}
|
||||
$comando.="$coma " . $valor;
|
||||
}
|
||||
$comando.=")";
|
||||
@@ -284,6 +297,7 @@ class Mantenimiento {
|
||||
//echo "id=$id pag=$pag orden=$orden sentido=$sentido";die();
|
||||
$comando = "update " . $this->tabla . " set ";
|
||||
$lista = explode("&", $_POST['listacampos']);
|
||||
//var_dump($lista);
|
||||
$primero = true;
|
||||
foreach ($lista as $campo) {
|
||||
if ($campo == "id" || $campo == "")
|
||||
@@ -291,13 +305,23 @@ class Mantenimiento {
|
||||
if ($primero) {
|
||||
$primero = false;
|
||||
$coma = " ";
|
||||
}
|
||||
else
|
||||
} else {
|
||||
$coma = ",";
|
||||
if (strlen(trim($_POST[$campo])) == 0)
|
||||
$comando.="$coma $campo=null";
|
||||
else
|
||||
$comando.=$coma . ' ' . $campo . '="' . $_POST[$campo] . '"';
|
||||
}
|
||||
if ($this->campos[$campo]['Type'] == 'Boolean(1)') {
|
||||
$valor = "";
|
||||
if (empty($_POST[$campo])) {
|
||||
$valor = "0";
|
||||
}
|
||||
$valor = $_POST[$campo] == "on" ? '1' : $valor;
|
||||
$comando.=$coma . ' ' . $campo . '="' . $valor . '"';
|
||||
} else {
|
||||
if (strlen(trim($_POST[$campo])) == 0) {
|
||||
$comando.="$coma $campo=null";
|
||||
} else {
|
||||
$comando.=$coma . ' ' . $campo . '="' . $_POST[$campo] . '"';
|
||||
}
|
||||
}
|
||||
}
|
||||
$comando.=" where id=\"$id\"";
|
||||
if (!$this->bdd->ejecuta($comando)) {
|
||||
@@ -306,6 +330,7 @@ class Mantenimiento {
|
||||
|
||||
list($enlace, $resto) = explode("&", $this->url);
|
||||
$enlace.="&opc=inicial&orden=" . $orden . "&sentido=" . $sentido . "&id=" . $pag;
|
||||
//echo $comando;
|
||||
header('Location: ' . $enlace);
|
||||
return;
|
||||
}
|
||||
@@ -446,8 +471,10 @@ class Mantenimiento {
|
||||
//Se salta los campos que no deben aparecer
|
||||
continue;
|
||||
}
|
||||
//Genera una lista con los campos que intervienen en el formulario.
|
||||
$salida .='<div class="form-group">';
|
||||
$campo = $valor['Campo'];
|
||||
$campos.="$campo&";
|
||||
$salida.='<label class="col-sm-2 control-label" for="' . $campo . '">' . ucfirst($clave) . "</label> ";
|
||||
$salida.='<div class="col-sm-5">';
|
||||
//Se asegura que el id no se pueda modificar.
|
||||
@@ -460,8 +487,8 @@ class Mantenimiento {
|
||||
$tipoCampo = $valor['Type'];
|
||||
//Si es un campo fecha u hora y está insertando pone la fecha actual o la hora actual
|
||||
if ($tipo == ANADIR) {
|
||||
if (stripos($tipoCampo, "echa") || stripos($tipoCampo, "ate")) {
|
||||
$valorDato = strftime("%d/%m/%Y");
|
||||
if (stripos($tipoCampo, "echa")<>0 || stripos($tipoCampo, "ate")<>0) {
|
||||
$valorDato = strftime("%Y/%m/%d");
|
||||
}
|
||||
}
|
||||
// Calcula el tamaño y el tipo
|
||||
@@ -473,13 +500,13 @@ class Mantenimiento {
|
||||
//
|
||||
//Prueba
|
||||
//
|
||||
$salida .= '<div class="input-group date" id="datetimepicker'.$nfechas.'">
|
||||
<input type="text" $name ="'.$campo.'" data-format="YYYY/MM/DD" value="'.$valorDato.'" '. $modoEfectivo. ' class="form-control" />
|
||||
$salida .= '<div class="input-group date" id="datetimepicker' . $nfechas . '">
|
||||
<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>
|
||||
</div>';
|
||||
$salida .= '<script type="text/javascript">
|
||||
$(function () {
|
||||
$('."'#datetimepicker".$nfechas."').datetimepicker({
|
||||
$(' . "'#datetimepicker" . $nfechas . "').datetimepicker({
|
||||
pick12HourFormat: false,
|
||||
language: 'es',
|
||||
pickTime: false
|
||||
@@ -495,6 +522,14 @@ class Mantenimiento {
|
||||
if ($tipoCampo == "Password") {
|
||||
$tipo_campo = "password";
|
||||
}
|
||||
if ($tipoCampo == "Boolean(1)") {
|
||||
$checked = $valorDato == '1' ? 'checked' : '';
|
||||
//$salida .= '<div class="checkbox">';
|
||||
$modocheck = $modoEfectivo == "readonly" ? 'onclick="javascript: return false;" readonly ' : '';
|
||||
$salida .= '<input type="checkbox" name="' . $campo . '" ' . $checked . ' ' . $modocheck . ' class="form-control">';
|
||||
$salida .= '</div></div>';
|
||||
continue;
|
||||
}
|
||||
//Si no es una clave foránea añade un campo de texto normal
|
||||
$salida.='<input class="form-control" type="' . $tipo_campo . '" name="' . $campo . '" value="' . $valorDato .
|
||||
'" maxlength="' . $tamano . '" size="' . (string) (intval($tamano) + 5) . '" ' . $modoEfectivo . " ><br><br>\n";
|
||||
@@ -503,8 +538,6 @@ class Mantenimiento {
|
||||
$salida.=$this->generaLista($this->foraneas[$campo], $campo, $valorDato, $modoEfectivo);
|
||||
$salida.="</div></div>";
|
||||
}
|
||||
//Genera una lista con los campos que intervienen en el formulario.
|
||||
$campos.="$campo&";
|
||||
}
|
||||
//genera un campo oculto con la lista de campos a modificar.
|
||||
$salida .= '<input name="listacampos" type="hidden" value="' . $campos . "\">\n";
|
||||
|
@@ -61,7 +61,7 @@ class Pdf_mysql_table extends Fpdf
|
||||
//Titulo
|
||||
$fecha=strftime("%d-%b-%Y %H:%M");
|
||||
$this->SetFont('Arial','',8);
|
||||
$this->Cell(0,4,html_entity_decode(APLICACION),0,1,'L');
|
||||
$this->Cell(0,4,html_entity_decode(CENTRO . " " . APLICACION,ENT_COMPAT | ENT_HTML401,'ISO-8859-1'),0,1,'L');
|
||||
$this->SetFont('Arial','',18);
|
||||
$this->Cell(0,6,utf8_decode($this->titulo),0,1,'C');
|
||||
$this->SetFont('Arial','',8);
|
||||
@@ -111,7 +111,7 @@ class Pdf_mysql_table extends Fpdf
|
||||
if ($this->procesandoTotales) {
|
||||
$this->SetFont('Arial','B',12);
|
||||
}
|
||||
$this->Cell($col['w'],5,$data[$col['f']],1,0,$alin,$fill);
|
||||
$this->Cell($col['w'],5,utf8_decode($data[$col['f']]),1,0,$alin,$fill);
|
||||
//$this->Cell($col['w'],5,utf8_decode($data[$col['f']]),1,0,$alin,$fill);
|
||||
//$this->Cell($col['w'],5,utf8_decode($data['proveedor']),1,0,$alin,$fill);
|
||||
//$this->Write(5,"nombre=".$col['f'].",titulo=".$col['c'].",ancho=".$col['w'].",alin=".$col['a']);
|
||||
|
71
README.md
71
README.md
@@ -1,8 +1,73 @@
|
||||
Inventario2
|
||||
# Inventario de Centro Educativo
|
||||
Copyright (c) 2008-2014, Ricardo Montañana Gómez
|
||||
|
||||
Inventario2 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.
|
||||
|
||||
Aplicación de inventario para un centro educativo.
|
||||
|
||||
Utiliza:
|
||||
*PHP v. 5.x
|
||||
*MySQL v. 5.x
|
||||
*PHP v. 5.3.x
|
||||
*MySQL v. 5.1.x
|
||||
*Apache
|
||||
|
||||
##Instalación
|
||||
Para instalar la aplicación basta con seguir estos pasos:
|
||||
###1. Copiar los archivos en una ubicación a la que tenga acceso el usuario con el que se ejecuta el servidor Apache (apache, _www, etc.).
|
||||
|
||||
mkdir Inventario
|
||||
cd Inventario
|
||||
unizp ../1.02.zip
|
||||
o
|
||||
tar xvzf ../1.02.tgz
|
||||
|
||||
###2. Crear un directorio temporal y dar derechos de escritura a los ficheros de configuración.
|
||||
|
||||
mkdir tmp
|
||||
chown apache tmp
|
||||
chown apache inc/configuracion.inc
|
||||
chown apache inc
|
||||
|
||||
###3. Crear una base de datos en MySQL con el siguiente comando
|
||||
|
||||
create database Inventario character set utf8 collate utf8_spanish_ci;
|
||||
|
||||
###4. Dar todos los derechos de acceso a esa base de datos a un usuario:
|
||||
|
||||
grant all on Inventario.* to usuario identified by "contraseña";
|
||||
|
||||
###5. Crear la estructura de la base de datos para poder comenzar a trabajar:
|
||||
|
||||
mysql -u usuario --password=contraseña <sql/setup.sql
|
||||
|
||||
Con esto queda instalado el programa. Se crean en este proceso dos usuarios:
|
||||
|
||||
Usuario: admin Usuario: demo
|
||||
Contraseña: pruebas Contraseña: pruebas
|
||||
|
||||
##Modelo de datos
|
||||
El modelo de datos que se ha utilizado ha sido:
|
||||

|
||||
|
||||
###Procedimiento de actualización de ISO-8859-1 a UTF-8 en MySQL
|
||||
Para actualizar la base de datos tan sólo hay que modificar el tipo de la base de datos y de las tablas a utf8 mediante workbench o mediante el comando:
|
||||
|
||||
use Inventario2;
|
||||
alter database Inventario2 character set utf8 collate utf8_spanish_ci;
|
||||
alter table Articulos convert to character set utf8 collate utf8_spanish_ci;
|
||||
alter table Ubicaciones convert to character set utf8 collate utf8_spanish_ci;
|
||||
alter table Elementos convert to character set utf8 collate utf8_spanish_ci;
|
||||
alter table Usuarios convert to character set utf8 collate utf8_spanish_ci;
|
||||
|
||||
Una vez hecho esto hay que asegurarse que el charset con el que trabaja el servidor MySQL es utf8 para eso se entra en mysql y mediante el comando status se averigua. Se puede cambiar en my.cnf o mediante workbench crear/modificar el fichero de configuración.
|
||||
|
||||
Contenido mínimo del fichero /etc/my.cnf
|
||||
|
||||
[mysqld]
|
||||
character-set-server = utf8
|
||||
collation-server = utf8_spanish_ci
|
||||
|
||||
[client]
|
||||
default-character-set=utf8
|
6
Sql.php
6
Sql.php
@@ -80,9 +80,9 @@ class Sql {
|
||||
public function __destruct()
|
||||
{
|
||||
//Libera la memoria de una posible consulta.
|
||||
if ($this->peticion) {
|
||||
$this->peticion->free_result();
|
||||
}
|
||||
//if ($this->peticion) {
|
||||
// $this->peticion->free_result();
|
||||
//}
|
||||
// Si estaba conectada la base de datos la cierra.
|
||||
if ($this->estado) {
|
||||
$this->bdd->close();
|
||||
|
@@ -1,3 +1,7 @@
|
||||
<?php
|
||||
include('../inc/configuracion.inc');
|
||||
header("Content-type: text/css");
|
||||
?>
|
||||
/*
|
||||
* Base structure
|
||||
*/
|
||||
@@ -5,7 +9,7 @@
|
||||
/* Move down content because we have a fixed navbar that is 50px tall */
|
||||
body {
|
||||
padding-top: 50px;
|
||||
background-color: #F3FEC8;
|
||||
background-color: <?php echo COLORFON; ?>; /*Fondo*/
|
||||
}
|
||||
|
||||
|
||||
@@ -38,8 +42,9 @@ body {
|
||||
padding: 5px;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto; /* Scrollable contents if viewport is shorter than content. */
|
||||
background-color: #C4FAEC;/*#f5f5f5;*/
|
||||
background-color: <?php echo COLORLAT; ?>;/*Lateral*/
|
||||
border-right: 1px solid #eee;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,15 +70,11 @@ body {
|
||||
|
||||
.main {
|
||||
padding: 10px;
|
||||
background-color: #F3FEC8;
|
||||
|
||||
}
|
||||
@media (min-width: 768px) {
|
||||
.main {
|
||||
padding-right: 20px;
|
||||
padding-left: 20px;
|
||||
background-color: #F3FEC8;
|
||||
|
||||
}
|
||||
}
|
||||
.main .page-header {
|
13
css/jquery.simplecolorpicker-glyphicons.css
Executable file
13
css/jquery.simplecolorpicker-glyphicons.css
Executable file
@@ -0,0 +1,13 @@
|
||||
.simplecolorpicker.glyphicons span.color[data-selected]:after {
|
||||
/* Taken from glyphicon class. */
|
||||
position: relative;
|
||||
top: 1px;
|
||||
font-family: 'Glyphicons Halflings';
|
||||
line-height: .9;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
|
||||
content: '\e013'; /* Ok/check mark */
|
||||
|
||||
margin-right: 1px;
|
||||
margin-left: 1px;
|
||||
}
|
87
css/jquery.simplecolorpicker.css
Executable file
87
css/jquery.simplecolorpicker.css
Executable file
@@ -0,0 +1,87 @@
|
||||
/*
|
||||
* Very simple jQuery Color Picker
|
||||
* https://github.com/tkrotoff/jquery-simplecolorpicker
|
||||
*
|
||||
* Copyright (C) 2012-2013 Tanguy Krotoff <tkrotoff@gmail.com>
|
||||
*
|
||||
* Licensed under the MIT license
|
||||
*/
|
||||
|
||||
/**
|
||||
* Inspired by Bootstrap Twitter.
|
||||
* See https://github.com/twbs/bootstrap/blob/master/less/navbar.less
|
||||
* See https://github.com/twbs/bootstrap/blob/master/less/dropdowns.less
|
||||
*/
|
||||
|
||||
.simplecolorpicker.picker {
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: 0;
|
||||
z-index: 1051; /* Above Bootstrap modal (@zindex-modal = 1050) */
|
||||
display: none;
|
||||
float: left;
|
||||
|
||||
min-width: 160px;
|
||||
max-width: 283px; /* @popover-max-width = 276px + 7 */
|
||||
|
||||
padding: 5px 0 0 5px;
|
||||
margin: 2px 0 0;
|
||||
list-style: none;
|
||||
background-color: #fff; /* @dropdown-bg */
|
||||
|
||||
border: 1px solid #ccc; /* @dropdown-fallback-border */
|
||||
border: 1px solid rgba(0, 0, 0, .15); /* @dropdown-border */
|
||||
|
||||
-webkit-border-radius: 4px; /* @border-radius-base */
|
||||
-moz-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
|
||||
-webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, .175);
|
||||
-moz-box-shadow: 0 6px 12px rgba(0, 0, 0, .175);
|
||||
box-shadow: 0 6px 12px rgba(0, 0, 0, .175);
|
||||
|
||||
-webkit-background-clip: padding-box;
|
||||
-moz-background-clip: padding;
|
||||
background-clip: padding-box;
|
||||
}
|
||||
|
||||
.simplecolorpicker.inline {
|
||||
display: inline-block;
|
||||
padding: 6px 0;
|
||||
}
|
||||
|
||||
.simplecolorpicker span {
|
||||
margin: 0 5px 5px 0;
|
||||
}
|
||||
|
||||
.simplecolorpicker.icon,
|
||||
.simplecolorpicker span.color {
|
||||
display: inline-block;
|
||||
|
||||
cursor: pointer;
|
||||
border: 1px solid transparent;
|
||||
}
|
||||
|
||||
.simplecolorpicker.icon:after,
|
||||
.simplecolorpicker span.color:after {
|
||||
content: '\00a0\00a0\00a0\00a0'; /* Spaces */
|
||||
}
|
||||
|
||||
.simplecolorpicker span.color[data-disabled]:hover {
|
||||
cursor: not-allowed;
|
||||
border: 1px solid transparent;
|
||||
}
|
||||
|
||||
.simplecolorpicker span.color:hover,
|
||||
.simplecolorpicker span.color[data-selected],
|
||||
.simplecolorpicker span.color[data-selected]:hover {
|
||||
border: 1px solid #222; /* @gray-dark */
|
||||
}
|
||||
.simplecolorpicker span.color[data-selected]:after {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
/* Vertical separator, replaces optgroup. */
|
||||
.simplecolorpicker span.vr {
|
||||
border-left: 1px solid #222; /* @gray-dark */
|
||||
}
|
235
css/jquery.simplecolorpicker.js
Executable file
235
css/jquery.simplecolorpicker.js
Executable file
@@ -0,0 +1,235 @@
|
||||
/*
|
||||
* Very simple jQuery Color Picker
|
||||
* https://github.com/tkrotoff/jquery-simplecolorpicker
|
||||
*
|
||||
* Copyright (C) 2012-2013 Tanguy Krotoff <tkrotoff@gmail.com>
|
||||
*
|
||||
* Licensed under the MIT license
|
||||
*/
|
||||
|
||||
(function($) {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
var SimpleColorPicker = function(select, options) {
|
||||
this.init('simplecolorpicker', select, options);
|
||||
};
|
||||
|
||||
/**
|
||||
* SimpleColorPicker class.
|
||||
*/
|
||||
SimpleColorPicker.prototype = {
|
||||
constructor: SimpleColorPicker,
|
||||
|
||||
init: function(type, select, options) {
|
||||
var self = this;
|
||||
|
||||
self.type = type;
|
||||
|
||||
self.$select = $(select);
|
||||
self.$select.hide();
|
||||
|
||||
self.options = $.extend({}, $.fn.simplecolorpicker.defaults, options);
|
||||
|
||||
self.$colorList = null;
|
||||
|
||||
if (self.options.picker === true) {
|
||||
var selectText = self.$select.find('> option:selected').text();
|
||||
self.$icon = $('<span class="simplecolorpicker icon"'
|
||||
+ ' title="' + selectText + '"'
|
||||
+ ' style="background-color: ' + self.$select.val() + ';"'
|
||||
+ ' role="button" tabindex="0">'
|
||||
+ '</span>').insertAfter(self.$select);
|
||||
self.$icon.on('click.' + self.type, $.proxy(self.showPicker, self));
|
||||
|
||||
self.$picker = $('<span class="simplecolorpicker picker ' + self.options.theme + '"></span>').appendTo(document.body);
|
||||
self.$colorList = self.$picker;
|
||||
|
||||
// Hide picker when clicking outside
|
||||
$(document).on('mousedown.' + self.type, $.proxy(self.hidePicker, self));
|
||||
self.$picker.on('mousedown.' + self.type, $.proxy(self.mousedown, self));
|
||||
} else {
|
||||
self.$inline = $('<span class="simplecolorpicker inline ' + self.options.theme + '"></span>').insertAfter(self.$select);
|
||||
self.$colorList = self.$inline;
|
||||
}
|
||||
|
||||
// Build the list of colors
|
||||
// <span class="color selected" title="Green" style="background-color: #7bd148;" role="button"></span>
|
||||
self.$select.find('> option').each(function() {
|
||||
var $option = $(this);
|
||||
var color = $option.val();
|
||||
|
||||
var isSelected = $option.is(':selected');
|
||||
var isDisabled = $option.is(':disabled');
|
||||
|
||||
var selected = '';
|
||||
if (isSelected === true) {
|
||||
selected = ' data-selected';
|
||||
}
|
||||
|
||||
var disabled = '';
|
||||
if (isDisabled === true) {
|
||||
disabled = ' data-disabled';
|
||||
}
|
||||
|
||||
var title = '';
|
||||
if (isDisabled === false) {
|
||||
title = ' title="' + $option.text() + '"';
|
||||
}
|
||||
|
||||
var role = '';
|
||||
if (isDisabled === false) {
|
||||
role = ' role="button" tabindex="0"';
|
||||
}
|
||||
|
||||
var $colorSpan = $('<span class="color"'
|
||||
+ title
|
||||
+ ' style="background-color: ' + color + ';"'
|
||||
+ ' data-color="' + color + '"'
|
||||
+ selected
|
||||
+ disabled
|
||||
+ role + '>'
|
||||
+ '</span>');
|
||||
|
||||
self.$colorList.append($colorSpan);
|
||||
$colorSpan.on('click.' + self.type, $.proxy(self.colorSpanClicked, self));
|
||||
|
||||
var $next = $option.next();
|
||||
if ($next.is('optgroup') === true) {
|
||||
// Vertical break, like hr
|
||||
self.$colorList.append('<span class="vr"></span>');
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Changes the selected color.
|
||||
*
|
||||
* @param color the hexadecimal color to select, ex: '#fbd75b'
|
||||
*/
|
||||
selectColor: function(color) {
|
||||
var self = this;
|
||||
|
||||
var $colorSpan = self.$colorList.find('> span.color').filter(function() {
|
||||
return $(this).data('color').toLowerCase() === color.toLowerCase();
|
||||
});
|
||||
|
||||
if ($colorSpan.length > 0) {
|
||||
self.selectColorSpan($colorSpan);
|
||||
} else {
|
||||
console.error("The given color '" + color + "' could not be found");
|
||||
}
|
||||
},
|
||||
|
||||
showPicker: function() {
|
||||
var pos = this.$icon.offset();
|
||||
this.$picker.css({
|
||||
// Remove some pixels to align the picker icon with the icons inside the dropdown
|
||||
left: pos.left - 6,
|
||||
top: pos.top + this.$icon.outerHeight()
|
||||
});
|
||||
|
||||
this.$picker.show(this.options.pickerDelay);
|
||||
},
|
||||
|
||||
hidePicker: function() {
|
||||
this.$picker.hide(this.options.pickerDelay);
|
||||
},
|
||||
|
||||
/**
|
||||
* Selects the given span inside $colorList.
|
||||
*
|
||||
* The given span becomes the selected one.
|
||||
* It also changes the HTML select value, this will emit the 'change' event.
|
||||
*/
|
||||
selectColorSpan: function($colorSpan) {
|
||||
var color = $colorSpan.data('color');
|
||||
var title = $colorSpan.prop('title');
|
||||
|
||||
// Mark this span as the selected one
|
||||
$colorSpan.siblings().removeAttr('data-selected');
|
||||
$colorSpan.attr('data-selected', '');
|
||||
|
||||
if (this.options.picker === true) {
|
||||
this.$icon.css('background-color', color);
|
||||
this.$icon.prop('title', title);
|
||||
this.hidePicker();
|
||||
}
|
||||
|
||||
// Change HTML select value
|
||||
this.$select.val(color);
|
||||
},
|
||||
|
||||
/**
|
||||
* The user clicked on a color inside $colorList.
|
||||
*/
|
||||
colorSpanClicked: function(e) {
|
||||
// When a color is clicked, make it the new selected one (unless disabled)
|
||||
if ($(e.target).is('[data-disabled]') === false) {
|
||||
this.selectColorSpan($(e.target));
|
||||
this.$select.trigger('change');
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Prevents the mousedown event from "eating" the click event.
|
||||
*/
|
||||
mousedown: function(e) {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
},
|
||||
|
||||
destroy: function() {
|
||||
if (this.options.picker === true) {
|
||||
this.$icon.off('.' + this.type);
|
||||
this.$icon.remove();
|
||||
$(document).off('.' + this.type);
|
||||
}
|
||||
|
||||
this.$colorList.off('.' + this.type);
|
||||
this.$colorList.remove();
|
||||
|
||||
this.$select.removeData(this.type);
|
||||
this.$select.show();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Plugin definition.
|
||||
* How to use: $('#id').simplecolorpicker()
|
||||
*/
|
||||
$.fn.simplecolorpicker = function(option) {
|
||||
var args = $.makeArray(arguments);
|
||||
args.shift();
|
||||
|
||||
// For HTML element passed to the plugin
|
||||
return this.each(function() {
|
||||
var $this = $(this),
|
||||
data = $this.data('simplecolorpicker'),
|
||||
options = typeof option === 'object' && option;
|
||||
if (data === undefined) {
|
||||
$this.data('simplecolorpicker', (data = new SimpleColorPicker(this, options)));
|
||||
}
|
||||
if (typeof option === 'string') {
|
||||
data[option].apply(data, args);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Default options.
|
||||
*/
|
||||
$.fn.simplecolorpicker.defaults = {
|
||||
// No theme by default
|
||||
theme: '',
|
||||
|
||||
// Show the picker or make it inline
|
||||
picker: false,
|
||||
|
||||
// Animation delay in milliseconds
|
||||
pickerDelay: 0
|
||||
};
|
||||
|
||||
})(jQuery);
|
21
fpdf.css
21
fpdf.css
@@ -1,21 +0,0 @@
|
||||
body {font-family:"Times New Roman",serif}
|
||||
h1 {font:bold 135% Arial,sans-serif; color:#4000A0; margin-bottom:0.9em}
|
||||
h2 {font:bold 95% Arial,sans-serif; color:#900000; margin-top:1.5em; margin-bottom:1em}
|
||||
dl.param dt {text-decoration:underline}
|
||||
dl.param dd {margin-top:1em; margin-bottom:1em}
|
||||
dl.param ul {margin-top:1em; margin-bottom:1em}
|
||||
tt, code, kbd {font-family:"Courier New",Courier,monospace; font-size:82%}
|
||||
div.source {margin-top:1.4em; margin-bottom:1.3em}
|
||||
div.source pre {display:table; border:1px solid #24246A; width:100%; margin:0em; font-family:inherit; font-size:100%}
|
||||
div.source code {display:block; border:1px solid #C5C5EC; background-color:#F0F5FF; padding:6px; color:#000000}
|
||||
div.doc-source {margin-top:1.4em; margin-bottom:1.3em}
|
||||
div.doc-source pre {display:table; width:100%; margin:0em; font-family:inherit; font-size:100%}
|
||||
div.doc-source code {display:block; background-color:#E0E0E0; padding:4px}
|
||||
.kw {color:#000080; font-weight:bold}
|
||||
.str {color:#CC0000}
|
||||
.cmt {color:#008000}
|
||||
p.demo {text-align:center; margin-top:-0.9em}
|
||||
a.demo {text-decoration:none; font-weight:bold; color:#0000CC}
|
||||
a.demo:link {text-decoration:none; font-weight:bold; color:#0000CC}
|
||||
a.demo:hover {text-decoration:none; font-weight:bold; color:#0000FF}
|
||||
a.demo:active {text-decoration:none; font-weight:bold; color:#0000FF}
|
@@ -1,36 +0,0 @@
|
||||
<?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.
|
||||
* @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('SERVIDOR','localhost'); //Ubicación del servidor MySQL
|
||||
define('BASEDATOS','Inventario2'); //Nombre de la base de datos.
|
||||
define('USUARIO','test'); //Usuario con permisos de lectura/escritura en la base de datos
|
||||
define('CLAVE','tset'); //contraseña del usuario.
|
||||
define('VERSION','0.97 Beta');
|
||||
define('PROGRAMA','Gestión de Inventario.');
|
||||
define('CENTRO','I.E.S.O. Pascual Serrano');
|
||||
define('APLICACION',CENTRO.' '.PROGRAMA.VERSION);
|
||||
define('NUMFILAS',17); // Número de registros a mostrar en las pantallas de consulta iniciales
|
||||
define('PAUSA',2);//Nº segundos de pausa para mostrar mensaje id insertado
|
||||
define('ESTILO','personal'); //Estilo de los iconos de edición (personal, personal, personal)
|
||||
define('PLANTILLA','bootstrap'); //Estilo de la plantilla y recursos a utilizar
|
||||
?>
|
@@ -22,15 +22,19 @@
|
||||
*/
|
||||
define('AUTOR','Ricardo Montañana Gómez');
|
||||
define('SERVIDOR','localhost'); //Ubicación del servidor MySQL
|
||||
define('BASEDATOS','Inventario2'); //Nombre de la base de datos.
|
||||
define('BASEDATOS','Inventario4'); //Nombre de la base de datos.
|
||||
define('USUARIO','test'); //Usuario con permisos de lectura/escritura en la base de datos
|
||||
define('CLAVE','tset'); //contraseña del usuario.
|
||||
define('VERSION','1.00 Beta');
|
||||
define('VERSION','1.02');
|
||||
define('PROGRAMA','Gestión de Inventario.');
|
||||
define('CENTRO','I.E.S.O. Pascual Serrano');
|
||||
define('APLICACION',CENTRO.' '.PROGRAMA.VERSION);
|
||||
define('APLICACION',PROGRAMA.VERSION);
|
||||
define('NUMFILAS',17); // Número de registros a mostrar en las pantallas de consulta iniciales
|
||||
define('PAUSA',2);//Nº segundos de pausa para mostrar mensaje id insertado
|
||||
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', '#7ae7bf'); //Color de la barra de menú lateral
|
||||
define('COLORFON', '#a4bdfc'); //Color del fondo de la pantalla
|
||||
define('MYSQLDUMP', '/usr/local/bin/mysqldump'); //camino a mysqldump
|
||||
define('GZIP', '/usr/bin/gzip'); //Camino a gzip
|
||||
?>
|
||||
|
@@ -10,4 +10,5 @@
|
||||
2|Descuadres|index.php?descuadres|_blank|Diferencias entre artículos y elementos
|
||||
1|Varios|||
|
||||
2|Configuración|index.php?configuracion|_self|Opciones configurables de la aplicación
|
||||
2|Importación|index.php?importacion&opc=form|_self|Importa datos de una hoja de cálculo
|
||||
2|Importación|index.php?importacion&opc=form|_self|Importa datos de una hoja de cálculo
|
||||
2|Copia Datos|index.php?copiaseg|_self|Realiza una copia de seguridad de los datos de la aplicación
|
@@ -1,26 +1,26 @@
|
||||
<!DOCTYPE html>
|
||||
<!-- saved from url=(0043)http://getbootstrap.com/examples/dashboard/ -->
|
||||
<html lang="en">
|
||||
<html lang="es">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<meta charset="iso-8859-1">
|
||||
<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<EFBFBD>ana">
|
||||
<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.css" rel="stylesheet">
|
||||
<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">
|
||||
<style type="text/css"></style>
|
||||
<style id="clearly_highlighting_css" type="text/css">/* selection */ html.clearly_highlighting_enabled ::-moz-selection { background: rgba(246, 238, 150, 0.99); } html.clearly_highlighting_enabled ::selection { background: rgba(246, 238, 150, 0.99); } /* cursor */ html.clearly_highlighting_enabled { /* cursor and hot-spot position -- requires a default cursor, after the URL one */ cursor: url("chrome-extension://pioclpoplcdbaefihamjohnefbikjilc/clearly/images/highlight--cursor.png") 14 16, text; } /* highlight tag */ em.clearly_highlight_element { font-style: inherit !important; font-weight: inherit !important; background-image: url("chrome-extension://pioclpoplcdbaefihamjohnefbikjilc/clearly/images/highlight--yellow.png"); background-repeat: repeat-x; background-position: top left; background-size: 100% 100%; } /* the delete-buttons are positioned relative to this */ em.clearly_highlight_element.clearly_highlight_first { position: relative; } /* delete buttons */ em.clearly_highlight_element a.clearly_highlight_delete_element { display: none; cursor: pointer; padding: 0; margin: 0; line-height: 0; position: absolute; width: 34px; height: 34px; left: -17px; top: -17px; background-image: url("chrome-extension://pioclpoplcdbaefihamjohnefbikjilc/clearly/images/highlight--delete-sprite.png"); background-repeat: no-repeat; background-position: 0px 0px; } em.clearly_highlight_element a.clearly_highlight_delete_element:hover { background-position: -34px 0px; } /* retina */ @media (min--moz-device-pixel-ratio: 2), (-webkit-min-device-pixel-ratio: 2), (min-device-pixel-ratio: 2) { em.clearly_highlight_element { background-image: url("chrome-extension://pioclpoplcdbaefihamjohnefbikjilc/clearly/images/highlight--yellow@2x.png"); } em.clearly_highlight_element a.clearly_highlight_delete_element { background-image: url("chrome-extension://pioclpoplcdbaefihamjohnefbikjilc/clearly/images/highlight--delete-sprite@2x.png"); background-size: 68px 34px; } } </style><style id="holderjs-style" type="text/css"></style><style>[touch-action="none"]{ -ms-touch-action: none; touch-action: none; }[touch-action="pan-x"]{ -ms-touch-action: pan-x; touch-action: pan-x; }[touch-action="pan-y"]{ -ms-touch-action: pan-y; touch-action: pan-y; }[touch-action="scroll"],[touch-action="pan-x pan-y"],[touch-action="pan-y pan-x"]{ -ms-touch-action: pan-x pan-y; touch-action: pan-x pan-y; }
|
||||
</style>
|
||||
|
||||
<script type="text/javascript" src="./css/jquery.min.js"></script>
|
||||
</head>
|
||||
<body bgcolor="#C4FAEC">
|
||||
<body>
|
||||
<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
|
||||
<div class="container-fluid">
|
||||
<div class="navbar-header">
|
||||
@@ -88,5 +88,6 @@
|
||||
<script type="text/javascript" src="./css/moment.min.js"></script>
|
||||
<script type="text/javascript" src="./css/bootstrap-datetimepicker.min.js"></script>
|
||||
<script type="text/javascript" src="./css/bootstrap-datetimepicker.es.js"></script>
|
||||
<script type="text/javascript" src="./css/jquery.simplecolorpicker.js"></script>
|
||||
</body>
|
||||
</html>
|
@@ -1,7 +1,7 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<!DOCTYPE html>
|
||||
<html lang="es">
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" >
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" >
|
||||
<title>Gestión de Inventario</title>
|
||||
<link rel="stylesheet" href="css/estilo.css" type="text/css">
|
||||
<link rel="shortcut icon" href="img/tux.ico">
|
||||
|
@@ -84,7 +84,7 @@ SET @saved_cs_client = @@character_set_client;
|
||||
SET character_set_client = utf8;
|
||||
CREATE TABLE `Ubicaciones` (
|
||||
`id` smallint(5) unsigned NOT NULL auto_increment,
|
||||
`Descripcion` varchar(30) NOT NULL COMMENT 'ordenable,link/Ubicacion',
|
||||
`Descripcion` varchar(50) NOT NULL COMMENT 'ordenable,link/Ubicacion',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=184 DEFAULT CHARSET=latin1;
|
||||
SET character_set_client = @saved_cs_client;
|
168
sql/inv-utf.sql
Normal file
168
sql/inv-utf.sql
Normal file
File diff suppressed because one or more lines are too long
@@ -28,7 +28,7 @@ CREATE TABLE `Articulos` (
|
||||
`modelo` varchar(20) default NULL COMMENT 'ordenable',
|
||||
`cantidad` int(11) default NULL COMMENT 'ordenable',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=785 DEFAULT CHARSET=latin1;
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=785 DEFAULT CHARSET=utf8;
|
||||
SET character_set_client = @saved_cs_client;
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ CREATE TABLE `Elementos` (
|
||||
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=1884 DEFAULT CHARSET=latin1;
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=1884 DEFAULT CHARSET=utf8;
|
||||
SET character_set_client = @saved_cs_client;
|
||||
|
||||
|
||||
@@ -65,9 +65,9 @@ SET @saved_cs_client = @@character_set_client;
|
||||
SET character_set_client = utf8;
|
||||
CREATE TABLE `Ubicaciones` (
|
||||
`id` smallint(5) unsigned NOT NULL auto_increment,
|
||||
`Descripcion` varchar(30) NOT NULL COMMENT 'ordenable,link/Ubicacion',
|
||||
`Descripcion` varchar(50) NOT NULL COMMENT 'ordenable,link/Ubicacion',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=184 DEFAULT CHARSET=latin1;
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=184 DEFAULT CHARSET=utf8;
|
||||
SET character_set_client = @saved_cs_client;
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ CREATE TABLE `Usuarios` (
|
||||
`config` tinyint(1) NOT NULL default '0',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `nombre` (`nombre`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
|
||||
SET character_set_client = @saved_cs_client;
|
||||
|
||||
--
|
||||
@@ -101,7 +101,7 @@ SET character_set_client = @saved_cs_client;
|
||||
|
||||
LOCK TABLES `Usuarios` WRITE;
|
||||
/*!40000 ALTER TABLE `Usuarios` DISABLE KEYS */;
|
||||
INSERT INTO `Usuarios` VALUES (1,'admin','galeote','s3LUSqxg{s',1,1,1,1,1,1,1),(2,'demo','demo','NogP_U0Byi',0,0,0,1,1,0,0);
|
||||
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;
|
||||
|
||||
|
@@ -10,12 +10,12 @@
|
||||
<Col Campo="nombre" Nombre="nombre" Ancho="8" Ajuste="L" Titulo="Nombre" Varios="ordenable" Editable="si"/>
|
||||
<Col Campo="clave" Nombre="clave" Ancho="16" Ajuste="L" Titulo="Clave" Tipo="Password" Editable="si"/>
|
||||
<Col Campo="idSesion" Nombre="idSesion" Ancho="32" Ajuste="L" Titulo="id Sesión" Editable="si"/>
|
||||
<Col Campo="alta" Nombre="Alta" Ancho="1" Ajuste="R" Titulo="Altas" Editable="si"/>
|
||||
<Col Campo="modificacion" Nombre="modificacion" Ancho="1" Ajuste="R" Titulo="Modificaciones" Editable="si"/>
|
||||
<Col Campo="borrado" Nombre="borrado" Ancho="1" Ajuste="R" Titulo="Borrados" Editable="si"/>
|
||||
<Col Campo="consulta" Nombre="consulta" Ancho="1" Ajuste="R" Titulo="Consultas" Editable="si"/>
|
||||
<Col Campo="informe" Nombre="informe" Ancho="1" Ajuste="R" Titulo="Informes" Editable="si"/>
|
||||
<Col Campo="usuarios" Nombre="usuarios" Ancho="1" Ajuste="R" Titulo="Usuarios" Editable="si"/>
|
||||
<Col Campo="config" Nombre="config" Ancho="1" Ajuste="R" Titulo="Configuración" Editable="si"/>
|
||||
<Col Campo="alta" Nombre="alta" Ancho="1" Ajuste="R" Tipo="Boolean" Titulo="Altas" Editable="si"/>
|
||||
<Col Campo="modificacion" Nombre="modificacion" Ancho="1" Ajuste="R" Tipo="Boolean" Titulo="Modificaciones" Editable="si"/>
|
||||
<Col Campo="borrado" Nombre="borrado" Ancho="1" Ajuste="R" Tipo="Boolean" Titulo="Borrados" Editable="si"/>
|
||||
<Col Campo="consulta" Nombre="consulta" Ancho="1" Ajuste="R" Tipo="Boolean" Titulo="Consultas" Editable="si"/>
|
||||
<Col Campo="informe" Nombre="informe" Ancho="1" Ajuste="R" Tipo="Boolean" Titulo="Informes" Editable="si"/>
|
||||
<Col Campo="usuarios" Nombre="usuarios" Ancho="1" Ajuste="R" Tipo="Boolean" Titulo="Usuarios" Editable="si"/>
|
||||
<Col Campo="config" Nombre="config" Ancho="1" Ajuste="R" Tipo="Boolean" Titulo="Configuración" Editable="si"/>
|
||||
</Campos>
|
||||
</Mantenimiento>
|
||||
|
Reference in New Issue
Block a user