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


PHP cross_dst函数代码示例

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


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

示例1: sql_row

 }
 $row = sql_row($res, 0);
 sql_free($res);
 # Note: Removed stripslashes() calls from name and description. Previous
 # versions of MRBS mistakenly had the backslash-escapes in the actual database
 # records because of an extra addslashes going on. Fix your database and
 # leave this code alone, please.
 $name = $row[0];
 $create_by = $row[1];
 $description = $row[2];
 $start_day = strftime('%d', $row[3]);
 $start_month = strftime('%m', $row[3]);
 $start_year = strftime('%Y', $row[3]);
 $start_hour = strftime('%H', $row[3]);
 $start_min = strftime('%M', $row[3]);
 $duration = $row[4] - $row[3] - cross_dst($row[3], $row[4]);
 $type = $row[5];
 $room_id = $row[6];
 $entry_type = $row[7];
 $rep_id = $row[8];
 if ($entry_type >= 1) {
     $sql = "SELECT rep_type, start_time, end_date, rep_opt, rep_num_weeks\n\t\t        FROM {$tbl_repeat} WHERE id={$rep_id}";
     $res = sql_query($sql);
     if (!$res) {
         fatal_error(1, sql_error());
     }
     if (sql_count($res) != 1) {
         fatal_error(1, get_vocab("repeat_id") . $rep_id . get_vocab("not_found"));
     }
     $row = sql_row($res, 0);
     sql_free($res);
开发者ID:verdurin,项目名称:mrbs-mcr,代码行数:31,代码来源:edit_entry.php

示例2: report_row

function report_row(&$rows, &$data)
{
    global $output_format, $ajax, $ajax_capable;
    global $csv_row_sep, $csv_col_sep;
    global $custom_fields, $field_natures, $field_lengths, $tbl_entry;
    global $approval_somewhere, $confirmation_somewhere;
    global $strftime_format;
    global $select_options;
    global $field_order_list;
    // If we're capable of delivering an Ajax request and this is not Ajax request,
    // then don't do anything.  We're going to save sending the data until we actually
    // get the Ajax request;  we just send the rest of the page at this stage.
    if ($output_format == OUTPUT_HTML && $ajax_capable && !$ajax) {
        return;
    }
    $values = array();
    foreach ($field_order_list as $field) {
        $value = $data[$field];
        // Some fields need some special processing to turn the raw value into something
        // more meaningful
        switch ($field) {
            case 'end_time':
                // Calculate the duration and then fall through to calculating the end date
                // Need the duration in seconds for sorting.  Have to correct it for DST
                // changes so that the user sees what he expects to see
                $duration_seconds = $data['end_time'] - $data['start_time'];
                $duration_seconds -= cross_dst($data['start_time'], $data['end_time']);
                $d = get_duration($data['start_time'], $data['end_time'], $data['enable_periods']);
                $d_string = $d['duration'] . ' ' . $d['dur_units'];
                $d_string = escape($d_string);
            case 'start_time':
                $mod_time = $field == 'start_time' ? 0 : -1;
                if ($data['enable_periods']) {
                    list(, $date) = period_date_string($value, $mod_time);
                } else {
                    $date = time_date_string($value);
                }
                $value = $date;
                break;
            case 'type':
                $value = get_type_vocab($value);
                break;
            case 'confirmation_enabled':
                // Translate the status field bit into meaningful text
                if ($data['confirmation_enabled']) {
                    $value = $data['status'] & STATUS_TENTATIVE ? get_vocab("tentative") : get_vocab("confirmed");
                } else {
                    $value = '';
                }
                break;
            case 'approval_enabled':
                // Translate the status field bit into meaningful text
                if ($data['approval_enabled']) {
                    $value = $data['status'] & STATUS_AWAITING_APPROVAL ? get_vocab("awaiting_approval") : get_vocab("approved");
                } else {
                    $value = '';
                }
                break;
            case 'last_updated':
                $value = time_date_string($value);
                break;
            default:
                // Custom fields
                if (array_key_exists($field, $custom_fields)) {
                    // Output a yes/no if it's a boolean or integer <= 2 bytes (which we will
                    // assume are intended to be booleans)
                    if ($field_natures[$field] == 'boolean' || $field_natures[$field] == 'integer' && isset($field_lengths[$field]) && $field_lengths[$field] <= 2) {
                        $value = empty($value) ? get_vocab("no") : get_vocab("yes");
                    } elseif (isset($value)) {
                        // If the custom field is an associative array then we want
                        // the value rather than the array key (provided the key is not
                        // an empty string)
                        if (isset($select_options["entry.{$field}"]) && is_assoc($select_options["entry.{$field}"]) && array_key_exists($value, $select_options["entry.{$field}"]) && $value !== '') {
                            $value = $select_options["entry.{$field}"][$value];
                        }
                    } else {
                        $value = '';
                    }
                }
                break;
        }
        $value = escape($value);
        // For HTML output we take special action for some fields
        if ($output_format == OUTPUT_HTML) {
            switch ($field) {
                case 'name':
                    // Add a link to the entry and also a data-id value for the Bulk Delete JavaScript
                    $value = "<a href=\"view_entry.php?id=" . $data['id'] . "\"" . " data-id=\"" . $data['id'] . "\"" . " title=\"{$value}\">{$value}</a>";
                    break;
                case 'end_time':
                    // Process the duration and then fall through to the end_time
                    // Include the duration in a seconds as a title in an empty span so
                    // that the column can be sorted and filtered properly
                    $d_string = "<span title=\"{$duration_seconds}\"></span>{$d_string}";
                case 'start_time':
                case 'last_updated':
                    // Include the numeric time as a title in an empty span so
                    // that the column can be sorted and filtered properly
                    $value = "<span title=\"{$data[$field]}\"></span>{$value}";
                    break;
//.........这里部分代码省略.........
开发者ID:bdwong-mirrors,项目名称:mrbs,代码行数:101,代码来源:report.php

示例3: fatal_error

if (sql_count($res) < 1) {
    fatal_error(0, $series ? get_vocab("invalid_series_id") : get_vocab("invalid_entry_id"));
}
$row = sql_row_keyed($res, 0);
sql_free($res);
$name = htmlspecialchars($row['name']);
$description = htmlspecialchars($row['description']);
$create_by = htmlspecialchars($row['create_by']);
$room_name = htmlspecialchars($row['room_name']);
$area_name = htmlspecialchars($row['area_name']);
$type = $row['type'];
$room_id = $row['room_id'];
$updated = time_date_string($row['last_updated']);
// need to make DST correct in opposite direction to entry creation
// so that user see what he expects to see
$duration = $row['duration'] - cross_dst($row['start_time'], $row['end_time']);
if ($enable_periods) {
    list($start_period, $start_date) = period_date_string($row['start_time']);
} else {
    $start_date = time_date_string($row['start_time']);
}
if ($enable_periods) {
    list(, $end_date) = period_date_string($row['end_time'], -1);
} else {
    $end_date = time_date_string($row['end_time']);
}
$rep_type = 0;
if ($series == 1) {
    $rep_type = $row['rep_type'];
    $rep_end_date = utf8_strftime('%A %d %B %Y', $row['end_date']);
    $rep_opt = $row['rep_opt'];
开发者ID:verdurin,项目名称:mrbs-mcr,代码行数:31,代码来源:view_entry.php

示例4: slot

}
# Acquire mutex to lock out others trying to book the same slot(s).
if (!sql_mutex_lock("{$tbl_entry}")) {
    fatal_error(1, get_vocab("failed_to_acquire"));
}
# Check for any schedule conflicts in each room we're going to try and
# book in
$err = "";
foreach ($rooms as $room_id) {
    if ($rep_type != 0 && !empty($reps)) {
        if (count($reps) < $max_rep_entrys) {
            for ($i = 0; $i < count($reps); $i++) {
                # calculate diff each time and correct where events
                # cross DST
                $diff = $endtime - $starttime;
                $diff += cross_dst($reps[$i], $reps[$i] + $diff);
                $tmp = mrbsCheckFree($room_id, $reps[$i], $reps[$i] + $diff, $ignore_id, $repeat_id);
                if (!empty($tmp)) {
                    $err = $err . $tmp;
                }
            }
        } else {
            $err .= get_vocab("too_may_entrys") . "<P>";
            $hide_title = 1;
        }
    } else {
        $err .= mrbsCheckFree($room_id, $starttime, $endtime - 1, $ignore_id, 0);
    }
}
# end foreach rooms
if (empty($err)) {
开发者ID:verdurin,项目名称:mrbs-mcr,代码行数:31,代码来源:edit_entry_handler.php

示例5: mktime

        if (isset($ampm) && $ampm == "pm" && $hour < 12) {
            $hour += 12;
        }
        if (isset($ampm) && $ampm == "am" && $hour > 11) {
            $hour -= 12;
        }
    }
    $starttime = mktime($hour, $minute, 0, $month, $day, $year, is_dst($month, $day, $year, $hour));
    $endtime = mktime($hour, $minute, 0, $month, $day, $year, is_dst($month, $day, $year, $hour)) + $units * $duration;
    # Round up the duration to the next whole resolution unit.
    # If they asked for 0 minutes, push that up to 1 resolution unit.
    $diff = $endtime - $starttime;
    if (($tmp = $diff % $resolution) != 0 || $diff == 0) {
        $endtime += $resolution - $tmp;
    }
    $endtime += cross_dst($starttime, $endtime);
}
$sql = "SELECT {$tbl_room}.id, {$tbl_room}.room_name, {$tbl_room}.description, {$tbl_room}.capacity, {$tbl_area}.area_name, {$tbl_room}.area_id FROM {$tbl_room} JOIN {$tbl_area} on {$tbl_room}.area_id={$tbl_area}.id WHERE ( SELECT COUNT(*) FROM {$tbl_entry} ";
//old booking fully inside new booking
$sql .= "WHERE (({$tbl_entry}.start_time>={$starttime} AND {$tbl_entry}.end_time<{$endtime}) ";
//new start time within old booking
$sql .= "OR ({$tbl_entry}.start_time<{$starttime} AND {$tbl_entry}.end_time>{$starttime}) ";
//new end time within old booking
$sql .= "OR ({$tbl_entry}.start_time<{$endtime} AND {$tbl_entry}.end_time>={$endtime})) ";
$sql .= "AND mdl_mrbs_entry.room_id = mdl_mrbs_room.id ) < 1  AND {$tbl_room}.capacity >= {$mincap} ";
if ($computer) {
    $sql .= "AND description like 'Teaching IT%' ";
}
if ($teaching) {
    $sql .= "AND description like 'Teaching%' ";
}
开发者ID:rtsfc,项目名称:moodle-block_mrbs,代码行数:31,代码来源:roomsearch_ss.php

示例6: map_add_booking


//.........这里部分代码省略.........
            $n++;
        }
        // fill in the id, type and start time
        $column[$s][$n]["id"] = $row['entry_id'];
        $column[$s][$n]["is_repeat"] = isset($row['repeat_id']);
        $column[$s][$n]["is_multiday_start"] = $is_multiday_start;
        $column[$s][$n]["is_multiday_end"] = $is_multiday_end;
        $column[$s][$n]["status"] = $row['status'];
        $column[$s][$n]["color"] = $row['type'];
        $column[$s][$n]["start_time"] = hour_min($start_s);
        $column[$s][$n]["slots"] = NULL;
        // to avoid undefined index NOTICE errors
        // if it's a multiple booking also fill in the name and description
        if ($n > 0) {
            $column[$s][$n]["data"] = $row['type'];
            //$column[$s][$n]["long_descr"] = $row['entry_description'];
            //$column[$s][$n]["create_by"] = $row['entry_create_by'];
            //$column[$s][$n]["room_id"] = $row['room_id'];
        } else {
            $column[$s][$n]["data"] = NULL;
            $column[$s][$n]["long_descr"] = NULL;
            $column[$s][$n]["create_by"] = NULL;
            $column[$s][$n]["room_id"] = NULL;
        }
    }
    // end for
    // Show the name of the booker, the description and the number of complete
    // slots in the first complete slot that the booking happens in, or at the
    // start of the day if it started before today.
    // Find the number of time slots that the booking occupies, and the index
    // of the first slot that this booking has entirely to itself
    // We need to adjust the start and end times for DST transitions as the display
    // ignores DST
    $n_slots = intval(($end_t - $start_t - cross_dst($start_t, $end_t)) / $resolution) + 1;
    $first_slot = $start_s;
    // If the last time slot is already occupied, we have a multiple
    // booking in the last slot, so decrement the number of slots that
    // we will display for this booking
    if (isset($column[$end_s][1]["id"])) {
        $n_slots--;
        // If we're only the second booking to land on this time slot
        // then we'll have to adjust the information held for the first booking
        // (unless it's just one slot long in the first place, when it
        // doesn't matter as it will now be part of a multiple booking).
        // If we are the third booking or more, then it will have already
        // been adjusted.
        if (!isset($column[$end_s][2]["id"])) {
            if ($column[$end_s][0]["slots"] > 1) {
                // Move the name and description into the new first slot and decrement the number of slots
                $column[$end_s + $resolution][0]["data"] = $column[$end_s][0]["data"];
                //$column[$end_s + $resolution][0]["long_descr"] = $column[$end_s][0]["long_descr"];
                //$column[$end_s + $resolution][0]["create_by"]  = $column[$end_s][0]["create_by"];
                //$column[$end_s + $resolution][0]["room_id"]    = $column[$end_s][0]["room_id"];
                $column[$end_s + $resolution][0]["slots"] = $column[$end_s][0]["slots"] - 1;
            }
        }
    }
    // and if the first time slot is already occupied, decrement
    // again, adjust the first slot for this booking
    if (isset($column[$start_s][1]["id"])) {
        $n_slots--;
        $first_slot += $resolution;
        // If we're only the second booking to land on this time slot
        // then we'll have to adjust the information held for the first booking
        if (!isset($column[$start_s][2]["id"])) {
            // Find the first slot ($s) of the first booking
开发者ID:cvelayo,项目名称:worklog,代码行数:67,代码来源:temp.php

示例7: mktime

         $hour = 0;
         $minute = 0;
     }
 } else {
     if (!isset($hour) || !isset($minute)) {
         $hour = $morningstarts;
         $minute = $morningstarts_minutes;
     }
 }
 $start_time = mktime($hour, $minute, 0, $month, $day, $year);
 if (isset($end_seconds)) {
     $end_minutes = intval($end_seconds / 60);
     $end_hour = intval($end_minutes / 60);
     $end_minute = $end_minutes % 60;
     $end_time = mktime($end_hour, $end_minute, 0, $month, $day, $year);
     $duration = $end_time - $start_time - cross_dst($start_time, $end_time);
 } else {
     if (!isset($default_duration)) {
         $default_duration = SECONDS_PER_HOUR;
     }
     $duration = $enable_periods ? 60 : $default_duration;
     $end_time = $start_time + $duration;
     // The end time can't be past the end of the booking day
     $pm7 = get_start_last_slot($month, $day, $year);
     $end_time = min($end_time, $pm7 + $resolution);
 }
 $rep_id = 0;
 if (!isset($rep_type)) {
     $rep_type = REP_NONE;
     $rep_end_day = $day;
     $rep_end_month = $month;
开发者ID:jberanek,项目名称:mrbs_clone,代码行数:31,代码来源:edit_entry.php

示例8: array

    // a series.  ["The "DTSTART" property for a "VEVENT" specifies the inclusive
    // start of the event.  For recurring events, it also specifies the very first
    // instance in the recurrence set."]
    $rep_details = array('rep_type' => $rep_type, 'rep_opt' => $rep_opt, 'rep_num_weeks' => $rep_num_weeks);
    if (isset($month_type)) {
        if ($month_type == REP_MONTH_ABSOLUTE) {
            $rep_details['month_absolute'] = $month_absolute;
        } else {
            $rep_details['month_relative'] = $month_relative;
        }
    }
    // Get the first entry in the series and make that the start time
    $reps = mrbsGetRepeatEntryList($starttime, $end_date, $rep_details, 1);
    if (count($reps) > 0) {
        $duration = $endtime - $starttime;
        $duration -= cross_dst($starttime, $endtime);
        $starttime = $reps[0];
        $endtime = $starttime + $duration;
        $start_day = date('j', $starttime);
        $start_month = date('n', $starttime);
        $start_year = date('Y', $starttime);
    }
}
if (!$ajax || !$commit) {
    // Get the start day/month/year and make them the current day/month/year
    $day = $start_day;
    $month = $start_month;
    $year = $start_year;
}
// Set up the return URL.    As the user has tried to book a particular room and a particular
// day, we must consider these to be the new "sticky room" and "sticky day", so modify the
开发者ID:dev-lav,项目名称:htdocs,代码行数:31,代码来源:edit_entry_handler.php

示例9: stripslashes

}
# Note: Removed stripslashes() calls from name and description. Previous
# versions of MRBS mistakenly had the backslash-escapes in the actual database
# records because of an extra addslashes going on. Fix your database and
# leave this code alone, please.
$name = htmlspecialchars($row[0]);
$description = htmlspecialchars($row[1]);
$create_by = htmlspecialchars($row[2]);
$room_name = htmlspecialchars($row[3]);
$area_name = htmlspecialchars($row[4]);
$type = $row[5];
$room_id = $row[6];
$updated = time_date_string(MDB_Date::mdbstamp2Unix($row[7]));
# need to make DST correct in opposite direction to entry creation
# so that user see what he expects to see
$duration = $row[8] - cross_dst($row[9], $row[10]);
if ($enable_periods) {
    list($start_period, $start_date) = period_date_string($row[9]);
} else {
    $start_date = time_date_string($row[9]);
}
if ($enable_periods) {
    list(, $end_date) = period_date_string($row[10], -1);
} else {
    $end_date = time_date_string($row[10]);
}
$rep_type = 0;
if ($series == 1) {
    $rep_type = $row[11];
    $rep_end_date = utf8_strftime('%A %d %B %Y', $row[12]);
    $rep_opt = $row[13];
开发者ID:verdurin,项目名称:mrbs-mcr,代码行数:31,代码来源:view_entry.php

示例10: stripslashes

# Note: Removed stripslashes() calls from name and description. Previous
# versions of MRBS mistakenly had the backslash-escapes in the actual database
# records because of an extra addslashes going on. Fix your database and
# leave this code alone, please.
$name = htmlspecialchars($row[0]);
$description = htmlspecialchars($row[1]);
$create_by = htmlspecialchars($row[2]);
$room_name = htmlspecialchars($row[3]);
$area_name = htmlspecialchars($row[4]);
$type = $row[5];
$room_id = $row[6];
$repeat_id = $row[7];
$updated = time_date_string($row[8]);
# need to make DST correct in opposite direction to entry creation
# so that user see what he expects to see
$duration = $row[9] - cross_dst($row[10], $row[11]);
if ($enable_periods) {
    list($start_period, $start_date) = period_date_string($row[10]);
} else {
    $start_date = time_date_string($row[10]);
}
if ($enable_periods) {
    list(, $end_date) = period_date_string($row[11], -1);
} else {
    $end_date = time_date_string($row[11]);
}
$rep_type = 0;
if ($repeat_id != 0) {
    $res = sql_query("SELECT rep_type, end_date, rep_opt, rep_num_weeks\n\t                    FROM {$tbl_repeat} WHERE id={$repeat_id}");
    if (!$res) {
        fatal_error(0, sql_error());
开发者ID:verdurin,项目名称:mrbs-mcr,代码行数:31,代码来源:view_entry.php

示例11: mrbsCreateRepeatingEntrys

/** mrbsCreateRepeatingEntrys()
 * 
 * Creates a repeat entry in the data base + all the repeating entrys
 * 
 * $starttime   - Start time of entry
 * $endtime     - End time of entry
 * $rep_type    - The repeat type
 * $rep_enddate - When the repeating ends
 * $rep_opt     - Any options associated with the entry
 * $room_id     - Room ID
 * $owner       - Owner
 * $name        - Name
 * $type        - Type (Internal/External)
 * $description - Description
 * 
 * Returns:
 *   0        - An error occured while inserting the entry
 *   non-zero - The entry's ID
 */
function mrbsCreateRepeatingEntrys($starttime, $endtime, $rep_type, $rep_enddate, $rep_opt, $room_id, $owner, $name, $type, $description, $rep_num_weeks)
{
    global $max_rep_entrys;
    $reps = mrbsGetRepeatEntryList($starttime, $rep_enddate, $rep_type, $rep_opt, $max_rep_entrys, $rep_num_weeks);
    if (count($reps) > $max_rep_entrys) {
        return 0;
    }
    if (empty($reps)) {
        $ent = mrbsCreateSingleEntry($starttime, $endtime, 0, 0, $room_id, $owner, $name, $type, $description);
        return $ent;
    }
    $ent = mrbsCreateRepeatEntry($starttime, $endtime, $rep_type, $rep_enddate, $rep_opt, $room_id, $owner, $name, $type, $description, $rep_num_weeks);
    if ($ent) {
        for ($i = 0; $i < count($reps); $i++) {
            # calculate diff each time and correct where events
            # cross DST
            $diff = $endtime - $starttime;
            $diff += cross_dst($reps[$i], $reps[$i] + $diff);
            mrbsCreateSingleEntry($reps[$i], $reps[$i] + $diff, 1, $ent, $room_id, $owner, $name, $type, $description);
        }
    }
    return $ent;
}
开发者ID:rtsfc,项目名称:moodle-block_mrbs,代码行数:42,代码来源:mrbs_sql.php

示例12: getPreviousEntryData

/**
 * Gather all fields values for an entry. Used for emails to get previous
 * entry state.
 *
 * @param int     $id       entry id to get data
 * @param int     $series   1 if this is a serie or 0
 * @return bool             TRUE or PEAR error object if fails
 */
function getPreviousEntryData($id, $series)
{
    global $tbl_area, $tbl_entry, $tbl_repeat, $tbl_room, $enable_periods;
    //
    $sql = "\n    SELECT  e.name,\n            e.description,\n            e.create_by,\n            r.room_name,\n            a.area_name,\n            e.type,\n            e.room_id,\n            e.repeat_id,\n            e.timestamp,\n            (e.end_time - e.start_time) AS tbl_e_duration,\n            e.start_time AS tbl_e_start_time,\n            e.end_time AS tbl_e_end_time,\n            a.area_admin_email,\n            r.room_admin_email";
    // Here we could just use $tbl_repeat.start_time, and not use alias,
    // as the last column will take precedence using mysql_fetch_array,
    // but for portability purpose I will not use it.
    if (1 == $series) {
        $sql .= ", re.rep_type, re.rep_opt, re.rep_num_weeks,\n            (re.end_time - re.start_time) AS tbl_r_duration,\n            re.start_time AS tbl_r_start_time,\n            re.end_time AS tbl_r_end_time,\n            re.end_date AS tbl_r_end_date";
    }
    $sql .= "\n    FROM {$tbl_entry} e, {$tbl_room} r, {$tbl_area} a ";
    1 == $series ? $sql .= ', ' . $tbl_repeat . ' re ' : '';
    $sql .= "\n    WHERE e.room_id = r.id\n    AND r.area_id = a.id\n    AND e.id={$id}";
    1 == $series ? $sql .= " AND e.repeat_id = re.id" : '';
    //
    $res = sql_query($sql);
    !$res ? fatal_error(0, sql_error()) : '';
    sql_count($res) < 1 ? fatal_error(0, get_string('invalid_entry_id', 'block_mrbs')) : '';
    $row = sql_row_keyed($res, 0);
    sql_free($res);
    // Store all needed values in $mail_previous array to pass to
    // notifyAdminOnDelete function (shorter than individual variables -:) )
    $mail_previous['namebooker'] = $row['name'];
    $mail_previous['description'] = $row['description'];
    $mail_previous['createdby'] = $row['create_by'];
    $mail_previous['room_name'] = $row['room_name'];
    $mail_previous['area_name'] = $row['area_name'];
    $mail_previous['type'] = $row['type'];
    $mail_previous['room_id'] = $row['room_id'];
    $mail_previous['repeat_id'] = $row['repeat_id'];
    $mail_previous['updated'] = getMailTimeDateString($row[8]);
    $mail_previous['area_admin_email'] = $row['area_admin_email'];
    $mail_previous['room_admin_email'] = $row['room_admin_email'];
    // If we use periods
    if ($enable_periods) {
        // If we delete a serie, start_time and end_time must
        // come from $tbl_repeat, not $tbl_entry.
        //
        // This is not a serie
        if (1 != $series) {
            list($mail_previous['start_period'], $mail_previous['start_date']) = getMailPeriodDateString($row['tbl_e_start_time']);
            list($mail_previous['end_period'], $mail_previous['end_date']) = getMailPeriodDateString($row['tbl_e_end_time'], -1);
            // need to make DST correct in opposite direction to entry creation
            // so that user see what he expects to see
            $mail_previous['duration'] = $row['tbl_e_duration'] - cross_dst($row['tbl_e_start_time'], $row['tbl_e_end_time']);
        } else {
            list($mail_previous['start_period'], $mail_previous['start_date']) = getMailPeriodDateString($row['tbl_r_start_time']);
            list($mail_previous['end_period'], $mail_previous['end_date']) = getMailPeriodDateString($row['tbl_r_end_time'], 0);
            // use getMailTimeDateString as all I want is the date
            $mail_previous['rep_end_date'] = getMailTimeDateString($row['tbl_r_end_date'], FALSE);
            // need to make DST correct in opposite direction to entry creation
            // so that user see what he expects to see
            $mail_previous['duration'] = $row['tbl_r_duration'] - cross_dst($row['tbl_r_start_time'], $row['tbl_r_end_time']);
            $mail_previous['rep_opt'] = "";
            switch ($row['rep_type']) {
                case 2:
                case 6:
                    $rep_day[0] = $row['rep_opt'][0] != "0";
                    $rep_day[1] = $row['rep_opt'][1] != "0";
                    $rep_day[2] = $row['rep_opt'][2] != "0";
                    $rep_day[3] = $row['rep_opt'][3] != "0";
                    $rep_day[4] = $row['rep_opt'][4] != "0";
                    $rep_day[5] = $row['rep_opt'][5] != "0";
                    $rep_day[6] = $row['rep_opt'][6] != "0";
                    if ($row['rep_type'] == 6) {
                        $mail_previous['rep_num_weeks'] = $row['rep_num_weeks'];
                    } else {
                        $mail_previous['rep_num_weeks'] = "";
                    }
                    break;
                default:
                    $rep_day = array(0, 0, 0, 0, 0, 0, 0);
            }
            for ($i = 0; $i < 7; $i++) {
                $wday = ($i + $weekstarts) % 7;
                if ($rep_day[$wday]) {
                    $mail_previous['rep_opt'] .= day_name($wday) . " ";
                }
            }
            $mail_previous['rep_num_weeks'] = $row['rep_num_weeks'];
        }
        toPeriodString($mail_previous['start_period'], $mail_previous['duration'], $mail_previous['dur_units']);
    } else {
        // This is not a serie
        if (1 != $series) {
            $mail_previous['start_date'] = getMailTimeDateString($row['tbl_e_start_time']);
            $mail_previous['end_date'] = getMailTimeDateString($row['tbl_e_end_time']);
            // need to make DST correct in opposite direction to entry creation
            // so that user see what he expects to see
            $mail_previous['duration'] = $row['tbl_e_duration'] - cross_dst($row['tbl_e_start_time'], $row['tbl_e_end_time']);
        } else {
//.........这里部分代码省略.........
开发者ID:rtsfc,项目名称:moodle-block_mrbs,代码行数:101,代码来源:functions.php

示例13: array

    // a series.  ["The "DTSTART" property for a "VEVENT" specifies the inclusive
    // start of the event.  For recurring events, it also specifies the very first
    // instance in the recurrence set."]
    $rep_details = array('rep_type' => $rep_type, 'rep_opt' => $rep_opt, 'rep_num_weeks' => $rep_num_weeks);
    if (isset($month_type)) {
        if ($month_type == REP_MONTH_ABSOLUTE) {
            $rep_details['month_absolute'] = $month_absolute;
        } else {
            $rep_details['month_relative'] = $month_relative;
        }
    }
    // Get the first entry in the series and make that the start time
    $reps = mrbsGetRepeatEntryList($start_time, $end_date, $rep_details, 1);
    if (count($reps) > 0) {
        $duration = $end_time - $start_time;
        $duration -= cross_dst($start_time, $end_time);
        $start_time = $reps[0];
        $end_time = $start_time + $duration;
        $start_day = date('j', $start_time);
        $start_month = date('n', $start_time);
        $start_year = date('Y', $start_time);
    }
}
if (!$ajax || !$commit) {
    // Get the start day/month/year and make them the current day/month/year
    $day = $start_day;
    $month = $start_month;
    $year = $start_year;
}
// Set up the return URL.    As the user has tried to book a particular room and a particular
// day, we must consider these to be the new "sticky room" and "sticky day", so modify the
开发者ID:cvelayo,项目名称:worklog,代码行数:31,代码来源:edit_entry_handler.php


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