/lenasys/0.1

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/lenasys/0.1

« back to all changes in this revision

Viewing changes to trunk/DuggaSys/quizSystem/index.php

  • Committer: a11vikob
  • Date: 2013-03-28 15:33:33 UTC
  • mto: (4.2.2 hitlerhorabajs)
  • mto: This revision was merged to the branch mainline in revision 5.
  • Revision ID: a11vikob@student.his.se-20130328153333-2jf1mut7h63n28ra
Indentation etc fixed

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
header("X-UA-Compatible: IE=edge,chrome=1");
3
3
session_start();
4
4
 
5
 
function htmlsafe($str) {
 
5
function htmlsafe($str){
6
6
        return $str=htmlspecialchars($str,ENT_QUOTES,'UTF-8');
7
7
}
8
8
        
9
 
function generatePassword($length) {
 
9
function generatePassword($length){
10
10
        $arr = str_split('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890'); //Array of characters that may occur in the password
11
11
    shuffle($arr); //Shuffle array
12
12
    $arr = array_slice($arr, 0, $length); //Extract the first $length characters from the shuffled array
13
13
    return implode('', $arr); //Make string of the array and return the result
14
14
}
15
15
 
16
 
function addBackLink($postBacks) {
 
16
function addBackLink($postBacks){
17
17
        echo "<form name='backLink' action='.' method='post'>";
18
 
        foreach($postBacks as $name=>$value) {
 
18
        foreach($postBacks as $name=>$value){
19
19
                echo "<input type='hidden' name='".$name."' value='".$value."' />";
20
20
        }
21
21
    echo "<a href='#' onclick='document[\"backLink\"].submit();return false;'><-- Back</a>";
37
37
    session_destroy();
38
38
} else if (checklogin()) {
39
39
        
40
 
        include "../../php/dbconnect.php";
 
40
        include "dbconnect.php";
41
41
 
42
42
        //Default page
43
43
        $content="frontpage.html.php";
47
47
                include "data/index.php";
48
48
        } else if(isset($_POST['registerStudentsLink']) || isset($_POST['parseSubmit'])) {
49
49
                include "registerStudents/index.php";
50
 
        } else if(isset($_POST['listStudentsLink'])) {
 
50
        } else if(isset($_POST['listStudentsLink'])){
51
51
                include "students/index.php";
52
 
        } else if(isset($_POST['listQuizzesLink'])) {
 
52
        } else if(isset($_POST['listQuizzesLink'])){
53
53
                include "quiz/index.php";
54
 
        } else if(isset($_POST['checkQuizzesLink'])) {
 
54
        } else if(isset($_POST['checkQuizzesLink'])){
55
55
                include "quizChecking/index.php";
56
 
        }else if(isset($_POST['coursesLink'])) {
 
56
        }else if(isset($_POST['coursesLink'])){
57
57
                include "course/index.php";
58
58
        } else if (isset($_POST['searchString'])) {
59
59
        include "search/index.php";