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


PHP SessionManager::parse_session_dates方法代码示例

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


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

示例1: get_content_html

    /**
     * This method return a content html, it's used inside get_block method for showing it inside dashboard interface
     * @return string  content html
     */
    public function get_content_html()
    {
        $content = '';
        $sessions = $this->sessions;
        $content = '<div style="margin:10px;">';
        $content .= '<h3><font color="#000">' . get_lang('YourSessionsList') . '</font></h3>';
        if (count($sessions) > 0) {
            $sessions_table = '<table class="data_table" width:"95%">';
            $sessions_table .= '<tr>
									<th >' . get_lang('Title') . '</th>
									<th >' . get_lang('Date') . '</th>
									<th width="100px">' . get_lang('NbCoursesPerSession') . '</th>
								</tr>';
            $i = 1;
            foreach ($sessions as $session) {
                $session_id = intval($session['id']);
                $title = $session['name'];
                $date_string = SessionManager::parse_session_dates($session);
                $count_courses_in_session = count(Tracking::get_courses_list_from_session($session_id));
                if ($i % 2 == 0) {
                    $class_tr = 'row_odd';
                } else {
                    $class_tr = 'row_even';
                }
                $sessions_table .= '<tr class="' . $class_tr . '">
										<td>' . $title . '</td>
										<td align="center">' . $date_string . '</td>
										<td align="center">' . $count_courses_in_session . '</td>
								   </tr>';
                $i++;
            }
            $sessions_table .= '</table>';
            $content .= $sessions_table;
        } else {
            $content .= get_lang('ThereIsNoInformationAboutYourSessions');
        }
        if (count($sessions) > 0) {
            $content .= '<div style="text-align:right;margin-top:10px;"><a href="' . api_get_path(WEB_CODE_PATH) . 'mySpace/session.php">' . get_lang('SeeMore') . '</a></div>';
        }
        $content .= '</div>';
        return $content;
    }
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:46,代码来源:block_session.class.php

示例2: count

}
$nb_sessions = count($a_sessions);
if ($export_csv) {
    $csv_content = array();
}
if ($nb_sessions > 0) {
    $table = new SortableTable('tracking', 'count_sessions_coached');
    $table->set_header(0, get_lang('Title'));
    $table->set_header(1, get_lang('Date'));
    $table->set_header(2, get_lang('NbCoursesPerSession'));
    $table->set_header(3, get_lang('Details'), false);
    $all_data = array();
    foreach ($a_sessions as $session) {
        $row = array();
        $row[] = $session['name'];
        $row[] = SessionManager::parse_session_dates($session);
        $row[] = count(Tracking::get_courses_list_from_session($session['id']));
        if ($export_csv) {
            $csv_content[] = $row;
        }
        if (isset($_GET['id_coach']) && $_GET['id_coach'] != '') {
            $row[] = '<a href="student.php?id_session=' . $session['id'] . '&id_coach=' . intval($_GET['id_coach']) . '"><img src="' . api_get_path(WEB_IMG_PATH) . '2rightarrow.gif" border="0" /></a>';
        } else {
            $row[] = '<a href="course.php?id_session=' . $session['id'] . '"><img src="' . api_get_path(WEB_IMG_PATH) . '2rightarrow.gif" border="0" /></a>';
        }
        $all_data[] = $row;
    }
    if (!isset($tracking_column)) {
        $tracking_column = 0;
    }
    if ($_GET['tracking_direction'] == 'DESC') {
开发者ID:ragebat,项目名称:chamilo-lms,代码行数:31,代码来源:session.php

示例3: array

        $data = array();
        $personal_course_list = array();
        $id_session = $session_item['session_id'];
        foreach ($session_item['courses'] as $my_course) {
            $courseInfo = api_get_course_info_by_id($my_course['id']);
            $row = array();
            $row[] = $courseInfo['code'];
            $row[] = $courseInfo['title'];
            //$row[] = $my_course['status'] == STUDENT ? get_lang('Student') : get_lang('Teacher');
            $roles = api_detect_user_roles($user['user_id'], $courseInfo['real_id'], $id_session);
            $row[] = api_get_roles_to_string($roles);
            $tools = '<a href="course_information.php?code=' . $courseInfo['code'] . '&id_session=' . $id_session . '">' . Display::return_icon('synthese_view.gif', get_lang('Overview')) . '</a>' . '<a href="' . api_get_path(WEB_COURSE_PATH) . $courseInfo['path'] . '?id_session=' . $id_session . '">' . Display::return_icon('course_home.gif', get_lang('CourseHomepage')) . '</a>';
            $row[] = $tools;
            $data[] = $row;
        }
        $dates = SessionManager::parse_session_dates($session_item);
        echo Display::page_subheader($session_item['session_name'], ' ' . $dates);
        Display::display_sortable_table($header, $data, array(), array(), array('user_id' => intval($_GET['user_id'])));
    }
} else {
    Display::display_warning_message(get_lang('NoSessionsForThisUser'));
}
/**
 * Show the courses in which this user is subscribed
 */
