Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
--
-- Table structure for table `aplazamientos`
--
--
-- Dumping data for table `aplazamientos`
--
--
-- Table structure for table `clientes`
--
--
-- Dumping data for table `clientes`
--
--
-- Table structure for table `cursos`
--
--
-- Dumping data for table `cursos`
--
--
-- Table structure for table `datosclinicos`
--
--
-- Dumping data for table `datosclinicos`
--
--
-- Table structure for table `detalle_horario`
--
--
-- Dumping data for table `detalle_horario`
--
--
-- Table structure for table `empresas`
--
--
-- Dumping data for table `empresas`
--
--
-- Table structure for table `estados`
--
--
-- Dumping data for table `estados`
--
--
-- Table structure for table `horarios`
--
--
-- Dumping data for table `horarios`
--
--
-- Table structure for table `inscripciones`
--
--
-- Dumping data for table `inscripciones`
--
--
-- Dumping data for table `permisos`
--
--
-- Table structure for table `permisosroles`
--
--
-- Dumping data for table `permisosroles`
--
--
-- Table structure for table `personalmedico`
--
--
-- Dumping data for table `personalmedico`
--
--
-- Table structure for table `roles`
--
--
-- Dumping data for table `roles`
--
--
-- Table structure for table `rolesusuarios`
--
--
-- Dumping data for table `rolesusuarios`
--
--
-- Table structure for table `salones`
--
--
-- Dumping data for table `salones`
--
--
-- Table structure for table `salones_has_servicios`
--
--
-- Dumping data for table `salones_has_servicios`
--
--
-- Table structure for table `servicios`
--
DROP TABLE IF EXISTS `servicios`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `servicios` (
`id_servicio` int(11) NOT NULL AUTO_INCREMENT COMMENT 'La tabla servicios hace
referencia a los servicios que el gimnasio ofrece en los programas o
independientemente de ellos, es decir, Spa, Pilates, Yoga, Baby Rumba, Control
Nutricional, entre otros. Por lo general las rutinas contienen una serie de
servicios y una rutina podr pertenecer a muchos programas que haran un paquete
completo que ofrece el gimnasio. ',
`nombre` varchar(20) DEFAULT NULL COMMENT 'Este campo almacena el nombre de
programa ',
`descripcion` text COMMENT 'Este campo almacena una pequea descripcion de cada
programa',
`valor` double DEFAULT NULL,
`objetivo` text,
`sesiones` int(11) NOT NULL,
`fk_sub_servicios` int(11) DEFAULT NULL,
`fk_tipo_servicio` int(11) NOT NULL,
PRIMARY KEY (`id_servicio`),
KEY `fk_servicios_subservicios_idx` (`fk_sub_servicios`),
KEY `fk_servicios_tipos_servicios1_idx` (`fk_tipo_servicio`),
CONSTRAINT `fk_servicios_subservicios` FOREIGN KEY (`fk_sub_servicios`)
REFERENCES `servicios` (`id_servicio`) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT `fk_servicios_tipos_servicios1` FOREIGN KEY (`fk_tipo_servicio`)
REFERENCES `tipos_servicios` (`id_tipo_servicio`) ON DELETE NO ACTION ON UPDATE NO
ACTION
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `servicios`
--
--
-- Table structure for table `tipos_servicios`
--
--
-- Dumping data for table `tipos_servicios`
--
--
-- Table structure for table `usuarios`
--
--
-- Dumping data for table `usuarios`
--
--
-- Dumping events for database 'mapris'
--
--
-- Dumping routines for database 'mapris'
--
/*!50003 DROP FUNCTION IF EXISTS `fc_descencriptar` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode =
'STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ALLOW_INVALID_D
ATES,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUT
ION' */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` FUNCTION `fc_descencriptar`(`clave_codificada`
VARCHAR(10)) RETURNS varchar(10) CHARSET latin1
BEGIN
DECLARE var VARCHAR(10);
SET var = (SELECT decode(clave_codificada,255));
RETURN var;
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP FUNCTION IF EXISTS `fc_encriptar` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode =
'STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ALLOW_INVALID_D
ATES,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUT
ION' */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` FUNCTION `fc_encriptar`(`clave` VARCHAR(35)
CHARSET utf8) RETURNS varchar(35) CHARSET utf8
BEGIN
DECLARE var VARCHAR(35);
SET var = (SELECT MD5(clave));
return var;
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP PROCEDURE IF EXISTS `pr_validar_usuario` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode =
'STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `pr_validar_usuario`(IN `pr_cedula`
VARCHAR(20), IN `pr_clave` VARCHAR(20))
NO SQL
SELECT * FROM usuarios WHERE cedula = pr_cedula AND clave = fc_encriptar(pr_clave)
;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;