本文整理汇总了PHP中calendar::next_record方法的典型用法代码示例。如果您正苦于以下问题:PHP calendar::next_record方法的具体用法?PHP calendar::next_record怎么用?PHP calendar::next_record使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类calendar
的用法示例。
在下文中一共展示了calendar::next_record方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isset
if (isset($feedback)) {
echo '<p class="Error">' . $feedback . '</p>';
}
if (!$GO_SECURITY->has_permission($GO_SECURITY->user_id, $event["acl_read"]) && !$GO_SECURITY->has_permission($GO_SECURITY->user_id, $event["acl_write"])) {
$GO_SECURITY->add_user_to_acl($GO_SECURITY->user_id, $event["acl_read"]);
}
$calendar_count = $cal->get_user_calendars($GO_SECURITY->user_id);
$calendar_id = isset($_REQUEST['calendar_id']) ? $_REQUEST['calendar_id'] : 0;
if ($calendar_count > 1) {
echo $sc_select_calendar . ': ';
echo '<form name="accept" method="post" action="' . $_SERVER['PHP_SELF'] . '">';
echo '<input type="hidden" name="email" value="' . $_REQUEST['email'] . '" />';
echo '<input type="hidden" name="event_id" value="' . $_REQUEST['event_id'] . '" />';
echo '<input type="hidden" name="member" value="' . $_REQUEST['member'] . '" />';
echo '<table border="0">';
while ($cal->next_record()) {
if ($GO_SECURITY->has_permission($GO_SECURITY->user_id, $cal->f('acl_write'))) {
$calendars_check = isset($_POST['calendars']) && in_array($cal->f('id'), $_POST['calendars']) ? 'checked' : '';
echo '<tr><td><input type="checkbox" name="calendars[]" value="' . $cal->f('id') . '" ' . $calendars_check . ' /></td><td>' . $cal->f('name') . '</td></tr>';
}
}
echo '</table>';
$button = new button($cmdOk, "javascript:document.forms[0].submit();");
echo '</form>';
} else {
if ($calendar_count == 1) {
$cal->next_record();
$calendar_id = $cal->f('id');
if ($calendar_id > 0) {
if (!$cal->event_is_subscribed($_REQUEST['event_id'], $calendar_id)) {
if ($cal->subscribe_event($_REQUEST['event_id'], $calendar_id)) {
示例2: while
$title = $view['name'];
$calendar_id = 0;
$cal_start_hour = $view['start_hour'];
$cal_end_hour = $view['end_hour'];
}
}
if (!isset($view) || !$view) {
//get the calendar properties and check permissions
if ($calendar_id != 0 && ($calendar = $cal->get_calendar($calendar_id))) {
$calendar['read_permission'] = $GO_SECURITY->has_permission($GO_SECURITY->user_id, $calendar['acl_read']);
$calendar['write_permission'] = $GO_SECURITY->has_permission($GO_SECURITY->user_id, $calendar['acl_write']);
if (!$calendar['read_permission'] && !$calendar['write_permission']) {
//hmm no calendar_id given and default calendar is set
//Does this user even have calendars?
$cal->get_user_calendars($GO_SECURITY->user_id);
if ($cal->next_record()) {
//yes he does so set it default
$calendar_id = $cal->f('id');
} else {
$calendar_name = $_SESSION['GO_SESSION']['name'];
$new_calendar_name = $calendar_name;
$x = 1;
while ($cal->get_calendar_by_name($new_calendar_name)) {
$new_calendar_name = $calendar_name . ' (' . $x . ')';
$x++;
}
if (!($calendar_id = $cal->add_calendar($GO_SECURITY->user_id, addslashes($new_calendar_name), 7, 20))) {
$feedback = '<p class="Error">' . $strSaveError . '</p>';
}
}
$calendar = $cal->get_calendar($calendar_id);