/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/students/listStudents.html.php

  • Committer: Henrik G.
  • Date: 2013-03-26 23:22:55 UTC
  • Revision ID: henrik.gustavsson@his.se-20130326232255-ik6snyatlbkf3zs1
First seed of Lenasys ... Needs to be Organized Further

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<h2>List student by course</h2>
 
2
<form name="listStudentsCourseSelectForm" action="." method="post">
 
3
        <label>Course:</label><br />
 
4
        <select name="courseName">
 
5
        <?php
 
6
                //All courses in the database
 
7
                //$courseList
 
8
                foreach ($courseList as $course) {
 
9
                        echo "<option value='".$course['name']."'>".$course['name']."</option>";
 
10
                }
 
11
        ?>
 
12
        </select>
 
13
        <select name="semester">
 
14
                <option value="HT">HT</option>
 
15
                <option value="VT">VT</option>
 
16
        </select>
 
17
        <select name="year">
 
18
                <?php
 
19
                for($i=12;$i<25;$i++){
 
20
                        echo "<option value='".$i."'>".$i."</option>";
 
21
                }
 
22
                ?>
 
23
        </select>
 
24
        <select name="period">
 
25
                <option value="1">LP-1</option>
 
26
                <option value="2">LP-2</option>
 
27
                <option value="3">LP-3</option>
 
28
                <option value="4">LP-4</option>
 
29
                <option value="5">LP-5</option>
 
30
        </select>
 
31
        <br />
 
32
        <!--<label>Paste student list from Webladok:</label><br />-->
 
33
        <!--<textarea name="studentList" rows="30" cols="100"></textarea>-->
 
34
        <br />
 
35
        <input type='hidden' name='scrolly' id='scrolly' value='0' />
 
36
        <input type="hidden" name="listStudentsLink" />
 
37
        <input type="submit" name="listStudentsSubmit" value="Display list" />
 
38
</form>
 
39
 
 
40
<?php 
 
41
    //List all students for selected course
 
42
        $printNewPassword=false;
 
43
        if(isset($studentList)){
 
44
                echo "<table class='dataTable'>";
 
45
                echo "<caption>".$_POST['courseName']." ".$occasion."</caption>";
 
46
                if(count($studentList)>0){
 
47
                        foreach($studentList[0] as $columnName=>$data){
 
48
                                echo "<th>".$columnName."</th>";
 
49
                        }
 
50
                        foreach($studentList as $row){
 
51
                                echo "<tr>";
 
52
                                foreach($row as $data){
 
53
                                        echo "<td>".$data."</td>";
 
54
                                        if(isset($newPasswordForSSN) && $data==$newPasswordForSSN){
 
55
                                                $printNewPassword=true;
 
56
                                        }
 
57
                                }
 
58
                                if($printNewPassword){
 
59
                                        echo "<td>New password:<br/>".$newPassword."</td>";
 
60
                                        $printNewPassword=false;
 
61
                                } else {
 
62
                                        echo "<td>
 
63
                                                        <form name='newPasswForStudentForm' action='.' method='post'>
 
64
                                                                <input type='submit' name='generateNewPassWordForStudent' value='Generate new password' class='confirm'/>
 
65
                                                                <input type='hidden' name='studentSSN' value='".$row['ssn']."' />
 
66
                                                                <input type='hidden' name='studentLoginName' value='".$row['loginName']."' />
 
67
                                                                <input type='hidden' name='courseName' value='".$_POST['courseName']."' />
 
68
                                                                <input type='hidden' name='courseOccasion' value='".$occasion."' />
 
69
                                                                <input type='hidden' name='listStudentsSubmit' />
 
70
                                                                <input type='hidden' name='listStudentsLink' />
 
71
                                                                <input type='hidden' name='scrolly' id='scrolly' value='0' />
 
72
                                                        </form>
 
73
                                                </td>";
 
74
                                }
 
75
                                echo "<td>
 
76
                                                <form name='unregisterStudentForm' action='.' method='post'>
 
77
                                                        <input type='submit' name='unregisterStudentSubmit' value='Unregister' class='confirm' />
 
78
                                                        <input type='hidden' name='studentSSN' value='".$row['ssn']."' />
 
79
                                                        <input type='hidden' name='courseName' value='".$_POST['courseName']."' />
 
80
                                                        <input type='hidden' name='courseOccasion' value='".$occasion."' />
 
81
                                                        <input type='hidden' name='listStudentsLink' />
 
82
                                                        <input type='hidden' name='listStudentsSubmit' />
 
83
                                                        <input type='hidden' name='scrolly' id='scrolly' value='0' />
 
84
                                                </form>
 
85
                                        </td>";
 
86
                                echo "</tr>";
 
87
                        }
 
88
                } else {
 
89
                        echo "<tr><td>No students registered for the selected course occasion</td></tr>";
 
90
                }
 
91
                echo "</table>";
 
92
        }
 
93
?>
 
94
 
 
95
<a href=".">Back</a>
 
 
b'\\ No newline at end of file'