} function testArg($arg) { if (!isset($_POST[$arg])) { response("KO", "no " . $arg); } } $email_to = "*****@*****.**"; //response("KO","no dsd".$_POST["title"]); error_log("description:" . $_POST["description"]); testArg("title"); testArg("date"); testArg("dateend"); testArg("adress"); testArg("description"); testArg("mail"); $title = $_POST['title']; $date = $_POST['date']; $dateend = $_POST['dateend']; //$description = stripslashes($_POST['description']); $description = $_POST['description']; $adress = $_POST['adress']; $mail = $_POST['mail']; $breakLine = array("\n", "\r"); $escapeBreakLine = array("\\n", ""); $breakLineHTML = array("<br/>", ""); $descriptionHTML = str_replace($breakLine, $breakLineHTML, $description); $description = str_replace($breakLine, $escapeBreakLine, $description); $url = 'http://www.google.com/calendar/event?' . str_replace("=", "=", htmlentities('action=TEMPLATE&text=' . urlencode($title) . '&dates=' . $date . '/' . $dateend . '&details=' . urlencode($description) . '&location=' . urlencode($adress) . '&trp=true&sprop=caldev&sprop=name:caldev.io', ENT_QUOTES, 'UTF-8')); $email_message = $title . '<br/>' . $date . ' > ' . $dateend . '<br/>' . $adress . '<br/>' . $descriptionHTML . '<br/>' . $mail . '<br/>ip:' . $_SERVER["REMOTE_ADDR"] . '<br/><br/>' . $url; //$email_message = urlencode(htmlentities($email_message, ENT_QUOTES, 'UTF-8'));
$html .= "<td>" . $tabUser['description'] . "</td>"; $html .= "<td>" . $tabUser['email'] . "</td>"; $html .= "<td>" . $tabUser['dateNaissance'] . "</td></tr></table>"; } return $html; } } if (isset($_REQUEST['idUser']) && is_numeric($_REQUEST['idUser']) && testArg(['', '', '', '', '', '', ''])) { if (modifyUser($_REQUEST['nom'], $_REQUEST['prenom'], $_REQUEST['pseudo'], $_REQUEST['pass'], $_REQUEST['description'], $_REQUEST['email'], $_REQUEST['date'], $_REQUEST['idUser'])) { header('Location: AffichageNom.php'); exit; } else { echo "<p>Une erreur s'est produite</p>"; } } if (isset($_REQUEST['boutonEnvoyer']) && testArg(['', '', '', '', '', '', '', ''])) { try { insertUser($_REQUEST['nom'], $_REQUEST['prenom'], $_REQUEST['pseudo'], $_REQUEST['pass'], $_REQUEST['description'], $_REQUEST['email'], $_REQUEST['date'], $_REQUEST['classe']); header('Location: AffichageNom.php'); exit; } catch (Exception $e) { echo $e->getMessage(); } catch (PDOException $e) { echo $e->getMessage(); } } if (isset($_REQUEST['value']) && is_numeric($_REQUEST['value'])) { $tabInfoUser = getInfoUser($_REQUEST['value']); $nom = $tabInfoUser['nom']; $prenom = $tabInfoUser['prenom']; $pseudo = $tabInfoUser['pseudo'];
"response" : "' . $response . '" }'; exit; } function testArg($arg) { if (!isset($_GET[$arg])) { response("KO", "no " . $arg); } } testArg("title"); testArg("filename"); testArg("date"); testArg("dateend"); testArg("adress"); testArg("description"); $title = $_GET['title']; $filename = $_GET['filename'] . ".ics"; header('Content-Disposition: attachment; filename=' . $filename); $date = $_GET['date']; $dateend = $_GET['dateend']; $descriptionOriginal = $_GET['description']; $adress = $_GET['adress']; error_log(str_replace("=", "%3D", $descriptionOriginal)); $breakLine = array("\n", "\r"); $escapeBreakLine = array("\\n", ""); $breakLineHTML = array("<br/>", ""); $descriptionOriginal = str_replace("=", "=3D", $descriptionOriginal); $descriptionHTML = str_replace($breakLine, $breakLineHTML, $descriptionOriginal); $description = str_replace($breakLine, $escapeBreakLine, $descriptionOriginal); echo "BEGIN:VCALENDAR\nPRODID:-//Google Inc//Google Calendar 70.9054//EN\nVERSION:2.0\nCALSCALE:GREGORIAN\nMETHOD:REQUEST\nBEGIN:VEVENT\nDTSTART:{$date}\nDTEND:{$dateend}\nDTSTAMP:{$date}\nUID:bilelz+caldev@gmail.com\nATTENDEE;CUTYPE=3DINDIVIDUAL;ROLE=3DREQ-PARTICIPANT;PARTSTAT=3DACCEPTED;RSV=\nP=3DTRUE\n ;CN=3Dcaldev.io;X-NUM-GUESTS=3D0:mailto:bilelz+caldev@gmail.com\nCREATED:{$date}\nDESCRIPTION:{$descriptionHTML}\nLAST-MODIFIED:{$date}\nLOCATION:{$adress}\nSEQUENCE:0\nSTATUS:CONFIRMED\nSUMMARY:{$title}\nTRANSP:OPAQUE\nEND:VEVENT\nEND:VCALENDAR";
/* * Auteur : Bertrand Nicolas * Date : 27.11.2015 * Version : 0.8 */ require_once './functionDb/function_db_insert.php'; function testArg($tab) { foreach ($tab as $value) { if (!isset($value) || empty($value)) { return false; } } return true; } if (isset($_REQUEST['Inscription']) && testArg([$_REQUEST['pseudo'], $_REQUEST['pass']])) { insertUser($_REQUEST['pseudo'], $_REQUEST['pass']); header('Location: index.php'); exit; } ?> <html lang="fr"> <head> <meta charset="utf8" /> <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" /> <link href='https://fonts.googleapis.com/css?family=Righteous' rel='stylesheet' type='text/css'> </head> <body> <header> <h1>The Festival</h1> <nav>