mirror of
https://github.com/rmontanana/inventario2.git
synced 2025-08-15 23:45:58 +00:00
Modificado AportaContenido para incluir el nombre del centro en la pantalla inicial. Corregido también pequeño error en el Readme para poner las líneas en blanco donde corresponden.
This commit is contained in:
@@ -1,49 +0,0 @@
|
||||
<?php
|
||||
include('../inc/configuracion.inc');
|
||||
include('../Sql.php');
|
||||
|
||||
$bd = new Sql(SERVIDOR, USUARIO, CLAVE, "Inventario2");
|
||||
$bda = new Sql(SERVIDOR, USUARIO, CLAVE, "Inventario3");
|
||||
//Convierte Ubicaciones
|
||||
echo "Actualizando Ubiaciones";
|
||||
$comando = "select * from Ubicaciones;";
|
||||
$bd->ejecuta($comando);
|
||||
while ($fila = $bd->procesaResultado()) {
|
||||
//echo $fila['Descripcion'];
|
||||
//$descripcion = utf8_encode($fila['Descripcion']);
|
||||
$descripcion = $fila['Descripcion'];
|
||||
$id = $fila['id'];
|
||||
$comando = "insert into Ubicaciones (id,Descripcion) values ($id,'$descripcion');";
|
||||
//echo $comando;
|
||||
//echo $comando."\n";
|
||||
$bda->ejecuta($comando);
|
||||
}
|
||||
//Convierte Artículos
|
||||
echo "Actualizando la tabla de Artículos...";
|
||||
$comando = "select * from Articulos;";
|
||||
$bd->ejecuta($comando);
|
||||
while ($fila = $bd->procesaResultado()) {
|
||||
$id = $fila['id'];
|
||||
$descripcion = $fila['descripcion'];
|
||||
$marca = $fila['marca'];
|
||||
$modelo = $fila['modelo'];
|
||||
$cantidad = $fila['cantidad'];
|
||||
$comando = "insert into Articulos (id,Descripcion,Marca,Modelo,Cantidad) values ($id,'$descripcion','$marca','$modelo',$cantidad);";
|
||||
echo $comando."\n";
|
||||
$bda->ejecuta($comando);
|
||||
}
|
||||
//Convierte Elementos
|
||||
echo "Actualizando la tabla de Elementos...";
|
||||
$comando = "select * from Elementos";
|
||||
$bd->ejecuta($comando);
|
||||
while ($fila = $bd->procesaResultado()) {
|
||||
$id = $fila['id'];
|
||||
$id_articulo = $fila['id_Articulo'];
|
||||
$id_ubicacion = $fila['id_Ubicacion'];
|
||||
$numserie = $fila['numserie'];
|
||||
$cantidad = $fila['cantidad'];
|
||||
$fechaCompra = $fila['fechaCompra'];
|
||||
$comando = "insert into Elementos (id,id_Articulo,id_Ubicacion,numserie,cantidad,fechaCompra)
|
||||
values ($id,$id_articulo,$id_ubicacion,'$numserie',$cantidad,'$fechaCompra');";
|
||||
$bda->ejecuta($comando);
|
||||
}
|
@@ -1,24 +0,0 @@
|
||||
#!/bin/bash
|
||||
echo "Proceso de conversión de base de datos de ISO-8859-1 a UTF-8"
|
||||
echo "Sintaxis: " $0 " {usuario} {contraseña} {BaseDatosOrigen} {BaseDatosDestino}"
|
||||
echo "El usuario debe tener acceso para crear la base de datos destino y acceso a la base de datos de origen"
|
||||
echo "La base de datos Destino se borrará. Si no estás seguro pulsa control c"
|
||||
read k
|
||||
echo "Volcando la base de datos " $1
|
||||
mysqldump -u $1 --password=$2 --result-file=salida.sql $3
|
||||
echo "Creando la base de datos " $4
|
||||
mysql -u $1 --password=$2 <<EOF
|
||||
drop database $4 if exists
|
||||
create database $4 charset utf8 collate utf8_spanish_ci;
|
||||
EOF
|
||||
echo "Importando los datos en la base de datos " $4
|
||||
sed "s/latin1/utf8/g" salida.sql >salida2.sql
|
||||
iconv -f iso-8859-1 -t utf8 salida2.sql >salida.iconv.sql
|
||||
mysql -u $1 --password=$2 $4 < salida2.iconv.sql
|
||||
echo "Re-exportando los datos"
|
||||
mysqldump -u $1 --password=$2 --result-file=salida-final.sql $4
|
||||
echo "Re-importando los datos"
|
||||
mysql -u $1 --password=$2 $4 <salida-final.sql
|
||||
echo "Limpiando la casa"
|
||||
rm salida.sql salida2.sql salida.iconv.sql salida-final.sql
|
||||
echo "Proceso terminado"
|
@@ -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
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
168
sql/salida.sql
168
sql/salida.sql
File diff suppressed because one or more lines are too long
168
sql/salida2.sql
168
sql/salida2.sql
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;
|
||||
|
||||
--
|
||||
|
Reference in New Issue
Block a user