Skip to content
This repository has been archived by the owner on Jan 25, 2021. It is now read-only.

Commit

Permalink
renommage des fichiers, ajout du script sql initial et README
Browse files Browse the repository at this point in the history
  • Loading branch information
lduboeuf committed Jun 22, 2017
1 parent 27c63e1 commit 55248df
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 4 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# afpa-bay
Premier projet php

## Installation
Créer une base de de donnée, importer le script `resources/film.sql`.
Adapter les url de connexion dans les scripts

5 changes: 3 additions & 2 deletions film-creation.php → film-form-handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,16 @@
//tout va bien
echo 'cool!, film ajouté à la liste <a href="index.php">retour à la liste</a>';
}else{
echo '<p class="alert">ptit soucis ici!</p>';
echo '<p class="alert">ptit soucis ici, un champ semble foireux!</p>';
print_r($bdd->errorInfo());
require('film-form.php');
}
//$pdo->lastInsertId();

}else{ //ya un pb, tous les champs ne sont pas renseignés

echo '<p class="alert">tous les champs sont obligatoires</p>';
require('form-film.php');
require('film-form.php');
}


Expand Down
2 changes: 1 addition & 1 deletion form-film.php → film-form.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

<form id="film-form" action="index.php?page=film-creation" method="post">
<form id="film-form" action="index.php?page=film-form-handler" method="post">
<fieldset>
<legend>Nouveau film</legend>
<label for="titre">titre :</label>
Expand Down
2 changes: 1 addition & 1 deletion film-list.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
?>

<h2>Liste des films</h2>
<a href="index.php?page=form-film">ajouter un film</a>
<a href="index.php?page=film-form">ajouter un film</a>
<form method="get" action="index.php">
<input type="text" name="recherche" value="<?php echo $recherche ?>"/>
<input type="submit" name="ok" value="rechercher"/>
Expand Down
72 changes: 72 additions & 0 deletions resources/film.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
-- phpMyAdmin SQL Dump
-- version 4.6.6deb4
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Jun 22, 2017 at 08:54 AM
-- Server version: 5.7.18-0ubuntu0.17.04.1
-- PHP Version: 7.0.18-0ubuntu0.17.04.1

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 utf8mb4 */;

--
-- Database: `afpa-bay`
--

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

--
-- Table structure for table `film`
--

CREATE TABLE `film` (
`id` int(11) NOT NULL,
`titre` varchar(256) NOT NULL,
`auteur` varchar(256) NOT NULL,
`acteurs` varchar(1024) NOT NULL,
`date_sortie` year(4) NOT NULL,
`thumbnail` varchar(256) 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);

--
-- Indexes for dumped tables
--

--
-- Indexes for table `film`
--
ALTER TABLE `film`
ADD PRIMARY KEY (`id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `film`
--
ALTER TABLE `film`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
/*!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 */;

0 comments on commit 55248df

Please sign in to comment.