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..cedc9d9 100755 --- a/databaseOperations.php +++ b/databaseOperations.php @@ -237,4 +237,27 @@ 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)); + $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..a85bf75 --- /dev/null +++ b/eventAdded.php @@ -0,0 +1,40 @@ + + + + + + Kiwi Calendar : Ajouter un évènement + + + + + + + + + + +
+ logo ESIR + +
+ +
+ Ok ! +
+ +