-- phpMyAdmin SQL Dump
-- version 4.0.9
-- http://www.phpmyadmin.net
--
-- Servidor: 10.6.64.97
-- Tiempo de generación: 22-05-2018 a las 19:30:36
-- Versión del servidor: 5.5.59
-- Versión de PHP: 5.3.3

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

--
-- Base de datos: `db5837549_1list2cookAPP`
--

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `Images`
--

CREATE TABLE IF NOT EXISTS `Images` (
  `imagIden` int(11) NOT NULL AUTO_INCREMENT,
  `imagPath` varchar(255) NOT NULL,
  PRIMARY KEY (`imagIden`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=14 ;

--
-- Volcado de datos para la tabla `Images`
--

INSERT INTO `Images` (`imagIden`, `imagPath`) VALUES
(2, '1526321899_IMG_20180514_151347.jpg'),
(3, '1526321933_IMG_20180514_151347.jpg'),
(4, '1526489164_IMG_20180514_151347.jpg'),
(5, '1526489731_IMG_20180514_151347.jpg'),
(6, '1526489754_images.jpg'),
(7, '1526490967_images.jpg'),
(8, '1526757005_recepta1.jpg'),
(9, '1526757030_recepta2.jpg'),
(10, '1526815719_recepta3.jpg'),
(11, '1526915969_images.jpg'),
(12, '1527008688_IMG_20180514_151347.jpg'),
(13, '1527008806_images.jpg');

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `Ingredients`
--

CREATE TABLE IF NOT EXISTS `Ingredients` (
  `ingrIden` int(11) NOT NULL AUTO_INCREMENT,
  `ingrName` varchar(100) NOT NULL,
  PRIMARY KEY (`ingrIden`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=156 ;

--
-- Volcado de datos para la tabla `Ingredients`
--

INSERT INTO `Ingredients` (`ingrIden`, `ingrName`) VALUES
(1, 'Vistec de vedella'),
(2, 'Salsa de romesco'),
(3, 'Oli'),
(13, 'I1'),
(14, 'I2'),
(15, 'I3'),
(16, 'Pastanagues'),
(17, 'Platans'),
(32, 'Mandarines'),
(33, 'Platan'),
(34, 'Caqui'),
(35, 'Tomaquets'),
(36, 'Enciam'),
(37, 'Pebrot vermell'),
(38, 'Pebrot verd'),
(62, 'Hamburguesa de pollastre'),
(63, 'Hamburguesa mixta'),
(64, 'Entrecot de vedella'),
(65, 'Botifarra negra'),
(66, 'Carn picada de porc'),
(67, 'Pit de pollastre sense os'),
(74, 'Macarrons'),
(75, 'Tomàquet fregit'),
(76, 'Ceba'),
(77, 'Formatge ratllat'),
(84, 'Pollastre'),
(85, 'Ceba'),
(86, 'Pollastre'),
(91, 'Pit de pollastre'),
(92, 'Pa ratllat'),
(99, 'huevo'),
(100, 'copos avena'),
(101, 'panela'),
(102, 'aceite '),
(103, 'harina'),
(104, 'Ing 1'),
(105, 'Ing 2'),
(106, 'I1'),
(107, 'I2'),
(108, 'Ou'),
(109, 'Suc de llimona'),
(112, 'Mozarella ratllada'),
(113, 'Xampinyons'),
(114, 'Massa de cresta'),
(115, 'Orenga'),
(116, 'Ou'),
(117, 'Ou'),
(118, 'Civada'),
(119, 'Oli de girasol'),
(120, 'Panela'),
(121, 'Essència de llimona'),
(122, 'Farina'),
(123, 'Menjar de gats'),
(124, 'Sorra de gats'),
(125, 'Panela'),
(126, 'Menta'),
(127, 'Carmels farigola'),
(128, 'Massa pasta fullada'),
(129, 'Porro'),
(130, 'Pebrot vermell'),
(131, 'Ous'),
(132, 'Xampinyons'),
(133, 'Formatge de cabra'),
(134, 'Nata per cuinar'),
(135, 'Espinacs'),
(149, 'Piña'),
(150, 'Ing 1'),
(152, 'I1'),
(154, 'Ing2'),
(155, 'Ing3');

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `IngredientsLists`
--

CREATE TABLE IF NOT EXISTS `IngredientsLists` (
  `inliIden` int(11) NOT NULL AUTO_INCREMENT,
  `inliList` int(11) NOT NULL,
  `inliIngredient` int(11) NOT NULL,
  `inliQuantity` varchar(100) DEFAULT NULL,
  `inliStat` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`inliIden`),
  KEY `inliList` (`inliList`,`inliIngredient`),
  KEY `inliIngredient` (`inliIngredient`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=136 ;

--
-- Volcado de datos para la tabla `IngredientsLists`
--

INSERT INTO `IngredientsLists` (`inliIden`, `inliList`, `inliIngredient`, `inliQuantity`, `inliStat`) VALUES
(16, 4, 32, '5', 1),
(17, 4, 33, '1 manat', 0),
(18, 4, 34, '1', 1),
(19, 4, 35, '5', 1),
(20, 4, 36, '2', 1),
(21, 4, 37, '1', 0),
(22, 4, 38, '3 unitats', 0),
(46, 10, 62, '4 unitats', 0),
(47, 10, 63, '4 unitats', 1),
(48, 10, 64, ' 2 unitats', 1),
(49, 10, 65, '1 unitat', 0),
(50, 10, 66, '500 gr', 0),
(51, 10, 67, '4 unitats', 1),
(58, 9, 1, '250', 1),
(59, 9, 2, '200', 1),
(60, 9, 3, '5', 1),
(61, 9, 13, '1', 1),
(62, 9, 14, '2', 1),
(63, 9, 15, '3', 0),
(64, 12, 1, '250', 1),
(65, 12, 2, '200', 1),
(66, 12, 3, '5', 1),
(67, 13, 84, '1 sencer', 0),
(68, 13, 85, '3', 1),
(71, 10, 84, '1 sencer', 0),
(72, 10, 85, '3', 1),
(73, 10, 86, '1', 1),
(76, 16, 1, '250', 1),
(77, 16, 2, '200', 1),
(78, 16, 3, '5', 1),
(104, 17, 112, '1 paquet', 1),
(105, 17, 113, '3 unitats', 1),
(106, 17, 114, '16 unitats', 1),
(107, 17, 115, '', 0),
(108, 17, 116, '1 unitat', 0),
(109, 17, 123, '1 paquet', 1),
(110, 17, 124, '2 caixes', 1),
(111, 18, 117, '1 unitat', 1),
(112, 18, 118, '125 g', 1),
(113, 18, 119, '75 ml', 1),
(114, 18, 120, '30 g', 1),
(115, 18, 121, '5 gotes', 1),
(116, 18, 122, '2 cullarades', 1),
(117, 19, 125, '1 paquet', 1),
(118, 19, 126, '250 g', 1),
(119, 19, 127, '10 unitats', 1),
(131, 26, 149, '1', 1),
(133, 28, 152, '1', 1),
(134, 27, 154, '2 units', 1),
(135, 27, 155, '3', 1);

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `IngredientsRecipes`
--

CREATE TABLE IF NOT EXISTS `IngredientsRecipes` (
  `inreIden` int(11) NOT NULL AUTO_INCREMENT,
  `inreRece` int(11) NOT NULL,
  `inreIngr` int(11) NOT NULL,
  `inreQuantity` varchar(100) NOT NULL,
  PRIMARY KEY (`inreIden`),
  KEY `inreRece` (`inreRece`),
  KEY `inreIngr` (`inreIngr`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=84 ;

--
-- Volcado de datos para la tabla `IngredientsRecipes`
--

INSERT INTO `IngredientsRecipes` (`inreIden`, `inreRece`, `inreIngr`, `inreQuantity`) VALUES
(1, 1, 1, '250'),
(2, 1, 2, '200'),
(4, 1, 3, '5'),
(17, 12, 74, '500 g'),
(18, 12, 17, '200 g'),
(19, 12, 75, '250 g'),
(20, 12, 76, '2 unitats'),
(21, 12, 77, ''),
(28, 19, 84, '1 sencer'),
(29, 19, 85, '3'),
(30, 19, 86, '1'),
(35, 21, 91, '8 unitats'),
(36, 21, 92, '500 gr'),
(43, 22, 99, '1'),
(44, 22, 100, '125 gr'),
(45, 22, 101, '30 gr'),
(46, 22, 102, '75 gr'),
(47, 22, 103, 'a ojo'),
(48, 18, 104, '1'),
(49, 18, 105, '2'),
(50, 23, 106, '1'),
(51, 23, 107, '2'),
(52, 21, 108, '2 unitats'),
(53, 21, 109, '1/2 llimona'),
(56, 25, 112, '1 paquet'),
(57, 25, 113, '3 unitats'),
(58, 25, 114, '16 unitats'),
(59, 25, 115, ''),
(60, 25, 116, '1 unitat'),
(61, 26, 117, '1 unitat'),
(62, 26, 118, '125 g'),
(63, 26, 119, '75 ml'),
(64, 26, 120, '30 g'),
(65, 26, 121, '5 gotes'),
(66, 26, 122, '2 cullarades'),
(67, 27, 128, '1 unitat'),
(68, 27, 129, '1/3'),
(69, 27, 130, '1/3'),
(70, 27, 131, '3 unitats'),
(71, 27, 132, '2 unitats'),
(72, 27, 133, '50 g'),
(73, 27, 134, '250 ml'),
(74, 27, 135, '30 g'),
(81, 31, 150, '1 unit'),
(82, 32, 152, '1');

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `Lists`
--

CREATE TABLE IF NOT EXISTS `Lists` (
  `listIden` int(11) NOT NULL AUTO_INCREMENT,
  `listUser` int(11) NOT NULL,
  `listTitle` varchar(100) NOT NULL,
  PRIMARY KEY (`listIden`),
  KEY `listUser` (`listUser`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=29 ;

--
-- Volcado de datos para la tabla `Lists`
--

INSERT INTO `Lists` (`listIden`, `listUser`, `listTitle`) VALUES
(4, 1, 'Fruita i verdura'),
(9, 1, 'Llista de la compra'),
(10, 1, 'Carnisseria'),
(12, 1, 'Filet de vedella'),
(13, 1, 'Pollo bueno'),
(16, 1, 'Filet de vedella 3'),
(17, 2, 'Mercadona'),
(18, 2, 'Galetes de civada'),
(19, 2, 'Herboristeria'),
(26, 1, 'New list'),
(27, 8, 'List 1'),
(28, 8, 'List new');

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `Recipes`
--

CREATE TABLE IF NOT EXISTS `Recipes` (
  `reciIden` int(11) NOT NULL AUTO_INCREMENT,
  `reciUser` int(11) NOT NULL,
  `reciCategory` int(11) NOT NULL,
  `reciTitle` varchar(255) NOT NULL,
  `reciText` text NOT NULL,
  `reciRations` varchar(100) NOT NULL,
  `reciTime` varchar(100) NOT NULL,
  `reciImage` int(11) DEFAULT NULL,
  PRIMARY KEY (`reciIden`),
  KEY `reciUser` (`reciUser`),
  KEY `reciImage` (`reciImage`),
  KEY `reciCategory` (`reciCategory`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=33 ;

--
-- Volcado de datos para la tabla `Recipes`
--

INSERT INTO `Recipes` (`reciIden`, `reciUser`, `reciCategory`, `reciTitle`, `reciText`, `reciRations`, `reciTime`, `reciImage`) VALUES
(1, 1, 1, 'Filet de vedella amb salsa romesco', 'Recepta de filet de vedella a la brasa amb salsa de romesco. Fàcil i ràpid.', '1', '15 minuts', NULL),
(2, 1, 2, 'Salmó amb verdures al forn', 'Recepta de salmó amb verdures al forn.', '2', '30 minuts', NULL),
(12, 1, 9, 'Macarrons amb salsa de paté', 'Macarrons amb salsa de paté d''ànec, tomàquet fregit i ceba.', '4 persones', '30 minuts', NULL),
(16, 1, 12, 'Recipe Image', 'Recepte amb imatge', '2', '2', NULL),
(18, 1, 13, 'Recepte + Imatge', 'RM', '2', '3', 3),
(19, 1, 16, 'Pollo to bueno', 'Pollo que esta de muerte. Pura mierda para las venas.', '1 persona', '20 minuts', 7),
(21, 1, 1, 'Pollastre arrebossat', 'Recepta de pollastre arrebossat de l''avia Rosario.', '4', '20 minuts', NULL),
(22, 1, 18, 'glletas de avena', 'galletas sanas', '3', '20 min', NULL),
(23, 1, 1, 'n', 'b', '1', '2', NULL),
(25, 2, 19, 'Crestes de mozzarella i xampinyons', 'Cruixents i delicioses crestes de mozzarella amb xampinyons. Perfectes com a pica pica o entrants.', '3-4 persones', '30 minuts', 8),
(26, 2, 20, 'Galetes de civada', 'Ideals per menjar entre hores. Recepta fàcil i ràpida.', '3-4 persones', '20 minuts', 9),
(27, 2, 19, 'Quiché de verdures i formatge', 'Entrant sa i contundent vegetaria, per a qualsevol ocasió.', '5-6 persones', '1 hora', 10),
(31, 8, 22, 'Recipe 1', 'Recipe description.\nText.', '2 persons', '1 minute', NULL),
(32, 8, 17, 'R2', 'BDR1', 'R1', 'T1', 13);

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `RecipesCategories`
--

CREATE TABLE IF NOT EXISTS `RecipesCategories` (
  `cateIden` int(11) NOT NULL AUTO_INCREMENT,
  `cateName` varchar(100) NOT NULL,
  PRIMARY KEY (`cateIden`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=23 ;

--
-- Volcado de datos para la tabla `RecipesCategories`
--

INSERT INTO `RecipesCategories` (`cateIden`, `cateName`) VALUES
(1, 'Carn'),
(2, 'Peix'),
(7, 'Categoria nova'),
(8, 'Categoria'),
(9, 'Pasta'),
(10, 'asd'),
(11, 'qwe'),
(12, 'Image'),
(13, 'Imatge'),
(14, '3Carn'),
(15, '3Categoria nova'),
(16, 'Pura mierda'),
(17, 'C1'),
(18, 'dulce'),
(19, 'Entrants'),
(20, 'Postres'),
(21, 'TEST category'),
(22, 'Category');

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `Steps`
--

CREATE TABLE IF NOT EXISTS `Steps` (
  `stepIden` int(11) NOT NULL AUTO_INCREMENT,
  `stepText` text NOT NULL,
  `stepRecipe` int(11) NOT NULL,
  PRIMARY KEY (`stepIden`),
  KEY `stepRecipe` (`stepRecipe`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=80 ;

--
-- Volcado de datos para la tabla `Steps`
--

INSERT INTO `Steps` (`stepIden`, `stepText`, `stepRecipe`) VALUES
(16, 'Escalfar el tomaquet fregit i la ceba picada en una paella durant 5 minuts.', 12),
(17, 'Barrejar la salsa amb el paté. Afegir sal i pebre al gust.', 12),
(18, 'Escorre la pasta i barrejarla amb la salsa.', 12),
(19, 'Servir la pasta i afegir  formatge ratllat al gust.', 12),
(26, 'Pas 1', 19),
(40, 'mezclar todos los ingredientes. si quieres las galletas mas duras añade más harina', 22),
(41, 'meter en el horno 15 min a 200 grados', 22),
(42, '1Lorem ipsum dolor sit amet consectetur adipiscing elit ante, sagittis nibh cum risus integer euismod platea scelerisque tristique, ultrices aliquet netus elementum viverra eget venenatis.', 1),
(43, '2Lorem ipsum dolor sit amet consectetur adipiscing elit ante, sagittis nibh cum risus integer euismod platea scelerisque tristique, ultrices aliquet netus elementum viverra eget venenatis.', 1),
(46, 'P2', 18),
(47, 'P3', 18),
(48, 'P4', 18),
(49, 'P1', 23),
(50, 'P2', 23),
(51, 'P3', 23),
(52, 'Batir els ous en un bol i afegir el suc de mitja llimona.', 21),
(53, 'Arrebossar les pechugas amb l''ou i el pa ratllat.', 21),
(54, 'Fregir cada pit de pollastre.', 21),
(57, 'Tallar els xampinyons en trossets petits i sofregir fins que perdin l''aigua.', 25),
(58, 'Cobrir una massa amb formatge, xampinyons i altre vegada formatge. ', 25),
(59, 'Tancar amb una segona massa i plegar les bores per assegurar el seu contingut.', 25),
(60, 'Pintar amb ou batut i afegir orenga per sobre.', 25),
(61, 'Daurar-les al forn durant 15 minuts.', 25),
(62, 'Preescalfar el forn a 200 ºC.', 26),
(63, 'Barrejar tots els ingredients en un bol.', 26),
(64, 'Fer petites boletes de massa i posar-les a la safata del forn.', 26),
(65, 'Cuinem les galetes durant 15 minuts.', 26),
(66, 'Deixar-les refredar abans de menjar.', 26),
(67, 'Posar la massa en el motlle i cuinar en el forn durant 10 minuts a 150 graus.', 27),
(68, 'Tallar les verdures i sofregir-les fins que perdin l''aigua.', 27),
(69, 'Barrejar la nata amb els ous en un bol. Incorporar les verdures i el formatge tallat.', 27),
(70, 'Incorporar la barreja al motlle amb la massa, cuinar durant 20 minuts a 160 graus.', 27),
(71, 'Deixar refredar abans de treure-la del motlle.', 27),
(77, '', 31),
(78, 'DP1', 32);

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `Users`
--

CREATE TABLE IF NOT EXISTS `Users` (
  `userIden` int(11) NOT NULL AUTO_INCREMENT,
  `userName` varchar(255) NOT NULL,
  `userEmail` varchar(100) NOT NULL,
  `userPass` varchar(100) NOT NULL,
  `userRegi` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`userIden`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=10 ;

--
-- Volcado de datos para la tabla `Users`
--

INSERT INTO `Users` (`userIden`, `userName`, `userEmail`, `userPass`, `userRegi`) VALUES
(1, 'Marc Pérez', 'prezmm@gmail.com', 'prez123', '2018-05-05 10:46:55'),
(2, 'User01', 'user01@1list2cook.com', 'user01', '2018-05-05 18:35:02'),
(7, 'User02', 'user02@1list2cook.com', 'user02', '2018-05-09 17:54:10'),
(8, 'User Test', 'test@1list2cook.com', 'userTEST', '2018-05-20 14:22:38');

--
-- Restricciones para tablas volcadas
--

--
-- Filtros para la tabla `IngredientsLists`
--
ALTER TABLE `IngredientsLists`
  ADD CONSTRAINT `IngredientsLists_ibfk_1` FOREIGN KEY (`inliList`) REFERENCES `Lists` (`listIden`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `IngredientsLists_ibfk_2` FOREIGN KEY (`inliIngredient`) REFERENCES `Ingredients` (`ingrIden`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Filtros para la tabla `IngredientsRecipes`
--
ALTER TABLE `IngredientsRecipes`
  ADD CONSTRAINT `IngredientsRecipes_ibfk_1` FOREIGN KEY (`inreRece`) REFERENCES `Recipes` (`reciIden`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `IngredientsRecipes_ibfk_2` FOREIGN KEY (`inreIngr`) REFERENCES `Ingredients` (`ingrIden`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Filtros para la tabla `Lists`
--
ALTER TABLE `Lists`
  ADD CONSTRAINT `Lists_ibfk_1` FOREIGN KEY (`listUser`) REFERENCES `Users` (`userIden`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Filtros para la tabla `Recipes`
--
ALTER TABLE `Recipes`
  ADD CONSTRAINT `Recipes_ibfk_1` FOREIGN KEY (`reciUser`) REFERENCES `Users` (`userIden`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `Recipes_ibfk_2` FOREIGN KEY (`reciCategory`) REFERENCES `RecipesCategories` (`cateIden`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `Recipes_ibfk_3` FOREIGN KEY (`reciImage`) REFERENCES `Images` (`imagIden`) ON DELETE SET NULL ON UPDATE CASCADE;

--
-- Filtros para la tabla `Steps`
--
ALTER TABLE `Steps`
  ADD CONSTRAINT `Steps_ibfk_1` FOREIGN KEY (`stepRecipe`) REFERENCES `Recipes` (`reciIden`) ON DELETE CASCADE ON UPDATE CASCADE;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
