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


PHP mrbsGetRepeatEntryList函数代码示例

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


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

示例1: array

} else {
    $rep_type = 0;
}
if (!isset($rep_day)) {
    $rep_day = array();
}
# For weekly repeat(2), build string of weekdays to repeat on:
$rep_opt = "";
if ($rep_type == 2 || $rep_type == 6) {
    for ($i = 0; $i < 7; $i++) {
        $rep_opt .= empty($rep_day[$i]) ? "0" : "1";
    }
}
# Expand a series into a list of start times:
if ($rep_type != 0) {
    $reps = mrbsGetRepeatEntryList($starttime, isset($rep_enddate) ? $rep_enddate : 0, $rep_type, $rep_opt, $max_rep_entrys, $rep_num_weeks);
}
# When checking for overlaps, for Edit (not New), ignore this entry and series:
$repeat_id = 0;
if (isset($id)) {
    $ignore_id = $id;
    $repeat_id = sql_query1("SELECT repeat_id FROM {$tbl_entry} WHERE id={$id}");
    if ($repeat_id < 0) {
        $repeat_id = 0;
    }
} else {
    $ignore_id = 0;
}
# 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"));
开发者ID:verdurin,项目名称:mrbs-mcr,代码行数:31,代码来源:edit_entry_handler.php

示例2: mktime

$endtime_midnight = mktime(0, 0, 0, $month_temp, $day_temp, $year_temp);
if (resa_est_hors_reservation($starttime_midnight, $endtime_midnight)) {
    print_header();
    echo '<h2>Erreur dans la date de début ou de fin de réservation</h2>';
    echo '<a href="' . $back . '&amp;Err=yes">' . get_vocab('returnprev') . '</a>';
    include 'include/trailer.inc.php';
    die;
}
$rep_opt = '';
if ($rep_type == 2) {
    for ($i = 0; $i < 7; ++$i) {
        $rep_opt .= empty($rep_day[$i]) ? '0' : '1';
    }
}
if ($rep_type != 0) {
    $reps = mrbsGetRepeatEntryList($starttime, isset($rep_enddate) ? $rep_enddate : 0, $rep_type, $rep_opt, $max_rep_entrys, $rep_num_weeks, $rep_jour_c, $area, $rep_month_abs1, $rep_month_abs2);
}
$repeat_id = 0;
if (isset($id) && $id != 0) {
    $ignore_id = $id;
    $repeat_id = grr_sql_query1('SELECT repeat_id FROM ' . TABLE_PREFIX . "_entry WHERE id={$id}");
    if ($repeat_id < 0) {
        $repeat_id = 0;
    }
} else {
    $ignore_id = 0;
}
if (!grr_sql_mutex_lock('' . TABLE_PREFIX . '_entry')) {
    fatal_error(1, get_vocab('failed_to_acquire'));
}
$date_now = time();
开发者ID:nicolas-san,项目名称:GRRV4,代码行数:31,代码来源:edit_entry_handler.php

示例3: 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

示例4: array

    // other words make sure that the first starttime defines an actual
    // entry.   We need to do this because if we are going to construct an iCalendar
    // object, RFC 5545 demands that the start time is the first event of
    // 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;
开发者ID:dev-lav,项目名称:htdocs,代码行数:31,代码来源:edit_entry_handler.php

示例5: 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
 * $beneficiaire       - beneficiaire
 * $beneficiaire_ext - bénéficiaire extérieur
 * $name        - Name
 * $type        - Type (Internal/External)
 * $description - Description
  *$rep_jour_c - Le jour cycle d'une réservation, si aucun 0
 *
 * 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, $creator, $beneficiaire, $beneficiaire_ext, $name, $type, $description, $rep_num_weeks, $option_reservation,$overload_data, $moderate, $rep_jour_c)
{
    global $max_rep_entrys, $id_first_resa;
    $area = mrbsGetRoomArea($room_id);
    $reps = mrbsGetRepeatEntryList($starttime, $rep_enddate, $rep_type, $rep_opt, $max_rep_entrys, $rep_num_weeks, $rep_jour_c, $area);
    if(count($reps) > $max_rep_entrys)
        return 0;

    if(empty($reps))
    {
        mrbsCreateSingleEntry($starttime, $endtime, 0, 0, $room_id, $creator, $beneficiaire, $beneficiaire_ext, $name, $type, $description, $option_reservation,$overload_data,$moderate, $rep_jour_c,"-");
        $id_first_resa = grr_sql_insert_id("".TABLE_PREFIX."_entry", "id");
        return;
    }

    $ent = mrbsCreateRepeatEntry($starttime, $endtime, $rep_type, $rep_enddate, $rep_opt, $room_id, $creator, $beneficiaire, $beneficiaire_ext, $name, $type, $description, $rep_num_weeks,$overload_data, $rep_jour_c);
    if($ent)
    {
        $diff = $endtime - $starttime;

        for($i = 0; $i < count($reps); $i++) {
            mrbsCreateSingleEntry($reps[$i], $reps[$i] + $diff, 1, $ent,
                 $room_id, $creator, $beneficiaire, $beneficiaire_ext, $name, $type, $description, $option_reservation,$overload_data, $moderate, $rep_jour_c,"-");
            $id_new_resa = grr_sql_insert_id("".TABLE_PREFIX."_entry", "id");
            // s'il s'agit d'une modification d'une ressource déjà modérée et acceptée : on met à jour les infos dans la table ".TABLE_PREFIX."_entry_moderate
            if ($moderate==2) moderate_entry_do($id_new_resa,1,"","no");
            // On récupère l'id de la première réservation de la série et qui sera utilisé pour l'enoi d'un mail
            if ($i == 0) $id_first_resa = $id_new_resa;
            }
    }

    return $ent;
}
开发者ID:rhertzog,项目名称:lcs,代码行数:55,代码来源:mrbs_sql.inc.php


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