$_SESSION['courses'] = $courses; $_user['persoLastLogin'] = last_login($uid); $_user['lastLogin'] = str_replace('-', ' ', $_user['persoLastLogin']); $user_assignments = $user_announcements = $user_documents = $user_agenda = $user_forumPosts = ''; // Get user's course info $user_lesson_info = getUserLessonInfo($uid); //if user is registered to at least one lesson if (count($lesson_ids) > 0) { // get user assignments $user_assignments = getUserAssignments($lesson_ids); // get user announcements $user_announcements = getUserAnnouncements($lesson_ids); // get user documents $user_documents = getUserDocuments($lesson_ids); // get user agenda $user_agenda = getUserAgenda($lesson_ids); // get user forum posts $user_forumPosts = getUserForumPosts($lesson_ids); } // get user latest personal messages $user_messages = getUserMessages(); // create array with content //BEGIN - Get user personal calendar $today = getdate(); $day = $today['mday']; $month = $today['mon']; $year = $today['year']; Calendar_Events::get_calendar_settings(); $user_personal_calendar = Calendar_Events::small_month_calendar($day, $month, $year); //END - Get personal calendar // == BEGIN create array with personalised content
<?php include_once "header.php"; include_once "sidebar.php"; $userid = $_GET['uid']; $agenda = getUserAgenda($userid); ?> <div class="content-wrapper" style="background-color:#ecf0f5;"> <ul class="nav nav-tabs"> <li class="active"><a href="#home">Week</a></li> <li><a href="#menu1">Month</a></li> </ul> <div class="tab-content"> <div id="home" class="tab-pane fade in active"> <!-- Content Header (Page header) --> <section class="content-header"> <h1> Naughty girl </h1> <ol class="breadcrumb"> <li><a href="dashboard.php"><i class="fa fa-dashboard"></i>Home</a></li> <li class="active">Here</li> </ol> </section> <style type="text/css">
function sqlGetWeekSchedule($uid, $daystring) { //$daystring = $y."-".$m."-".$d; $date = date_create($daystring); //get first day of the week $str = "-" . (date('N', strtotime($daystring)) - 1) . " day"; $week_start = strtotime($str, strtotime($daystring)); $week_start = date('Y-m-j', $week_start); //get last day of the week $str = "+" . (7 - date('N', strtotime($daystring))) . " day"; $week_end = strtotime($str, strtotime($daystring)); $week_end = date('Y-m-j', $week_end); $sql = "SELECT timeslot,date FROM lam_day_calendar WHERE date <= '{$week_end}' AND date >= '{$week_start}' AND userid='{$uid}';"; $sch = db_fetch($sql); $general_schedule = getUserAgenda($uid); //print_r($general_schedule); $rel = ["Monday" => "", "Tuesday" => "", "Wednesday" => "", "Thursday" => "", "Friday" => "", "Saturday" => "", "Sunday" => ""]; foreach ($general_schedule as $item) { $rel[$item["day"]] = $item["timeslot"]; } foreach ($sch as $item) { $j = date('l', strtotime($item["date"])); $rel[$j] = $item["timeslot"]; } return $rel; }