diff --git a/addEvent.css b/addEvent.css
index 4442db2..39029bb 100644
--- a/addEvent.css
+++ b/addEvent.css
@@ -45,3 +45,11 @@ border-radius: 10px; /* future proofing */
textarea, input {
width: 80%;
}
+
+#checkboxGrp {
+ width:80%;
+}
+
+#checkboxGrp input {
+ margin:3px;
+}
diff --git a/addEvent.php b/addEvent.php
index ed3bdf6..5701552 100644
--- a/addEvent.php
+++ b/addEvent.php
@@ -14,87 +14,98 @@ $db = connect();
-
- Kiwi Calendar : Ajouter un évènement
-
-
-
-
-
-
-
-
-
-
-
+
+ Kiwi Calendar : Ajouter un évènement
+
+
+
+
+
+
+
+
+
+
+
-
-
Ajouter un Évènement
+
-
+
+
diff --git a/databaseOperations.php b/databaseOperations.php
index 3f2989a..4e8210f 100755
--- a/databaseOperations.php
+++ b/databaseOperations.php
@@ -48,6 +48,25 @@ function getCategories($db)
}
}
+function getCategoriesNames($db)
+{
+ try
+ {
+ $request = $db->prepare('SELECT * FROM categorie');
+ $request->execute();
+ $result = $request->fetchAll();
+ $request->closeCursor();
+ return $result;
+ }
+ catch(PDOException $e)
+ {
+ //NOTE: change $e->getMessage() by an error message before going to production
+ echo($e->getMessage());
+ die();
+ }
+}
+
+
/**
* @brief queries all the sub categories from a certain tab
* @param $db: the PDO connection to the database
@@ -246,7 +265,7 @@ function getEventsSince($db,$date)
}
}
-function addEvent($db, $titre, $localisation, $dtstart, $dtend, $description, $url, $urlImage, $contact)
+function addEvent($db, $titre, $catArray, $localisation, $dtstart, $dtend, $description, $url, $urlImage, $contact)
{
try
{
@@ -259,6 +278,7 @@ function addEvent($db, $titre, $localisation, $dtstart, $dtend, $description, $u
'url'=>$url,
'urlImage'=>$urlImage,
'contact'=>$contact));
+ //TODO add this Event to categories. Exemple : INSERT INTO eventCategorie(event_id, cat_id) VALUES(6, 14);
$request->closeCursor();
header("Location:index.php");
exit;
diff --git a/eventAdded.php b/eventAdded.php
index 09d01f7..04c801d 100644
--- a/eventAdded.php
+++ b/eventAdded.php
@@ -10,7 +10,8 @@ $description = $_POST['description'];
$url = $_POST['site'];
$urlImage = $_POST['urlImage'];
$contact = $_POST['contact'];
-addEvent($db, $titre, $localisation, $dtstart, $dtend, $description, $url, $urlImage, $contact);
+$catArray = $_POST['chk_group'];
+addEvent($db, $titre, $catArray, $localisation, $dtstart, $dtend, $description, $url, $urlImage, $contact);
?>