@@ -12,19 +12,13 @@
< link rel ="stylesheet " media ="screen " href ="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/css/bootstrap.min.css ">
< script src ="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js "> </ script >
< script src ="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js "> </ script >
< script type ="text/javascript " src ="formValidation.js "> </ script >
< link rel ="stylesheet " href ="style.css ">
< title > Modules</ title >
<!-- script that shows/hides the uplaod container -->
< script >
$ ( document ) . ready ( function ( ) {
$ ( ".FAQpanelhead" ) . click ( function ( ) {
$ ( ".FAQpanelbody" ) . toggle ( ) ;
} ) ;
} ) ;
<!-- script that shows/hides the uplaod container -->
< script >
$ ( document ) . ready ( function ( ) {
$ ( ".btnUpload" ) . click ( function ( ) {
$ ( ".toUpload" ) . show ( ) ;
@@ -39,19 +33,11 @@
$ ( '#element' ) . click ( function ( ) {
if ( $ ( '#radio_button1' ) . is ( ':checked' ) ) {
$ ( '#element' ) . attr ( 'accept' , 'application/pdf' ) ;
$ ( '#element' ) . attr ( 'name' , 'pdf' ) ;
}
if ( $ ( '#radio_button2' ) . is ( ':checked' ) ) {
$ ( '#element' ) . attr ( 'accept' , 'application/zip' ) ;
$ ( '#element' ) . attr ( 'name' , 'zip' ) ;
}
if ( $ ( '#radio_button3' ) . is ( ':checked' ) ) {
$ ( '#element' ) . attr ( 'accept' , 'application/png' ) ;
$ ( '#element' ) . attr ( 'name' , 'png' ) ;
}
if ( $ ( '#radio_button4' ) . is ( ':checked' ) ) {
$ ( '#element' ) . attr ( 'accept' , 'application/jpeg' ) ;
$ ( '#element' ) . attr ( 'name' , 'jpeg' ) ;
$ ( '#element' ) . attr ( 'accept' , 'image/* , application/pdf , application/msword , application/vnd.ms-excel , application/vnd.ms-powerpoint' ) ;
}
} ) ;
} ) ;
@@ -62,25 +48,16 @@
< body >
<?php
if (isset ($ moduleID )){
$ query = "SELECT * FROM MODULE WHERE Module_ID = '" .$ _GET ['id' ]."'" ;
$ checkModuleID = mysqli_query ($ db , $ query );
if (mysqli_num_rows ($ checkModuleID ) > 0 ){
$ _SESSION ['username' ] = $ _SESSION ['username' ];
if (!isset ($ moduleID )){
$ moduleID = $ _GET ['id' ];
}
else {
header ('location: error.html' );
}
}
else {
$ _SESSION ['moduleID' ] = $ moduleID ;
}
$ _SESSION ['moduleID' ] = $ moduleID ;
?>
<!-- where the lectures that are uplaoded will be listed and when clicked will display/preview the lecture in the iframe -->
< div class ="container ">
< div class ="row ">
@@ -89,18 +66,17 @@
< h3 > <?php echo $ _SESSION ['moduleID' ] ?> </ h3 >
< h4 > Module Title</ h4 >
<?php
$ query = 'SELECT * FROM MODULE WHERE Module_ID= "' .$ _SESSION ['moduleID' ].'"' ; //$_SESSION['moduleID']
$ query = 'SELECT * FROM MODULE WHERE Module_ID = "' .$ _SESSION ['moduleID' ].'"' ; //$_SESSION['moduleID']
$ result = mysqli_query ($ db , $ query );
while ($ row = mysqli_fetch_assoc ($ result )){
$ moduleTitle = $ row ['Module_TITLE' ];
$ moduleDesc = $ row ['Module_DESCRIPTION' ];
echo "
<p>" .$ moduleTitle ."</p>
<br>" ;
echo "<h4> Module Description</h4>" ;
echo "<p>" .$ moduleDesc ."</p>" ;
echo "<p>" .$ moduleTitle ."</p><br>" ;
echo "<h4> Module Description</h4>" ;
echo "<p>" .$ moduleDesc ."</p>" ;
}
echo "<h4>Lecture Material</h4>" ;
$ query = 'SELECT * FROM MATERIAL WHERE Module_ID = "' .$ _SESSION ['moduleID' ].'" AND Material_TYPE = "pdf"' ;
$ result = mysqli_query ($ db , $ query );
@@ -109,7 +85,7 @@
$ materialTitle = $ row ['Material_TITLE' ];
$ materialLink = $ row ['File' ];
$ access = $ row ['Access_DATE' ];
echo "
echo "
<div class='modules-lect-button'>
<a href='' data-toggle='modal' data-target='#LectureModal' data-backdrop='static' data-keyboard='false'>" .$ i ."." .$ materialTitle ." </a>
<form action='cloud_delete.php' method='post'>
@@ -119,10 +95,10 @@
</div>" ;
$ i ++;
if ($ access > date ("Y-m-d" )){
echo "Set to be accessible from " . $ access ;
echo "Set to be accessible from " . $ access ;
}
}
?>
?>
< h4 > Other Material</ h4 >
<?php
$ query = 'SELECT * FROM MATERIAL WHERE Module_ID = "' .$ _SESSION ['moduleID' ].'" AND Material_TYPE = "oth"' ;
@@ -132,7 +108,7 @@
$ materialTitle = $ row ['Material_TITLE' ];
$ materialLink = $ row ['File' ];
$ access = $ row ['Access_DATE' ];
echo "
echo "
<div class='modules-lect-button'>
<a href='' data-toggle='modal' data-target='#LectureModal' data-backdrop='static' data-keyboard='false'>" .$ i ."." .$ materialTitle ." </a>
<form action='cloud_delete.php' method='post'>
@@ -142,63 +118,41 @@
</div>" ;
$ i ++;
if ($ access > date ("Y-m-d" )){
echo "Set to be accessible from " . $ access ;
echo "Set to be accessible from " . $ access ;
}
}?>
}
?>
< h4 > Module Feedback</ h4 >
< a href ="moduleFeedbackForm .php "> < button class ="btn-md "> Module Feedback</ button > </ a >
< h4 > Student Feedback</ h4 >
< a href ="lecturerFeedbackForm .php "> < button class ="btn-md "> Module Feedback</ button > </ a >
< input hidden type ='text ' id ='moduleID ' name ='moduleID ' value = <?php $ moduleID ?> >
</ div >
</ div >
<!-- button for uplaod... it hides the upload button and iframe and it shows the upload form/window -->
<!-- <button class="btn-default btnUpload">Upload file</button> -->
< h3 > Upload Lecture Material</ h3 >
< form name ="uploadMaterial " action ="cloud_upload.php " method ="post " onsubmit ="emptyLectUpload(this); ">
Enter a title:
< input type ="text " name ="title "> < br >
Make slides accessable from (optional):
<?php
echo "
<input type='date' min=" .date ("Y-m-d" )." max='2050-01-01' value=" .date ("Y-m-d" )." name='access'><br>
Upload as:<br>
<input type='radio' name='type' value='pdf' id='radio_button1' checked='checked' > Lecture slides ( .pdf )<br>
<input type='radio' name='type' value='oth' id='radio_button2'> Other material ( images, .zip archives )<br>
<input type='file' name='upload' id='element'><br>
<input type='submit' value='Upload'>
" ;?>
</ form >
< button class ="btn-default btnUpload "> Upload file</ button >
< h3 > Upload Lecture Material</ h3 >
< form action ="cloud_upload.php " method ="post ">
Enter a title:
< input type ="text " name ="title "> < br >
Make slides accessable from (optional):
<?php echo "
<input type='date' min='" .date ("Y-m-d" )."' value='" .date ("Y-m-d" )."' max='2050-01-01' name='access'><br>" ?>
Upload as:< br >
< input type ="radio " name ="type " value ="pdf " id ="radio_button1 " checked ="checked " > Lecture slides ( .pdf only)< br >
< input type ="radio " name ="type " value ="oth " id ="radio_button2 "> Other material ( images, .xls, .doc, .ppt )< br >
< input type ="file " name ="upload " id ="element "> < br >
< input type ="submit " value ='Upload '>
</ form >
</ div >
</ div >
< div class ="col-md-5 ">
< div class ="well ">
< div class ="panel panel-default ">
< div class ="panel-heading "> < span data-toggle ="modal " data-target ="#FAQModal " data-backdrop ="static " data-keyboard ="false "> Enter an FAQ into the system</ span > < span class ="glyphicon glyphicon-menu-up glypbuttons FAQpanelhead "> </ span > </ div >
< div class ="panel-body FAQpanelbody " data-toggle ="modal " data-target ="#FAQModal " data-backdrop ="static " data-keyboard ="false " style ="display:none; ">
<?php
$ query = 'SELECT * FROM FAQ WHERE Module_ID= "' .$ _SESSION ['moduleID' ].'"' ;
$ result = mysqli_query ($ db , $ query ) or die (mysqli_error ($ db ));
while ($ row1 = mysqli_fetch_assoc ($ result )){
$ question = $ row1 ['Question' ];
$ answer = $ row1 ['Answer' ];
echo '<p>Q:' .$ question .'</p>
<p>A:' .$ answer .'</p>' ;
}
?>
< div id ="FAQadd ">
< form id ="FAQadd " name ="addfaq " action ="faqAdd.php " method ="post ">
< input type ="text " name ="question " id ="question " placeholder ="Enter Question "> < br >
< input type ="text " name ="answer " id ="answer " placeholder ="Enter Answer ">
< button type ="submit " onclick ="emptyFAQUpload(this) "> Post FAQ</ button >
</ form >
</ div >
</ div >
<!-- iframe that will be used for lectures display-->
<!-- Modal -->
< div class ="modal fade " id ="LectureModal " role ="dialog ">
@@ -222,55 +176,72 @@
<iframe src=" .$ file ." width='80%;' height='350px;'></iframe>
</div>" ;
}
?>
< script src ="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js "> </ script >
< script src ="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/js/bootstrap.min.js "> </ script >
< script >
</ script >
echo "
<div class='col-sm-6 '>
<div class='panel panel-default lectureComments'>
<div class='panel-heading'>Comments</div>
<div class='panel-body'>" ;
$ query = 'SELECT * FROM MATERIAL_COMMENTS WHERE Module_ID="' .$ _SESSION ['moduleID' ].'"' ;
$ result = mysqli_query ($ db , $ query );
while ($ row = mysqli_fetch_assoc ($ result )){
$ comment = $ row ["Comment" ];
$ user = $ row ["User_ID" ];
echo "
<div class='media'>
<div class='media-left'>
<span class='media-object'><b>" .$ user ."</b></span>
</div>
<div class='media-body'>
<p>" .$ comment ."</p>
</div>
</div>" ;
}
?>
< div id ="formCommentsBox ">
< form id ="formComments " action ="comments.php " method ="post " onSubmit ="commentalert() ">
< input type ="text " name ="comment " placeholder ="Enter comment ">
< button type ="submit "> Make Comment</ button >
</ form >
</ div >
</ div >
</ div >
</ div >
< div class ="col-sm-6 ">
< div class ="panel panel-default lectureNotes ">
< div class ="panel-heading "> Personal Notes</ div >
< div class ="panel-body ">
< div ng-app ="">
< label > Write your personal notes:</ label >
< p > < textarea type ="text " class ="textnotes " rows ="3 " ng-model ="name "> </ textarea >
< button type ="submit " class ="btn btn-sm "> Send</ button >
< div ng-bind ="name "> </ div >
</ div >
</ div >
</ div >
</ div >
</ div >
< div class ="modal-footer ">
< button type ="button " class ="btn btn-default " data-dismiss ="modal "> Close</ button >
</ div >
</ div >
</ div >
</ div >
< script type ="text/javascript ">
function commentalert ( ) {
alert ( "Your comment has been posted!" ) ;
}
</ script >
< script src ="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js "> </ script >
< script src ="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/js/bootstrap.min.js "> </ script >
<!-- upload container which is shown only when upload button is clicked and hidden when a file has been uploaded or
or the operation has been cancelled -->
<!--<div class="col-sm-8 toUpload" style="display:none;">
<div class="well">
<p>Browse files to upload</p>
<div class="fileUpload">
<table width="100%">
<thead>
<th width="70%">File name</th>
<th width="20%">Date</th>
<th width="10%">Type</th>
</thead>
<tbody>
<tr>
<td>Name.ext</td>
<td>20/03/2001</td>
<td>text</td>
</tr>
<tr>
<td>Name.ext</td>
<td>20/03/2001</td>
<td>text</td>
</tr>
</tbody>
</table>
<form class="form-inline formInlineMargin" role="form">
<div class="form-group formInlineUp">
<label for="email">File name:</label>
<input type="text" class="form-control" id="fileName">
</div>
<button type="submit" class="btn btn-default hideUpload">Upload</button>
<button type="button" class="btn btn-default hideUpload">Cancel</button>
</form>
</div>
</div>
</div>-->
< script >
</ script >
</ div >