Example #1
0
function showExcel($category_id, $courses_id_str, $exercises_id_str)
{
    initConfigTable();
    $course_ids = trim($courses_id_str) == '' ? array() : explode(",", trim($courses_id_str));
    $exercise_ids = trim($exercises_id_str) == '' ? array() : explode(",", trim($exercises_id_str));
    $student_infos = array();
    $course_score_summary = array();
    $course_score_minmax = array();
    $course_score_first = array();
    $knowledge_summary = array();
    $knowledge_score_summary = array();
    $student_knowledge_score_summary = array();
    $total_attempt_count_summary = array();
    $total_attempt_time_summary = array();
    $total_attempt_detail_summary = array();
    $total_attempt_time_start_summary = array();
    $total_attempt_time_end_summary = array();
    //读取课程
    $courses = getCourses($category_id);
    $nonConfigCourses = array();
    //输出Excel文件头
    header("Content-Type: application/vnd.ms-excel; charset=utf-8");
    header("Content-Type: application/force-download");
    header("Content-Type: application/octet-stream");
    header("Content-Type: application/download");
    header("Content-Disposition: attachment; filename=report_" . date("Ymd_His") . ".xls");
    header("Content-Transfer-Encoding: binary ");
    header("Expires: 0");
    header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
    header("Cache-Control: private", false);
    echo "MIME-Version: 1.0\r\n" . "X-Document-Type: Workbook\r\n" . "Content-Type: multipart/related; boundary=\"***MY_BOUNDARY_LINE***\"\r\n" . "\r\n" . "--***MY_BOUNDARY_LINE***\r\n" . "Content-Type: text/html; charset=\"utf-8\"\r\n" . "\r\n";
    echo '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel">' . '<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8">' . '<xml>' . '<o:DocumentProperties>' . '<o:Author>Adex Lin</o:Author>' . '<o:LastAuthor>Adex Lin</o:LastAuthor>' . '<o:Created>' . date("Y-m-d H:i:s") . '</o:Created>' . '<o:LastSaved>' . date("Y-m-d H:i:s") . '</o:LastSaved>' . '<o:Company>SinoMedex</o:Company>' . '<o:Version>1.0</o:Version>' . '</o:DocumentProperties>' . '</xml>' . '<xml>' . '<x:ExcelWorkbook>' . '<x:ExcelWorksheets>';
    $index = 1;
    foreach ($course_ids as $course_id) {
        $course_name = preg_replace('/[::\\/\\\\?\\*\\& ]/u', '', $courses[$course_id]);
        $course_name = preg_replace('/课件$/u', '', $course_name);
        echo '<x:ExcelWorksheet>' . '<x:Name>' . $course_name . '</x:Name>' . '<x:WorksheetSource HRef="cid:' . $index++ . '"/>' . '</x:ExcelWorksheet>';
    }
    foreach ($exercise_ids as $course_id) {
        $course_name = preg_replace('/[::\\/\\\\?\\*\\& ]/u', '', $courses[$course_id]);
        $course_name = preg_replace('/练习$/u', '', $course_name);
        $course_name = preg_replace('/课件/u', '练习', $course_name);
        echo '<x:ExcelWorksheet>' . '<x:Name>' . $course_name . '</x:Name>' . '<x:WorksheetSource HRef="cid:' . $index++ . '"/>' . '</x:ExcelWorksheet>';
    }
    echo '<x:ExcelWorksheet>' . '<x:Name>课件学习概况</x:Name>' . '<x:WorksheetSource HRef="cid:' . $index++ . '"/>' . '</x:ExcelWorksheet>' . '<x:ExcelWorksheet>' . '<x:Name>课件学习详情</x:Name>' . '<x:WorksheetSource HRef="cid:' . $index++ . '"/>' . '</x:ExcelWorksheet>' . '<x:ExcelWorksheet>' . '<x:Name>练习得分汇总</x:Name>' . '<x:WorksheetSource HRef="cid:' . $index++ . '"/>' . '</x:ExcelWorksheet>' . '<x:ExcelWorksheet>' . '<x:Name>练习最高|最低得分汇总</x:Name>' . '<x:WorksheetSource HRef="cid:' . $index++ . '"/>' . '</x:ExcelWorksheet>' . '<x:ExcelWorksheet>' . '<x:Name>练习首次得分汇总</x:Name>' . '<x:WorksheetSource HRef="cid:' . $index++ . '"/>' . '</x:ExcelWorksheet>' . '<x:ExcelWorksheet>' . '<x:Name>知识点最高得分汇总</x:Name>' . '<x:WorksheetSource HRef="cid:' . $index++ . '"/>' . '</x:ExcelWorksheet>' . '<x:ExcelWorksheet>' . '<x:Name>知识点首次得分汇总</x:Name>' . '<x:WorksheetSource HRef="cid:' . $index++ . '"/>' . '</x:ExcelWorksheet>';
    echo '</x:ExcelWorksheets>' . '</x:ExcelWorkbook>' . '</xml>' . '</head>' . '</html>';
    $index = 1;
    //读取课件浏览
    foreach ($course_ids as $course_id) {
        //读取课件
        $scores = getTracks($category_id, $course_id);
        list($student_infos1, $attempt_counts1, $attempt_start_times, $attempt_end_times, $attempt_total_times, $attempt_status, $attempt_score) = $scores;
        $student_infos += $student_infos1;
        //输出单个sheet
        echo "\r\n" . "--***MY_BOUNDARY_LINE***\r\n" . "Content-ID: " . $index++ . "\r\n" . "Content-Type: text/html; charset=\"utf-8\"\r\n" . "\r\n";
        echo '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel">' . '<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8">' . '<xml>' . '<x:WorksheetOptions>' . '<x:ProtectContents>False</x:ProtectContents>' . '<x:ProtectObjects>False</x:ProtectObjects>' . '<x:ProtectScenarios>False</x:ProtectScenarios>' . '</x:WorksheetOptions>' . '</xml>' . '</head>' . '<body>';
        drawTrackTable($course_id, $student_infos1, $attempt_counts1, $attempt_start_times, $attempt_end_times, $attempt_total_times, $attempt_status, $attempt_score, "normal");
        //汇总每个学生的课件浏览记录
        list($attempt_count_summary, $attempt_time_summary, $attempt_detail_summary, $attempt_time_start_summary, $attempt_time_end_summary) = drawTrackTable($course_id, $student_infos1, $attempt_counts1, $attempt_start_times, $attempt_end_times, $attempt_total_times, $attempt_status, $attempt_score, "summary");
        $total_attempt_count_summary += $attempt_count_summary;
        $total_attempt_time_summary += $attempt_time_summary;
        $total_attempt_detail_summary += $attempt_detail_summary;
        $total_attempt_time_start_summary += $attempt_time_start_summary;
        $total_attempt_time_end_summary += $attempt_time_end_summary;
        //输出Sheet尾
        echo '</body>' . '</html>';
    }
    //读取成绩
    foreach ($exercise_ids as $course_id) {
        //输出单个sheet
        echo "\r\n" . "--***MY_BOUNDARY_LINE***\r\n" . "Content-ID: " . $index++ . "\r\n" . "Content-Type: text/html; charset=\"utf-8\"\r\n" . "\r\n";
        echo '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel">' . '<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8">' . '<xml>' . '<x:WorksheetOptions>' . '<x:ProtectContents>False</x:ProtectContents>' . '<x:ProtectObjects>False</x:ProtectObjects>' . '<x:ProtectScenarios>False</x:ProtectScenarios>' . '</x:WorksheetOptions>' . '</xml>' . '</head>' . '<body>';
        //读取题目的分数和领域
        $quiz_configs = getConfig($category_id, $course_id, false);
        if ($quiz_configs == null) {
            array_push($nonConfigCourses, $course_id);
            //输出Sheet尾
            echo '</body>' . '</html>';
            continue;
        }
        list($elements, $element_scores, $element_knowledeges, $knowledges, $knowledge_scores) = $quiz_configs;
        $knowledge_summary += $knowledges;
        $knowledge_score_summary += $knowledge_scores;
        //读取考试成绩
        list($student_infos2, $attempt_counts, $attempt_start_times, $attempt_end_times, $attempt_total_times, $student_element_scores, $student_knowledge_scores) = getScores($category_id, $course_id, $quiz_configs);
        $student_infos += $student_infos2;
        //输出单个课件习题成绩
        echo '<table><tr><td colspan="3"><b>表:习题最高分</b></td></tr></table>';
        drawEScoreTable($course_id, $student_infos2, $attempt_counts, $attempt_start_times, $attempt_end_times, $attempt_total_times, $elements, $element_scores, $student_element_scores, "high");
        //输出单个课件的知识点成绩
        echo '<table><tr><td> </td></tr></table>';
        echo '<table><tr><td colspan="3"><b>表:知识点最高分</b></td></tr></table>';
        drawKScoreTable($course_id, $student_infos2, $attempt_counts, $knowledges, $knowledge_scores, $student_knowledge_scores, "high");
        //合并知识点成绩
        $exist_score = $knowledge_score_summary;
        $new_score = array();
        foreach (array_keys($exist_score + $knowledge_scores) as $key) {
            $new_score[$key] = (isset($exist_score[$key]) ? $exist_score[$key] : 0) + (isset($knowledge_scores[$key]) ? $knowledge_scores[$key] : 0);
        }
        $knowledge_score_summary = $new_score;
        //汇总学生各个知识点的成绩
        $exist_summary = $student_knowledge_score_summary;
        $new_summary = array();
        foreach (array_keys($exist_summary + $student_knowledge_scores) as $key) {
            $new_summary[$key] = (isset($exist_summary[$key]) ? $exist_summary[$key] : 0) + (isset($student_knowledge_scores[$key]) ? $student_knowledge_scores[$key] : 0);
        }
        $student_knowledge_score_summary = $new_summary;
        //得到汇总成绩表
        list($student_count, $element_correct_count, $max_attempt_count, $student_score_line, $student_course_summary, $student_course_minmax, $student_course_first) = drawEScoreTable($course_id, $student_infos2, $attempt_counts, $attempt_start_times, $attempt_end_times, $attempt_total_times, $elements, $element_scores, $student_element_scores, "summary");
        $course_score_summary += $student_course_summary;
        $course_score_minmax += $student_course_minmax;
        $course_score_first += $student_course_first;
        //输出Sheet尾
        echo '</body>' . '</html>';
    }
    asort($course_ids);
    asort($exercise_ids);
    asort($student_infos);
    asort($course_score_summary);
    asort($course_score_minmax);
    asort($course_score_first);
    asort($total_attempt_count_summary);
    asort($total_attempt_count_summary);
    asort($total_attempt_count_summary);
    array_unique($student_infos);
    array_unique($course_score_summary);
    array_unique($course_score_minmax);
    array_unique($course_score_first);
    array_unique($total_attempt_count_summary);
    array_unique($total_attempt_count_summary);
    array_unique($total_attempt_count_summary);
    //绘制课件学习概况Sheet
    echo "\r\n" . "--***MY_BOUNDARY_LINE***\r\n" . "Content-ID: " . $index++ . "\r\n" . "Content-Type: text/html; charset=\"utf-8\"\r\n" . "\r\n";
    echo '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel">' . '<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8">' . '<xml>' . '<x:WorksheetOptions>' . '<x:ProtectContents>False</x:ProtectContents>' . '<x:ProtectObjects>False</x:ProtectObjects>' . '<x:ProtectScenarios>False</x:ProtectScenarios>' . '</x:WorksheetOptions>' . '</xml>' . '</head>' . '<body>';
    echo '<table><tr><td colspan="3"><b>表:课件学习概况</b></td></tr></table>';
    drawTSummaryTable($student_infos, $courses, $course_ids, $total_attempt_count_summary, $total_attempt_time_summary, $total_attempt_detail_summary, $total_attempt_time_start_summary, $total_attempt_time_end_summary, "course");
    //输出Sheet尾
    echo '</body>' . '</html>';
    //绘制课件学习详情Sheet
    echo "\r\n" . "--***MY_BOUNDARY_LINE***\r\n" . "Content-ID: " . $index++ . "\r\n" . "Content-Type: text/html; charset=\"utf-8\"\r\n" . "\r\n";
    echo '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel">' . '<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8">' . '<xml>' . '<x:WorksheetOptions>' . '<x:ProtectContents>False</x:ProtectContents>' . '<x:ProtectObjects>False</x:ProtectObjects>' . '<x:ProtectScenarios>False</x:ProtectScenarios>' . '</x:WorksheetOptions>' . '</xml>' . '</head>' . '<body>';
    echo '<table><tr><td colspan="3"><b>表:课件学习详情</b></td></tr></table>';
    drawTSummaryTable($student_infos, $courses, $course_ids, $total_attempt_count_summary, $total_attempt_time_summary, $total_attempt_detail_summary, $total_attempt_time_start_summary, $total_attempt_time_end_summary, "detail");
    //输出Sheet尾
    echo '</body>' . '</html>';
    //绘制汇总成绩Sheet
    echo "\r\n" . "--***MY_BOUNDARY_LINE***\r\n" . "Content-ID: " . $index++ . "\r\n" . "Content-Type: text/html; charset=\"utf-8\"\r\n" . "\r\n";
    echo '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel">' . '<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8">' . '<xml>' . '<x:WorksheetOptions>' . '<x:ProtectContents>False</x:ProtectContents>' . '<x:ProtectObjects>False</x:ProtectObjects>' . '<x:ProtectScenarios>False</x:ProtectScenarios>' . '</x:WorksheetOptions>' . '</xml>' . '</head>' . '<body>';
    echo '<table><tr><td colspan="3"><b>表:练习得分汇总</b></td></tr></table>';
    drawESummaryTable($student_infos, $courses, $nonConfigCourses, $exercise_ids, $course_score_summary);
    //输出Sheet尾
    echo '</body>' . '</html>';
    //绘制最高最低
    echo "\r\n" . "--***MY_BOUNDARY_LINE***\r\n" . "Content-ID: " . $index++ . "\r\n" . "Content-Type: text/html; charset=\"utf-8\"\r\n" . "\r\n";
    echo '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel">' . '<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8">' . '<xml>' . '<x:WorksheetOptions>' . '<x:ProtectContents>False</x:ProtectContents>' . '<x:ProtectObjects>False</x:ProtectObjects>' . '<x:ProtectScenarios>False</x:ProtectScenarios>' . '</x:WorksheetOptions>' . '</xml>' . '</head>' . '<body>';
    echo '<table><tr><td colspan="3"><b>表:练习最高|最低得分汇总</b></td></tr></table>';
    drawEMinMaxTable($student_infos, $courses, $nonConfigCourses, $exercise_ids, $course_score_minmax);
    //输出Sheet尾
    echo '</body>' . '</html>';
    //绘制首次得分
    echo "\r\n" . "--***MY_BOUNDARY_LINE***\r\n" . "Content-ID: " . $index++ . "\r\n" . "Content-Type: text/html; charset=\"utf-8\"\r\n" . "\r\n";
    echo '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel">' . '<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8">' . '<xml>' . '<x:WorksheetOptions>' . '<x:ProtectContents>False</x:ProtectContents>' . '<x:ProtectObjects>False</x:ProtectObjects>' . '<x:ProtectScenarios>False</x:ProtectScenarios>' . '</x:WorksheetOptions>' . '</xml>' . '</head>' . '<body>';
    echo '<table><tr><td colspan="3"><b>表:练习首次得分汇总</b></td></tr></table>';
    drawEFirstTable($student_infos, $courses, $nonConfigCourses, $exercise_ids, $course_score_first);
    //输出Sheet尾
    echo '</body>' . '</html>';
    //绘制知识点得分汇总
    echo "\r\n" . "--***MY_BOUNDARY_LINE***\r\n" . "Content-ID: " . $index++ . "\r\n" . "Content-Type: text/html; charset=\"utf-8\"\r\n" . "\r\n";
    echo '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel">' . '<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8">' . '<xml>' . '<x:WorksheetOptions>' . '<x:ProtectContents>False</x:ProtectContents>' . '<x:ProtectObjects>False</x:ProtectObjects>' . '<x:ProtectScenarios>False</x:ProtectScenarios>' . '</x:WorksheetOptions>' . '</xml>' . '</head>' . '<body>';
    echo '<table><tr><td colspan="3"><b>表:知识点最高分汇总</b></td></tr></table>';
    drawKScoreTable($course_id, $student_infos, $attempt_counts, $knowledge_summary, $knowledge_score_summary, $student_knowledge_score_summary, "high");
    //绘制知识点得分汇总
    echo "\r\n" . "--***MY_BOUNDARY_LINE***\r\n" . "Content-ID: " . $index++ . "\r\n" . "Content-Type: text/html; charset=\"utf-8\"\r\n" . "\r\n";
    echo '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel">' . '<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8">' . '<xml>' . '<x:WorksheetOptions>' . '<x:ProtectContents>False</x:ProtectContents>' . '<x:ProtectObjects>False</x:ProtectObjects>' . '<x:ProtectScenarios>False</x:ProtectScenarios>' . '</x:WorksheetOptions>' . '</xml>' . '</head>' . '<body>';
    echo '<table><tr><td colspan="3"><b>表:知识点首次分得分汇总</b></td></tr></table>';
    drawKScoreTable($course_id, $student_infos, $attempt_counts, $knowledge_summary, $knowledge_score_summary, $student_knowledge_score_summary, "first");
    //输出Sheet尾
    echo '</body>' . '</html>';
    //输出Excel文件尾
    echo "\r\n" . "--***MY_BOUNDARY_LINE***--\r\n";
}
Example #2
0
<?php

