Skip to content

Instantly share code, notes, and snippets.

View AxelDesarrolloWeb's full-sized avatar

Axel Benjamín Alvarez Alcaraz AxelDesarrolloWeb

View GitHub Profile
@JCervantesB
JCervantesB / Email.php
Last active August 27, 2025 18:00
Email.php para deployment
<?php
namespace Classes;
use PHPMailer\PHPMailer\PHPMailer;
class Email {
public $email;
public $nombre;
@codigoconjuan
codigoconjuan / regalos.js
Created September 9, 2022 23:23
ChartJS Colores
backgroundColor: [
'#ea580c',
'#84cc16',
'#22d3ee',
'#a855f7',
'#ef4444',
'#14b8a6',
'#db2777',
'#e11d48',
'#7e22ce'
@codigoconjuan
codigoconjuan / eventos_registros.sql
Created September 8, 2022 23:52
Relación N:N de Eventos y Registros
CREATE TABLE `eventos_registros` (
`id` int NOT NULL AUTO_INCREMENT,
`evento_id` int DEFAULT NULL,
`registro_id` int DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `evento_id` (`evento_id`),
KEY `registro_id` (`registro_id`),
CONSTRAINT `eventos_registros_ibfk_1` FOREIGN KEY (`evento_id`) REFERENCES `eventos` (`id`),
CONSTRAINT `eventos_registros_ibfk_2` FOREIGN KEY (`registro_id`) REFERENCES `registros` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
@codigoconjuan
codigoconjuan / regalos.sql
Created September 7, 2022 20:37
Gist Regalos DevWebCamp
CREATE TABLE `regalos` (
`id` int NOT NULL AUTO_INCREMENT,
`nombre` varchar(50) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
INSERT INTO `regalos` (`id`, `nombre`) VALUES
@codigoconjuan
codigoconjuan / registros.sql
Created September 6, 2022 16:04
Base de datos de Registro
CREATE TABLE `registros` (
`id` int NOT NULL AUTO_INCREMENT,
`paquete_id` int DEFAULT NULL,
`pago_id` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`token` varchar(8) DEFAULT NULL,
`usuario_id` int DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `usuarioId` (`usuario_id`),
KEY `paquete_id` (`paquete_id`),
CONSTRAINT `registros_ibfk_1` FOREIGN KEY (`usuario_id`) REFERENCES `usuarios` (`id`),
@codigoconjuan
codigoconjuan / paquetes.sql
Created September 6, 2022 16:01
Gist Base de Datos Paquetes
CREATE TABLE `paquetes` (
`id` int NOT NULL AUTO_INCREMENT,
`nombre` varchar(30) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
INSERT INTO `paquetes` (`id`, `nombre`) VALUES
(1, 'Presencial'),
(2, 'Virtual'),
(3, 'Gratis');
@codigoconjuan
codigoconjuan / eventos.sql
Last active September 2, 2025 21:24
Datos para Eventos DevWebcamp
INSERT INTO `eventos` (`id`, `nombre`, `descripcion`, `disponibles`, `categoria_id`, `dia_id`, `hora_id`, `ponente_id`) VALUES
(1, 'Next.js - Aplicaciones con gran performance', 'Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec sodales condimentum magna fringilla egestas. In non pellentesque magna, at mollis velit. Morbi nec dapibus diam. Phasellus ante neque, blandit eget tortor a, cursus molestie turpis. Aenean placerat aliquet nibh, et interdum ipsum finibus at. Nulla sit amet faucibus leo, vel blandit urna. Curabitur dictum euismod sem, eget euismod magna pulvinar et. Nam semper aliquet nunc eu ornare. ', 50, 2, 2, 1, 1),
(2, 'MongoDB - Base de Datos a gran escala', 'Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec sodales condimentum magna fringilla egestas. In non pellentesque magna, at mollis velit. Morbi nec dapibus diam. Phasellus ante neque, blandit eget tortor a, cursus molestie turpis. Aenean placerat aliquet n
@codigoconjuan
codigoconjuan / Evento.php
Created August 24, 2022 18:54
Validación para Nuevos Eventos
// Mensajes de validación para la creación de un evento
public function validar() {
if(!$this->nombre) {
self::$alertas['error'][] = 'El Nombre es Obligatorio';
}
if(!$this->descripcion) {
self::$alertas['error'][] = 'La descripción es Obligatoria';
}
if(!$this->categoria_id || !filter_var($this->categoria_id, FILTER_VALIDATE_INT)) {
self::$alertas['error'][] = 'Elige una Categoría';
@codigoconjuan
codigoconjuan / eventos.sql
Last active August 30, 2025 22:00
Estructura de la base de datos para Eventos
CREATE TABLE `eventos` (
`id` int NOT NULL AUTO_INCREMENT,
`nombre` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`descripcion` text,
`disponibles` int DEFAULT NULL,
`categoria_id` int NOT NULL,
`dia_id` int NOT NULL,
`hora_id` int NOT NULL,
`ponente_id` int NOT NULL,
PRIMARY KEY (`id`),
@codigoconjuan
codigoconjuan / categorias.sql
Created August 24, 2022 16:36
Estructura de la Base de Datos de Categorias
CREATE TABLE `categorias` (
`id` int NOT NULL AUTO_INCREMENT,
`nombre` varchar(45) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;