Browse Source

Merge branch 'master' of github.com:TheMrNomis/KiWi-calendar

master
AmarOk 10 years ago
parent
commit
e852406190
3 changed files with 19 additions and 28 deletions
  1. +1
    -0
      .gitignore
  2. +13
    -0
      databaseOperations.php
  3. +5
    -28
      eventAdded.php

+ 1
- 0
.gitignore View File

@ -1,2 +1,3 @@
*.*~
*.db
test*

+ 13
- 0
databaseOperations.php View File

@ -265,6 +265,19 @@ function getEventsSince($db,$date)
}
}
/**
* @brief add an event into the database
* @param $db: the PDO connection to the database
* @param $titre: title of the event
* @param $catArray: an array containing the categories related to this event
* @param $localisation: localisation of the event
* @param $dtstart: datetime of the beginning of the event
* @param $dtend: datetime of the end of the event
* @param $description: description of the event
* @param $url: url of the event
* @param $urlImage: url of the image of the event
* @param $contact: name of the contact
*/
function addEvent($db, $titre, $catArray, $localisation, $dtstart, $dtend, $description, $url, $urlImage, $contact)
{
try


+ 5
- 28
eventAdded.php View File

@ -2,39 +2,16 @@
include_once('databaseOperations.php');
include('datetimeOperations.php');
$db = connect();
$titre = $_POST['title'];
$localisation = $_POST['address'];
$titre = htmlentities($_POST['title']);
$localisation = htmlentities($_POST['address']);
$dtstart = strtotime($_POST['dtstart']);
$dtend = strtotime($_POST['dtend']);
$description = $_POST['description'];
$description = htmlentities($_POST['description']);
$url = $_POST['site'];
$urlImage = $_POST['urlImage'];
$contact = $_POST['contact'];
$catArray = $_POST['chk_group'];
addEvent($db, $titre, $catArray, $localisation, $dtstart, $dtend, $description, $url, $urlImage, $contact);
header('Location:./');
exit;
?>
<!DOCTYPE html>
<html>
<head>
<title>Kiwi Calendar : Ajouter un évènement</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="./main.css" />
<link rel="stylesheet" href="./event.css" />
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/css/bootstrap-combined.min.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" media="screen"
href="http://tarruda.github.com/bootstrap-datetimepicker/assets/css/bootstrap-datetimepicker.min.css">
<link rel="icon" type="image/png" href="favicon.png" />
<link rel="stylesheet" href="./addEvent.css" />
<!--[if IE]><link rel="shortcut icon" type="image/x-icon" href="favicon.ico" /><![endif]-->
</head>
<body>
<header id="title">
<img alt="logo ESIR" src="./images/esir.png" />
<a href="./index.php"><img class="rightLogo" alt="logo Kiwi" src="./images/KiWiCalendar.png" /></a>
</header>
<div id="descEvent">
Ok !
</div>
</body>
</html>

Loading…
Cancel
Save