diff --git a/addEvent.php b/addEvent.php index 3de851d..42e9b02 100644 --- a/addEvent.php +++ b/addEvent.php @@ -1,3 +1,9 @@ + + @@ -21,7 +27,7 @@

Ajouter un Évènement

-
+
Titre :

diff --git a/databaseOperations.php b/databaseOperations.php index 86f8f23..618c50f 100755 --- a/databaseOperations.php +++ b/databaseOperations.php @@ -237,4 +237,28 @@ function getEventsSince($db,$date) die(); } } + +function addEvent($db, $titre, $localisation, $dtstart, $dtend, $description, $url, $urlImage, $contact) +{ + try + { + $request = $db->prepare('INSERT INTO event(event_title, event_localisation, event_dtstart , event_dtend, event_description, event_url, event_urlImage, event_contact) VALUES(:title, :localisation, :dstart, :dtend, :description, :url, :urlImage, :contact)'); + $request->execute(array('title'=>$titre, + 'localisation'=>$localisation, + 'dtend'=>date("Y-m-d hh:mm:ss",$dtstart), + 'dstart'=>date("Y-m-d hh:mm:ss",$dtend), + 'description'=>$description, + 'url'=>$url, + 'urlImage'=>$urlImage, + 'contact'=>$contact)); + echo("debug"); + $request->closeCursor(); + } + catch(PDOException $e) + { + //NOTE: change $e->getMessage() by an error message before going to production + echo($e->getMessage()); + die(); + } +} ?> diff --git a/eventAdded.php b/eventAdded.php new file mode 100644 index 0000000..a0edb5c --- /dev/null +++ b/eventAdded.php @@ -0,0 +1,40 @@ + + + + + + Kiwi Calendar : Ajouter un évènement + + + + + + + + + + +
+ logo ESIR + +
+ +
+ Ok ! +
+ + diff --git a/populateDatabase.sql b/populateDatabase.sql index bf6ec4a..39fd380 100644 --- a/populateDatabase.sql +++ b/populateDatabase.sql @@ -22,3 +22,6 @@ INSERT INTO categorie(sous_cat_id, cat_title) VALUES(2, "Labfab"); INSERT INTO event VALUES (1, "Porte Ouverte Inria", "INRIA Rennes", "2015-12-10", "2015-12-10", "L'Inria ouvre ses portes aux étudiants !", "http://po.irisa.fr/", "http://www.lirmm.fr/DEMAR/images/inria_corpo_rvb.jpg", "contact@irisa.fr"); INSERT INTO event VALUES (2, "Inpol", "ESIR, Rennes", "2015-12-10 09:00:00", "2015-12-10 12:00:00", "Cours d'innovation et politique", NULL, "https://esir.univ-rennes1.fr/sites/esir.univ-rennes1.fr/themes/esir/logo.png", NULL); INSERT INTO event VALUES (3, "Festival film animation", "Bruz, France", "2015-12-07 09:00:00", "2015-12-13 20:00:00", "Festival national du film d'animation", "http://festival-film-animation.fr/", "http://festival-film-animation.fr/cache/com_unitehcarousel/films_en_bretagne_logo_site_150x150_exact_images-2015.jpg", "communication@afca.asso.fr"); +INSERT INTO event VALUES (4, "Noel", "Esir, Rennes, France", "2015-12-17 19:00:00", "2015-12-13 23:00:00", "Soirée de Noel de l'ISATI dans le hall de l'ESIR !", "http://isati.istic.univ-rennes1.fr/", "http://isati.istic.univ-rennes1.fr/assets/images/isati.png", "communication@isati.org"); +INSERT INTO event VALUES (5, "Noel", "Village du pere noel, Finlande", "2015-12-23 19:00:00", "2015-12-25 23:00:00", "Soirée de Noel", "http://jepasseunnoeltropswagi.net", "https://images.duckduckgo.com/iu/?u=http%3A%2F%2Ffarahlafee.f.a.pic.centerblog.net%2F074e7416.gif&f=1", "papa@noel.org"); +INSERT INTO event VALUES (6, "Nouvel An", "Tour Eiffel, Paris", "2015-12-31 19:00:00", "2016-01-01 23:00:00", "Nouvel an", "http://jepasseunnouvelantropswagi.net", "https://images.duckduckgo.com/iu/?u=http%3A%2F%2Ftse4.mm.bing.net%2Fth%3Fid%3DOIP.M5cb70d969f54c82b06e77edc0c11e81eo0%26pid%3D15.1&f=1", "");