$sql = 'SELECT * FROM ' . $table_course_user . ' cu, ' . $table_course . ' c' . ' WHERE cu.user_id = ' . $user['user_id'] . ' AND cu.c_id = c.id ' . ' AND cu.relation_type <> ' . COURSE_RELATION_TYPE_RRHH . ' ';
$res = Database::query($sql);
if (Database::num_rows($res) > 0) {
    $header = array();
    $header[] = array(get_lang('Code'), true);
    $header[] = array(get_lang('Title'), true);
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:31,代码来源:user_information.php

示例4: show_session_data

 /**
  * Shows the general data for a particular meeting
  *
  * @param id	session id
  * @return string	session data
  */
 public static function show_session_data($id_session)
 {
     if ($id_session != strval(intval($id_session))) {
         return '';
     } else {
         $id_session = intval($id_session);
     }
     $session_info = api_get_session_info($id_session);
     $session_category = SessionManager::get_session_category($session_info['session_category_id']);
     $session_category_name = null;
     if (!empty($session_category)) {
         $session_category_name = $session_category['name'];
     }
     $user_info = api_get_user_info($session_info['id_coach']);
     $general_coach = null;
     if (!empty($user_info)) {
         $general_coach = $user_info['complete_name'] . ' (' . $user_info['username'] . ')';
     }
     $msg_date = SessionManager::parse_session_dates($session_info);
     $output = '';
     if (!empty($session_category)) {
         $output .= '<tr><td>' . get_lang('SessionCategory') . ': ' . '<b>' . $session_category_name . '</b></td></tr>';
     }
     $output .= '<tr>
                     <td style="width:50%">' . get_lang('SessionName') . ': ' . '<b>' . $session_info['name'] . '</b></td>
                     <td>' . get_lang('GeneralCoach') . ': ' . '<b>' . $general_coach . '</b></td></tr>';
     $output .= '<tr><td>' . get_lang('SessionIdentifier') . ': ' . Display::return_icon('star.png', ' ', array('align' => 'absmiddle')) . '</td>
                     <td>' . get_lang('Date') . ': ' . '<b>' . $msg_date . '</b></td></tr>';
     return $output;
 }
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:36,代码来源:course_home.lib.php

示例5: array_merge

                        }
                    }
                }
            }
        }
    }
}
$my_real_array = ArrayClass::msort($my_real_array, 'date', 'asc');
if (!empty($new_exercises)) {
    $my_real_array = array_merge($new_exercises, $my_real_array);
}
$back_url = '';
if (!empty($course_id)) {
    //$back_url = Display::url(Display::return_icon('back.png',get_lang('back.png')), api_get_path(WEB_CODE_PATH).'session/?session_id='.$session_id);
}
$dates = SessionManager::parse_session_dates($session_info);
echo Display::page_header($back_url . ' ' . $session_info['name'] . " <small>{$dates}<small>");
if (!empty($new_course_list)) {
    echo '<div id="session_course_list" class="row">';
    foreach ($new_course_list as $course_item) {
        echo '<div class="span3">';
        echo '<div class="big_icon">';
        echo Display::url(Display::return_icon('course.png', $course_item['only_title'], array(), ICON_SIZE_BIG), $course_item['link']);
        echo '</div>';
        echo '<div class="content">';
        echo $course_item['title'];
        echo '</div>';
        echo '</div>';
    }
    echo '</div>';
}
开发者ID:ragebat,项目名称:chamilo-lms,代码行数:31,代码来源:index.php

示例6: get_sessions_by_category