/**
 * Created by IntelliJ IDEA.
 * User: Tom
 * Date: 26.11.2015
 * Time: 18:04
 */
$_db_host = "localhost";
$_db_username = "******";
$_db_passwort = "";
$_db_datenbank = "eportfolio";
include 'functions.php';
if (isset($_GET['id_b'])) {
    $_student = getStudent($_GET['id_b'], $_db_host, $_db_username, $_db_passwort, $_db_datenbank);
    $_courses = getCourses($_GET['id_b'], $_db_host, $_db_username, $_db_passwort, $_db_datenbank);
    $_daten = mysqli_fetch_array($_student, MYSQLI_ASSOC);
}
?>

<html>
<head>
    <title>Student <?php 
echo $_daten['MatNr'];
?>
</title>
</head>
<body>
<div id="info">
    <h1>Data of Student <?php 
echo $_daten['MatNr'];
Example #3
0
function lifeCycleManagementUI($msg, $dbConn)
{
    $classes = getCourses($dbConn);
    if (!empty($classes)) {
        ?>
  <fieldset style="width:600px;border-radius:6px;"><div id="msg"><?php 
        echo $msg;
        ?>
</div>
  <h4 id="detailed_ui_title_clean_annotations" class="detailed_ui_title">Course Life Cycle Management (eg. from term to term)</h4>
  
  <div style="margin:0px;padding:0px;border:0px" class="detailed_ui" id="detailed_ui_clean_annotations">
  <form name="clean_annotations_form" method="post" action="<?php 
        echo $_SERVER['PHP_SELF'];
        ?>
">
  <label for="session">Session</label>
  <select name="session">
  	<option value="2012">2012</option>
    <option value="2013" selected>2013</option>
  </select>
  <label for="season">Season</label>
  <select name="season">
  	<option value="W" selected>W</option>
    <option value="S">S</option>
  </select>
  <label for="class">Course</label>
  <select name="class">
<?php 
        foreach ($classes as $ID => $name) {
            ?>
    <option value="<?php 
            echo $ID;
            ?>
"><?php 
            echo $name;
            ?>
</option>
<?php 
        }
        ?>
  </select>
  <br/>
  <br/>
  <input 
  title="Use this if you want to reuse the videos in a course, only wiping out old annotations and then update the class list"
  type="submit" name="cleanAnnotations" id="clean_annotations_form" value="Clean Annotations" onClick="confirmation()" style="font-size:16px"/>
  <br/>
  <br/>
  <input 
  title="This will archive an old course, so that there won't be conflicts when you create a new course of the same name."
  type="submit" name="archiveOldCourse" id="clean_annotations_form" value="Archive Old Course" onClick="confirmation()" style="font-size:16px"/>
  </form>
  </div>
  </fieldset>
  <br/>
<?php 
    }
}
Example #4
0
<?php

