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


PHP calendar::add_calendar方法代码示例

本文整理汇总了PHP中calendar::add_calendar方法的典型用法代码示例。如果您正苦于以下问题:PHP calendar::add_calendar方法的具体用法?PHP calendar::add_calendar怎么用?PHP calendar::add_calendar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在calendar的用法示例。


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

示例1: while

 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);
     if ($calendar) {
         $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']) {
         header('Location: ' . $GO_CONFIG->host . 'error_docs/401.php');
         exit;
     }
 }
 $title = $calendar['name'];
 $cal_start_hour = $calendar['start_hour'];
开发者ID:BackupTheBerlios,项目名称:hpt-obm-svn,代码行数:31,代码来源:index.php

示例2: header

         if ($calendar_id > 0) {
             $existing_calendar = $cal->get_calendar_by_name($name);
             if ($existing_calendar && $existing_calendar['id'] != $calendar_id) {
                 $feedback = "<p class=\"Error\">" . $sc_calendar_exists . "</p>";
             } else {
                 $cal->update_calendar($calendar_id, $name, $_POST['calendar_start_hour'], $_POST['calendar_end_hour']);
                 if ($_POST['close'] == 'true') {
                     header('Location: ' . $return_to);
                     exit;
                 }
             }
         } else {
             if ($cal->get_calendar_by_name($name)) {
                 $feedback = "<p class=\"Error\">" . $sc_calendar_exists . "</p>";
             } else {
                 if ($calendar_id = $cal->add_calendar($GO_SECURITY->user_id, $name, $_POST['calendar_start_hour'], $_POST['calendar_end_hour'])) {
                     $db = new db();
                     $db->query("INSERT INTO cal_config VALUES ('" . $GO_SECURITY->user_id . "','" . $calendar_id . "')");
                     if ($_POST['close'] == 'true') {
                         header('Location: ' . $return_to);
                         exit;
                     }
                 } else {
                     $feedback = "<p class=\"Error\">" . $strSaveError . "</p>";
                 }
             }
         }
     }
 } else {
     $feedback = "<p class=\"Error\">" . $error_missing_field . "</p>";
 }
开发者ID:BackupTheBerlios,项目名称:hpt-obm-svn,代码行数:31,代码来源:calendar.php


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