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


PHP Calendar::getCalendars方法代码示例

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


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

示例1: getCalendars

function getCalendars()
{
    global $obj_smarty;
    $arr_users = array();
    $arr_user = User::getUser();
    $bln_admin = User::isAdmin();
    $bln_superadmin = User::isSuperAdmin();
    $obj_smarty->assign('name', $arr_user['firstname'] . ' ' . (!empty($arr_user['infix']) ? $arr_user['infix'] : '') . $arr_user['lastname']);
    $obj_smarty->assign('user', $_SESSION['calendar-uid']['username']);
    $obj_smarty->assign('user_id', $_SESSION['calendar-uid']['uid']);
    $obj_smarty->assign('is_admin', $bln_admin);
    $obj_smarty->assign('is_super_admin', $bln_superadmin);
    if ($bln_admin) {
        $arr_calendars = Calendar::getCalendars();
    }
    return $arr_calendars;
}
开发者ID:ramant15,项目名称:ektimo,代码行数:17,代码来源:index.php

示例2: search

function search()
{
    global $error;
    global $obj_smarty;
    global $obj_db;
    $arr_return = array();
    $arr_submit = array(array('sq', 'string', true, ''), array('cal_id', 'string', true, ''));
    $frm_submitted = validate_var($arr_submit);
    if (!empty($frm_submitted)) {
        if (isset($_SESSION['calendar-uid']) && $_SESSION['calendar-uid']['uid']) {
            $user_id = $_SESSION['calendar-uid']['uid'];
        } else {
            $user_id = 0;
        }
        $arr_calendars = array();
        if (!empty($frm_submitted['cal_id'])) {
            $arr_calendars = Calendar::getCalendars($frm_submitted['cal_id']);
        }
        $arr_days = array(1 => 'Monday', 2 => 'Tuesday', 3 => 'Wednesday', 4 => 'Thursday', 5 => 'Friday', 6 => 'Saturday', 7 => 'Sunday');
        $arr_events = array();
        if (!empty($arr_calendars)) {
            foreach ($arr_calendars as $calendar) {
                $str_query = 'SELECT e.*, re.rep_interval, re.weekdays, event_id as id, concat_ws(" ",date_start,time_start) as start,concat_ws(" ",date_end,time_end) as end FROM events e' . ' LEFT JOIN `repeating_events` re ON(re.rep_event_id = e.repeating_event_id)  WHERE title LIKE  "%' . $frm_submitted['sq'] . '%" ' . ($user_id > 0 && $calendar['share_type'] != "public" && ALLOW_ACCESS_BY !== 'free' && !Calendar::UserInGroup($calendar, $user_id) ? ' AND user_id = ' . $user_id : '');
                $str_query .= ' AND calendar_id = ' . $calendar['calendar_id'];
                $str_query .= ' ORDER BY date_start';
                $obj_result = mysqli_query($obj_db, $str_query);
                while ($arr_line = mysqli_fetch_array($obj_result, MYSQLI_ASSOC)) {
                    $arr_events[] = $arr_line;
                }
            }
        }
        foreach ($arr_events as $event) {
            $arr_weekdays = explode(',', $event['weekdays']);
            $str_weekdays = '';
            foreach ($arr_weekdays as $day) {
                if (!empty($day)) {
                    $str_weekdays .= $arr_days[$day] . ', ';
                }
            }
            $event['weekdays'] = $str_weekdays;
            $arr_return[] = $event;
        }
        $str_events = '';
        //	$_SESSION['employee-work-schedule-sq'] = $frm_submitted['sq'];
    } else {
        $arr_return = array();
        $frm_submitted['sq'] = '';
    }
    $obj_smarty->assign('results', $arr_return);
    $obj_smarty->assign('q', $frm_submitted['sq']);
    if (isset($frm_submitted['cal_id'])) {
        $obj_smarty->assign('cal_id', $frm_submitted['cal_id']);
    }
    $obj_smarty->display(FULLCAL_DIR . '/view/search_results.html');
}
开发者ID:ramant15,项目名称:ektimo,代码行数:55,代码来源:index.php

示例3: undeleteCalendar

function undeleteCalendar()
{
    global $error;
    global $obj_smarty;
    $arr_submit = array(array('cid', 'int', true, ''));
    $frm_submitted = validate_var($arr_submit);
    if (User::isAdmin() || User::isSuperAdmin()) {
        $bln_success = Calendar::undeleteCalendar($frm_submitted['cid']);
        if ($bln_success) {
            $obj_smarty->assign('msg', 'Calendar is back again');
        }
        $arr_calendars = Calendar::getCalendars();
        $obj_smarty->assign('calendars', $arr_calendars);
        $obj_smarty->assign('active', 'public_calendars');
    } else {
        $obj_smarty->assign('error', 'NO rights to undelete this calendar');
    }
    $obj_smarty->display(FULLCAL_DIR . '/view/user_panel.tpl');
    exit;
}
开发者ID:ramant15,项目名称:ektimo,代码行数:20,代码来源:index.php