switch ($_POST['API']) {
    case 1:
        getCompanies();
        break;
    case 2:
        getDepartments($_POST['company']);
        break;
    case 3:
        getCourses($_POST['company'], $_POST['department']);
        break;
    case 4:
        getXMLs($_POST['company'], $_POST['department'], $_POST['course']);
        break;
    case 5:
        downloadXML($_POST['company'], $_POST['department'], $_POST['course'], $_POST['xmlname']);
        break;
    default:
        break;
}
function getCompanies()
{
    $dir = @opendir("CaptivateResults");
    if ($dir != "") {
        while (($file = readdir($dir)) !== false) {
            if (!is_file($file)) {
                echo $file . ";";
            }
        }
        closedir($dir);
<?php

include '../../../php/functions.php';
console_log("Starting to get courses.");
if (isset($_POST['option'])) {
    $subject = $_REQUEST['option'];
    $courseList = getCourses($subject);
    console_log("courses: " . $courseList);
    echo $courseList;
} else {
    console_log("option did not get posted");
}
Example #6
0
        <div id="main-content">
            <div class="centered">
                <?php 
require_once CLASSES_PATH . "AdminDataManager.php";
?>
                <h4>Courses Info</h4>
                <a href="#courses-info" class="show-more-content">Show Content</a>
                <div class="more-content">
                    <table class="table table-bordered table-condensed">
                        <tr>
                            <th>Course Subject</th>
                            <th>Course Number</th>
                            <th>Course Title</th>
                        </tr>
                    <?php 
$courses_info = getCourses();
foreach ($courses_info as $course) {
    ?>
                        <tr>
                            <td><?php 
    echo $course["subject_name"];
    ?>
</td>
                            <td><?php 
    echo $course["course_number"];
    ?>
</td>
                            <td><?php 
    echo $course["course_title"];
    ?>
</td>
Example #7
0
<?php

include_once "analyticstracking.php";
include "../backend/sql-homepage.php";
$subjectsList = getSubjects();
$projects = getProjects();
$courseList = getCourses();
$subjectIcons = array();
foreach ($subjectsList as &$subject) {
    $subjectIcons[$subject['subject_name']] = $subject['subject_icon'];
}
?>
<html lang="en-US">
<head>
    <meta name="keywords" content="HTML, CSS, SQL, PHP, JavaScript">
    <meta name="description" content="My personal homepage">
    <meta charset="UTF-8">
    <meta name="author" content="Roar Hoksnes Eriksen">
    <link rel="stylesheet" href="styles/external-libraries/bootstrap.min.css">
    <link rel="stylesheet" href="styles/external-libraries/font-awesome.min.css">
    <link rel="stylesheet" href="styles/external-libraries/bootstrap-theme.min.css">
    <link rel="stylesheet" href="styles/external-libraries/bootstrap.css.map">
    <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300' rel='stylesheet' type='text/css'>
    <title>Roar Hoksnes Eriksen</title>
    <link rel="stylesheet" href="styles/style.css">
</head>

<body>

<aside id="contact">
    <button class="btn" onclick="openLinkedIn()"><span class="fontawesome" id="linked-in">&#xf0e1;</span></button>
Example #8
0
         $departmentId = $_POST[$key];
         $sec = getSecretaries($departmentId);
         echo generateOptionsWithSpecifiedValueField($sec, 'secretaryId', 'secretaryUsername');
     }
     break;
 case 'departmentIdAndReturnStudentId':
     if (!empty($_POST[$key])) {
         $departmentId = $_POST[$key];
         $stu = getStudents($departmentId);
         echo generateOptionsWithSpecifiedValueField($stu, 'studentId', 'studentUsername');
     }
     break;
 case 'departmentIdAndReturnCourseId':
     if (!empty($_POST[$key])) {
         $departmentId = $_POST[$key];
         $cou = getCourses($departmentId);
         echo generateOptionsWithSpecifiedValueField($cou, 'courseId', 'courseName');
     }
     break;
 case 'departmentIdAndReturnClassId':
     if (!empty($_POST[$key])) {
         $departmentId = $_POST[$key];
         $cla = getClasses($departmentId);
         echo generateOptionsWithSpecifiedValueField($cla, 'classId', 'className');
     }
     break;
 case 'courseIdAndReturnGradeId':
     if (!empty($_POST[$key])) {
         $departmentId = $_POST[$key];
         $gra = getClasses($departmentId);
         echo generateOptionsWithSpecifiedValueField($gra, 'gradeId', 'gradeVal');
Example #9
0
         $post_data = json_encode(array('error' => $post_data), JSON_FORCE_OBJECT);
         echo $post_data;
     }
     break;
 case 'update_attendance':
     if (isset($_GET['session_id']) && $_GET['session_id'] != "" && isset($_GET['taken_by']) && $_GET['taken_by'] != "" && isset($_GET['time']) && $_GET['time'] != "" && isset($_GET['data']) && $_GET['data'] != "") {
         updateAttendance($conn, $_GET['session_id'], $_GET['taken_by'], $_GET['time'], $_GET['data']);
     } else {
         $post_data = array('message' => 'missing parameters', 'comment' => 'require param [session_id,taken_by,time,data]');
         $post_data = json_encode(array('error' => $post_data), JSON_FORCE_OBJECT);
         echo $post_data;
     }
     break;
 case 'get_courses':
     if (isset($_GET['token']) && $_GET['token'] != "" && isset($_GET['user_id']) && $_GET['user_id'] != "") {
         getCourses($conn, $_GET['token'], $_GET['user_id']);
     } else {
         $post_data = array('message' => 'missing parameters', 'comment' => 'require param [token,user_id]');
         $post_data = json_encode(array('error' => $post_data), JSON_FORCE_OBJECT);
         echo $post_data;
     }
     break;
 case 'get_sessions':
     if (isset($_GET['course_id']) && $_GET['course_id'] != "" && isset($_GET['attendance_type_id']) && $_GET['attendance_type_id'] != "") {
         getSessions($conn, $_GET['course_id'], $_GET['attendance_type_id']);
     } else {
         $post_data = array('message' => 'missing parameters', 'comment' => 'require param [course_id,attendance_type_id]');
         $post_data = json_encode(array('error' => $post_data), JSON_FORCE_OBJECT);
         echo $post_data;
     }
     break;
Example #10
0
    var $courseCore;
    public function __construct($courseDesc, $courseCredits, $courseBarToEntry, $courseCore)
    {
        $this->courseDesc = $courseDesc;
        $this->courseCredits = $courseCredits;
        $this->courseBarToEntry = $courseBarToEntry;
        $this->courseCore = $courseCore;
    }
}
class APcourse extends Course
{
    var $score;
}
//The part where shit happens
//================================================
$courses = getCourses($major);
mySort($courses);
$courses2 = array(array());
//for each element in courses, it makes a new array in courses2, and fills it with one element from courses
//makes a 2D array
for ($x = 0; $x < count($courses); $x++) {
    array_push($courses2, array());
    array_push($courses2[$x], $courses[$x]);
}
$courses2 = combineSimilar($courses2);
$apCourses = getAPcredits($major);
for ($q = 0; $q < count($apScores); $q += 2) {
    foreach ($apCourses as $r) {
        if ($apScores[$q] == $r->courseDesc) {
            $r->score = $apScores[$q + 1];
        }
Example #11
0
                <input type="submit" name="submit" value="transfer">
            </form>
            <?php 
}
?>
    </div>

    <div class="course" id="remove">
        <h4>Remove Course</h4>
        <form action="manageCoursesSubmit.php" method="post">
            <?php 
if (isLoginAsAdmin()) {
    echo generateDropDownListWithFirstOption(getAllUniversitiesNames(), "Select University", 'selectedUniversity', 'selectedUniversityRemove');
    echo generateDropDownListWithFirstOption(null, "Select University First", 'selectedDepartmentId', 'selectedDepartmentRemove');
    echo generateDropDownListWithFirstOption(null, "Select Department First", 'selectedCourseId', 'selectedCourseRemove');
} else {
    if (isLoginAsSecretary()) {
        $departmentId = $_SESSION["departmentId"];
        echo "<input type='hidden' name='selectedDepartmentId' value='{$departmentId}'>";
        echo generateDropDownListWithSpecifiedValueKey(getCourses($departmentId), 'selectedCourseId', 'selectedCourseRemove', 'courseId', 'courseName');
    }
}
?>
            <input type="submit" name="submit" class="warningButton" value="remove">
        </form>
    </div>

</div>

<?php 
include 'footer.php';
Example #12
0
/**
 * Affiche les parcours en fonction du filtrage de la difficulté, de la pongueur et du quartier
 * @param string $difficulte    La difficulté du parcour (Facile, Moyen, DIfficile)
 * @param double $longueur      La longueur maximum que doit avoir le parcour
 * @param int $idQuartier       Le quartier a afficher
 */
function showCourses($difficulte, $longueur, $idQuartier)
{
    // récumère les informations sur les parcours
    $courses = getCourses($difficulte, $longueur, $idQuartier);
    // Affiche un message si sucun parcour ne correspond aux critaires
    if (empty($courses)) {
        echo 'Aucun parcours ne correspond a vos critaires';
    }
    // Affichage web
    foreach ($courses as $value) {
        echo '<table class="table">';
        echo '<tr>';
        if (isset($_SESSION["user"])) {
            if (!alreadyFav($_SESSION["user"]["idUtilisateur"], $value["idParcours"])) {
                echo ' <td><a onclick="initMapParcours(' . $value["idParcours"] . ')"><span class="glyphicon glyphicon-star" id="yellow"></span></a></td>';
            } else {
                echo ' <td><span class="glyphicon glyphicon-star-empty" id="black"></span></td>';
            }
        }
        echo '<td><a onclick="initMapParcours(' . $value["idParcours"] . ')">' . $value["NomParcours"] . '</a>' . '</td>';
        echo '<td>' . number_format($value["LongueurParcours"], 1, ',', ' ') . ' </td>';
        echo '<td>' . $value["DifficulteParcours"] . '</td>';
        echo '<td>' . $value["NomQuartier"] . '</td>';
        echo '</tr>';
        echo '</table>';
    }
}