This repository has been archived by the owner on Jan 25, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
97 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
include('DBConnect.php'); | ||
/** | ||
* Description of Genre | ||
* | ||
* @author lionel | ||
*/ | ||
class GenreDAO { | ||
|
||
|
||
|
||
/** | ||
* | ||
* @return type tableau de genre | ||
*/ | ||
public static function findAll(){ | ||
$bdd = connectDB(); | ||
$stmt = $bdd->query('SELECT * from genre'); | ||
return $stmt->fetchAll(PDO::FETCH_ASSOC); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
-- https://www.phpmyadmin.net/ | ||
-- | ||
-- Host: localhost:3306 | ||
-- Generation Time: Jun 22, 2017 at 11:32 AM | ||
-- Generation Time: Jun 28, 2017 at 09:15 AM | ||
-- Server version: 5.7.18-0ubuntu0.17.04.1 | ||
-- PHP Version: 7.0.18-0ubuntu0.17.04.1 | ||
|
||
|
@@ -32,44 +32,27 @@ CREATE TABLE `film` ( | |
`auteur` varchar(256) NOT NULL, | ||
`acteurs` varchar(1024) NOT NULL, | ||
`date_sortie` year(4) NOT NULL, | ||
`thumbnail` varchar(256) DEFAULT NULL | ||
`thumbnail` varchar(256) DEFAULT NULL, | ||
`genre_id` int(11) DEFAULT NULL | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | ||
|
||
-- | ||
-- Dumping data for table `film` | ||
-- | ||
|
||
INSERT INTO `film` (`id`, `titre`, `auteur`, `acteurs`, `date_sortie`, `thumbnail`) VALUES | ||
(1, 'Bernie', 'Dupontel Albert', 'Dupontel Albert', 1996, 'http://fr.web.img6.acsta.net/medias/nmedia/18/64/13/46/18754633.jpg'), | ||
(2, 'sdf', 'sdf', 'sdf', 2011, NULL), | ||
(3, 'sdcsd', 'sdc', 'sdc', 2015, NULL), | ||
(4, 'sdcsd', 'sdc', 'sdc', 2015, NULL), | ||
(5, 'rturtu', 'rtutru', 'rtutr', 2005, NULL), | ||
(6, 'kikou des bois', 'zonote', 'talui', 2005, NULL), | ||
(7, 'sdcsdsdcsd', 'sdcsdcsdc', 'sdcsdcsdcdc', 2004, NULL), | ||
(8, 'taliu', 'zonote', 'pikatchou', 2005, NULL), | ||
(9, 'hgfj', 'gfj', 'fgjf', 2014, NULL), | ||
(10, 'ddg', 'dfgdfg', 'dfgdfg', 1986, NULL); | ||
|
||
-- -------------------------------------------------------- | ||
|
||
-- | ||
-- Table structure for table `utilisateur` | ||
-- | ||
|
||
CREATE TABLE `utilisateur` ( | ||
`id` int(11) NOT NULL, | ||
`login` varchar(20) NOT NULL, | ||
`mdp` varchar(256) NOT NULL, | ||
`email` varchar(256) NOT NULL | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | ||
|
||
-- | ||
-- Dumping data for table `utilisateur` | ||
-- | ||
|
||
INSERT INTO `utilisateur` (`id`, `login`, `mdp`, `email`) VALUES | ||
(1, 'lionel', '$2y$10$jd3m6moA6rQ.p8OUuwO.UO3XAxml/Z6GW/.WxK1qzTnnK6py38sbS', '[email protected]'); | ||
INSERT INTO `film` (`id`, `titre`, `auteur`, `acteurs`, `date_sortie`, `thumbnail`, `genre_id`) VALUES | ||
(1, 'Bernie', 'Dupontel Albert', 'Dupontel Albert', 1996, 'http://fr.web.img6.acsta.net/medias/nmedia/18/64/13/46/18754633.jpg', 2), | ||
(2, 'sdf', 'sdf', 'sdf', 2011, NULL, 2), | ||
(3, 'sdcsd', 'sdc', 'sdc', 2015, NULL, 2), | ||
(4, 'sdcsd', 'sdc', 'sdc', 2015, NULL, 2), | ||
(5, 'rturtu', 'rtutru', 'rtutr', 2005, NULL, 2), | ||
(6, 'kikou des bois', 'zonote', 'talui', 2005, NULL, 2), | ||
(7, 'sdcsdsdcsd', 'sdcsdcsdc', 'sdcsdcsdcdc', 2004, NULL, 2), | ||
(8, 'taliu', 'zonote', 'pikatchou', 2005, NULL, 2), | ||
(9, 'hgfj', 'gfj', 'fgjf', 2014, NULL, 2), | ||
(10, 'ddg', 'dfgdfg', 'dfgdfg', 1986, NULL, 2), | ||
(11, 'aaaaaa', 'fgj', 'gfjfgj', 2015, NULL, 2), | ||
(12, 'testouille des prés', 'kikou', 'olala', 2004, NULL, 2); | ||
|
||
-- | ||
-- Indexes for dumped tables | ||
|
@@ -79,13 +62,8 @@ INSERT INTO `utilisateur` (`id`, `login`, `mdp`, `email`) VALUES | |
-- Indexes for table `film` | ||
-- | ||
ALTER TABLE `film` | ||
ADD PRIMARY KEY (`id`); | ||
|
||
-- | ||
-- Indexes for table `utilisateur` | ||
-- | ||
ALTER TABLE `utilisateur` | ||
ADD PRIMARY KEY (`id`); | ||
ADD PRIMARY KEY (`id`), | ||
ADD KEY `genre_id` (`genre_id`); | ||
|
||
-- | ||
-- AUTO_INCREMENT for dumped tables | ||
|
@@ -95,12 +73,17 @@ ALTER TABLE `utilisateur` | |
-- AUTO_INCREMENT for table `film` | ||
-- | ||
ALTER TABLE `film` | ||
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11; | ||
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13; | ||
-- | ||
-- AUTO_INCREMENT for table `utilisateur` | ||
-- Constraints for dumped tables | ||
-- | ||
ALTER TABLE `utilisateur` | ||
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; | ||
|
||
-- | ||
-- Constraints for table `film` | ||
-- | ||
ALTER TABLE `film` | ||
ADD CONSTRAINT `film_ibfk_1` FOREIGN KEY (`genre_id`) REFERENCES `genre` (`id`); | ||
|
||
/*!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 */; | ||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<select name="genre"> | ||
<?php | ||
include('model/dao/GenreDAO.php'); | ||
$genres = GenreDAO::findAll(); | ||
foreach ($genres as $genre) { | ||
echo '<option value="'.$genre['id'].'">'.$genre['nom'].'</option>'; | ||
} | ||
|
||
?> | ||
</select> | ||
|
||
|
||
|
||
|