当前位置: 首页>>代码示例>>PHP>>正文


PHP createEvent函数代码示例

本文整理汇总了PHP中createEvent函数的典型用法代码示例。如果您正苦于以下问题:PHP createEvent函数的具体用法?PHP createEvent怎么用?PHP createEvent使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了createEvent函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: http_response_code

            }
        }
    }
    return true;
}
if (!isUserLoggedIn()) {
    http_response_code(403);
    showError('You need to login to create an event.');
} else {
    if (isset($_POST['submit'])) {
        if (isset($_POST['type']) && isset($_POST['name']) && isset($_POST['description']) && isset($_POST['date']) && isset($_FILES["image"]) && isset($_POST["csrf_token"])) {
            if (validateCSRFToken($_POST["csrf_token"])) {
                $extension = pathinfo($_FILES["image"]["name"], PATHINFO_EXTENSION);
                if (isset($extension)) {
                    if (test_date($_POST['date'])) {
                        $idEvent = createEvent($_POST['type'], $_POST['name'], $_POST['description'], $_POST['date'], isset($_POST['public']), $_SESSION['userid']);
                        if ($idEvent != -1) {
                            try {
                                if (file_exists($_FILES['image']['tmp_name']) && is_uploaded_file($_FILES['image']['tmp_name'])) {
                                    // Check if an image was been uploaded
                                    $target_dir = "images/events/";
                                    $target_file = $target_dir . $idEvent . '.' . $extension;
                                    if (!updateEventImage($idEvent, $target_file)) {
                                        throw new RuntimeException("Could not set event image.");
                                    }
                                    uploadImage($_FILES["image"], $target_file);
                                }
                                showSuccess("Event created.");
                            } catch (RuntimeException $e) {
                                showError($e->getMessage());
                            }
开发者ID:andrelago13,项目名称:LTW,代码行数:31,代码来源:create_event_action.php

示例2: cleanInput

    $month = cleanInput($_POST['month']);
    $year = cleanInput($_POST['year']);
    $startHour = cleanInput($_POST['startHour']);
    $startMin = cleanInput($_POST['startMin']);
    $startMeridian = cleanInput($_POST['startMeridian']);
    $stopHour = cleanInput($_POST['stopHour']);
    $stopMin = cleanInput($_POST['stopMin']);
    $stopMeridian = cleanInput($_POST['stopMeridian']);
    $min = cleanInput($_POST['min']);
    $max = cleanInput($_POST['max']);
    $description = cleanInput($_POST['description']);
    if ($sport && $location && $zip && $day && $month && $year && $startHour && $startMin && $startMeridian) {
        //echo "VALUES SET:" . $sport;
        $values = array($sport . ", ", $_SESSION['uid'] . ", ", "'" . $location . "', ", "'" . $street . "', ", "'" . $city . "', ", "'" . $state . "', ", $zip . ", ", "'" . $year . "-" . $month . "-" . $day . "', ", "'" . $startHour . ":" . $startMin . " " . $startMeridian . "', ", "'" . $stopHour . ":" . $stopMin . " " . $stopMeridian . "', ", $min . ", ", $max . ", ", "'" . $description . "'");
        //echo "LOCATION DIRTY: " . $_POST['location'] . " ::LOCATION CLEAN: " .  stripslashes($location);
        if (createEvent($values)) {
            echo "EVENT SUCCESSFULLY CREATED";
        } else {
            echo "THERE WAS AN ERROR CREATING YOUR EVENT. PLEASE TRY AGAIN LATER.";
        }
    } else {
        echo "PLEASE FILL OUT ALL REQUIRED FIELDS.";
    }
}
?>
<div id="page">
	<div id="content">
		<div class="post">
			<h1 class="title">Create an Open Game</h1>
			<div class="entry">
				<form name="input" action="/create/index.php" method="post">
开发者ID:jacksinn,项目名称:opengame,代码行数:31,代码来源:page_create.php

示例3: uploadImage

<?php

include_once "database/events.php";
include_once "database/upload.php";
if (isset($_POST['create_btn'])) {
    $image_path = uploadImage($_FILES['image'], 'resources/images/uploaded/');
    echo '<p> Final path: ' . $image_path;
    if ($image_path != 'error') {
        if ($_POST['private'] == 'yes') {
            $private = 1;
        } else {
            $private = 0;
        }
        createEvent($_POST['date'], $_POST['description'], $_POST['type'], $_POST['creator'], $image_path, $private);
    }
}
header('Location: ' . './list_events.php');
开发者ID:quartz55,项目名称:LTW_classes,代码行数:17,代码来源:action_create_event.php

示例4: function

                }
                break;
        }
    }
});
/* EVENTS */
$app->post('/event', function () {
    $body = http_get_request_body();
    if ($body != null) {
        $typeCheck = json_decode($body);
        switch ($typeCheck->type) {
            /* CREATE AN EVENT */
            case EVENT:
                $inEvent = $typeCheck->obj;
                if ($inEvent != null) {
                    $eventId = createEvent($inEvent->adminId, $inEvent->name, $inEvent->startdate, $inEvent->enddate);
                    if ($eventId > 0) {
                        $event = R::load(EVENT, $eventId);
                        echo json_encode($event->export());
                    }
                }
                break;
                /* ADD A BARN TO AN EVENT */
            /* ADD A BARN TO AN EVENT */
            case BARN:
                $inBarn = $typeCheck->obj;
                if ($inBarn != null) {
                    $barnId = createBarn($inBarn->id, $inBarn->name);
                    if ($barnId > 0) {
                        $barn = R::load(BARN, $barnId);
                        echo json_encode($barn->export());
开发者ID:rileyteige,项目名称:MyHorseShow-Server,代码行数:31,代码来源:index.php

示例5: function

$app->get('/blog', function (Silex\Application $app) {
    // Match the root route (/) and supply the application as argument
    return $app['twig']->render('blog.html.twig', array('articles' => $app['articles']));
})->bind('blog');
$app->post('/hello', function (Request $request) {
    $name = $request->get('name');
    // where 'name' is your form field's name
    return 'Hello ' . $app->escape($name);
});
$app->post('/newmeeting', function (Request $request) {
    $emails = $request->get('emails');
    $days = $request->get('days');
    $meeting_name = $request->get('meeting_name');
    $grid = $request->get('grid');
    $top_range = $request->get('top_range');
    $bottom_range = $request->get('bottom_range');
    $owner = $request->get('owner');
    $from_email = array_shift($emails);
    $to_emails = $emails;
    $eventId = createEvent($emails, $owner, $grid);
    return new Response($eventId, 201);
});
$app->get('/blog/{id}', function (Silex\Application $app, $id) {
    // Add a parameter for an ID in the route, and it will be supplied as argument in the function
    if (!array_key_exists($id, $app['articles'])) {
        $app->abort(404, 'The article could not be found');
    }
    $article = $app['articles'][$id];
    return $app['twig']->render('single.html.twig', array('article' => $article));
})->assert('id', '\\d+')->bind('single');
// name the route so it can be referred to later in the section 'Generating routes'
开发者ID:kevcom,项目名称:scheduler,代码行数:31,代码来源:routes.php

示例6: createEvent

<?php

include_once "events.php";
if (isset($_POST['create_btn'])) {
    createEvent($_POST['date'], $_POST['description'], $_POST['type'], $_POST['creator'], $_FILES['image']);
}
header('Location: ' . './list_events.php');
开发者ID:nmvalente,项目名称:LTW,代码行数:7,代码来源:action_create_event.php

示例7: createEventFromPending

function createEventFromPending($uid) {
	// load in the file
	$handle = openPendingFile("r");
	while ($line = fgets($handle))
	{
		if ($uid == $line.substr(0, $uid.length()))
		{
			$data = explode(',', $line);
			// if approved
			if ($decision = 'y')
			{
				createEvent("", $data[1], $data[2], $data[3], $data[4], $data[5], $data[6], $data[7]);
				return true;
			}
			// if rejected. else should be okay because it was validated above
			else
			{
				// send email to student notifying them of the rejection. fix!
				$student = infoForAttendee($data[6]);
				$body = "Hello " . $student['name'] . ".\n";
				$body .= "Your meeting was declined.\n";
				$body .= "Better luck next time!\n";
				sendEmail($student['email'], "Meeting Declined", $body);
				return true;
			}
		}
	}
	return false;
}
开发者ID:BGCX261,项目名称:zona-cal-svn-to-git,代码行数:29,代码来源:functions.inc.php

示例8: safeString

         $start = "";
         if (isset($_POST['start'])) {
             $start = safeString($_POST['start']);
         }
         if ($start == "") {
             array_push($errors, 'Start date can not be blank.');
         }
         $end = "";
         if (isset($_POST['end'])) {
             $end = safeString($_POST['end']);
         }
         if ($end == "") {
             array_push($errors, 'End date can not be blank.');
         }
         if (count($errors) == 0) {
             createEvent($session->generateSessionToken(), $etitle, $description, $location, $start, $end);
             $title = 'Successfully Created New Event';
             $done = true;
         }
     }
     break;
 case "eventmanage":
     $title = 'Manage Events';
     $data = adminGetEvents();
     $action_template = 'admin/event-manage.tpl';
     break;
 case "deleteevent":
     $names = explode(":", $_GET['names']);
     foreach ($names as $name) {
         eventDelete($name);
     }
开发者ID:nickavv,项目名称:iSENSE,代码行数:31,代码来源:admin.php

示例9: onAddEntry

 function onAddEntry($data)
 {
     createEvent(getClientLoginHttpClient("aglcarrilanas@gmail.com", "noviembre11"), $data['nombre'], "Carrera normal", $data['lugar'], $data['fecha'], '00:00', $data['fecha'], '23:59', '+01');
 }
开发者ID:RamonCidL,项目名称:Carrilanas,代码行数:4,代码来源:CarreraConInscripciones.php

示例10: session_start

session_start();
$cancelProcess = false;
if (!isset($_SESSION['authUser'])) {
    $cancelProcess = true;
    header("Location: login.php");
}
if (isset($_POST['saveevent']) && !$cancelProcess) {
    $eventname = $_POST['eventname'];
    $startdate = $_POST['startdate'];
    $enddate = $_POST['enddate'];
    $userid = $_SESSION['UserID'];
    $capacity = $_POST['capacity'];
    $displaycapacity = $_POST['displaycapacity'];
    $eventid = $_POST['eventid'];
    if ($eventid == "") {
        $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);
开发者ID:misumoo,项目名称:bascomb,代码行数:31,代码来源:events_handle.php

示例11: newEvent

function newEvent($event, $userData)
{
    createEvent($event, $userData['latitude'], $userData['longitude']);
    updateUserEvent($userData['ustreamUID'], $event);
}
开发者ID:nzukoski,项目名称:Misc,代码行数:5,代码来源:search.php

示例12: switch

<?php

if (!isset($_REQUEST['cmd'])) {
    echo '{"result": 0, "message": "Unknown command"}';
    return;
}
$cmd = $_REQUEST['cmd'];
switch ($cmd) {
    case 1:
        login();
        break;
    case 2:
        signUp();
        break;
    case 3:
        createEvent();
        break;
    case 4:
        loginCheck();
        break;
    case 5:
        getEvents();
        break;
        //  case 6:
        //  editEquipment();
        //  break;
        //  case 7:
        //  deleteEquipment();
        //  break;
        //  case 8:
        //  sendSMS();
开发者ID:jnorvor,项目名称:IWuzHierSome,代码行数:31,代码来源:control.php

示例13: createRehearsal

function createRehearsal($name, $type, $call, $done, $location, $points, $sem, $comments, $section)
{
    if ($type != 'rehearsal' && $type != 'sectional') {
        die("Internal error 1 in createRehearsal; type is {$type}");
    }
    if ($type == 'rehearsal' && $section != 0) {
        die("Internal error 2 in createRehearsal; type is {$type}");
    }
    $attend = 0;
    if ($type == 'sectional') {
        $attend = -1;
    }
    if ($section) {
        $attend = $section;
    }
    return createEvent($name, $type, $call, $done, $location, $points, $sem, $comments, 0, $attend);
}
开发者ID:showermat,项目名称:gree-c-web,代码行数:17,代码来源:doNewEvent.php

示例14: publish

function publish($link) {
	global $globals, $db, $client;

	//return;
	if (DEBUG) return;

	// Calculate votes average
	// it's used to calculate and check future averages
	$votes_avg = (float) $db->get_var("select SQL_NO_CACHE avg(vote_value) from votes, users where vote_type='links' AND vote_link_id=$link->id and vote_user_id > 0 and vote_value > 0 and vote_user_id = user_id and user_level !='disabled'");
	if ($votes_avg < $globals['users_karma_avg']) $link->votes_avg = max($votes_avg, $globals['users_karma_avg']*0.97);
	else $link->votes_avg = $votes_avg;

	$link->status = 'published';
	$link->date = $link->published_date=time();
	$db->query("update links set link_status='published', link_date=now(), link_votes_avg=$link->votes_avg where link_id=$link->id");

	// Increase user's karma
	$user = new User;
	$user->id = $link->author;
	if ($user->read()) {
		$user->karma = min(20, $user->karma + $globals['instant_karma_per_published']);
		$user->store();
		$annotation = new Annotation("karma-$user->id");
		$annotation->append(_('noticia publicada').": +". $globals['instant_karma_per_published'] .", karma: $user->karma\n");
	}

	// Add the publish event/log
	log_insert('link_publish', $link->id, $link->author);
	$link->annotation .= _('publicación'). "<br/>";
	$link->save_annotation('link-karma');

	if ($globals['url_shortener']) {
		$short_url = $link->get_short_permalink();
	} else {
		$short_url = fon_gs($link->get_permalink());
	}
	if ($globals['twitter_user'] && $globals['twitter_password']) {
		twitter_post($link->title, $short_url); 
	}
	if ($globals['jaiku_user'] && $globals['jaiku_key']) {
		jaiku_post($link->title, $short_url); 
	}
	if ($globals['pubsub']) {
		pubsub_post();
	}

  if ($link->start_date) {
    createEvent($client, $link->title, $link->content, $link->start_date, $link->end_date);
  }

}
开发者ID:rasomu,项目名称:chuza,代码行数:51,代码来源:promote9.php

示例15: include_once

<?
  include_once('../database/eventFunc.php'); 
  

  try {
    $event = createEvent($_POST['name'], $_POST['date'], $_POST['time'], $_POST['type'], $_POST['description'], 
      $_POST['location'], $_POST['privateEvent'], $_POST['image']);
    if ($event === false){
      echo "failed_to_create_event";
    }
    else if ($event === true){
      echo "success";
    }
  } catch (PDOException $e) {
    die($e->getMessage());
  }
?>
开发者ID:joaoDavidGB,项目名称:LTWprojeto,代码行数:17,代码来源:createEvent.php


注:本文中的createEvent函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。