當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。