//.........这里部分代码省略.........
         // First take $row2, as it contains less data and this data is enough
         while ($row2 = Database::fetch_array($result2)) {
             $join[] = $row2;
             $ordered_join[] = $row2;
             $ids[] = $row2['id'];
         }
     }
     if (Database::num_rows($result1) > 0) {
         // Now add the diff with $row1, ordering elements as planned by query
         $i = 0;
         while ($row1 = Database::fetch_array($result1)) {
             if (!in_array($row1['id'], $ids)) {
                 if ($reverse_order) {
                     while (isset($join[$i]) && strcmp($row1['session_category_name'], $join[$i]['session_category_name']) <= 0) {
                         $ordered_join[] = $join[$i];
                         $i++;
                     }
                 } else {
                     while (isset($join[$i]) && strcmp($row1['session_category_name'], $join[$i]['session_category_name']) > 0) {
                         $ordered_join[] = $join[$i];
                         $i++;
                     }
                     if (isset($join[$i]) && strcmp($row1['session_category_name'], $join[$i]['session_category_name']) === 0) {
                         while (isset($join[$i]) && isset($row1['short_name']) && strcmp($row1['short_name'], $join[$i]['short_name']) > 0) {
                             $ordered_join[] = $join[$i];
                             $i++;
                         }
                     }
                 }
                 $ordered_join[] = $row1;
                 $join[] = $row1;
             }
         }
     }
     if (count($ordered_join) == 0) {
         $ordered_join = $join;
     }
     if (count($ordered_join) > 0) {
         foreach ($ordered_join as $row) {
             if ($get_count) {
                 return $row['total_rows'];
             }
             $categories[$row['session_category_id']]['session_category']['id'] = $row['session_category_id'];
             $categories[$row['session_category_id']]['session_category']['name'] = $row['session_category_name'];
             $categories[$row['session_category_id']]['session_category']['date_start'] = $row['session_category_date_start'];
             $categories[$row['session_category_id']]['session_category']['date_end'] = $row['session_category_date_end'];
             $session_id = $row['id'];
             // The only usage of $session_info is to call
             // api_get_session_date_validation, which only needs id and
             // dates from the session itself, so really no need to query
             // the session table again
             $session_info = $row;
             // Checking session visibility
             $visibility = api_get_session_visibility($session_id, null, $ignore_visibility_for_admins);
             switch ($visibility) {
                 case SESSION_VISIBLE_READ_ONLY:
                 case SESSION_VISIBLE:
                 case SESSION_AVAILABLE:
                     break;
                 case SESSION_INVISIBLE:
                     continue 2;
             }
             if ($is_time_over == false) {
                 $date_validation = api_get_session_date_validation($session_info, null, false, false);
                 if (!$date_validation) {
                     continue;
                 }
             }
             $categories[$row['session_category_id']]['sessions'][$row['id']]['session_name'] = $row['name'];
             $categories[$row['session_category_id']]['sessions'][$row['id']]['session_id'] = $row['id'];
             $categories[$row['session_category_id']]['sessions'][$row['id']]['id_coach'] = $row['id_coach'];
             if (isset($row['id_coach']) && !empty($row['id_coach'])) {
                 $user_info = api_get_user_info($row['id_coach']);
                 $categories[$row['session_category_id']]['sessions'][$row['id']]['coach_info'] = $user_info;
             }
             $categories[$row['session_category_id']]['sessions'][$row['id']]['access_start_date'] = $row['access_start_date'];
             $categories[$row['session_category_id']]['sessions'][$row['id']]['access_end_date'] = $row['access_end_date'];
             $categories[$row['session_category_id']]['sessions'][$row['id']]['coach_access_start_date'] = $row['coach_access_start_date'];
             $categories[$row['session_category_id']]['sessions'][$row['id']]['coach_access_end_date'] = $row['coach_access_end_date'];
             $date_message = SessionManager::parse_session_dates($row);
             $categories[$row['session_category_id']]['sessions'][$row['id']]['date_message'] = $date_message;
             $courses = UserManager::get_courses_list_by_session($user_id, $row['id']);
             $course_list = array();
             foreach ($courses as $course) {
                 //Checking course session visibility
                 $visibility = api_get_session_visibility($session_id, $course['id']);
                 if ($visibility == SESSION_INVISIBLE) {
                     continue;
                 }
                 $user_status_in_course = CourseManager::get_user_in_course_status($user_id, $course['id']);
                 $course['user_status_in_course'] = $user_status_in_course;
                 $course_list[] = $course;
             }
             $categories[$row['session_category_id']]['sessions'][$row['id']]['courses'] = $course_list;
             $categories[$row['session_category_id']]['sessions'][$row['id']]['moved_to'] = isset($row['moved_to']) ? $row['moved_to'] : null;
             $categories[$row['session_category_id']]['sessions'][$row['id']]['moved_status'] = isset($row['moved_status']) ? $row['moved_status'] : null;
         }
     }
     return $categories;
 }
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:101,代码来源:usermanager.lib.php


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