本文整理汇总了PHP中update_event函数的典型用法代码示例。如果您正苦于以下问题:PHP update_event函数的具体用法?PHP update_event怎么用?PHP update_event使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了update_event函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: calendar_arrived
function calendar_arrived($form_pid)
{
$Today = date('Y-m-d');
//Take all recurring events relevent for today.
$result_event = sqlStatement("SELECT * FROM openemr_postcalendar_events WHERE pc_recurrtype='1' and pc_pid =? and pc_endDate!='0000-00-00' \n\t\tand pc_eventDate < ? and pc_endDate >= ? ", array($form_pid, $Today, $Today));
if (sqlNumRows($result_event) == 0) {
$result_event = sqlStatement("SELECT * FROM openemr_postcalendar_events WHERE pc_pid =?\tand pc_eventDate = ?", array($form_pid, $Today));
if (sqlNumRows($result_event) == 0) {
echo "<br><br><br>" . htmlspecialchars(xl('Sorry No Appointment is Fixed'), ENT_QUOTES) . ". " . htmlspecialchars(xl('No Encounter could be created'), ENT_QUOTES) . ".";
die;
} else {
$enc = todaysEncounterCheck($form_pid);
//create encounter
$zero_enc = 0;
sqlStatement("UPDATE openemr_postcalendar_events SET pc_apptstatus ='@' WHERE pc_pid =? and pc_eventDate = ?", array($form_pid, $Today));
}
} else {
while ($row_event = sqlFetchArray($result_event)) {
$pc_eid = $row_event['pc_eid'];
$pc_eventDate = $row_event['pc_eventDate'];
$pc_recurrspec_array = unserialize($row_event['pc_recurrspec']);
while (1) {
if ($pc_eventDate == $Today) {
if (!($exist_eid = check_event_exist($pc_eid))) {
update_event($pc_eid);
} else {
sqlStatement("UPDATE openemr_postcalendar_events SET pc_apptstatus = '@' WHERE pc_eid = ?", array($exist_eid));
}
$enc = todaysEncounterCheck($form_pid);
//create encounter
$zero_enc = 0;
break;
} elseif ($pc_eventDate > $Today) {
echo "<br><br><br>" . htmlspecialchars(xl('Sorry No Appointment is Fixed'), ENT_QUOTES) . ". " . htmlspecialchars(xl('No Encounter could be created'), ENT_QUOTES) . ".";
die;
break;
}
$pc_eventDate_array = split('-', $pc_eventDate);
//Find the next day as per the frequency definition.
$pc_eventDate =& __increment($pc_eventDate_array[2], $pc_eventDate_array[1], $pc_eventDate_array[0], $pc_recurrspec_array['event_repeat_freq'], $pc_recurrspec_array['event_repeat_freq_type']);
}
}
}
return $enc;
}
开发者ID:rreddy70,项目名称:openemr,代码行数:45,代码来源:encounter_events.inc.php
示例2: bigbluebutton_update_instance
function bigbluebutton_update_instance($bigbluebutton)
{
$bigbluebutton->timemodified = time();
$bigbluebutton->id = $bigbluebutton->instance;
if ($returnid = update_record('bigbluebutton', $bigbluebutton)) {
$event = NULL;
if ($event->id = get_field('event', 'id', 'modulename', 'bigbluebutton', 'instance', $bigbluebutton->id)) {
$event->courseid = $bigbluebutton->course;
$event->name = $bigbluebutton->name;
$event->meetingname = $bigbluebutton->meetingname;
$event->meetingid = $bigbluebutton->meetingid;
$event->attendeepw = $bigbluebutton->attendeepw;
$event->moderatorpw = $bigbluebutton->moderatorpw;
$event->autologin = $bigbluebutton->autologin;
$event->newwindow = $bigbluebutton->newwindow;
$event->welcomemsg = $bigbluebutton->welcomemsg;
update_event($event);
}
}
return $returnid;
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:21,代码来源:lib.php
示例3: certificate_update_instance
function certificate_update_instance($certificate)
{
$certificate->timemodified = time();
$certificate->id = $certificate->instance;
if ($returnid = update_record('certificate', $certificate)) {
if ($event->id = get_field('event', 'id', 'modulename', 'certificate', 'instance', $certificate->id)) {
$event->name = $certificate->name;
update_event($event);
} else {
$event = NULL;
$event->name = $certificate->name;
$event->courseid = $certificate->course;
$event->groupid = 0;
$event->userid = 0;
$event->modulename = 'certificate';
$event->instance = $certificate->id;
add_event($event);
}
} else {
delete_records('event', 'modulename', 'certificate', 'instance', $certificate->id);
}
return $returnid;
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:23,代码来源:lib.php
示例4: certificate_update_instance
/**
* Update certificate instance.
*
* @param stdClass $certificate
* @return bool true
*/
function certificate_update_instance($certificate)
{
global $DB;
// Update the certificate
$certificate->timemodified = time();
$certificate->id = $certificate->instance;
$DB->update_record('certificate', $certificate);
// Update the event if it exists, else create
if ($event = $DB->get_record('event', array('modulename' => 'certificate', 'instance' => $certificate->id))) {
$event->name = $certificate->name;
update_event($event);
} else {
$event = new stdClass();
$event->name = $certificate->name;
$event->description = '';
$event->courseid = $certificate->course;
$event->groupid = 0;
$event->userid = 0;
$event->modulename = 'certificate';
$event->instance = $certificate->id;
add_event($event);
}
return true;
}
开发者ID:noisyjerm,项目名称:moodle-mod_certificate,代码行数:30,代码来源:lib.php
示例5: array
$header = array('Authorization' => $_SESSION['token'], 'Content-Type' => 'application/json', 'Accept' => 'application/json');
$response = $client->fetch($baseApiUrl . '/api/v1/people/' . $details['id'], json_encode($params), 'PUT', $header, 0);
header('Location: index.php');
}
function update_event($details)
{
global $client, $baseApiUrl, $baseSiteSlug;
$params = array('event' => array('name' => $details['name'], 'status' => $details['status'], 'start_time' => $details['start_time'], 'end_time' => $details['end_time']));
$header = array('Authorization' => $_SESSION['token'], 'Content-Type' => 'application/json', 'Accept' => 'application/json');
$response = $client->fetch($baseApiUrl . '/api/v1/sites/' . $baseSiteSlug . '/pages/events/' . $details['id'], json_encode($params), 'PUT', $header, 0);
header('Location: index.php');
}
function delete_person($id)
{
global $client, $baseApiUrl;
$response = $client->fetch($baseApiUrl . '/api/v1/people/' . $id, array(), 'DELETE');
header('Location: index.php');
}
if (isset($_GET['create']) && $_GET['create'] == 'create') {
create_person($_GET);
} elseif (isset($_GET['update']) && $_GET['update'] == 'update') {
update_person($_GET);
} elseif (isset($_GET['delete'])) {
delete_person($_GET['delete']);
} elseif (isset($_GET['updateEvent'])) {
if (isset($_GET['id'])) {
update_event($_GET);
} else {
create_event($_GET);
}
}
开发者ID:bketnick,项目名称:hoop,代码行数:31,代码来源:function.php
示例6: quiz_refresh_events
function quiz_refresh_events($courseid = 0)
{
// This standard function will check all instances of this module
// and make sure there are up-to-date events created for each of them.
// If courseid = 0, then every quiz event in the site is checked, else
// only quiz events belonging to the course specified are checked.
// This function is used, in its new format, by restore_refresh_events()
if ($courseid == 0) {
if (!($quizzes = get_records("quiz"))) {
return true;
}
} else {
if (!($quizzes = get_records("quiz", "course", $courseid))) {
return true;
}
}
$moduleid = get_field('modules', 'id', 'name', 'quiz');
foreach ($quizzes as $quiz) {
$event = NULL;
$event2 = NULL;
$event2old = NULL;
if ($events = get_records_select('event', "modulename = 'quiz' AND instance = '{$quiz->id}' ORDER BY timestart")) {
$event = array_shift($events);
if (!empty($events)) {
$event2old = array_shift($events);
if (!empty($events)) {
foreach ($events as $badevent) {
delete_records('event', 'id', $badevent->id);
}
}
}
}
$event->name = addslashes($quiz->name);
$event->description = addslashes($quiz->intro);
$event->courseid = $quiz->course;
$event->groupid = 0;
$event->userid = 0;
$event->modulename = 'quiz';
$event->instance = $quiz->id;
$event->visible = instance_is_visible('quiz', $quiz);
$event->timestart = $quiz->timeopen;
$event->eventtype = 'open';
$event->timeduration = $quiz->timeclose - $quiz->timeopen;
if ($event->timeduration > QUIZ_MAX_EVENT_LENGTH) {
/// Set up two events
$event2 = $event;
$event->name = addslashes($quiz->name) . ' (' . get_string('quizopens', 'quiz') . ')';
$event->timeduration = 0;
$event2->name = addslashes($quiz->name) . ' (' . get_string('quizcloses', 'quiz') . ')';
$event2->timestart = $quiz->timeclose;
$event2->eventtype = 'close';
$event2->timeduration = 0;
if (empty($event2old->id)) {
unset($event2->id);
add_event($event2);
} else {
$event2->id = $event2old->id;
update_event($event2);
}
} else {
if (!empty($event2old->id)) {
delete_event($event2old->id);
}
}
if (empty($event->id)) {
if (!empty($event->timestart)) {
add_event($event);
}
} else {
update_event($event);
}
}
return true;
}
开发者ID:e-rasvet,项目名称:reader,代码行数:74,代码来源:lib.php
示例7: redirect_to_home_page
$agdx->store($id);
redirect_to_home_page("modules/agenda/index.php?course=$course_code&v=1");
}
if (isset($_POST['event_title'])) {
register_posted_variables(array('startdate' => true, 'event_title' => true, 'content' => true, 'duration' => true));
$content = purify($content);
if (isset($_POST['id']) and !empty($_POST['id'])) { // update event
$id = $_POST['id'];
$recursion = null;
if (!empty($_POST['frequencyperiod']) && intval($_POST['frequencynumber']) > 0 && !empty($_POST['enddate'])) {
$recursion = array('unit' => $_POST['frequencyperiod'], 'repeat' => $_POST['frequencynumber'], 'end' => $_POST['enddate']);
}
if(isset($_POST['rep']) && $_POST['rep'] == 'yes'){
$resp = update_recursive_event($id, $event_title, $startdate, $duration, $content, $recursion);
} else {
$resp = update_event($id, $event_title, $startdate, $duration, $content, $recursion);
}
$agdx->store($id);
} else { // add new event
$recursion = null;
if (!empty($_POST['frequencyperiod']) && intval($_POST['frequencynumber']) > 0 && !empty($_POST['enddate'])) {
$recursion = array('unit' => $_POST['frequencyperiod'], 'repeat' => $_POST['frequencynumber'], 'end' => $_POST['enddate']);
}
$ev = add_event($event_title, $content, $startdate, $duration, $recursion);
foreach($ev['event'] as $id) {
$agdx->store($id);
}
}
Session::Messages($langStoredOK, 'alert-success');
redirect_to_home_page("modules/agenda/index.php?course=$course_code");
} elseif (isset($_GET['delete']) && $_GET['delete'] == 'yes') {
开发者ID:nikosv,项目名称:openeclass,代码行数:31,代码来源:index.php
示例8: update_event
<?php
/**
* Created by PhpStorm.
* User: Jason
* Date: 11/11/2015
* Time: 6:31 PM
*/
require 'db_cn.inc';
require 'db_access.inc';
//This file contains php code that will be executed after the
//insert operation is done.
require 'update_event_result_ui.inc';
// Main control logic
update_event();
//-------------------------------------------------------------
function update_event()
{
connect_and_select_db(DB_SERVER, DB_UN, DB_PWD, DB_NAME);
// Get the bannerid and other data sent by the user from the query
$eventCode = $_REQUEST['eventCode'];
$name = mysql_real_escape_string($_POST["eventName"]);
$startDate = mysql_real_escape_string($_POST["startDate"]);
$endDate = mysql_real_escape_string($_POST["endDate"]);
$description = mysql_real_escape_string($_POST["description"]);
$type = mysql_real_escape_string($_POST["type"]);
$updateStmt = "update AdEvent\n\tset AdEvent.Name = '" . $name . "', StartDate = '" . $startDate . "', EndDate = '" . $endDate . "',\n\tDescription = '" . $description . "', AdType = '" . $type . "'" . "WHERE EventCode = '" . $eventCode . "'";
$result = execute_SQL_query_with_no_error_report($updateStmt);
$message = "";
if (!$result) {
$message .= "Error in updating Event: " . $eventCode . " in database.<br />" . mysql_error() . "<hr />";
开发者ID:rjoac1,项目名称:CSC423_TermProject,代码行数:31,代码来源:update_event.php
示例9: chat_update_chat_times
function chat_update_chat_times($chatid = 0)
{
/// Updates chat records so that the next chat time is correct
$timenow = time();
if ($chatid) {
if (!($chats[] = get_record_select("chat", "id = '{$chatid}' AND chattime <= '{$timenow}' AND schedule > '0'"))) {
return;
}
} else {
if (!($chats = get_records_select("chat", "chattime <= '{$timenow}' AND schedule > '0'"))) {
return;
}
}
foreach ($chats as $chat) {
unset($chat->name);
unset($chat->intro);
switch ($chat->schedule) {
case 1:
// Single event - turn off schedule and disable
$chat->chattime = 0;
$chat->schedule = 0;
break;
case 2:
// Repeat daily
$chat->chattime += 24 * 3600;
break;
case 3:
// Repeat weekly
$chat->chattime += 7 * 24 * 3600;
break;
}
update_record("chat", $chat);
$event = NULL;
// Update calendar too
if ($event->id = get_field('event', 'id', 'modulename', 'chat', 'instance', $chat->id)) {
$event->timestart = $chat->chattime;
update_event($event);
}
}
}
开发者ID:veritech,项目名称:pare-project,代码行数:40,代码来源:lib.php
示例10: workshop_update_instance
function workshop_update_instance($workshop)
{
// Given an object containing all the necessary data,
// (defined by the form in mod.html) this function
// will update an existing instance with new data.
global $CFG;
$workshop->timemodified = time();
$workshop->submissionstart = make_timestamp($workshop->submissionstartyear, $workshop->submissionstartmonth, $workshop->submissionstartday, $workshop->submissionstarthour, $workshop->submissionstartminute);
$workshop->assessmentstart = make_timestamp($workshop->assessmentstartyear, $workshop->assessmentstartmonth, $workshop->assessmentstartday, $workshop->assessmentstarthour, $workshop->assessmentstartminute);
$workshop->submissionend = make_timestamp($workshop->submissionendyear, $workshop->submissionendmonth, $workshop->submissionendday, $workshop->submissionendhour, $workshop->submissionendminute);
$workshop->assessmentend = make_timestamp($workshop->assessmentendyear, $workshop->assessmentendmonth, $workshop->assessmentendday, $workshop->assessmentendhour, $workshop->assessmentendminute);
$workshop->releasegrades = make_timestamp($workshop->releaseyear, $workshop->releasemonth, $workshop->releaseday, $workshop->releasehour, $workshop->releaseminute);
if (!workshop_check_dates($workshop)) {
return get_string('invaliddates', 'workshop');
}
// set the workshop's type
$wtype = 0;
// 3 phases, no grading grades
if ($workshop->includeself or $workshop->ntassessments) {
$wtype = 1;
}
// 3 phases with grading grades
if ($workshop->nsassessments) {
$wtype = 2;
}
// 5 phases with grading grades
$workshop->wtype = $wtype;
// encode password if necessary
if (!empty($workshop->password)) {
$workshop->password = md5($workshop->password);
} else {
unset($workshop->password);
}
$workshop->id = $workshop->instance;
if ($returnid = update_record("workshop", $workshop)) {
$dates = array('submissionstart' => $workshop->submissionstart, 'submissionend' => $workshop->submissionend, 'assessmentstart' => $workshop->assessmentstart, 'assessmentend' => $workshop->assessmentend);
$moduleid = get_field('modules', 'id', 'name', 'workshop');
foreach ($dates as $type => $date) {
if ($event = get_record('event', 'modulename', 'workshop', 'instance', $workshop->id, 'eventtype', $type)) {
$event->name = get_string($type . 'event', 'workshop', $workshop->name);
$event->description = $workshop->description;
$event->eventtype = $type;
$event->timestart = $date;
update_event($event);
} else {
if ($date) {
$event = NULL;
$event->name = get_string($type . 'event', 'workshop', $workshop->name);
$event->description = $workshop->description;
$event->courseid = $workshop->course;
$event->groupid = 0;
$event->userid = 0;
$event->modulename = 'workshop';
$event->instance = $workshop->instance;
$event->eventtype = $type;
$event->timestart = $date;
$event->timeduration = 0;
$event->visible = get_field('course_modules', 'visible', 'module', $moduleid, 'instance', $workshop->id);
add_event($event);
}
}
}
}
if (time() > $workshop->assessmentstart) {
// regrade all the submissions...
set_field("workshop_submissions", "nassessments", 0, "workshopid", $workshop->id);
workshop_grade_assessments($workshop);
}
return $returnid;
}
开发者ID:nagyistoce,项目名称:moodle-Teach-Pilot,代码行数:70,代码来源:lib.php
示例11: update_instance
/**
* Updates a new assignment activity
*
* Given an object containing all the necessary data,
* (defined by the form in mod_form.php) this function
* will update the assignment instance and return the id number
* The due date is updated in the calendar
* This is common to all assignment types.
*
* @global object
* @global object
* @param object $assignment The data from the form on mod_form.php
* @return int The assignment id
*/
function update_instance($assignment)
{
global $COURSE, $DB;
$assignment->timemodified = time();
$assignment->id = $assignment->instance;
$assignment->courseid = $assignment->course;
$DB->update_record('assignment', $assignment);
if ($assignment->timedue) {
$event = new object();
if ($event->id = $DB->get_field('event', 'id', array('modulename' => 'assignment', 'instance' => $assignment->id))) {
$event->name = $assignment->name;
$event->description = format_module_intro('assignment', $assignment, $assignment->coursemodule);
$event->timestart = $assignment->timedue;
update_event($event);
} else {
$event = new object();
$event->name = $assignment->name;
$event->description = format_module_intro('assignment', $assignment, $assignment->coursemodule);
$event->courseid = $assignment->course;
$event->groupid = 0;
$event->userid = 0;
$event->modulename = 'assignment';
$event->instance = $assignment->id;
$event->eventtype = 'due';
$event->timestart = $assignment->timedue;
$event->timeduration = 0;
add_event($event);
}
} else {
$DB->delete_records('event', array('modulename' => 'assignment', 'instance' => $assignment->id));
}
// get existing grade item
assignment_grade_item_update($assignment);
return true;
}
开发者ID:ajv,项目名称:Offline-Caching,代码行数:49,代码来源:lib.php
示例12: wwassignment_refresh_events
function wwassignment_refresh_events($courseid = 0)
{
error_log('wwassignment_refresh_events called');
if ($courseid == 0) {
if (!($wwassignment = get_records('wwassignment'))) {
return true;
}
} else {
if (!($wwassignment = get_records('wwassignment', 'course', $courseid))) {
return true;
}
}
$moduleid = get_field('modules', 'id', 'name', 'wwassignment');
foreach ($wwassignment as $wwassignment) {
$event = NULL;
$event->name = addslashes($wwassignment->name);
$event->description = addslashes($wwassignment->description);
$event->timestart = $wwassignment->timedue;
if ($event->id = get_field('event', 'id', 'modulename', 'wwassignment', 'instance', $wwassignment->id)) {
update_event($event);
} else {
$event->courseid = $wwassignment->course;
$event->groupid = 0;
$event->userid = 0;
$event->modulename = 'wwassignment';
$event->instance = $wwassignment->id;
$event->eventtype = 'due';
$event->timeduration = 0;
$event->visible = get_field('course_modules', 'visible', 'module', $moduleid, 'instance', $wwassignment->id);
add_event($event);
}
}
return true;
}
开发者ID:bjornbe,项目名称:wwassignment,代码行数:34,代码来源:lib.php
示例13: event_espresso_manage_events
function event_espresso_manage_events()
{
global $wpdb, $org_options;
?>
<div id="configure_organization_form" class="wrap meta-box-sortables ui-sortable">
<div id="event_reg_theme" class="wrap">
<div id="icon-options-event" class="icon32"></div>
<h2>
<?php
if ($_REQUEST['page'] == 'events' && isset($_REQUEST['event_admin_reports'])) {
switch ($_REQUEST['event_admin_reports']) {
case 'charts':
_e('Attendee Reports', 'event_espresso');
break;
case 'event_list_attendees':
case 'resend_email':
case 'list_attendee_payments':
_e('Attendee Reports', 'event_espresso');
if (!empty($_REQUEST['event_id']) && $_REQUEST['event_admin_reports'] != 'add_new_attendee') {
echo '<a href="admin.php?page=events&event_admin_reports=add_new_attendee&event_id=' . $_REQUEST['event_id'] . '" class="button add-new-h2" style="margin-left: 20px;">' . __('Add New Attendee', 'event_espresso') . '</a>';
}
break;
case 'edit_attendee_record':
_e('Edit Attendee Data', 'event_espresso');
break;
case 'enter_attendee_payments':
_e('Edit Attendee Payment Record', 'event_espresso');
break;
case 'add_new_attendee':
_e('Add New Attendee', 'event_espresso');
break;
case 'event_newsletter':
_e('Email Event Attendees', 'event_espresso');
break;
}
} else {
_e('Event Overview', 'event_espresso');
if (isset($_REQUEST['action']) && ($_REQUEST['action'] == 'edit' || $_REQUEST['action'] == 'add_new_event')) {
} else {
echo '<a href="admin.php?page=events&action=add_new_event" class="button add-new-h2" style="margin-left: 20px;">' . __('Add New Event', 'event_espresso') . '</a>';
}
}
?>
</h2>
<?php
if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'copy_event') {
require_once "copy_event.php";
copy_event();
}
if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'delete') {
event_espresso_delete_event();
}
//Delete recurrence series of events
if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'delete_recurrence_series') {
$r = $wpdb->get_results("SELECT id FROM " . EVENTS_DETAIL_TABLE . " ed WHERE recurrence_id = " . $_REQUEST['recurrence_id']);
if ($wpdb->num_rows > 0) {
foreach ($r as $row) {
event_espresso_delete_event($row->id);
}
}
}
if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'csv_import') {
require_once 'csv_import.php';
csv_import();
}
if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'add') {
require_once "insert_event.php";
add_event_to_db();
}
//Update the event
if (isset($_REQUEST['edit_action']) && $_REQUEST['edit_action'] == 'update') {
require_once "update_event.php";
update_event();
}
//If we need to add or edit a new event then we show the add or edit forms
if (isset($_REQUEST['action']) && ($_REQUEST['action'] == 'add_new_event' || $_REQUEST['action'] == 'edit')) {
?>
<form id="espresso_event_editor" name="form" method="post" action="<?php
echo $_SERVER["REQUEST_URI"];
?>
">
<?php
if ($_REQUEST['action'] == 'edit') {
//show the edit form
require_once "edit_event.php";
edit_event($_REQUEST['event_id']);
} else {
//Show the add new event form
require_once "add_new_event.php";
add_new_event();
}
?>
<br class="clear" />
</form>
<!-- /event_reg_theme -->
<?php
} else {
//If we are not adding or editing an event then show the list of events
if (isset($_REQUEST['event_admin_reports'])) {
switch ($_REQUEST['event_admin_reports']) {
//.........这里部分代码省略.........
开发者ID:hhgr,项目名称:uksoccer,代码行数:101,代码来源:index.php
示例14: dimdim_update_dimdim_times
function dimdim_update_dimdim_times($dimdimid = 0)
{
/// Updates dimdim records so that the next dimdim time is correct
$timenow = time();
if ($dimdimid) {
if (!($dimdims[] = get_record_select('dimdim', "id = '{$dimdimid}' AND dimdimtime <= '{$timenow}' AND schedule > '0'"))) {
return;
}
} else {
if (!($dimdims = get_records_select('dimdim', "dimdimtime <= '{$timenow}' AND schedule > '0'"))) {
return;
}
}
foreach ($dimdims as $dimdim) {
unset($dimdim->name);
unset($dimdim->intro);
switch ($dimdim->schedule) {
case 1:
// Single event - turn off schedule and disable
$dimdim->dimdimtime = 0;
$dimdim->schedule = 0;
break;
case 2:
// Repeat daily
$dimdim->dimdimtime += 24 * 3600;
break;
case 3:
// Repeat weekly
$dimdim->dimdimtime += 7 * 24 * 3600;
break;
}
update_record('dimdim', $dimdim);
$event = NULL;
// Update calendar too
if ($event->id = get_field('event', 'id', 'modulename', 'dimdim', 'instance', $dimdim->id)) {
$event->timestart = $dimdim->dimdimtime;
update_event($event);
}
}
}
开发者ID:kai707,项目名称:ITSA-backup,代码行数:40,代码来源:lib.php
示例15: basename
$calself = basename($PHP_SELF);
displayPageHeader($color);
//load calendar menu
calendar_header();
echo html_tag('tr', '', '', $color[0]) . html_tag('td', '', 'left') . html_tag('table', '', '', $color[0], 'width="100%" border="0" cellpadding="2" cellspacing="1"') . html_tag('tr') . html_tag('td', date_intl(_("l, F j Y"), mktime(0, 0, 0, $month, $day, $year)), 'left', '', 'colspan="2"');
if (!isset($updated)) {
//get changes to event
readcalendardata();
update_event_form();
} else {
if (!isset($confirmed)) {
//confirm changes
readcalendardata();
confirm_update();
} else {
update_event("{$month}{$day}{$year}", "{$hour}{$minute}");
echo html_tag('tr', html_tag('td', _("Event updated!"), 'left')) . "\n";
echo html_tag('tr', html_tag('td', "<a href=\"day.php?year={$year}&month={$month}&day={$day}\">" . _("Day View") . "</a>", 'left')) . "\n";
$fixdate = date('mdY', mktime(0, 0, 0, $event_month, $event_day, $event_year));
//if event has been moved to different year then act accordingly
if ($year == $event_year) {
$calendardata["{$fixdate}"]["{$event_hour}{$event_minute}"] = array('length' => $event_length, 'priority' => $event_priority, 'title' => $event_title, 'message' => $event_text);
writecalendardata();
} else {
writecalendardata();
$year = $event_year;
$calendardata = array();
readcalendardata();
$calendardata["{$fixdate}"]["{$event_hour}{$event_minute}"] = array('length' => $event_length, 'priority' => $event_priority, 'title' => $event_title, 'message' => $event_text);
writecalendardata();
}
开发者ID:teammember8,项目名称:roundcube,代码行数:31,代码来源:event_edit.php
示例16: update_event
function update_event($recurrence_arr = array())
{
//print_r($_REQUEST);
global $wpdb, $org_options, $current_user, $espresso_premium;
$wpdb->show_errors();
/*
* Begin Recurrence handling
*
* Will clean up in V 1.2.0
*
*/
if (get_option('event_espresso_re_active') == 1) {
require_once EVENT_ESPRESSO_RECURRENCE_FULL_PATH . "functions/re_functions.php";
if ($_POST['recurrence_id'] > 0) {
/*
* If the array is empty, then find the recurring dates
*/
if (count($recurrence_arr) == 0) {
// Prepare the parameters array for use with various RE functions
$re_params = array('start_date' => $_POST['recurrence_start_date'], 'event_end_date' => $_POST['recurrence_event_end_date'], 'end_date' => $_POST['recurrence_end_date'], 'registration_start' => $_POST['recurrence_regis_start_date'], 'registration_end' => $_POST['recurrence_regis_end_date'], 'frequency' => $_POST['recurrence_frequency'], 'interval' => $_POST['recurrence_interval'], 'recurrence_type' => $_POST['recurrence_type'], 'weekdays' => $_POST['recurrence_weekday'], 'repeat_by' => $_POST['recurrence_repeat_by'], 'recurrence_regis_date_increment' => $_POST['recurrence_regis_date_increment'], 'recurrence_manual_dates' => $_POST['recurrence_manual_dates'], 'recurrence_manual_end_dates' => $_POST['recurrence_manual_end_dates'], 'recurrence_visibility' => $_POST['recurrence_visibility'], 'recurrence_id' => $_POST['recurrence_id']);
//$re_params['adding_to_db'] = 'Y';
//Has the form been modified
$recurrence_form_modified = recurrence_form_modified($re_params);
//echo ($recurrence_form_modified) ? "Yes" : 'No';
if ($_POST['recurrence_apply_changes_to'] == 2) {
//Update all events in the series based on recurrence id
$recurrence_dates = $_POST['recurrence_type'] == 'm' ? find_recurrence_manual_dates($re_params) : find_recurrence_dates($re_params);
//$DEL_SQL = 'UPDATE ' . EVENTS_DETAIL_TABLE . " SET event_status = 'D' WHERE start_date NOT IN (" . $delete_in . ") AND recurrence_id = " . $wpdb->escape($_POST['recurrence_id']);
$UPDATE_SQL = "SELECT id,start_date,event_identifier FROM " . EVENTS_DETAIL_TABLE . " WHERE recurrence_id = %d AND NOT event_status = 'D'";
} else {
//Update this and upcoming events based on recurrence id and start_date >=start_date
$re_params['start_date'] = $_POST['start_date'];
$recurrence_dates = find_recurrence_dates($re_params);
//$DEL_SQL = 'UPDATE ' . EVENTS_DETAIL_TABLE . " SET event_status = 'D' WHERE start_date >='" . $wpdb->escape($_POST['start_date']) . "' AND start_date NOT IN (" . $delete_in . ") AND recurrence_id = " . $_POST['recurrence_id'];
$UPDATE_SQL = "SELECT id,start_date,event_identifier FROM " . EVENTS_DETAIL_TABLE . " WHERE start_date >='" . $wpdb->escape($_POST['start_date']) . "' AND recurrence_id = %d and NOT event_status = 'D' ";
}
//Recurrence Form modified and changes need to apply to all
if ($recurrence_form_modified && $_POST['recurrence_apply_changes_to'] > 1) {
//Update the recurrence table record with the new RE selections
update_recurrence_master_record();
/*
* Delete the records that don't belong in the formula
*/
if (count($recurrence_dates) > 0) {
$delete_in = '';
foreach ($recurrence_dates as $k => $v) {
$delete_in .= "'" . $k . "',";
}
$delete_in = substr($delete_in, 0, -1);
}
if ($_POST['recurrence_apply_changes_to'] == 2) {
//Update all events in the series based on recurrence id
//$DEL_SQL = 'UPDATE ' . EVENTS_DETAIL_TABLE . " SET event_status = 'D' WHERE start_date NOT IN (" . $delete_in . ") AND recurrence_id = " . $_POST['recurrence_id'];
$DEL_SQL = 'DELETE EDT, EAT FROM ' . EVENTS_DETAIL_TABLE . " EDT\n LEFT JOIN " . EVENTS_ATTENDEE_TABLE . " EAT\n ON EDT.id = EAT.event_id\n WHERE EAT.id IS NULL\n AND EDT.start_date NOT IN (" . $delete_in . ")\n AND recurrence_id = " . $_POST['recurrence_id'];
$UPDATE_SQL = "SELECT id,start_date,event_identifier FROM " . EVENTS_DETAIL_TABLE . " WHERE recurrence_id = %d and NOT event_status = 'D' ORDER BY start_date";
} else {
//Update this and upcoming events based on recurrence id and start_date >=start_date
//$DEL_SQL = 'UPDATE ' . EVENTS_DETAIL_TABLE . " SET event_status = 'D' WHERE start_date >='" . $wpdb->escape($_POST['start_date']) . "' AND start_date NOT IN (" . $delete_in . ") AND recurrence_id = " . $_POST['recurrence_id'];
$DEL_SQL = 'DELETE EDT, EAT FROM ' . EVENTS_DETAIL_TABLE . " EDT\n LEFT JOIN " . EVENTS_ATTENDEE_TABLE . " EAT\n ON EDT.id = EAT.event_id\n WHERE EAT.id IS NULL\n AND EDT.start_date >='" . $wpdb->escape($_POST['start_date']) . "'\n AND start_date NOT IN (" . $delete_in . ")\n AND recurrence_id = " . $_POST['recurrence_id'];
$UPDATE_SQL = "SELECT id,start_date,event_identifier FROM " . EVENTS_DETAIL_TABLE . " WHERE start_date >='" . $wpdb->escape($_POST['start_date']) . "' AND recurrence_id = %d AND NOT event_status = 'D' ORDER BY start_date";
}
if ($delete_in != '') {
$wpdb->query($DEL_SQL);
}
/*
* Add the new records based on the new formula
* The $recurrence_dates array will contain the new dates
*/
if (!function_exists('add_event_to_db')) {
require_once 'insert_event.php';
}
foreach ($recurrence_dates as $k => $v) {
$result = $wpdb->get_row($wpdb->prepare("SELECT ID FROM " . EVENTS_DETAIL_TABLE . " WHERE recurrence_id = %d and start_date = %s and NOT event_status = 'D'", array($_POST['recurrence_id'], $k)));
if ($wpdb->num_rows == 0) {
add_event_to_db(array('recurrence_id' => $_POST['recurrence_id'], 'recurrence_start_date' => $v['start_date'], 'recurrence_event_end_date' => $v['end_date'], 'recurrence_end_date' => $v['start_date'], 'registration_start' => $v['registration_start'], 'registration_end' => $v['registration_end']));
} else {
}
}
/*
* Find all the event ids in the series and feed into the $recurrence_dates array
* This array will be used at the end of this document to invoke the recursion of update_event function so all the events in the series
* can be updated with the information.
*/
}
$result = $wpdb->get_results($wpdb->prepare($UPDATE_SQL, array($_POST['recurrence_id'])));
foreach ($result as $row) {
if ($row->start_date != '') {
$recurrence_dates[$row->start_date]['event_id'] = $row->id;
$recurrence_dates[$row->start_date]['event_identifier'] = $row->event_identifier;
}
}
}
}
}
// echo_f('rd',$recurrence_dates);
if (defined('EVENT_ESPRESSO_RECURRENCE_MODULE_ACTIVE') && !empty($_POST['recurrence']) && $_POST['recurrence'] == 'Y' && count($recurrence_arr) == 0 && $_POST['recurrence_apply_changes_to'] > 1) {
//skip the first update
} else {
$event_mata = array();
//will be used to hold event meta data
//.........这里部分代码省略.........
开发者ID:macconsultinggroup,项目名称:WordPress,代码行数:101,代码来源:update_event.php
示例17: get_all_contacts
$contacts = get_all_contacts();
if (isset($_GET['id'])) {
$id = $_GET['id'];
$event = get_event($_GET['id']);
} else {
if (isset($_POST['id'])) {
if (!isset($_FILES['pdf']) || !file_exists($_FILES['pdf']['tmp_name']) || !is_uploaded_file($_FILES['pdf']['tmp_name'])) {
update_event($_POST['id'], stripslashes($_POST['description']));
} else {
$info = pathinfo($_FILES['pdf']['name']);
$ext = $info['extension'];
// get the extension of the file
$newname = $_POST['id'] . "." . $ext;
$target = 'pdfs/' . $newname;
move_uploaded_file($_FILES['pdf']['tmp_name'], $target);
update_event($_POST['id'], stripslashes($_POST['description']), $target);
}
$id = $_POST['id'];
$contact_id1 = $_POST['contact_id1'];
$contact_id2 = $_POST['contact_id2'];
if ($contact_id1 == -1) {
$contact_id1 = false;
}
|
请发表评论