Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
286 commits
Select commit Hold shift + click to select a range
a718abe
Modifying Student/Home Template
BrendanKennedy Mar 7, 2016
37f3da8
Modifying Student/Home Template
BrendanKennedy Mar 7, 2016
e3055d7
Modifying Teacher/Home Template
BrendanKennedy Mar 7, 2016
df38c11
Modifying Teacher/Home Template
BrendanKennedy Mar 7, 2016
8414011
Edits to sidebar display for student and teacher
BrendanKennedy Mar 7, 2016
f344a06
Edits to sidebar display for student and teacher
BrendanKennedy Mar 7, 2016
69a8722
Retrieving admin type (normal/super) from admin/home
BrendanKennedy Mar 7, 2016
7af32fe
Retrieving admin type (normal/super) from admin/home
BrendanKennedy Mar 7, 2016
5253178
Conditioning display of admin/home for super user (James Hunter )
BrendanKennedy Mar 7, 2016
1a2b72c
Adding functionality for elevated Admin user status, and ManageAdmin …
BrendanKennedy Mar 7, 2016
0c9c318
Adding functionality for elevated Admin user status, and ManageAdmin …
BrendanKennedy Mar 7, 2016
2169904
Teacher/MyCourses/ Page Template; Teacher/MyCourses Data Pull (full)
BrendanKennedy Mar 8, 2016
3078092
Teacher/MyCourses/ Page Template; Teacher/MyCourses Data Pull (full) …
BrendanKennedy Mar 8, 2016
422d0e6
Teacher/MyCourses/ Page Template; Teacher/MyCourses Data Pull (full) …
BrendanKennedy Mar 8, 2016
acb3bef
Teacher/MyCourses/ Page Template; Teacher/MyCourses Data Pull (full) …
BrendanKennedy Mar 8, 2016
1af3f6a
Teacher/MyCourses/ Page Template; Teacher/MyCourses Data Pull (full) …
BrendanKennedy Mar 8, 2016
282cefc
Teacher/MyCourses/ Page Template; Teacher/MyCourses Data Pull (full) …
BrendanKennedy Mar 8, 2016
30228f8
Teacher/MyCourses/ Page Template; Teacher/MyCourses Data Pull (full) …
BrendanKennedy Mar 8, 2016
4148d28
Teacher/MyCourses/ Page Template; Teacher/MyCourses Data Pull (full) …
BrendanKennedy Mar 8, 2016
65d0482
Teacher/MyCourses/ Page Template; Teacher/MyCourses Data Pull (full) …
BrendanKennedy Mar 8, 2016
ceec327
Teacher/MyCourses/ Page Template; Teacher/MyCourses Data Pull (full) …
BrendanKennedy Mar 8, 2016
b7cf975
Admin superuser: sidebar changes, and small admin/home changes
BrendanKennedy Mar 8, 2016
7e30146
Teacher Archive UI switch and structure dev
BrendanKennedy Mar 8, 2016
4738791
Teacher Archive: view student, view worksheet
BrendanKennedy Mar 8, 2016
c9cfc4a
Teacher Archive Structure changes and nav links
BrendanKennedy Mar 8, 2016
b083d38
Debuggin Teacher Archive Changes to structure and ViewStudent
BrendanKennedy Mar 8, 2016
716b758
Fixing Auth. for Teacher/Archive/Course pages
BrendanKennedy Mar 8, 2016
66ba989
Fixing Proportions and links for teacher/archive pages
BrendanKennedy Mar 8, 2016
7d2eb34
Coloring and button positioning
BrendanKennedy Mar 8, 2016
32267fc
Revising Columns, setting up a couple pages I missed with the FlatUI,…
BrendanKennedy Mar 9, 2016
ba2a57b
Fixes to admin edits (sizing, arrangement, table formatting
BrendanKennedy Mar 9, 2016
80363c4
Admin/Archive UI revisions
BrendanKennedy Mar 9, 2016
46084f7
Small change to AnnotationEditor; Changes to DB pull in Sidebar to ac…
BrendanKennedy Mar 10, 2016
c417276
Debug ChangeRole from sidebar
BrendanKennedy Mar 10, 2016
e77af9d
Adding page: manage institutions (will be restricted to superadmin user)
BrendanKennedy Mar 10, 2016
3f0f75c
UI for adding an institution
BrendanKennedy Mar 10, 2016
051d331
UI for adding an institution -- DEBUG
BrendanKennedy Mar 10, 2016
a1cf054
UI for adding an institution -- DEBUG
BrendanKennedy Mar 10, 2016
426599e
UI for adding an institution -- DEBUG
BrendanKennedy Mar 10, 2016
1016287
UI for adding an institution -- DEBUG
BrendanKennedy Mar 10, 2016
ab3e3f6
UI for adding an institution -- DEBUG
BrendanKennedy Mar 10, 2016
41562b1
UI for adding an institution -- DEBUG
BrendanKennedy Mar 10, 2016
982d607
UI for adding an institution -- DEBUG
BrendanKennedy Mar 10, 2016
c1ad356
UI for adding an institution -- DEBUG
BrendanKennedy Mar 10, 2016
7e2cbe0
UI for adding an institution -- DEBUG
BrendanKennedy Mar 10, 2016
9f32fa5
UI for adding an institution -- DEBUG
BrendanKennedy Mar 10, 2016
c56f0ed
UI for adding an institution -- DEBUG
BrendanKennedy Mar 10, 2016
33ab7d1
UI for adding an institution -- DEBUG
BrendanKennedy Mar 10, 2016
9d724ab
UI for adding an institution -- DEBUG
BrendanKennedy Mar 10, 2016
b7307ff
UI for adding an institution -- DEBUG
BrendanKennedy Mar 10, 2016
d435223
UI for adding an institution -- DEBUG
BrendanKennedy Mar 10, 2016
6aefa53
UI for adding an institution -- DEBUG
BrendanKennedy Mar 10, 2016
982f4bf
UI for adding an institution -- DEBUG
BrendanKennedy Mar 10, 2016
12b2a6e
ViewInstitution page for primary admins and superuser admin
BrendanKennedy Mar 10, 2016
682dbe2
ViewInstitution page for primary admins and superuser admin -- DEBUG
BrendanKennedy Mar 10, 2016
0d95e35
Adding JS and CSS for bootstrap-editable
BrendanKennedy Mar 10, 2016
b626568
Debugging viewInstitution
BrendanKennedy Mar 10, 2016
20a556f
Debugging viewInstitution
BrendanKennedy Mar 10, 2016
47e2d44
Debugging viewInstitution
BrendanKennedy Mar 10, 2016
4eee724
Debugging viewInstitution
BrendanKennedy Mar 10, 2016
455daf6
Moving Students/ from Teacher/MyCourses/ to Teacher/MyCourses/ViewCou…
BrendanKennedy Mar 11, 2016
ebba17f
Teacher/MyCourses/ViewCourse/ -- DEBUG
BrendanKennedy Mar 11, 2016
e77a6ea
Teacher/MyCourses/ViewCourse/ -- DEBUG
BrendanKennedy Mar 11, 2016
248aa63
Revising Teacher Home
BrendanKennedy Mar 12, 2016
6a01e65
Small fix to teacher/home; UI mod to WorksheetEditor
BrendanKennedy Mar 12, 2016
91d10c6
WorksheetEditor Mods -- DEBUG
BrendanKennedy Mar 12, 2016
3b97daa
WorksheetEditor Mods -- DEBUG
BrendanKennedy Mar 12, 2016
82801eb
WorksheetEditor Mods -- DEBUG
BrendanKennedy Mar 12, 2016
3bd0dfa
WorksheetEditor Mods -- DEBUG
BrendanKennedy Mar 12, 2016
acf1654
reenabling forced HTTPS connection
kevinWisdom Mar 14, 2016
a095b39
Update Testfindphrase.html
brianramaswami Mar 14, 2016
4a47e11
Update findphrase.php
brianramaswami Mar 14, 2016
90eb475
Update Testfindphrase.html
brianramaswami Mar 14, 2016
dbecc42
Update Testfindphrase.php
brianramaswami Mar 14, 2016
a9d00e0
adding reset password form and email test form
kevinWisdom Mar 14, 2016
e3046ef
fixing whoopsie in test file redirects
kevinWisdom Mar 14, 2016
8cbb6b2
Update Testfindphrase.html
brianramaswami Mar 15, 2016
e1884ea
Security for changing role (safeguard for GET method)
BrendanKennedy Mar 15, 2016
a920af1
Merge branch 'master' of https://github.com/ninjamuffin/SeniorDesignG…
BrendanKennedy Mar 15, 2016
f8eb666
Live search/auto complete for Admin/archive/students
BrendanKennedy Mar 15, 2016
e6f7d8d
UI switch over for several teacher-view pages: view students, view my…
BrendanKennedy Mar 15, 2016
14f7d10
Searching students as Admin: auto-submit form from dynamically-popula…
BrendanKennedy Mar 15, 2016
7852941
Fixing bad https: link in viewStudent
BrendanKennedy Mar 15, 2016
e4710ee
Fixing bad https: link in viewStudent
BrendanKennedy Mar 15, 2016
0deea91
Fixing bad https: link in viewStudent
BrendanKennedy Mar 15, 2016
bc8a3ce
UI changes for teacher viewSubmission, viewcourse. css/theme changes…
BrendanKennedy Mar 16, 2016
c67c648
IMPORTANT: removing all http and https from urls in files, did not to…
BrendanKennedy Mar 16, 2016
f7e56e9
Second wave of removing http: from the head of urls
BrendanKennedy Mar 16, 2016
fd3bfdf
UI Changes for Admin/Archive and others; ChangePassword UI and js fun…
BrendanKennedy Mar 18, 2016
682e3fc
UI update for corpus/search; partial work done on Part of Speech sugg…
BrendanKennedy Mar 21, 2016
601776c
Corpus/Search mods, ChangeRole.php DEBUG
BrendanKennedy Mar 21, 2016
60cd3ec
Fixing bug in page logic for admin/archive/courses
BrendanKennedy Mar 21, 2016
b2aadb5
committing worksheetEditor changes
Mar 21, 2016
e877aa4
Merge branch 'master' of https://github.com/ninjamuffin/SeniorDesignG…
Mar 21, 2016
856e382
committing teacher worksheetEditor changes
Mar 21, 2016
dd87f1b
committing changes to teacher worksheetEditor
Mar 21, 2016
3b6cd54
committing more changes to worksheetEditor
Mar 21, 2016
56981d2
worksheetEditor
Mar 21, 2016
6a8d34e
worksheetEditor
Mar 21, 2016
cf04a7e
worksheetEditor
Mar 21, 2016
f14d3bc
worksheetEditor
Mar 21, 2016
ac56fe0
worksheetEditor
Mar 21, 2016
c2c7e33
worksheetEditor
Mar 21, 2016
7b9e503
worksheetEditor
Mar 21, 2016
5bc246e
worksheetEditor
Mar 21, 2016
a175e07
worksheetEditor
Mar 21, 2016
977bae8
worksheetEditor
Mar 21, 2016
51cd4f2
worksheetEditor
Mar 21, 2016
e1f17c6
worksheetEditor
Mar 21, 2016
e3eb63c
workshksheetEditor
Mar 22, 2016
ae0e9a6
worksheetEditor
Mar 22, 2016
f554f50
now working on the student worksheetEditor
Mar 22, 2016
41eb097
worksheetEditor
Mar 22, 2016
723f591
Student worksheetEditor
Mar 22, 2016
0ca1c35
Student worksheetEditor
Mar 22, 2016
0d1fbbd
Student worksheetEditor
Mar 22, 2016
3f32314
Student worksheetEditor
Mar 22, 2016
e89f4a3
Making student worksheetEditor dynamic
Mar 22, 2016
d69895e
Corpus UI changes
BrendanKennedy Mar 23, 2016
d6ef9cb
Corpus UI Changes
BrendanKennedy Mar 23, 2016
311d4bf
changed the stupid sidebar colors...
Mar 23, 2016
a951fd6
changing stupid sidebar colors
Mar 23, 2016
18ce370
more colors and stuff
Mar 23, 2016
2be1075
adjusting sidebar
Mar 23, 2016
60b83e6
remove reference to bad email file
kevinWisdom Mar 29, 2016
db74552
progress on text selection and fixing flatUI css call
Mar 29, 2016
d34963a
now alerts with string from selection
Mar 29, 2016
1950c4a
Corpus functionality and UI Changes; work remaining: load preview, su…
BrendanKennedy Mar 30, 2016
e52aec6
worksheetEditor
Mar 30, 2016
3b9e1dd
worksheet editor
Mar 30, 2016
af4d0af
worksheet editor
Mar 30, 2016
f62858a
worksheet editor
Mar 30, 2016
5441ca5
Minor changes to corpus UI (search)
BrendanKennedy Mar 30, 2016
807ac94
Merge branch 'master' of https://github.com/ninjamuffin/SeniorDesignG…
BrendanKennedy Mar 30, 2016
54b3647
adding buttons and more functionality to annotation editor
Mar 30, 2016
d57a391
making minor changes to worksheet editor
Mar 30, 2016
c1b80a1
Merge branch 'AnnoEditor'
Mar 30, 2016
601d344
Corpus functionality change and tagset.php file
BrendanKennedy Mar 30, 2016
523c599
Merge branch 'master' of https://github.com/ninjamuffin/SeniorDesignG…
BrendanKennedy Mar 30, 2016
9c948f0
Corpus UI rehaul and organization (partially working)
BrendanKennedy Mar 31, 2016
04f8646
Corpus UI revision: data passing between windows
BrendanKennedy Apr 1, 2016
f723dd8
Debug for corpus changes
BrendanKennedy Apr 1, 2016
a06bec4
working sql table for teacher home courses
kevinWisdom Apr 1, 2016
b3c75f4
fixing whoopsie
kevinWisdom Apr 1, 2016
1abc787
more whoopsies
kevinWisdom Apr 1, 2016
dcd4696
one more query whoopsie
kevinWisdom Apr 1, 2016
12c33b5
reformatting
kevinWisdom Apr 1, 2016
348f11e
slaying the final whoopsie
kevinWisdom Apr 1, 2016
b0ae4c3
debug resultlength
kevinWisdom Apr 1, 2016
7ab0fcb
Corpus UI debug
BrendanKennedy Apr 1, 2016
a12bfcc
Merge branch 'master' of https://github.com/ninjamuffin/SeniorDesignG…
BrendanKennedy Apr 1, 2016
4c88ca9
DIE WHOOPSIES
kevinWisdom Apr 1, 2016
951c12b
prints table of active courses
kevinWisdom Apr 1, 2016
aa8900e
Merge branch 'master' of github.com:ninjamuffin/SeniorDesignGroup5
kevinWisdom Apr 1, 2016
800137a
got Student WorksheetEditor lookin snazzy and pretty functional
Apr 1, 2016
a61a837
Merge branch 'master' of https://github.com/ninjamuffin/SeniorDesignG…
Apr 1, 2016
b872b57
Corpus search functionality => loading data
BrendanKennedy Apr 1, 2016
f3b82ed
Merge branch 'master' of https://github.com/ninjamuffin/SeniorDesignG…
BrendanKennedy Apr 1, 2016
c7ec530
moving for work on lab machine
kevinWisdom Apr 4, 2016
2c0293a
Merge branch 'master' of github.com:ninjamuffin/SeniorDesignGroup5
kevinWisdom Apr 4, 2016
ffe6752
corpus changes: UI update and loading status; teacher changes: structure
BrendanKennedy Apr 5, 2016
89acc23
worksheet works no php yet
Apr 5, 2016
03dd065
Edits to teacher view course
BrendanKennedy Apr 5, 2016
219dcab
expr num formatted and starting work on dynamic table for expression …
Apr 5, 2016
8f47900
fixing sidebar fail
Apr 6, 2016
3d159aa
Merge branch 'Worksheet'
Apr 6, 2016
7829958
adding Teacher Expression creation
Apr 6, 2016
28837bc
Teacher is ready for PHP goodness
Apr 6, 2016
be86ac0
Changes to Teacher archive/students, /home, and mycourses/
BrendanKennedy Apr 6, 2016
c0387c3
Merge branch 'master' of https://github.com/ninjamuffin/SeniorDesignG…
BrendanKennedy Apr 6, 2016
59f2bb4
Merge branch 'master' into Worksheet
BrendanKennedy Apr 6, 2016
447bdd3
Changes to teacher worksheeteditor (and additional files); changes to…
BrendanKennedy Apr 7, 2016
96de6f6
getting annotationeditor to work
Apr 7, 2016
265b24b
Changes to Base.php; update Student_ID to StudentID across many files
BrendanKennedy Apr 7, 2016
bf42261
Merge branch 'Worksheet'
BrendanKennedy Apr 7, 2016
985a774
AnnotationEditor UI makeover
BrendanKennedy Apr 7, 2016
8802b10
AnnotationEditor updates for Admin: data passing with real data, and …
BrendanKennedy Apr 8, 2016
5d90bc6
Teacher function: Add worksheet
BrendanKennedy Apr 9, 2016
ae67f3e
Manage Admins UI change
BrendanKennedy Apr 9, 2016
3b693c1
Finishing touches on create and delete worksheets (still needs error …
BrendanKennedy Apr 10, 2016
7989d33
cleaning up files, fixing a sidebar link
kevinWisdom Apr 10, 2016
f6792a4
fixing view student profile links and POST vars
kevinWisdom Apr 10, 2016
604ae34
changed post var to correct link
kevinWisdom Apr 10, 2016
fdcd0a0
Adding new expression for teacher worksheeteditor
BrendanKennedy Apr 10, 2016
969ae08
Merge branch 'master' of https://github.com/ninjamuffin/SeniorDesignG…
BrendanKennedy Apr 10, 2016
b815b57
diagnosing http POST error
kevinWisdom Apr 10, 2016
6bf75ec
adding http POST fix to teacher/home as well
kevinWisdom Apr 10, 2016
d0513b5
Editing and submitting expression changes
BrendanKennedy Apr 10, 2016
967f95c
Merge branch 'master' of https://github.com/ninjamuffin/SeniorDesignG…
BrendanKennedy Apr 10, 2016
67890da
ready to test viewstudentprofile page
kevinWisdom Apr 10, 2016
5198dc5
fixing whoopsie in html
kevinWisdom Apr 11, 2016
40778e7
Final edits to adding and saving expressions
BrendanKennedy Apr 11, 2016
1d3ed42
Merge branch 'master' of https://github.com/ninjamuffin/SeniorDesignG…
BrendanKennedy Apr 11, 2016
78727c5
Working changes to worksheeteditor
Apr 11, 2016
8e08e21
Kevin work on students, submissions, etc
BrendanKennedy Apr 11, 2016
bdd8667
Merge branch 'master' of https://github.com/ninjamuffin/SeniorDesignG…
BrendanKennedy Apr 11, 2016
f33e95c
Creating a Course for Admin
BrendanKennedy Apr 13, 2016
55b4a4e
student MyCourses and Smaller updates to worksheet editor
Apr 13, 2016
73f792b
Data passing and UI revisions to student mycourses/ domain pages
BrendanKennedy Apr 13, 2016
17c816c
adding js to master
Apr 13, 2016
4f76280
These are the changes that were missing from today's user test on the…
Apr 14, 2016
811b483
fixed edits to worksheeteditor
Apr 14, 2016
9ab8f9a
adding worksheet info to teacher worksheet editor
kevinWisdom Apr 14, 2016
ce1d8ee
Edits to student worksheet editor and JS
Apr 14, 2016
0f6577a
Merge branch 'master' of http://www.github.com/ninjamuffin/SeniorDesi…
Apr 14, 2016
80196e2
testing worksheet info display for teacher in editor
kevinWisdom Apr 16, 2016
2c99dbe
testing worksheet info display for teacher in editor
kevinWisdom Apr 16, 2016
3077cc1
still testing worksheet info display
kevinWisdom Apr 16, 2016
22d9662
Brendan's Friday Code-A-Thon Work
kevinWisdom Apr 16, 2016
5fd0960
teacher-side worksheet review. Next step, viewing individual submissions
kevinWisdom Apr 16, 2016
7463281
student worksheets javascript finished, ready for real data transmission
Apr 16, 2016
b02e45b
pushing it up here, boss
kevinWisdom Apr 18, 2016
99aa157
Changes and fixes to admin/archive/
BrendanKennedy Apr 19, 2016
90bf38b
committing update worksheet changes
Apr 19, 2016
25d5228
once again committing changes to worksheet editor, same as last
Apr 19, 2016
bbef0aa
Merge branch 'master' of https://github.com/ninjamuffin/SeniorDesignG…
BrendanKennedy Apr 19, 2016
127717a
correcting merge
Apr 19, 2016
6731db0
Merge branch 'master' of http://www.github.com/ninjamuffin/SeniorDesi…
Apr 19, 2016
0dfc977
Data load in Annotation Editor (Admin)
BrendanKennedy Apr 19, 2016
0c28c94
Changes to admin annotation editor (real data) and sidebar update for…
BrendanKennedy Apr 20, 2016
adf3b0b
Work on student-side worksheet editor and SQL queries
Apr 20, 2016
f29d87b
Merge branch 'master' of https://github.com/ninjamuffin/SeniorDesignG…
BrendanKennedy Apr 20, 2016
76080a7
Change to viewCourse
BrendanKennedy Apr 20, 2016
9df2856
Revision to Student/Home, student sidebar, and small alterations to a…
BrendanKennedy Apr 20, 2016
c63a519
Corpus UI color switch
BrendanKennedy Apr 20, 2016
325e53d
Committing changes to UI and removing testing alerts
Apr 20, 2016
c9e0b66
Merge branch 'master' of
Apr 20, 2016
ae95d75
Other Corpus UI Color switch
BrendanKennedy Apr 20, 2016
cef1b20
fixes and login updates for new users; worksheetEditor bug fixes
BrendanKennedy Apr 25, 2016
a8aeeb1
adding videos of usability
Apr 25, 2016
588aa47
Updating worksheet for student
Apr 25, 2016
703d3b1
Fixes to student submission
Apr 25, 2016
29b3a32
Corpus functionality updates
BrendanKennedy Apr 25, 2016
6d5ab92
Student worksheetEditor changes
BrendanKennedy Apr 26, 2016
a86faaf
More worksheetEditor student updates
BrendanKennedy Apr 26, 2016
0e622ba
Fix an error with student worksheetEditor (temp)
BrendanKennedy Apr 26, 2016
f553be2
updating POST vals into viewstudentsubmission
kevinWisdom Apr 26, 2016
d28cba1
debug echo for viewsubmission
kevinWisdom Apr 26, 2016
7b72b5b
Finished correction writing for student
BrendanKennedy Apr 26, 2016
ff28d96
Merge branch 'master' of https://github.com/ninjamuffin/SeniorDesignG…
BrendanKennedy Apr 26, 2016
36c049b
fixed post vars into view submission and first go at displaying submi…
kevinWisdom Apr 26, 2016
1d09a6a
Merge branch 'master' of github.com:ninjamuffin/SeniorDesignGroup5
kevinWisdom Apr 26, 2016
d61e66a
Finished student worksheetEditor (core functionality)
BrendanKennedy Apr 26, 2016
5d90662
Merge branch 'master' of https://github.com/ninjamuffin/SeniorDesignG…
BrendanKennedy Apr 26, 2016
024a531
Fully working (and debugged) Student WorksheetEditor
BrendanKennedy Apr 27, 2016
56c5ade
Corpus data handling for word input
BrendanKennedy Apr 27, 2016
6738e64
Student WorksheetEditor UI Updates and improvements
BrendanKennedy Apr 27, 2016
e564ddd
Demo ready corpus results and search
BrendanKennedy Apr 27, 2016
2d96938
Bug fix for student WorksheetEditor
BrendanKennedy Apr 27, 2016
378c855
Fixing corpus and student
BrendanKennedy May 4, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 63 additions & 4 deletions ChangeRole.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,69 @@

include 'base.php';

$q = $_GET['q'];
$params = array($_SESSION['Username']);
$options = array( "Scrollable" => SQLSRV_CURSOR_KEYSET);
$ListRolesQuery = "SELECT DISTINCT R.Role, R.Designation, R.RoleID, R.Type FROM Roles as R, RoleInstances as RI WHERE RI.SiteUsername = ? AND RI.RoleID = R.RoleID ORDER BY R.RoleID, R.Designation, R.Type";
$stmt = sqlsrv_query($con, $ListRolesQuery, $params, $options);
if( $stmt === false ) {
die( print_r( sqlsrv_errors(), true));
}

// Make the first (and in this case, only) row of the result set available for reading.
$RolesList = [];
$Designations = [];
$AccessPriv = [];
while( sqlsrv_fetch( $stmt ) === true) {
$RolesList[] = sqlsrv_get_field( $stmt, 0);
$AccessPriv[] = sqlsrv_get_field( $stmt, 3);
}


$targetRole = $_GET['q'];
$targetAccessType = $_GET['t'];

$index = 0;
$valid = false;
foreach($RolesList as $ListedRole)
{
if ($ListedRole == $targetRole)
{

if ($AccessPriv[$index] == $targetAccessType)
{
$valid = true;
$_SESSION['Role'] = $targetRole;
$_SESSION['AccessType'] = $targetAccessType;
if ($targetRole == 'Admin')
{
/*$params = array($_SESSION['username']);
$options = array( "Scrollable" => 'static' );*/
$instQuery = "SELECT I.InstitutionName FROM Institutions as I, Administrators as A WHERE A.SiteUsername = ? AND I.InstitutionID = A.InstitutionID";
$stmt = sqlsrv_query( $con, $instQuery, $params, $options);
if ($stmt === false)
die (print_r(sqlsrv_errors(), true));
if (sqlsrv_fetch( $stmt ) == true)
$_SESSION['Institution'] = sqlsrv_get_field($stmt, 0);
}
elseif ($targetRole == 'Student')
{
$instQuery = "SELECT I.InstitutionName FROM Institutions as I, Students as S WHERE S.SiteUsername = ? AND I.InstitutionID = S.InstitutionID";
$stmt = sqlsrv_query( $con, $instQuery, $params, $options);
if ($stmt === false)
die (print_r(sqlsrv_errors(), true));
if (sqlsrv_fetch( $stmt ) === true)
$_SESSION['Institution'] = sqlsrv_get_field( $stmt, 0);

}
echo "<meta http-equiv='refresh' content='0;/$targetRole/Home' />";
}
}
$index++;
}
if (!($valid))
{
echo "<meta http-equiv='refresh' content='0;/Logout.php' />";
}

$_SESSION['Role'] = $q;
$role = $_SESSION['Role'];

echo "<meta http-equiv='refresh' content='0;/$role/Home' />";
?>
Loading