本文整理汇总了PHP中deleteEvent函数的典型用法代码示例。如果您正苦于以下问题:PHP deleteEvent函数的具体用法?PHP deleteEvent怎么用?PHP deleteEvent使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了deleteEvent函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ifcrush_event_handle_form
/**
* Fraternity events are displayed with three action buttons:
* Updated, Delete, and Show PNMs.
* This function is the form handler for all three.
* This function is going to add an event for the passed $frat_letters
* This function is called from ifcrush_frat with $frat_letters
**/
function ifcrush_event_handle_form($frat_letters)
{
global $debug;
if ($debug) {
echo "[ifcrush_event_handle_form] {$frat_letters}";
echo "<pre>";
print_r($_POST);
echo "</pre>";
}
$thisevent = array('eventID' => isset($_POST['eventID']) ? $_POST['eventID'] : "", 'eventDate' => $_POST['eventDate'], 'title' => $_POST['eventTitle'], 'fratID' => $frat_letters);
// put the form input into an array
switch ($_POST['action']) {
case "Update Event":
updateEvent($thisevent);
break;
case "Delete Event":
deleteEvent($thisevent);
break;
case "Add Event":
addEvent($thisevent);
break;
default:
echo "[ifcrush_event_handle_form]: bad action";
}
}
示例2: delete
public function delete()
{
$error = false;
$error |= deleteEvent($this->id);
if (!@is_null($this->imagePath)) {
$error |= unlink($this->imagePath);
}
return $error;
}
示例3: handlePostRequest
function handlePostRequest($type, $eventid)
{
$data = json_decode(file_get_contents('php://input'));
$write = array();
if (lockDatabase() !== FALSE) {
if ($type != 'addroute') {
$loggedIn = logIn($data);
} else {
// don't need to log in to add a route
$loggedIn = TRUE;
}
if ($loggedIn) {
//rg2log($type);
switch ($type) {
case 'addroute':
$write = addNewRoute($eventid, $data);
@unlink(CACHE_DIRECTORY . "results_" . $eventid . ".json");
@unlink(CACHE_DIRECTORY . "tracks_" . $eventid . ".json");
@unlink(CACHE_DIRECTORY . "stats.json");
break;
case 'addmap':
$write = addNewMap($data);
break;
case 'createevent':
$write = addNewEvent($data);
@unlink(CACHE_DIRECTORY . "events.json");
@unlink(CACHE_DIRECTORY . "stats.json");
break;
case 'editevent':
$write = editEvent($eventid, $data);
@unlink(CACHE_DIRECTORY . "events.json");
@unlink(CACHE_DIRECTORY . "stats.json");
break;
case 'deleteevent':
$write = deleteEvent($eventid);
@unlink(CACHE_DIRECTORY . "events.json");
@unlink(CACHE_DIRECTORY . "results_" . $eventid . ".json");
@unlink(CACHE_DIRECTORY . "courses_" . $eventid . ".json");
@unlink(CACHE_DIRECTORY . "tracks_" . $eventid . ".json");
@unlink(CACHE_DIRECTORY . "stats.json");
break;
case 'deleteroute':
$write = deleteRoute($eventid);
@unlink(CACHE_DIRECTORY . "results_" . $eventid . ".json");
@unlink(CACHE_DIRECTORY . "tracks_" . $eventid . ".json");
@unlink(CACHE_DIRECTORY . "stats.json");
break;
case 'deletecourse':
$write = deleteCourse($eventid);
@unlink(CACHE_DIRECTORY . "results_" . $eventid . ".json");
@unlink(CACHE_DIRECTORY . "courses_" . $eventid . ".json");
@unlink(CACHE_DIRECTORY . "tracks_" . $eventid . ".json");
@unlink(CACHE_DIRECTORY . "stats.json");
break;
case 'login':
// handled by default before we got here
$write["ok"] = TRUE;
$write["status_msg"] = "Login successful";
break;
default:
rg2log("Post request not recognised: " . $type);
$write["status_msg"] = "Request not recognised: " . $type;
$write["ok"] = FALSE;
break;
}
} else {
$write["ok"] = FALSE;
$write["status_msg"] = "Incorrect user name or password";
}
unlockDatabase();
} else {
$write["status_msg"] = "File lock error";
$write["ok"] = FALSE;
}
$keksi = generateNewKeksi();
$write["keksi"] = $keksi;
header("Content-type: application/json");
$write["version"] = RG2VERSION;
echo json_encode($write);
}
示例4: switch
}
switch ($_GET['action']) {
case 'start':
getEvents();
break;
case 'add':
addEvent();
break;
case 'update':
updateEvent();
break;
case 'resize':
resizeEvent();
break;
case 'del':
deleteEvent();
break;
case 'get_cal':
getCalendar();
break;
case 'mail_event':
mailEvent();
break;
default:
break;
}
function addEvent()
{
global $error;
$order_id = $_SESSION['order_id'];
$color = DEFAULT_COLOR;
示例5: dbQuery
}
// This is the important stuff
dbQuery("delete from Monitors where Id = ?", array($markMid));
dbQuery("delete from Zones where MonitorId = ?", array($markMid));
if (ZM_OPT_X10) {
dbQuery("delete from TriggersX10 where MonitorId=?", array($markMid));
}
fixSequences();
// If fast deletes are on, then zmaudit will clean everything else up later
// If fast deletes are off and there are lots of events then this step may
// well time out before completing, in which case zmaudit will still tidy up
if (!ZM_OPT_FAST_DELETE) {
// Slight hack, we maybe should load *, but we happen to know that the deleteEvent function uses Id and StartTime.
$markEids = dbFetchAll("SELECT Id,StartTime FROM Events WHERE MonitorId=?", NULL, array($markMid));
foreach ($markEids as $markEid) {
deleteEvent($markEid, $markMid);
}
deletePath(ZM_DIR_EVENTS . "/" . basename($monitor['Name']));
deletePath(ZM_DIR_EVENTS . "/" . $monitor['Id']);
// I'm trusting the Id.
}
}
}
}
}
}
}
// Device view actions
if (canEdit('Devices')) {
if ($action == "device") {
if (!empty($_REQUEST['command'])) {
示例6: logged_out
<?php
require_once 'init.php';
//listens for what is sent through the link
//this page's only job is to receive items - kind of like a directory
if (isset($_GET['caller_id'])) {
$dir = $_GET['caller_id'];
if ($dir == "logout") {
logged_out();
} else {
if ($dir == "deleteuser") {
$id = $_GET['id'];
deleteUser($id);
} else {
if ($dir == "deletenews") {
$id = $_GET['id'];
deleteNews($id);
} else {
if ($dir == "deleteevent") {
$id = $_GET['id'];
deleteEvent($id);
} else {
//remove for when files go live
echo "Caller id was passed incorrectly.";
}
}
}
}
}
示例7: session_start
<?php
session_start();
include_once "database/events.php";
$id = $_GET['id'];
$event = getEvent($id);
if (isset($_SESSION['username'])) {
if ($_SESSION['username'] == 'admin' || $_SESSION['username'] == $event['creator']) {
deleteEvent($id, $_SESSION['username']);
}
}
header('Location: ' . './list_events.php');
示例8: array
// Vérifie qu'il n'y a pas des champs en trop ou en moins.
$champsAttendus = array('titre');
foreach ($_POST as $cle => $valeur) {
if (!in_array($cle, $champsAttendus)) {
unset($_POST[$cle]);
} elseif (!isset($_POST[$cle])) {
$_POST[$cle] = "";
} else {
$_POST[$cle] = htmlspecialchars($_POST[$cle]);
}
}
if ($_POST['titre']) {
// Le champ est rempli
if ($_POST['titre'] == $contents['values']['titre']) {
// Destruction de l'event
if (deleteEvent($_GET['id'])) {
} else {
$errorMessage = "Une erreur s'est produite dans la suppression de l'évènement. Merci de réessayer !";
}
// Si le message d'erreur est resté vide
if (!$errorMessage) {
// Sortie du script et redirection vers la page précédant la connexion :
alert('info', 'Vous avez bien supprimé cet évènement.');
header('Location: ' . getLink(['accueil']));
exit;
}
} else {
$errorMessage = "Le titre saisi est incorrect !";
}
} else {
$errorMessage = 'Merci de renseigner le nom de l\'évènement.';
示例9: deleteEvent
if (isset($_POST['method'])) {
$method = $_POST['method'];
}
if (isset($_POST['file'])) {
$file = $path . $_POST['file'];
}
if (isset($_GET['id'])) {
$file = $path . $_GET['event'];
deleteEvent($file, $_GET['id']);
}
if ($method == 'saveEvent') {
saveEvent($file);
} else {
if ($method == 'deleteEvent') {
$url = filter_input(INPUT_POST, 'url');
deleteEvent($file, $url);
}
}
function saveEvent($file)
{
$eventJSON = filter_input(INPUT_POST, 'json');
$to = filter_input(INPUT_POST, 'email');
$deleteUrl = filter_input(INPUT_POST, 'deleteUrl');
$username = filter_input(INPUT_POST, 'username');
$email = 'info@reservations.uchenici.bg';
$subject = "Thank you for creating event";
$message = "\nHello {$username},<br/>\nYou have successfully created an event! To remove the event click on the following link:<br/><br/>\n<a href='{$deleteUrl}'>{$deleteUrl}</a><br/><br/>\nBest Regards,<br/>\nTeam Rookies";
$headers = 'From: ' . $email . "\r\n" . 'Reply-To: ' . $email . "\r\n" . 'Content-Type:text/html; charset=UTF-8' . "\r\n" . 'X-Mailer: PHP/' . phpversion();
header('Content-Type: application/json');
if (mail($to, $subject, $message, $headers)) {
file_put_contents($file, $eventJSON);
示例10: changeEvent
changeEvent($mysql, $userId, $_POST['eventId']);
break;
case 'eventUpInCat':
eventUpInCat($mysql, $_POST['eventId'], $userId);
break;
case 'eventUpInAllCat':
eventUpInAllCat($mysql, $_POST['eventId'], $userId);
break;
case 'eventPause':
eventPause($mysql, $userId, $_POST['eventId']);
break;
case 'eventFreeze':
eventFreeze($mysql, $userId, $_POST['eventId']);
break;
case 'deleteEvent':
deleteEvent($mysql, $userId, $_POST['eventId']);
break;
case 'deleteSpot':
deleteSpot($mysql, $userId, $_POST['spotId']);
break;
case 'adminUserbaseEdit':
adminUserbaseEdit($mysql, $userId);
break;
case 'adminEventFreeze':
adminEventFreeze($mysql, $userId, $_POST['eventId']);
break;
case 'tariffConfirm':
tariffConfirm($mysql, $userId);
break;
case 'tariffOrder':
tariffOrder($mysql, $userId);
示例11: createEvent
$task = createEvent($eventname, $startdate, $enddate, $userid, $capacity, $displaycapacity);
} else {
$task = updateEvent($eventname, $startdate, $enddate, $userid, $capacity, $displaycapacity, $eventid);
}
if (!$task) {
$data = array("success" => false, "message" => "Error!");
} else {
$data = array("success" => true, "message" => "Success!", "id" => $task);
}
echo json_encode($data);
}
//saveevent
if (isset($_POST['deleteEvent']) && !$cancelProcess) {
$userid = $_SESSION['UserID'];
$eventid = $_POST['eventid'];
$task = deleteEvent($userid, $eventid);
if (!$task) {
$data = array("success" => false, "message" => "Error!");
} else {
$data = array("success" => true, "message" => "Success!");
}
echo json_encode($data);
}
//deleteEvent
if (isset($_POST['geteventinfo']) && !$cancelProcess) {
$eventid = $_POST['eventid'];
$userid = $_SESSION['UserID'];
$data = getEventInfo($eventid, $userid);
$data = array("success" => true, "message" => "Success!", "capacity" => $data->capacity, "startdate" => $data->startdate, "eventname" => $data->eventname, "eventid" => $data->eventid, "enddate" => $data->enddate, "displaycapacity" => $data->displaycapacity);
echo json_encode($data);
}
示例12: deleteUser
}
if (isset($_GET['delete'])) {
$User = $Model->recupUser($_GET['delete']);
if ($_SESSION['rang'] <= $User->rang) {
echo "<div class='error' >Suppression Impossible !</div>";
} else {
deleteUser($_GET['delete']);
header('Location : index.php?page=admin&supprimer=User');
}
}
if (isset($_GET['deleteNews'])) {
deleteNews($_GET['deleteNews']);
header('Location : index.php?page=admin&supprimer=News');
}
if (isset($_GET['deleteEvent'])) {
deleteEvent($_GET['deleteEvent']);
header('Location : index.php?page=admin&supprimer=Event');
}
/******************************************************/
/* Forum Gestion */
/******************************************************/
$listeCategorie = recupCategories();
$listeForum = recupForum();
function checkCategorie()
{
if (isCategorieInDb($_POST['nom'])) {
return "Categorie déjà utilisé, merci d'en choisir un autre.";
}
return "NoError";
}
if (isset($_POST['creerCat'])) {
示例13: deleteEvent
$max = $event["max_attendees"];
}
if ($_SERVER["REQUEST_METHOD"] == "POST") {
// process the event change
if (password_verify($_POST["admin-password"], $admin["password"])) {
if ($_POST["action"] == "delete") {
$registrations = deleteEvent($event["event_id"]);
foreach ($registrations as $registration) {
// refund the charge
if (!empty($registration["stripe_charge_id"])) {
$refund = \Stripe\Refund::create(array("charge" => $registration["stripe_charge_id"]));
}
// unregister the user
unregisterUser($registration["event_id"], $registration["user_id"]);
}
deleteEvent($event["event_id"], true);
$_SESSION["deleted"] = $event["name"];
header("Location:/admin/events/");
} elseif ($_POST["action"] == "edit") {
$edit = editEvent($event["event_id"], $_POST["name"], str_replace(array("\r\n", "\r", "\n"), "<br>", $_POST["description"]), $_POST["date"], $_POST["start-time"], $_POST["end-time"], $_POST["member-price"], $_POST["nonmember-price"], $_POST["max"]);
var_dump($edit);
$_SESSION["event-edited"] = true;
header("Location:/admin/events/edit/" . $event["event_id"] . "/");
}
} else {
$_SESSION["incorrect-password"] = true;
header("Location:/admin/events/edit/" . $event["event_id"] . "/");
}
} else {
?>
<html>
示例14: out
out(null, 'You must supply a valid start and end date');
}
break;
case 'add':
if (isset($event)) {
// The id column is auto-increment, so remove if passed in
unset($event['id']);
$result = addEvent($event);
}
out($result);
break;
case 'update':
if (isset($event)) {
$result = updateEvent($event);
}
out($result);
break;
case 'delete':
if (isset($event)) {
$result = deleteEvent($event);
}
if ($result === 1) {
// Return the deleted id instead of row count
$result = $event['id'];
}
out($result);
break;
}
} catch (Exception $e) {
handleException($e);
}
示例15: deleteEvent
<?php
function deleteEvent($eventID)
{
require_once 'conn.php';
$sql = "DELETE FROM `events` where id=:id";
try {
$sth = $dbh->prepare($sql);
$sth->execute(array(":id" => $eventID));
} catch (PDOException $e) {
echo "delete from db failed: " . $e->getMessage();
}
$dbh = null;
return array('result' => 'successfully deleted event ' . $eventID);
}
$res = deleteEvent(htmlspecialchars($_GET["id"]));
header('Content-Type: text/json');
echo json_encode($res);