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


PHP Events::get_atutor_events方法代码示例

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


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

示例1: calendar_cron

function calendar_cron()
{
    require 'includes/classes/events.class.php';
    require AT_INCLUDE_PATH . 'classes/phpmailer/atutormailer.class.php';
    //Iterate through each member's preference
    $sql = "SELECT * FROM %scalendar_notification WHERE 1=1";
    $rows_notify = queryDB($sql, array(TABLE_PREFIX));
    $event_obj = new Events();
    foreach ($rows_notify as $row) {
        //Send email only when preference is 1
        if ($row['status'] == 1) {
            $all_events = array();
            $mail = new ATutorMailer();
            //Get personal events
            $personal_events = $event_obj->get_personal_events($row['memberid']);
            foreach ($personal_events as $event) {
                $all_events[] = $event;
            }
            //Get course events
            $sql_q = "SELECT course_id FROM %scourse_enrollment WHERE member_id = %d";
            $rows_enrolled = queryDB($sql_q, array(TABLE_PREFIX, TABLE_PREFIX));
            foreach ($rows_enrolled as $row_q) {
                $course_events = $event_obj->get_atutor_events($row['memberid'], $row_q['course_id']);
                foreach ($course_events as $event) {
                    $all_events[] = $event;
                }
            }
            //Iterate through each event and keep only those events which will start tomorrow
            $email_msg = _AT('calendar_noti_mail_1') . "\n";
            $index = 1;
            foreach ($all_events as $id => $event) {
                if (strtotime(substr($event['start'], 0, 10)) == strtotime('tomorrow')) {
                    $email_msg .= _AT('calendar_noti_mail_2') . " #" . $index . " \n";
                    $email_msg .= _AT('calendar_noti_mail_3') . ": " . substr($event['start'], 0, 10) . " \n";
                    $email_msg .= _AT('calendar_noti_mail_4') . ": " . substr($event['end'], 0, 10) . " \n";
                    $email_msg .= _AT('calendar_noti_mail_5') . ": " . $event['title'] . " \n\n";
                    $index++;
                }
            }
            //Send email using ATutor mailer
            $mail->From = $_config['contact_email'];
            $mail->FromName = $_config['site_name'];
            $mail->AddAddress($_config['contact_email']);
            $mail->Subject = $stripslashes(_AT('calendar_noti_title'));
            $mail->Body = $email_msg;
            $sql_email = "SELECT email FROM %smembers WHERE member_id = %d";
            $row_email = queryDB($sql_email, array(TABLE_PREFIX, $row['memberid']), TRUE);
            $mail->AddBCC($row_email['email']);
            $mail->Send();
            unset($mail);
            //For testing
            // echo "<br/>".$email_msg."<br/>".$row_email['mail'];
        }
    }
}
开发者ID:genaromendezl,项目名称:ATutor,代码行数:55,代码来源:module_cron.php

示例2: array

 * This file is used to generate ics file.
 */
$_user_location = 'public';
define('AT_INCLUDE_PATH', '../../../include/');
require AT_INCLUDE_PATH . 'vitals.inc.php';
require 'includes/classes/events.class.php';
$rows = array();
$eventObj = new Events();
//Create ics file in $ical string variable
$ical = "BEGIN:VCALENDAR\nVERSION:2.0\nPRODID:-//ATutor//ATutor Calendar Module//EN";
//Get all the events of the user
foreach ($eventObj->get_personal_events($_SESSION['member_id'], TRUE) as $event) {
    array_push($rows, $event);
}
//Get ATutor system events
foreach ($eventObj->get_atutor_events($_SESSION['member_id'], $_SESSION['course_id'], TRUE) as $event) {
    array_push($rows, $event);
}
foreach ($rows as $row) {
    /*Timezone manipulation
      $sstamp   = strtotime($row['start']) - ($_GET['hrs'] * 60 * 60);
      $estamp   = strtotime($row['end'])   - ($_GET['hrs'] * 60 * 60);
      
      $startdt  = gmdate('Y-m-d H:i:s', $sstamp);
      $enddt    = gmdate('Y-m-d H:i:s', $estamp);
      
      $part_s   = explode(' ', $startdt);
      $part_e   = explode(' ', $enddt);*/
    $part_s = explode(" ", $row['start']);
    $part_e = explode(" ", $row['end']);
    $s_date_p = explode('-', $part_s[0]);
开发者ID:genaromendezl,项目名称:ATutor,代码行数:31,代码来源:export.php

示例3: foreach

        $member = $_SESSION['member_id'];
    } else {
        $member = $_GET['mid'];
    }
}
foreach ($eventObj->get_personal_events($member) as $event) {
    if (!isset($_GET['all'])) {
        $event['editable'] = true;
    }
    array_push($rows, $event);
}
if (isset($_GET['all']) || isset($_GET['mini']) || isset($_GET['mid'])) {
    if (isset($_GET['all']) || isset($_GET['mini'])) {
        if (is_array($courses)) {
            $i = 0;
            foreach ($eventObj->get_atutor_events($_SESSION['member_id'], $courses[$i]) as $event) {
                array_push($rows, $event);
                $i++;
            }
        } else {
            foreach ($eventObj->get_atutor_events($_SESSION['member_id'], $_SESSION['course_id']) as $event) {
                array_push($rows, $event);
            }
        }
    }
    if (isset($_GET['mid'])) {
        if (!isset($_GET['cid'])) {
            $_GET['cid'] = $courses;
        }
        if (is_array($_GET['cid'])) {
            $t = 0;
开发者ID:genaromendezl,项目名称:ATutor,代码行数:31,代码来源:json-events.php


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