示例4: Exception

 $capteurs = $bpl->getIPTable();
 $clientId = null;
 for ($i = 0; $clientId == null && $i < count($capteurs); ++$i) {
     if ($capteurs[$i]["bluecountId"] == $ref) {
         $clientId = $capteurs[$i]["clientId"];
     }
 }
 if (!$clientId) {
     throw new Exception("Identifiant capteur {$ref} non trouvé");
 }
 $bpl->setClientId($clientId);
 include_once "BluePHP/BTopLocalServer/Calendar.inc";
 $cal = new Calendar();
 $calendrier = $argv[2];
 $calId = null;
 $cals = $cal->getCalendars();
 for ($i = 0; $calId == null && $i < count($cals); ++$i) {
     if ($cals[$i]["calId"] == $calendrier) {
         $calId = $calendrier;
     }
 }
 if (!$calId) {
     throw new Exception("Identifiant calendrier {$calendrier} non trouvé");
 }
 include_once "BluePHP/BTopLocalServer/FlowCountingProcessing.inc";
 $fcp = new FlowCountingProcessing();
 foreach ($fcp->getFlowsFromCounter($ref) as $v) {
     $fcp->setCalendar($v["fcpId"], $calendrier);
 }
 include_once "BluePHP/BTopLocalServer/ZoneCounting.inc";
 $zcp = new ZoneCounting();
开发者ID:jeanpul,项目名称:maintenance-blueportail,代码行数:31,代码来源:ChangePlageHoraire.php

示例5: getDeletedCalendars

function getDeletedCalendars()
{
    global $obj_smarty;
    if (User::isLoggedIn()) {
        $arr_user = User::getUser();
        if (User::isSuperAdmin()) {
            $arr_calendars = Calendar::getCalendars(true, true);
            $obj_smarty->assign('calendars', $arr_calendars);
        } else {
            if (User::isAdmin()) {
                $arr_calendars = Calendar::getCalendarsOfAdmin($arr_user['user_id'], true);
                $obj_smarty->assign('calendars', $arr_calendars);
            }
        }
    }
    $obj_smarty->assign('active', 'calendars');
    $obj_smarty->display(FULLCAL_DIR . '/view/admin_panel.tpl');
    exit;
}
开发者ID:ramant15,项目名称:ektimo,代码行数:19,代码来源:index.php

示例6: exit

<?php

include_once "Config.inc";
try {
    if (count($argv) < 2) {
        echo "Erreur:\tArguments manquants\n" . "Usage:\tListeCalendrier.php client\n" . "\tclient\t\tIdentifiant client voir ListeIdentifiantCapteur.php\n";
        exit(1);
    }
    include_once "BluePHP/BluePortail/BluePortailLang.inc";
    $bpl = new BluePortailLang(array());
    $clientId = $argv[1];
    $clientIdInfo = $bpl->getClientData(array("clientId" => $clientId));
    if (!count($clientIdInfo)) {
        throw new Exception("Client {$clientId} non trouvé");
    }
    $bpl->setClientId($clientId);
    include_once "BluePHP/BTopLocalServer/Calendar.inc";
    $cal = new Calendar();
    echo sprintf("%16s%16s%16s%16s\n", "Identifiant", "Nom", "Plage Début", "Plage Fin");
    foreach ($cal->getCalendars() as $v) {
        echo sprintf("%16s%16s%16s%16s\n", $v["calId"], $v["calName"], strftime($v["testts"], strtotime($v["ts"])), strftime($v["testte"], strtotime($v["te"])));
    }
} catch (Exception $e) {
    echo "Exception reçue : ", $e->getMessage(), "\n";
}
开发者ID:jeanpul,项目名称:maintenance-blueportail,代码行数:25,代码来源:ListeCalendrier.php

示例7: elgg_get_logged_in_user_entity

<?php

namespace Events\API;

$user = elgg_get_logged_in_user_entity();
$event_guid = get_input('event_guid');
$event = get_entity($event_guid);
$calendars = (array) get_input('calendars');
$all_calendars = Calendar::getCalendars(elgg_get_logged_in_user_entity());
if (!$all_calendars) {
    $default_calendar = Calendar::getPublicCalendar(elgg_get_logged_in_user_entity());
    $all_calendars = array($default_calendar);
}
$added = $removed = 0;
foreach ($all_calendars as $c) {
    if (!in_array($c->guid, $calendars)) {
        $c->removeEvent($event);
        $removed++;
    }
}
foreach ($calendars as $guid) {
    $calendar = get_entity($guid);
    if ($calendar instanceof Calendar && $calendar->canAddEvent()) {
        $calendar->addEvent($event);
        $added++;
    }
}
if ($added && $removed) {
    system_message(elgg_echo('events:calendars:addedremoved', array($added, $removed)));
} elseif ($added) {
    system_message(elgg_echo('events:calendars:added', array($added)));
开发者ID:arckinteractive,项目名称:events_api,代码行数:31,代码来源:add_event.php


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