<html>
<head>
	<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <style type="text/css">
<!--
body {
        font-family: Verdana, Arial, Helvetica, sans-serif;
        margin: 0;
        font-size: 80%;
        font-weight: bold;
        background: #777;
        }
ul {
        list-style: none;
        margin: 0;
        padding: 0;
        }
-->
</style>
</head>

<body background="images/myfondo.jpg">  
<br><br><br>
<?php
if (!$_POST) {
			echo "
			<center><br><br><font face='verdana' size='3' color='#d0d0d0'>Creaci&oacute;n de las BASES DE DATOS</font></center><br><hr>
			<form name = 'entrada' action = 'creardb.php' method = 'POST'>
			<table border=0 align='center'>
				<tr>
					<td align='right'> <font face='verdana' size='2' color='#d0d0d0'>Nombre de Empresa:</font></td>
					<td> <input type='text' name='empresa' size='50' maxlenght='50'> </td>
				</tr>
				<tr>
					<td align='right'> <font face='verdana' size='2' color='#d0d0d0'>Bases de Datos a Crear:</font></td>
					<td> <input type='text' name='db' size='50' maxlenght='20'> </td>
				</tr>
				<tr>
					<td align='right'> <font face='verdana' size='2' color='#d0d0d0'>Usuario:</font></td>
					<td> <input type='text' name='usuario' size='50' maxlenght='20'> </td>
				</tr>
				<tr>
					<td align='right'> <font face='verdana' size='2' color='#d0d0d0'>Clave del Usuario:</font></td>
					<td> <input type='text' name='clave' size='50' maxlenght='20'> </td>
				</tr>
				<tr>
					<td align='right'> <font face='verdana' size='2' color='#d0d0d0'>Detalle del Usuario:</font></td>
					<td> <input type='text' name='detalle' size='50' maxlenght='50'> </td>
				</tr>
				<tr>
					<td align='right'> <font face='verdana' size='2' color='#d0d0d0'>Nombre de Archivo Logo:</font></td>
					<td> <input type='text' name='logo' size='50' maxlenght='20' value='logo.jpg'> </td>
				</tr>
				<tr>
					<td align='right'></td>
					<td><input type='submit' name='Validar'  value='Aceptar' ></td>
				</tr>
			</table>		
			</form> <br> <hr> ";
			echo "<font size=2 face='Verdana' color=#d0d0d0><center><b>MyNomina 7.1 / MyChequeo 12.5<b><br><center><br>";
			echo "<font size=1 face='Verdana' color=#d0d0d0> Sistema para el Procesamiento de Nomina. <br><br><font size=1 color=#d0d0d0  face='Verdana'> Design by Ing Richard Davila";	
			echo "<script language='JavaScript' type='text/JavaScript'>";
			echo "document.entrada.empresa.focus();";
			echo "</script>	";
} else {
		include "fphp.php";	
///=====================================================================================================================
		$db="mynomina";
		$enlace=cargar_conexion_inicial();
		mysql_select_db($db);
		$error=mysql_error();
		if ($error!="") {
			$sql = "CREATE DATABASE $db;";
			$consulta=mysql_query($sql);
			mysql_select_db($db);
			$sql="
					CREATE TABLE `usuario` (
					  `usuario` varchar(50) NOT NULL,
					  `clave` varchar(50) NOT NULL,
					  `detalle` varchar(50) NOT NULL,
					  `acceso` varchar(20) NOT NULL,
					  `db` varchar(50) NOT NULL,
					  `empresa` varchar(50) NOT NULL,
					  `logo` varchar(50) NOT NULL
					) ENGINE=MyISAM DEFAULT CHARSET=latin1;";
			$consulta=mysql_query($sql);
			$sql="
					INSERT INTO `usuario` VALUES ('".$_POST['usuario']."', '".$_POST['clave']."', '".$_POST['detalle']."', '11111111111111111111','".$_POST['db']."','".$_POST['empresa']."','".$_POST['logo']."');";
			$consulta=mysql_query($sql);
		} else {
			$consulta=mysql_query($sql);
			$sql="
					INSERT INTO `usuario` VALUES ('".$_POST['usuario']."', '".$_POST['clave']."', '".$_POST['detalle']."', '11111111111111111111','".$_POST['db']."','".$_POST['empresa']."','".$_POST['logo']."');";
			$consulta=mysql_query($sql);
		}
		mysql_close($enlace);

///=====================================================================================================================
		$db="mynomina_".$_POST['db'];
		$enlace=cargar_conexion_inicial();
		mysql_select_db($db);
		$error=mysql_error();
		if ($error!="") {
			$sql = "CREATE DATABASE $db;";
			$consulta=mysql_query($sql);
			mysql_select_db($db);
			$sql = "CREATE TABLE `chequeo` (`codigo` varchar(8) NOT NULL, `fecha` datetime NOT NULL,`mensaje` varchar(100) NOT NULL) ENGINE=MyISAM DEFAULT CHARSET=latin1;";
			$consulta=mysql_query($sql);
			$sql="
			CREATE TABLE `concepto` (
					  `codigo` varchar(4) NOT NULL,
					  `detalle` varchar(50) NOT NULL,
					  `cuenta` varchar(50) NOT NULL,
					  `tipo` varchar(1) NOT NULL,
					  `formula` varchar(100) NOT NULL,
					  `acumula` varchar(2) NOT NULL
					) ENGINE=MyISAM DEFAULT CHARSET=latin1;";
			$consulta=mysql_query($sql);
			
			$sql="
			CREATE TABLE `diario` (
			  `cedula` varchar(8) NOT NULL,
			  `nombres` varchar(50) NOT NULL,
			  `turno` varchar(60) NOT NULL,
			  `fecha` date NOT NULL,
			  `h1` int(11) NOT NULL,
			  `m1` int(11) NOT NULL,
			  `h2` int(11) NOT NULL,
			  `m2` int(11) NOT NULL,
			  `h3` int(11) NOT NULL,
			  `m3` int(11) NOT NULL,
			  `h4` int(11) NOT NULL,
			  `m4` int(11) NOT NULL,
			  `h5` int(11) NOT NULL,
			  `m5` int(11) NOT NULL,
			  `h6` int(11) NOT NULL,
			  `m6` int(11) NOT NULL,
			  `mensaje` varchar(100) NOT NULL,
			  `departamento` varchar(100) NOT NULL
			) ENGINE=MyISAM DEFAULT CHARSET=latin1;";
			$consulta=mysql_query($sql);
			
			$sql="
					CREATE TABLE `concepto_condicion` (
					  `codigo` varchar(4) NOT NULL,
					  `valor1` varchar(50) NOT NULL,
					  `valor2` varchar(50) NOT NULL,
					  `condicion` varchar(2) NOT NULL
					) ENGINE=MyISAM DEFAULT CHARSET=latin1;";
			$consulta=mysql_query($sql);

			$sql="
					CREATE TABLE `personal_sueldo` (
					  `id` int(11) NOT NULL auto_increment,
					  `codigo` varchar(8) NOT NULL,
					  `fecha` date NOT NULL,
					  `sueldo` decimal(18,2) NOT NULL
					) ENGINE=MyISAM DEFAULT CHARSET=latin1;";
			$consulta=mysql_query($sql);
			
			$sql="
					CREATE TABLE `concepto_empleado` (
					  `cedula` varchar(8) NOT NULL,
					  `codigo` varchar(4) NOT NULL
					) ENGINE=MyISAM DEFAULT CHARSET=latin1;";
			$consulta=mysql_query($sql);
			$sql="
					CREATE TABLE `internet` (
					  `fecha` date NOT NULL,
					  `correo` varchar(50) NOT NULL,
					  `contacto` varchar(50) NOT NULL,
					  `comentario` varchar(255) NOT NULL
					) ENGINE=MyISAM DEFAULT CHARSET=latin1;";
			$consulta=mysql_query($sql);
			$sql="
					CREATE TABLE `concepto_nomina` (
					  `codigo` varchar(4) NOT NULL,
					  `nomina` varchar(3) NOT NULL
					) ENGINE=MyISAM DEFAULT CHARSET=latin1;";
			$consulta=mysql_query($sql);
			$sql="
					CREATE TABLE `concepto_periodo` (
					  `codigo` varchar(4) NOT NULL,
					  `periodo` varchar(3) NOT NULL
					) ENGINE=MyISAM DEFAULT CHARSET=latin1;";
			$consulta=mysql_query($sql);
			$sql="
					CREATE TABLE `constante` (
					  `codigo` varchar(4) NOT NULL,
					  `detalle` varchar(50) NOT NULL,
					  `unidad` varchar(10) NOT NULL,
					  `fijo` char(1) NOT NULL
					) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Tabla para la carga de constantes';";
			$consulta=mysql_query($sql);
			$sql="
					CREATE TABLE `constante_individual` (
					  `codigo` varchar(4) NOT NULL,
					  `cedula` varchar(8) NOT NULL,
					  `nomina` varchar(3) NOT NULL,
					  `monto` decimal(18,2) NOT NULL
					) ENGINE=MyISAM DEFAULT CHARSET=latin1;";
			$consulta=mysql_query($sql);
			$sql="
					CREATE TABLE `empresa` (
					  `nombre` varchar(100) NOT NULL,
					  `pie` varchar(200) NOT NULL,
					  `encabeza` varchar(200) NOT NULL,
					  `derecho` varchar(50) NOT NULL,
					  `prestamo` int(11) NOT NULL,
					  `duti` int(11) NOT NULL,
					  `dvac` int(11) NOT NULL,
					  `dbon` int(11) NOT NULL,
					  `icon` int(11) NOT NULL
					) ENGINE=MyISAM DEFAULT CHARSET=latin1;";
			$consulta=mysql_query($sql);
			$sql="
					INSERT INTO `empresa` VALUES ('".$_POST['empresa']."', '', '', 0,0,0,0,0);";
			$consulta=mysql_query($sql);
			$sql="
					CREATE TABLE `nomina` (
					  `codigo` varchar(3) NOT NULL,
					  `detalle` varchar(50) NOT NULL,
					  `periodo` varchar(3) NOT NULL,
					  `cuenta` varchar(50) NOT NULL,
					  `tipo` varchar(1) NOT NULL
					) ENGINE=MyISAM DEFAULT CHARSET=latin1;";
			$consulta=mysql_query($sql);

			$sql="
					CREATE TABLE `logs` (
					`usu` VARCHAR( 50 ) NOT NULL ,
					`maq` VARCHAR( 50 ) NOT NULL ,
					`fec` DATE NOT NULL ,
					`hor` VARCHAR( 10 ) NOT NULL ,
					`mod` VARCHAR( 50 ) NOT NULL
					) ENGINE=MyISAM DEFAULT CHARSET=latin1;";
			$consulta=mysql_query($sql);
			
			$sql="
					CREATE TABLE `historico` (
					  `cedula` varchar(8) NOT NULL,
					  `concepto` varchar(4) NOT NULL,
					  `desconcepto` varchar(50) NOT NULL,
					  `tipo` varchar(1) NOT NULL,
					  `monto` decimal(18,2) NOT NULL,
					  `saldo` decimal(18,2) NOT NULL,
					  `cantidad` decimal(18,2) NOT NULL,
					  `nomina` varchar(3) NOT NULL,
					  `desnomina` varchar(50) NOT NULL,
					  `periodo` varchar(3) NOT NULL,
					  `desperiodo` varchar(50) NOT NULL
					) ENGINE=MyISAM DEFAULT CHARSET=latin1;";
			$consulta=mysql_query($sql);
			$sql="
					CREATE TABLE `payroll` (
					  `cedula` varchar(8) NOT NULL,
					  `concepto` varchar(4) NOT NULL,
					  `desconcepto` varchar(50) NOT NULL,
					  `tipo` varchar(1) NOT NULL,
					  `monto` decimal(18,2) NOT NULL,
					  `saldo` decimal(18,2) NOT NULL,
					  `cantidad` decimal(18,2) NOT NULL,
					  `nomina` varchar(3) NOT NULL,
					  `desnomina` varchar(50) NOT NULL,
					  `periodo` varchar(3) NOT NULL,
					  `desperiodo` varchar(50) NOT NULL
					) ENGINE=MyISAM DEFAULT CHARSET=latin1;";
			$consulta=mysql_query($sql);
			$sql="
					CREATE TABLE `payroll1` (
					  `cedula` varchar(8) NOT NULL,
					  `concepto` varchar(4) NOT NULL,
					  `desconcepto` varchar(50) NOT NULL,
					  `tipo` varchar(1) NOT NULL,
					  `monto` decimal(18,2) NOT NULL,
					  `saldo` decimal(18,2) NOT NULL,
					  `cantidad` decimal(18,2) NOT NULL,
					  `nomina` varchar(3) NOT NULL,
					  `desnomina` varchar(50) NOT NULL,
					  `periodo` varchar(3) NOT NULL,
					  `desperiodo` varchar(50) NOT NULL
					) ENGINE=MyISAM DEFAULT CHARSET=latin1;";
			$consulta=mysql_query($sql);
			$sql="
					CREATE TABLE `payroll2` (
					  `cedula` varchar(8) NOT NULL,
					  `concepto` varchar(4) NOT NULL,
					  `desconcepto` varchar(50) NOT NULL,
					  `tipo` varchar(1) NOT NULL,
					  `monto` decimal(18,2) NOT NULL,
					  `saldo` decimal(18,2) NOT NULL,
					  `cantidad` decimal(18,2) NOT NULL,
					  `nomina` varchar(3) NOT NULL,
					  `desnomina` varchar(50) NOT NULL,
					  `periodo` varchar(3) NOT NULL,
					  `desperiodo` varchar(50) NOT NULL
					) ENGINE=MyISAM DEFAULT CHARSET=latin1;";
			$consulta=mysql_query($sql);
			$sql="
					CREATE TABLE `payroll3` (
					  `cedula` varchar(8) NOT NULL,
					  `concepto` varchar(4) NOT NULL,
					  `desconcepto` varchar(50) NOT NULL,
					  `tipo` varchar(1) NOT NULL,
					  `monto` decimal(18,2) NOT NULL,
					  `saldo` decimal(18,2) NOT NULL,
					  `cantidad` decimal(18,2) NOT NULL,
					  `nomina` varchar(3) NOT NULL,
					  `desnomina` varchar(50) NOT NULL,
					  `periodo` varchar(3) NOT NULL,
					  `desperiodo` varchar(50) NOT NULL
					) ENGINE=MyISAM DEFAULT CHARSET=latin1;";
			$consulta=mysql_query($sql);
			$sql="
					CREATE TABLE `payroll4` (
					  `cedula` varchar(8) NOT NULL,
					  `concepto` varchar(4) NOT NULL,
					  `desconcepto` varchar(50) NOT NULL,
					  `tipo` varchar(1) NOT NULL,
					  `monto` decimal(18,2) NOT NULL,
					  `saldo` decimal(18,2) NOT NULL,
					  `cantidad` decimal(18,2) NOT NULL,
					  `nomina` varchar(3) NOT NULL,
					  `desnomina` varchar(50) NOT NULL,
					  `periodo` varchar(3) NOT NULL,
					  `desperiodo` varchar(50) NOT NULL
					) ENGINE=MyISAM DEFAULT CHARSET=latin1;";
			$consulta=mysql_query($sql);
			$sql="
					CREATE TABLE `payroll5` (
					  `cedula` varchar(8) NOT NULL,
					  `concepto` varchar(4) NOT NULL,
					  `desconcepto` varchar(50) NOT NULL,
					  `tipo` varchar(1) NOT NULL,
					  `monto` decimal(18,2) NOT NULL,
					  `saldo` decimal(18,2) NOT NULL,
					  `cantidad` decimal(18,2) NOT NULL,
					  `nomina` varchar(3) NOT NULL,
					  `desnomina` varchar(50) NOT NULL,
					  `periodo` varchar(3) NOT NULL,
					  `desperiodo` varchar(50) NOT NULL
					) ENGINE=MyISAM DEFAULT CHARSET=latin1;";
			$consulta=mysql_query($sql);
			$sql="
					CREATE TABLE `payroll6` (
					  `cedula` varchar(8) NOT NULL,
					  `concepto` varchar(4) NOT NULL,
					  `desconcepto` varchar(50) NOT NULL,
					  `tipo` varchar(1) NOT NULL,
					  `monto` decimal(18,2) NOT NULL,
					  `saldo` decimal(18,2) NOT NULL,
					  `cantidad` decimal(18,2) NOT NULL,
					  `nomina` varchar(3) NOT NULL,
					  `desnomina` varchar(50) NOT NULL,
					  `periodo` varchar(3) NOT NULL,
					  `desperiodo` varchar(50) NOT NULL
					) ENGINE=MyISAM DEFAULT CHARSET=latin1;";
			$consulta=mysql_query($sql);
			$sql="
					CREATE TABLE `payroll7` (
					  `cedula` varchar(8) NOT NULL,
					  `concepto` varchar(4) NOT NULL,
					  `desconcepto` varchar(50) NOT NULL,
					  `tipo` varchar(1) NOT NULL,
					  `monto` decimal(18,2) NOT NULL,
					  `saldo` decimal(18,2) NOT NULL,
					  `cantidad` decimal(18,2) NOT NULL,
					  `nomina` varchar(3) NOT NULL,
					  `desnomina` varchar(50) NOT NULL,
					  `periodo` varchar(3) NOT NULL,
					  `desperiodo` varchar(50) NOT NULL
					) ENGINE=MyISAM DEFAULT CHARSET=latin1;";
			$consulta=mysql_query($sql);
			$sql="
					CREATE TABLE `payroll8` (
					  `cedula` varchar(8) NOT NULL,
					  `concepto` varchar(4) NOT NULL,
					  `desconcepto` varchar(50) NOT NULL,
					  `tipo` varchar(1) NOT NULL,
					  `monto` decimal(18,2) NOT NULL,
					  `saldo` decimal(18,2) NOT NULL,
					  `cantidad` decimal(18,2) NOT NULL,
					  `nomina` varchar(3) NOT NULL,
					  `desnomina` varchar(50) NOT NULL,
					  `periodo` varchar(3) NOT NULL,
					  `desperiodo` varchar(50) NOT NULL
					) ENGINE=MyISAM DEFAULT CHARSET=latin1;";
			$consulta=mysql_query($sql);
			$sql="
					CREATE TABLE `payroll9` (
					  `cedula` varchar(8) NOT NULL,
					  `concepto` varchar(4) NOT NULL,
					  `desconcepto` varchar(50) NOT NULL,
					  `tipo` varchar(1) NOT NULL,
					  `monto` decimal(18,2) NOT NULL,
					  `saldo` decimal(18,2) NOT NULL,
					  `cantidad` decimal(18,2) NOT NULL,
					  `nomina` varchar(3) NOT NULL,
					  `desnomina` varchar(50) NOT NULL,
					  `periodo` varchar(3) NOT NULL,
					  `desperiodo` varchar(50) NOT NULL
					) ENGINE=MyISAM DEFAULT CHARSET=latin1;";
			$consulta=mysql_query($sql);
			$sql="
					CREATE TABLE `periodo` (
					  `nomina` varchar(3) NOT NULL,
					  `periodo` varchar(3) NOT NULL,
					  `deduccion` int(11) NOT NULL,
					  `desde` date NOT NULL,
					  `hasta` date NOT NULL,
					  `pre` int(11) NULL,
					  `lunes` int(11) NULL
					) ENGINE=MyISAM DEFAULT CHARSET=latin1;";
			$consulta=mysql_query($sql);
			$sql="
					CREATE TABLE `interes` (
					  `id` int(11) NOT NULL auto_increment,
					  `fec` date NOT NULL,
					  `mon` decimal(18,2) NOT NULL,
					  PRIMARY KEY  (`id`)
					) ENGINE=MyISAM DEFAULT CHARSET=latin1;";
			$consulta=mysql_query($sql);
			$sql="
					CREATE TABLE `personal` (
					  `codigo` varchar(8) NOT NULL,
					  `nombres` varchar(50) NOT NULL,
					  `apellidos` varchar(50) NOT NULL,
					  `dir` varchar(100) NOT NULL,
					  `telefono` varchar(50) NOT NULL,
					  `sexo` varchar(1) NOT NULL,
					  `hijo` int(11) NOT NULL,
					  `gsanguineo` varchar(1) NOT NULL,
					  `gerencia` varchar(4) NOT NULL,
					  `departamento` varchar(4) NOT NULL,
					  `cargo` varchar(4) NOT NULL,
					  `unidad` varchar(4) NOT NULL,
					  `nomina` varchar(3) NOT NULL,
					  `turno` varchar(4) NOT NULL,
					  `banco` varchar(4) NOT NULL,
					  `fechan` date NOT NULL,
					  `fechai` date NOT NULL,
					  `fechae` date NOT NULL,
					  `cuenta` varchar(30) NOT NULL,
					  `mensaje` varchar(50) NOT NULL,
					  `sdia` decimal(18,2) NOT NULL,
					  `smes` decimal(18,2) NOT NULL,
					  `division` varchar(4) NOT NULL,
					  `sector` varchar(4) NOT NULL,
					  `estado` varchar(4) NOT NULL,
					  `pago` varchar(4) NOT NULL,
					  `parroquia` varchar(4) NOT NULL,
					  `nacionalidad` varchar(4) NOT NULL,
					  `municipio` varchar(4) NOT NULL,
					  `area` varchar(4) NOT NULL,
					  `edocivil` varchar(4) NOT NULL,
					  `tipo` varchar(4) NOT NULL,
					  `profesion` varchar(4) NOT NULL,
					  `direccion` varchar(4) NOT NULL,
					  `sso` varchar(30) NOT NULL,
					  `status` varchar(1) NOT NULL
					) ENGINE=MyISAM DEFAULT CHARSET=latin1;";
			$consulta=mysql_query($sql);
			$sql="
					CREATE TABLE `prestamo` (
					  `numero` int(11) NOT NULL,
					  `tipo` varchar(1) NOT NULL,
					  `cedula` varchar(8) NOT NULL,
					  `detalle` varchar(50) NOT NULL,
					  `fecha` date NOT NULL,
					  `monto` decimal(18,5) NOT NULL,
					  `interes` decimal(18,5) NOT NULL,
					  `total` decimal(18,5) NOT NULL,
					  `saldo` decimal(18,5) NOT NULL,
					  `cuota` decimal(18,5) NOT NULL
					) ENGINE=MyISAM DEFAULT CHARSET=latin1;";
			$consulta=mysql_query($sql);

			$sql="
					CREATE TABLE IF NOT EXISTS `sabana_concepto` (
					  `c001` varchar(4) NOT NULL,
					  `c002` varchar(4) NOT NULL,
					  `c003` varchar(4) NOT NULL,
					  `c004` varchar(4) NOT NULL,
					  `c005` varchar(4) NOT NULL,
					  `c006` varchar(4) NOT NULL,
					  `c007` varchar(4) NOT NULL,
					  `c008` varchar(4) NOT NULL,
					  `c009` varchar(4) NOT NULL,
					  `c010` varchar(4) NOT NULL,
					  `c011` varchar(4) NOT NULL,
					  `c012` varchar(4) NOT NULL,
					  `c013` varchar(4) NOT NULL,
					  `c014` varchar(4) NOT NULL,
					  `c015` varchar(4) NOT NULL,
					  `c016` varchar(4) NOT NULL,
					  `c017` varchar(4) NOT NULL,
					  `c018` varchar(4) NOT NULL,
					  `c019` varchar(4) NOT NULL,
					  `c020` varchar(4) NOT NULL,
					  `c021` varchar(4) NOT NULL,
					  `c022` varchar(4) NOT NULL,
					  `c023` varchar(4) NOT NULL,
					  `c024` varchar(4) NOT NULL,
					  `c025` varchar(4) NOT NULL,
					  `c026` varchar(4) NOT NULL,
					  `c027` varchar(4) NOT NULL,
					  `c028` varchar(4) NOT NULL,
					  `c029` varchar(4) NOT NULL,
					  `c030` varchar(4) NOT NULL,
					  `d001` varchar(10) NOT NULL,
					  `d002` varchar(10) NOT NULL,
					  `d003` varchar(10) NOT NULL,
					  `d004` varchar(10) NOT NULL,
					  `d005` varchar(10) NOT NULL,
					  `d006` varchar(10) NOT NULL,
					  `d007` varchar(10) NOT NULL,
					  `d008` varchar(10) NOT NULL,
					  `d009` varchar(10) NOT NULL,
					  `d010` varchar(10) NOT NULL,
					  `d011` varchar(10) NOT NULL,
					  `d012` varchar(10) NOT NULL,
					  `d013` varchar(10) NOT NULL,
					  `d014` varchar(10) NOT NULL,
					  `d015` varchar(10) NOT NULL,
					  `d016` varchar(10) NOT NULL,
					  `d017` varchar(10) NOT NULL,
					  `d018` varchar(10) NOT NULL,
					  `d019` varchar(10) NOT NULL,
					  `d020` varchar(10) NOT NULL,
					  `d021` varchar(10) NOT NULL,
					  `d022` varchar(10) NOT NULL,
					  `d023` varchar(10) NOT NULL,
					  `d024` varchar(10) NOT NULL,
					  `d025` varchar(10) NOT NULL,
					  `d026` varchar(10) NOT NULL,
					  `d027` varchar(10) NOT NULL,
					  `d028` varchar(10) NOT NULL,
					  `d029` varchar(10) NOT NULL,
					  `d030` varchar(10) NOT NULL
					) ENGINE=MyISAM DEFAULT CHARSET=latin1;";
			$consulta=mysql_query($sql);

			$sql="
					CREATE TABLE `tablas` (
					  `codigo` varchar(4) NOT NULL,
					  `tabla` varchar(20) NOT NULL,
					  `detalle` varchar(30) NOT NULL
					) ENGINE=MyISAM DEFAULT CHARSET=latin1;";
			$consulta=mysql_query($sql);
		}
		mysql_close($enlace);
		header ('location:index.php');
//========================================================================================================================================	
}	
?>
</body>
</html>
