forked from mrlan/LRR
				
			Compare commits
	
		
			4 Commits 
		
	
	
		
			master
			...
			Bug37-Dmyt
		
	
	| Author | SHA1 | Date | 
|---|---|---|
|  | 6acac2dbc7 | |
|  | 18a41dd1bb | |
|  | 036489041f | |
|  | 207d12a4a3 | 
							
								
								
									
										20
									
								
								Admin.php
								
								
								
								
							
							
						
						
									
										20
									
								
								Admin.php
								
								
								
								
							|  | @ -51,11 +51,11 @@ if ($_SESSION['user_type'] != "Lecturer") { | |||
|         </li> | ||||
| 
 | ||||
|         <li class="nav-item"> | ||||
|           <a class="nav-link" data-toggle="tab" href="#menu2" id="batch_tab">Batch Create New Student Accounts</a> | ||||
|           <a class="nav-link" data-toggle="tab" href="#menu2">Batch Create New Student Accounts</a> | ||||
|         </li> | ||||
| 
 | ||||
|         <li class="nav-item"> | ||||
|           <a class="nav-link" data-toggle="tab" href="#menu1" id="existing_accounts_tab">Existing Accounts</a> | ||||
|           <a class="nav-link" data-toggle="tab" href="#menu1">Existing Accounts</a> | ||||
|         </li> | ||||
| 
 | ||||
|       </ul> | ||||
|  | @ -66,7 +66,7 @@ if ($_SESSION['user_type'] != "Lecturer") { | |||
|         <div id="home" class="container tab-pane active"><br> | ||||
| 
 | ||||
|           <b>Create Lecturer/TA Accounts </b> | ||||
|           <form method="post" action="Script.php" id="create_account_form"> | ||||
|           <form method="post" action="Script.php"> | ||||
|             <input type="hidden" name="frm_createlecturrer" value="true" required="" /> | ||||
|             Full_Name | ||||
|             <input type="text" name="fullname" placeholder="Full Name" class="form-control" required=""> | ||||
|  | @ -76,9 +76,9 @@ if ($_SESSION['user_type'] != "Lecturer") { | |||
|             Passport_Number / ID (Used as Intial Password) | ||||
|             <input type="text" class="form-control" name="passport" placeholder="Passport No./ID" required=""> | ||||
|             <br> User Type : | ||||
|             <input type="radio" name="type" value="Lecturer" required="" id="role_lecturer"> Lecturer | ||||
|             <input type="radio" name="type" value="TA" required="" id="role_TA"> T/A | ||||
|             <input type="submit" class="btn btn-primary" value="Create" id="create_btn"><br> | ||||
|             <input type="radio" name="type" value="Lecturer" required=""> Lecturer | ||||
|             <input type="radio" name="type" value="TA" required=""> T/A | ||||
|             <input type="submit" class="btn btn-primary" value="Create"><br> | ||||
|             <?php | ||||
| 
 | ||||
|             error_reporting(E_ALL); | ||||
|  | @ -121,10 +121,10 @@ if ($_SESSION['user_type'] != "Lecturer") { | |||
|               $btn = "<button class='btn-primary' onclick=\"updatePass(" . $row['User_ID'] . ",'$pass')\">Reset</button>"; | ||||
|               if ($row['Status'] == "Active") { | ||||
|                 $newstatus = "Blocked"; | ||||
|                 $btnBlock = "<button class='btn-danger' onclick=\"blockUser(" . $row['User_ID'] . ",'$newstatus')\" id=\"block_account_1\">Block</button>"; | ||||
|                 $btnBlock = "<button class='btn-danger' onclick=\"blockUser(" . $row['User_ID'] . ",'$newstatus')\">Block</button>"; | ||||
|               } else { | ||||
|                 $newstatus = "Active"; | ||||
|                 $btnBlock = "<button class='btn-success' onclick=\"blockUser(" . $row['User_ID'] . ",'$newstatus')\" id=\"activate_account_1\">Activate</button>"; | ||||
|                 $btnBlock = "<button class='btn-success' onclick=\"blockUser(" . $row['User_ID'] . ",'$newstatus')\">Activate</button>"; | ||||
|               } | ||||
| 
 | ||||
|               echo "<tr><td>" . $row['User_ID'] . "</td><td>" . $row['Full_Name'] . "</td><td>" . $row['Email'] . "</td> <td>" . $row['Passport_Number'] . "</td><td>$btn</td><td>$btnBlock</td></tr>"; | ||||
|  | @ -138,11 +138,11 @@ if ($_SESSION['user_type'] != "Lecturer") { | |||
| 
 | ||||
|         <div id="menu2" class="container tab-pane fade" style="margin-top:10px"> | ||||
|           <b>Separate two student numbers with a space.</b><br> | ||||
|           <form action="batch_insert.php" method="post" id="batch_form"> | ||||
|           <form action="batch_insert.php" method="post"> | ||||
|             <p> | ||||
|               <textarea cols="80" rows="16" name="users" required=""></textarea> | ||||
|             </p> | ||||
|             <input type="submit" class="btn btn-primary" value="Register Students" id="register_btn"><br> | ||||
|             <input type="submit" class="btn btn-primary" value="Register Students"><br> | ||||
|           </form> | ||||
|         </div> | ||||
| 
 | ||||
|  |  | |||
							
								
								
									
										335
									
								
								Courses.php
								
								
								
								
							
							
						
						
									
										335
									
								
								Courses.php
								
								
								
								
							|  | @ -7,19 +7,18 @@ include 'NoDirectPhpAcess.php'; | |||
| $page = 'Courses'; | ||||
| include 'Header.php'; | ||||
| 
 | ||||
| echo "<main role='main' class='container bg-white' style='margin-top: 20px;'>"; | ||||
| 
 | ||||
| $user_d = $_SESSION['user_id']; | ||||
| 
 | ||||
| if ($_SESSION['user_type'] == "Lecturer" || $_SESSION['user_type'] == "TA") { | ||||
| ?>
 | ||||
|     ?>
 | ||||
| 
 | ||||
| 
 | ||||
|         <!--    FOR LECTURER--> | ||||
|   | ||||
|         <div class="row" style="width:80%;margin:auto; text-align:left;"> | ||||
| 
 | ||||
|         <script src="./css/jquery-1.11.1.min.js"></script> | ||||
|         <script src="./css/jquery-ui.min.js"></script> | ||||
|         <link rel="stylesheet" href="./css/jquery-ui.css" /> | ||||
| 
 | ||||
|                 <script> | ||||
|                 function extend_deadline(id) { | ||||
| 
 | ||||
|  | @ -30,12 +29,12 @@ if ($_SESSION['user_type'] == "Lecturer" || $_SESSION['user_type'] == "TA") { | |||
|                         $('<form id="frm" method="get" action="Script.php">\n\ | ||||
|                             <input type="hidden" name="extenddeadline" value="true" >\n\ | ||||
|                             <input type="hidden" name="id" value="' + id + '" > \n\ | ||||
| New Date/Time <br><input type="date" name="date" required=""> <input type="time" name="time" required=""> \n\ | ||||
|                             New Date/Time <br><input type="date" name="date" required=""> <input type="time" name="time" required=""> \n\ | ||||
|                             \n\ | ||||
| <br><input type="radio" value="1" name="type" required=""> Extend for All<hr>  \n\ | ||||
| <input type="radio" value="2" name="type" required=""> Extend for these Individual Students \n\ | ||||
|                             <br><input type="radio" value="1" name="type" required=""> Extend for All<hr>  \n\ | ||||
|                             <input type="radio" value="2" name="type" required=""> Extend for these Individual Students \n\ | ||||
|                             ' + dropstudents + '   \n\ | ||||
| </form>').dialog({ | ||||
|                             </form>').dialog({ | ||||
|                                 modal: true, | ||||
|                                 title: 'Extend Deadline', | ||||
|                                 buttons: { | ||||
|  | @ -82,7 +81,7 @@ New Date/Time <br><input type="date" name="date" required=""> <input type="time" | |||
|                             <div class='alert> <a href='~\..\Courses.php?course=$url'>   <div class='panel'> | ||||
|                             ($code) - $name  | ||||
|                             <br> <span style='font-size:8pt'>Faculty: $faculty | Year: $academic | Lecturer: $lecturer </span> | ||||
| </div></a> | ||||
|                             </div></a> | ||||
|                             <hr></div></div> <div class='row' style='width:80%;margin:auto; text-align:left;'> | ||||
|                             ";
 | ||||
| 
 | ||||
|  | @ -190,7 +189,7 @@ New Date/Time <br><input type="date" name="date" required=""> <input type="time" | |||
| 
 | ||||
|                             <h3> Post new Lab Assignment </a></h3> | ||||
| 
 | ||||
|                         <form method='post' enctype='multipart/form-data' action='Script.php' id="newlab_form"> | ||||
|                             <form method='post' enctype='multipart/form-data' action='Script.php'> | ||||
|                                 <?php | ||||
|                                 $_SESSION['url'] = $url; | ||||
|                                 ?>
 | ||||
|  | @ -205,11 +204,11 @@ New Date/Time <br><input type="date" name="date" required=""> <input type="time" | |||
|                                 </div> | ||||
| 
 | ||||
|                                 Title | ||||
|                             <input type='text' name='title' placeholder='Ttle' class='form-control' required='' value="" id="lab_title"> | ||||
|                                 <input type='text' name='title' placeholder='Ttle' class='form-control' required='' value=""> | ||||
|                                 Instructions | ||||
|                             <textarea name='instructions' placeholder='Assignment Instructions' class='form-control' required='' value="" id="lab_instructor"></textarea> | ||||
|                                 <textarea name='instructions' placeholder='Assignment Instructions' class='form-control' required='' value=""></textarea> | ||||
|                                 Marks | ||||
|                             <input type='text' name='marks' placeholder='Marks' class='form-control' required='' value="" id="lab_mark"> | ||||
|                                 <input type='text' name='marks' placeholder='Marks' class='form-control' required='' value=""> | ||||
|                                 Attachment 1 | ||||
|                                 <input type='file' name='attachment1' placeholder='Attachment 1' class='form-control'> | ||||
| 
 | ||||
|  | @ -222,11 +221,11 @@ New Date/Time <br><input type="date" name="date" required=""> <input type="time" | |||
|                                 Attachment 4 | ||||
|                                 <input type='file' name='attachment4' placeholder='Attachment 4' class='form-control'> | ||||
|                                 <br> | ||||
|                             Submission Type <input type='radio' name='type' value='Individual' required='' id="lab_individual"> Individual | ||||
|                                 Submission Type <input type='radio' name='type' value='Individual' required=''> Individual | ||||
| 
 | ||||
|                             <input type='radio' name='type' value='Group' required='' id="lab_group"> Group | ||||
|                                 <input type='radio' name='type' value='Group' required=''> Group | ||||
|                                 <hr> | ||||
|                             <input type='submit' class='btn btn-primary' value='Post Lab Assignment' id="submit_btn"><br> | ||||
|                                 <input type='submit' class='btn btn-primary' value='Post Lab Assignment'><br> | ||||
|                             </form><br><br><br><br> | ||||
|                             <?php | ||||
|                         } | ||||
|  | @ -259,6 +258,7 @@ New Date/Time <br><input type="date" name="date" required=""> <input type="time" | |||
|                 if (mysqli_num_rows($result) == 0) { | ||||
|                     echo "No assignments posted so far."; | ||||
|                 } else { | ||||
|                     echo "<div class='row'><div class='col-sm-6'>"; | ||||
|                     while ($row = mysqli_fetch_assoc($result)) { | ||||
|                         $marks = $row['Marks']; | ||||
|                         $title = $row['Title']; | ||||
|  | @ -275,14 +275,14 @@ New Date/Time <br><input type="date" name="date" required=""> <input type="time" | |||
|                         $full_link = "<a href='~\..\Lab_Report_Assignments\\$att1'>$att1</a>"; | ||||
| 
 | ||||
|                         if ($att2 != "") { | ||||
|                         $full_link = $full_link . "  |  <a href='~\..\Lab_Report_Assignments\\$att2'>$att2</a>"; | ||||
|                             $full_link = $full_link . " <a class='card-link' href='~\..\Lab_Report_Assignments\\$att2'>$att2</a>"; | ||||
|                         } | ||||
|                         if ($att3 != "") { | ||||
|                         $full_link = $full_link . "  |  <a href='~\..\Lab_Report_Assignments\\$att3'>$att3</a>"; | ||||
|                             $full_link = $full_link . " <a class='card-link' href='~\..\Lab_Report_Assignments\\$att3'>$att3</a>"; | ||||
|                         } | ||||
| 
 | ||||
|                         if ($att4 != "") { | ||||
|                         $full_link = $full_link . "   |   <a href='~\..\Lab_Report_Assignments\\$att4'>$att4</a>"; | ||||
|                             $full_link = $full_link . " <a class='card-link' href='~\..\Lab_Report_Assignments\\$att4'>$att4</a>"; | ||||
|                         } | ||||
| 
 | ||||
|                         $resultx1 = mysqli_query($con, "Select Count(*) as cnt from lab_report_submissions where lab_report_submissions.Lab_Report_ID=$id"); | ||||
|  | @ -301,23 +301,42 @@ New Date/Time <br><input type="date" name="date" required=""> <input type="time" | |||
| 
 | ||||
|                         $header = "Courses > " . $name . "($code) > Assignments > " . $title; | ||||
|   | ||||
|                     echo "      <div class='break-word btn btn-default' style='word-wrap: break-word;border-color:grey;'>
 | ||||
|   $title ($as_type) <br> $ins | ||||
| 
 | ||||
|    <br> <span style='font-size:8pt'>Posted : $posted  Deadline :  <b> $deadline </b>   ($marks Marks)                     " | ||||
|                         . "<br>" | ||||
|                         echo"<div class='card' style='width: 18rem;'> 
 | ||||
|                               <div class='card-body'> | ||||
|                                 <h5 class='card-title'>$title ($as_type)</h5> | ||||
|                                 <p class='card-text'>$ins</p> | ||||
|                               </div> | ||||
| 
 | ||||
|                         . "<span class='btn-default'>    $count_subs Submissions ( $count_marked Marked )       <a href='Courses.php?course=" . $url . "&act=edit&cid=" . $id . "'>Edit</a>   |  <a href='~\..\Submissions.php?id=$id&header=$header&total=$marks' onclick=''> View </a>        |           <a href='#'  onclick='extend_deadline($id)'> Extend Deadline </a>  </span>         <hr> Attachments : $full_link </span>" | ||||
|                         . "  </div>
 | ||||
|                         ";
 | ||||
|                               <ul class='list-group list-group-flush'> | ||||
|                                 <li class='list-group-item'>Posted : $posted</li> | ||||
|                                 <li class='list-group-item'>Deadline : <b> $deadline </b></li> | ||||
| 
 | ||||
|                                 <li class='list-group-item'> | ||||
|                                 <div class='dropdown show'> | ||||
|                                   <a class='btn btn-secondary dropdown-toggle'  id='dropdownMenuLink' data-toggle='dropdown'  > | ||||
|                                     Action | ||||
|                                   </a> | ||||
|                                   <div class='dropdown-menu' aria-labelledby='dropdownMenuLink'> | ||||
|                                     <a class='dropdown-item' href='Courses.php?course= $url &act=edit&cid= $id' >Edit</button> | ||||
|                                     <a class='dropdown-item' href='~\..\Submissions.php?id=$id&header=$header&total=$a' onclick='' >View action</a> | ||||
|                                     <a class='dropdown-item' href='#' onclick='extend_deadline($id)'>Extend Deadline</a> | ||||
|                                   </div> | ||||
|                                 </div> | ||||
|                                 </li>   | ||||
|                               </ul> | ||||
|                               <div class='card-body'> | ||||
|                                 $full_link | ||||
|                               </div> | ||||
|                             </div> ";
 | ||||
|                     } | ||||
|                 } | ||||
|             echo "</div>"; | ||||
|                 echo "</div></div></div>"; | ||||
| 
 | ||||
|                 $resultx1 = mysqli_query($con, "SELECT course_students_table.Student_ID,users_table.Full_Name FROM 
 | ||||
| `course_students_table` | ||||
| INNER JOIN users_table on users_table.Student_ID=course_students_table.Student_ID | ||||
| WHERE Course_ID=$course_id");
 | ||||
|                     `course_students_table` | ||||
|                     INNER JOIN users_table on users_table.Student_ID=course_students_table.Student_ID | ||||
|                     WHERE Course_ID=$course_id");
 | ||||
| 
 | ||||
|                 echo "<span id='dropstudents' style='display:none;'> <select name='stdid'>"; | ||||
|                 while ($row = mysqli_fetch_assoc($resultx1)) { | ||||
|  | @ -343,7 +362,7 @@ WHERE Course_ID=$course_id"); | |||
|                 echo    "  <div class='alert' style='margin-left:20px;border-bottom:2px solid #1D91EF;'> <a href='~\..\Courses.php?course=$url'>
 | ||||
|                 Course Portal  > $user_name (Lecturer) > Course Listing | ||||
|                 <br> <span style='font-size:8pt'> </span> | ||||
| </a></div> | ||||
|                 </a></div> | ||||
|                 ";
 | ||||
| 
 | ||||
|                 $result = mysqli_query($con, "SELECT `Course_ID`, `Course_Name`, `Academic_Year`, `Faculty`, " | ||||
|  | @ -352,13 +371,15 @@ WHERE Course_ID=$course_id"); | |||
|                 if ($_SESSION['user_type'] == "TA") { | ||||
|                     $result = mysqli_query($con, "SELECT course_ta.Course_ID, `Course_Name`, 
 | ||||
|                       `Academic_Year`, `Faculty`, `Lecturer_User_ID`, `TA_User_ID`, `Course_Code`, `URL`, `Verify_New_Members`   FROM `courses_table`  | ||||
| INNER JOIN  | ||||
| course_ta ON course_ta.Course_ID=courses_table.Course_ID where course_ta.TA=$user_d");
 | ||||
|                       INNER JOIN  | ||||
|                       course_ta ON course_ta.Course_ID=courses_table.Course_ID where course_ta.TA=$user_d");
 | ||||
|                 } | ||||
|             // $result = mysqli_query($con,"SELECT `Course_ID`, `Course_Name`, `Academic_Year`, `Faculty`, `Lecturer_User_ID`, `TA_User_ID`, `Course_Code`, `URL`, `Verify_New_Members`   , users_table.Full_Name  FROM `courses_table` INNER JOIN users_table ON users_table.User_ID=courses_table.Lecturer_User_ID");
 | ||||
| 
 | ||||
|                 if (mysqli_num_rows($result) == 0) { | ||||
|                 } else { | ||||
|                       | ||||
|                         echo "<div class='list-group'>"; | ||||
|                     while ($row = mysqli_fetch_assoc($result)) { | ||||
|                         $id = $row['Course_ID']; | ||||
|                         $name = $row['Course_Name']; | ||||
|  | @ -369,8 +390,8 @@ course_ta ON course_ta.Course_ID=courses_table.Course_ID where course_ta.TA=$use | |||
|                         $url = $row['URL']; | ||||
| 
 | ||||
|                         $resultTA = mysqli_query($con, "SELECT `Course_ID`, `TA`,users_table.Full_Name as TA_NAME FROM `course_ta`
 | ||||
| INNER JOIN users_table on users_table.User_ID=course_ta.TA | ||||
| where course_ta.Course_ID=$id");
 | ||||
|                             INNER JOIN users_table on users_table.User_ID=course_ta.TA | ||||
|                             where course_ta.Course_ID=$id");
 | ||||
| 
 | ||||
|                         $ta = ""; | ||||
|                         while ($rowTA = mysqli_fetch_assoc($resultTA)) { | ||||
|  | @ -378,15 +399,17 @@ where course_ta.Course_ID=$id"); | |||
|                         } | ||||
| 
 | ||||
|                         echo "    
 | ||||
|                    | ||||
|                          <a href='~\..\Courses.php?course=$url'>   <div class='btn btn-default'> | ||||
|   ($code) - $name  | ||||
|    <br> <span style='font-size:8pt'>Faculty : $faculty        Year :  $academic          Lecturer  :$lecturer          TA:$ta </span> | ||||
| </div></a> | ||||
|                         ";
 | ||||
|                         <a href='~\..\Courses.php?course=$url' class='list-group-item list-group-item-action flex-column align-items-start'> | ||||
|                             <div class='d-flex w-100 justify-content-between'> | ||||
|                               <h5 class='mb-1'>($code) - $name </h5>  | ||||
|                             </div> | ||||
|                             <p class='mb-1'>Faculty : $faculty   Year :  $academic   Lecturer  :$lecturer    TA:$ta </p>  | ||||
|                         </a> ";
 | ||||
|                     } | ||||
| 
 | ||||
|                 } ?>
 | ||||
|             </div> | ||||
|             </div> | ||||
|             <div class="col-md-4"> | ||||
|                 <br> | ||||
|                 <b> Course Joining Requests </b> | ||||
|  | @ -394,9 +417,9 @@ where course_ta.Course_ID=$id"); | |||
|                 <?php | ||||
|                 $lecturer_id = $_SESSION['user_id']; | ||||
|                 $result = mysqli_query($con, "SELECT  course_students_table.ID,users_table.Full_Name,  courses_table.Course_ID, `Course_Name`, `Academic_Year`, `Faculty`, `Lecturer_User_ID`, `TA_User_ID`, `Course_Code`, `URL`, `Verify_New_Members` FROM `courses_table` 
 | ||||
| INNER JOIN course_students_table on  course_students_table.Course_ID=courses_table.Course_ID | ||||
| INNER JOIN users_table on users_table.Student_ID=course_students_table.Student_ID | ||||
| WHERE  Lecturer_User_ID=$lecturer_id and course_students_table.Status='Pending'");
 | ||||
|                     INNER JOIN course_students_table on  course_students_table.Course_ID=courses_table.Course_ID | ||||
|                     INNER JOIN users_table on users_table.Student_ID=course_students_table.Student_ID | ||||
|                     WHERE  Lecturer_User_ID=$lecturer_id and course_students_table.Status='Pending'");
 | ||||
| 
 | ||||
|                 if (mysqli_num_rows($result) == 0) { | ||||
| 
 | ||||
|  | @ -414,7 +437,7 @@ WHERE  Lecturer_User_ID=$lecturer_id and course_students_table.Status='Pending'" | |||
|                         echo "<div class='btn btn-default'>
 | ||||
|                         $std_name is Requesting to join <br> [($code) - $name ]      <br><a href='~\..\Script.php?AcceptStudent=y&id=$id&rs=yes' class='btn-sm btn-success' onclick=return confirm(\"are you sure to join this course?\")' > Accept </a>
 | ||||
|                           <a href='~\..\Script.php?AcceptStudent=y&id=$id&rs=no' class='btn-sm btn-danger' onclick=return confirm(\"are you sure to join this course?\")' > Decline </a>                     
 | ||||
| </div>";
 | ||||
|                         </div>";
 | ||||
|                     } | ||||
|                 } | ||||
|                 ?>
 | ||||
|  | @ -431,28 +454,28 @@ WHERE  Lecturer_User_ID=$lecturer_id and course_students_table.Status='Pending'" | |||
|                         <input type="hidden" name="frm_createCourse" value="true" required="" /> | ||||
|                         <input type="hidden" name="l" value="l" required="" /> | ||||
|                         Course Name | ||||
|                     <input type="text" name="name" placeholder="Course Name" class="form-control" required="" id="course_name"> | ||||
|                         <input type="text" name="name" placeholder="Course Name" class="form-control" required=""> | ||||
| 
 | ||||
|                         Course Code | ||||
|                     <input type="text" name="code" placeholder="Course Code" class="form-control" required="" id="course_code"> | ||||
|                         <input type="text" name="code" placeholder="Course Code" class="form-control" required=""> | ||||
| 
 | ||||
|                         URL (Leave blank to use Course Code & Year) | ||||
|                         <input type="text" name="url" placeholder="Choose Custom URL " class="form-control"> | ||||
| 
 | ||||
|                         Academic Year | ||||
|                     <input type="text" name="academic" placeholder="Academic Year" class="form-control" required="" id="academic_year"> | ||||
|                         <input type="text" name="academic" placeholder="Academic Year" class="form-control" required=""> | ||||
| 
 | ||||
|                         Faculty <br> | ||||
|                     <input type="text" name="faculty" placeholder="Faculty" class="form-control" required="" id="faculty"> | ||||
|                         <input type="text" name="faculty" placeholder="Faculty" class="form-control" required=""> | ||||
| 
 | ||||
|                         <input type="hidden" name="lecturer" value="<?php echo $_SESSION['user_id'];  ?>"> | ||||
| 
 | ||||
|                         Verify Joining Students | ||||
|                     <input type="radio" name="verify" value="1" id="join_yes"> Yes | ||||
|                     <input type="radio" name="verify" value="0" checked="" id="join_no"> No | ||||
|                         <input type="radio" name="verify" value="1"> Yes | ||||
|                         <input type="radio" name="verify" value="0" checked=""> No | ||||
| 
 | ||||
|                         <br> | ||||
|                     <input type="submit" class="btn btn-primary" value="Create Portal" id="portal_btn"><br> | ||||
|                         <input type="submit" class="btn btn-primary" value="Create Portal"><br> | ||||
| 
 | ||||
|                     </form> | ||||
| 
 | ||||
|  | @ -463,30 +486,69 @@ WHERE  Lecturer_User_ID=$lecturer_id and course_students_table.Status='Pending'" | |||
|             <!--   END LECTURER   --> | ||||
| 
 | ||||
|             <?php | ||||
| } | ||||
|         } | ||||
| 
 | ||||
| if ($_SESSION['user_type'] == "Student") { | ||||
|         if ($_SESSION['user_type'] == "Student") { | ||||
|             ?>
 | ||||
| 
 | ||||
|             <!--STUDENT CODE--> | ||||
|         <div class="row" style="width:80%;margin:auto; text-align:left;"> | ||||
|             <div class="row"> | ||||
|                 <div class='col-md-1'></div>  | ||||
|                 <div class="col-md-6"> | ||||
|                     <br> Course Portal > Students <br> | ||||
|                     <?php | ||||
| 
 | ||||
|                     error_reporting(0); | ||||
|                     if (isset($_SESSION['info_Courses_student'])) { | ||||
|                     echo '<hr><span class="alert alert-success" role="alert">' . $_SESSION['info_Courses_student'] . '</span>'; | ||||
|                         echo '<hr><p class="alert alert-success" role="alert">' . $_SESSION['info_Courses_student'] . '</p>'; | ||||
|                         $_SESSION['info_Courses_student'] = null; | ||||
|                     } | ||||
|                     ?>
 | ||||
|                     <br><br> | ||||
|                 </div> | ||||
|             <div class="col-md-6"></div> | ||||
|                 <div class="col-md-5"></div> | ||||
|             </div>  | ||||
| 
 | ||||
|             <div class="p-4 my-4 bg-purple rounded shadow-sm">  | ||||
|       | ||||
|                 <div class="col-md-12"> | ||||
|                 <?php | ||||
|                     echo " 
 | ||||
| 
 | ||||
|                     <form method='get' action='Courses.php'> | ||||
|   | ||||
|                     <div class='form-row'> | ||||
|                         <div class='form-group col-md-6'> | ||||
|                             <input type='text' class='form-control' name='search'  aria-label='Enter Course Code' placeholder='Enter Course Code'> | ||||
|                         </div> | ||||
|                         <div class='form-group col-md-4'>  | ||||
|                             <select name='faculty' class='form-control' aria-label='Search by'><option selected value='' >Search by Faculty</option>";
 | ||||
|                             $result = mysqli_query($con, "SELECT   DISTINCT(Faculty) as Faculty FROM `courses_table`"); | ||||
|                             if (mysqli_num_rows($result) == 0) { | ||||
|                             } else { | ||||
|                                 while ($row = mysqli_fetch_assoc($result)) { | ||||
|                                     $fname = $row['Faculty']; | ||||
| 
 | ||||
|                                     echo "<option value='$fname'>Faculty $fname </option>"; | ||||
|                                 } | ||||
|                             } | ||||
| 
 | ||||
|                             echo "</select>
 | ||||
|                         </div> | ||||
| 
 | ||||
| 
 | ||||
|                         <div class='form-group col-md-2'> | ||||
|                             <button class='btn btn-primary' type='submit' >Find</button>  | ||||
|                         </div>   | ||||
| 
 | ||||
|                     </div>  | ||||
|                     </form>";
 | ||||
|                 } | ||||
| 
 | ||||
|                 ?>
 | ||||
|                 </div> | ||||
|             </div> | ||||
|    | ||||
|         <div class="row" style="width:80%;margin:auto; text-align:left;"> | ||||
|             <div class="col-md-6"> | ||||
|   | ||||
|                     <?php | ||||
|                     error_reporting(0); | ||||
|  | @ -496,21 +558,24 @@ if ($_SESSION['user_type'] == "Student") { | |||
|                         $faculty = $_GET["faculty"]; | ||||
| 
 | ||||
|                         if ($faculty == "") { | ||||
|                     echo "<h4> Search Results for Course Code $search</h4><hr>"; | ||||
|                             echo "<div class='my-3 p-3 bg-body rounded shadow-sm'>  <div class='row' >    <div class='col-md-12'> "; | ||||
|                             echo "<h4 class='border-bottom pb-2 mb-0'> Search Results for Course Code $search</h4>"; | ||||
|                             $result = mysqli_query($con, "SELECT `Course_ID`, `Course_Name`, `Academic_Year`, `Faculty`," | ||||
|                                 . " `Lecturer_User_ID`, `TA_User_ID`, `Course_Code`, `URL`, `Verify_New_Members`  " | ||||
|                                 . " , users_table.Full_Name  FROM `courses_table` INNER JOIN users_table" | ||||
|                                 . " ON users_table.User_ID=courses_table.Lecturer_User_ID where Course_Code like '%{$search}%' and courses_table.Course_ID not in (select course_id from course_students_table where Student_ID=$student_id)"); | ||||
|                         } else { | ||||
|                     echo "<h3> Find Courses under faculty $faculty</h3>"; | ||||
|                             echo "<div class='my-3 p-3 bg-body rounded shadow-sm'>  <div class='row' >    <div class='col-md-12'> "; | ||||
|                             echo "<h3 class='border-bottom pb-2 mb-0'> Find Courses under faculty $faculty</h3>"; | ||||
|                             $result = mysqli_query($con, "SELECT `Course_ID`, `Course_Name`, `Academic_Year`, `Faculty`,
 | ||||
|                              `Lecturer_User_ID`, `TA_User_ID`, `Course_Code`, `URL`, `Verify_New_Members`  | ||||
|                              , users_table.Full_Name  FROM `courses_table` INNER JOIN users_table | ||||
|                              ON users_table.User_ID=courses_table.Lecturer_User_ID where Faculty='$faculty'  and courses_table.Course_ID not in (select course_id from course_students_table where Student_ID=$student_id)");
 | ||||
|                         } | ||||
| 
 | ||||
|                echo "<div class='row row-cols-1 row-cols-sm-2 row-cols-md-3 g-3'>"; | ||||
|                         if (mysqli_num_rows($result) == 0) { | ||||
|                     echo "No results found for your Search <hr>"; | ||||
|                             echo "<h5>No results found for your Search <h5><hr>"; | ||||
|                         } else { | ||||
| 
 | ||||
|                             while ($row = mysqli_fetch_assoc($result)) { | ||||
|  | @ -528,25 +593,52 @@ if ($_SESSION['user_type'] == "Student") { | |||
|                                     $msg2 = "Send Joining Request"; | ||||
|                                 } | ||||
| 
 | ||||
|                         echo "<div class='btn btn-default' style='word-wrap:break-word'>
 | ||||
|   [$code] $name <br>($url) <br>  <a href='~\..\Script.php?JoinCourse=y&id=$id&std=$student_id&joining=$v' class='btn-sm btn-success' onclick=return confirm(\"Are you sure to join this course?\")' id='join_btn'> $msg2 </a>
 | ||||
|    <br> <span style='font-size:10pt'>Faculty: $faculty | Year: $academic | Lecturer: $lecturer </span><br>$msg</div> | ||||
|                         ";
 | ||||
|                     } | ||||
|                                  echo "<div class='col'> 
 | ||||
|                                         <div class='card'>   | ||||
|                                             <div class='card-header'> | ||||
|                                                 <ul class='nav nav-pills card-header-pills'> | ||||
|                                                   <li class='nav-item'> | ||||
|                                                     <h5 class='nav-link'> $name </h5> | ||||
|                                                   </li> | ||||
|                                                   <li class='nav-item'> | ||||
|                                                     <p class='nav-link'>$msg</p> | ||||
|                                                   </li>  | ||||
|                                                 </ul>  | ||||
|                                             </div> | ||||
|                                             <div class='card-body'> | ||||
|                                               <h5 class='card-title'>$code</h5>  | ||||
|                                               <p class='card-text'> $academic</p> | ||||
|                                               <p class='card-text'>$faculty</p> | ||||
|                                               <p class='card-text'>$lecturer</p> | ||||
|                                               <a href='~\..\Script.php?JoinCourse=y&id=$id&std=$student_id&joining=$v' onclick=return confirm(\"Are you sure to join this course?\")' class='btn btn-success'>Open</a>
 | ||||
|                                             </div> | ||||
|                                         </div> | ||||
|                                       </div>";
 | ||||
|   | ||||
|                             } | ||||
|                         } | ||||
| 
 | ||||
|             echo "<h4> My Courses </h4>"; | ||||
|                echo "</div>"; | ||||
|                     } | ||||
|                     ?>
 | ||||
| </div> | ||||
| </div> | ||||
| </div> | ||||
| 
 | ||||
| <div class="my-3 p-3 bg-body rounded shadow-sm"> | ||||
|     <h4 class="border-bottom pb-2 mb-0"> My Courses </h4> | ||||
|         <div class="row row-cols-1 row-cols-sm-2 row-cols-md-3 g-3">  | ||||
|                     <?php  | ||||
|                     $result = mysqli_query($con, "SELECT users_table.Full_Name, course_students_table.Status, courses_table.Course_ID, `Course_Name`, `Academic_Year`, `Faculty`, `Lecturer_User_ID`, `TA_User_ID`, `Course_Code`, `URL`, `Verify_New_Members` FROM `courses_table`
 | ||||
| INNER JOIN users_table | ||||
|                         INNER JOIN users_table | ||||
|                         ON users_table.User_ID=courses_table.Lecturer_User_ID | ||||
| 
 | ||||
| INNER JOIN course_students_table on course_students_table.Course_ID=courses_table.Course_ID | ||||
|                         INNER JOIN course_students_table on course_students_table.Course_ID=courses_table.Course_ID | ||||
| 
 | ||||
|                         where course_students_table.Student_ID=$student_id");
 | ||||
| 
 | ||||
|                     if (mysqli_num_rows($result) == 0) { | ||||
|                 echo "<i class='fa fa-exclamation-circle'></i> You are not Enrolled in any Course"; | ||||
|                         echo "<h4><i class='fa fa-exclamation-circle'></i> You are not Enrolled in any Course</h4>"; | ||||
|                     } else { | ||||
|                         while ($row = mysqli_fetch_assoc($result)) { | ||||
|                             $name = $row['Course_Name']; | ||||
|  | @ -558,59 +650,62 @@ INNER JOIN course_students_table on course_students_table.Course_ID=courses_tabl | |||
|                             $id = $row['Course_ID']; | ||||
|                             $Status = $row['Status']; | ||||
| 
 | ||||
|                     ?>
 | ||||
|            | ||||
|              <?php  | ||||
|                             if ($Status == "Joined") { | ||||
|                         echo "<a href='~\..\Course.php?url=$url'>   <div class='btn btn-default' style='word-wrap:break-word'>
 | ||||
|   ($code) - $name <br>($url)           <i class='fa fa-check-circle'></i> $Status        <a href='~\..\Course.php?url=$url' class='btn-sm btn-primary'> Open</a> | ||||
|    <br> <span style='font-size:8pt'>Faculty : $faculty  Year :   $academic  Lecturer  :$lecturer </span></div></a> | ||||
|                         ";
 | ||||
|                     } else { | ||||
|                         echo "<div class='btn btn-default'>
 | ||||
|   ($code) - $name  <i class='btn-sm btn-danger'> $Status</i> | ||||
|    <br> <span style='font-size:8pt'>Faculty : $faculty  Year :   $academic  Lecturer  :$lecturer </span></div> | ||||
|                         ";
 | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
| 
 | ||||
|             echo "</div><div class='col-md-6'>
 | ||||
|      | ||||
|         <form method='get' action='Courses.php'> | ||||
|             <div class='row'>  | ||||
|             <div class='col-md-10'>  | ||||
|             <div class='row'><div class='col-md-6'> Find course by Code | ||||
|             <input  type='text' class='form-control' name='search' placeholder='Enter Course Code' id='search_field'> | ||||
|             </div><div class='col-md-6'> | ||||
| List courses by faculty | ||||
| 
 | ||||
| <select name='faculty' class='form-control'>";
 | ||||
|             $result = mysqli_query($con, "SELECT   DISTINCT(Faculty) as Faculty FROM `courses_table`"); | ||||
|             if (mysqli_num_rows($result) == 0) { | ||||
|             } else { | ||||
|                 while ($row = mysqli_fetch_assoc($result)) { | ||||
|                     $fname = $row['Faculty']; | ||||
| 
 | ||||
|                     echo "<option value=''> Search by faculty </option> <option value='$fname'> $fname </option>"; | ||||
|                 } | ||||
|             } | ||||
| 
 | ||||
|             echo "</select></div></div>
 | ||||
| 
 | ||||
| </div> | ||||
|                  <div class='col-md-1'> <br> | ||||
|             <input type='submit' class='btn btn-primary' value='Find' id='find_btn'> | ||||
|                                 echo "<div class='col'> 
 | ||||
|                                         <div class='card'>   | ||||
|                                             <div class='card-header'> | ||||
|                                                 <ul class='nav nav-pills card-header-pills'> | ||||
|                                                   <li class='nav-item'> | ||||
|                                                     <h5 class='nav-link'> $name </h5> | ||||
|                                                   </li> | ||||
|                                                   <li class='nav-item'> | ||||
|                                                     <p class='nav-link bg-success'><i class='fa fa-check-circle'></i> $Status</p> | ||||
|                                                   </li>  | ||||
|                                                 </ul>  | ||||
|                                             </div> | ||||
|         | ||||
|                                             <div class='card-body'> | ||||
|                                               <h5 class='card-title'>$code</h5>  | ||||
|                                               <p class='card-text'> $academic</p> | ||||
|                                               <p class='card-text'>$faculty</p> | ||||
|                                               <p class='card-text'>$lecturer</p> | ||||
|                                               <a href='~\..\Course.php?url=$url' class='btn btn-primary'>Open</a> | ||||
|                                             </div> | ||||
|         </form> | ||||
|                                             </div> | ||||
|                                       </div>";
 | ||||
|                             } else {  | ||||
| 
 | ||||
|     </div></div>";
 | ||||
|                                echo "<div class='col'> 
 | ||||
|                                         <div class='card'>   | ||||
|                                             <div class='card-header'> | ||||
|                                                 <ul class='nav nav-pills card-header-pills'> | ||||
|                                                   <li class='nav-item'> | ||||
|                                                     <h5 class='nav-link'> $name </h5> | ||||
|                                                   </li> | ||||
|                                                   <li class='nav-item'> | ||||
|                                                     <p class='nav-link btn-danger'><i class='fa fa-check-circle'></i> $Status</p> | ||||
|                                                   </li>  | ||||
|                                                 </ul>  | ||||
|                                             </div> | ||||
|                                             <div class='card-body'> | ||||
|                                               <h5 class='card-title'>$code</h5>  | ||||
|                                               <p class='card-text'> $academic</p> | ||||
|                                               <p class='card-text'>$faculty</p> | ||||
|                                               <p class='card-text'>$lecturer</p>  | ||||
|                                             </div> | ||||
|                                         </div> | ||||
|                                       </div>";
 | ||||
|   | ||||
|                             } | ||||
|                         } | ||||
|                     } | ||||
| 
 | ||||
|                     ?>
 | ||||
|         </div> | ||||
|     </div> | ||||
| </div> | ||||
|    | ||||
|             <style> | ||||
|                 .form-control { | ||||
|                     padding-top: 1px; | ||||
|                     padding-bottom: 1px; | ||||
|                 } | ||||
|             </style> | ||||
| 
 | ||||
| </main> | ||||
							
								
								
									
										11
									
								
								Footer.php
								
								
								
								
							
							
						
						
									
										11
									
								
								Footer.php
								
								
								
								
							|  | @ -1,4 +1,9 @@ | |||
| <br><br><br><br><br><br><br><br><br> | ||||
| <div style="background-color:white;width:100%di"> | ||||
|   | ||||
| </div> | ||||
|  <footer class="footer bg-primary"> | ||||
|       <div class="container text-light">  | ||||
|         <p >LRR was originally developed as a <a href="http://lanlab.org/course/2018f/se/homepage.html" style="color:white;">Software engineering course project</a> by Mohamed Nor and Elmahdi Houzi.  Please submit your suggestions or bug reports to  lanhui _at_ zjnu.edu.cn.  Last updated on 18/04/2020 by Ashly. <a href="./homepage" style="color:white;">More information ...</a></p>  | ||||
|       <small>© 2018 Copyright: <a href="http://lanlab.org/">lanlab.org</a></small> | ||||
|       </div> | ||||
|     </footer> | ||||
|    | ||||
|   | ||||
|  |  | |||
							
								
								
									
										211
									
								
								Header.php
								
								
								
								
							
							
						
						
									
										211
									
								
								Header.php
								
								
								
								
							|  | @ -19,137 +19,37 @@ if (mysqli_connect_errno()) { | |||
| 
 | ||||
| <head> | ||||
|   | ||||
|   <link href="./css/bootstrap.min.css" rel="stylesheet" type="text/css" /> | ||||
|   <link href="./font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css" /> | ||||
|   <link href="./css/bootstrap.min.css" rel="stylesheet" type="text/css" /> | ||||
|   <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/> | ||||
|   <link href="./font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css" /><!-- Font-awesome CSS --> | ||||
|   <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous"><!-- Bootstrap CSS --> | ||||
| 
 | ||||
|   <link href="./css/Styles.css" rel="stylesheet" type="text/css" /> | ||||
| 
 | ||||
|   <script src="./css/jquery.min.js" type="text/javascript"></script> | ||||
|   <script src="./css/bootsrap.min.js" type="text/javascript"></script> | ||||
|   <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script> | ||||
|     <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script> | ||||
|     <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script> | ||||
|    | ||||
|   <script src="./css/jquery.datetimepicker.min.js" type="text/javascript"></script> | ||||
| 
 | ||||
| </head> | ||||
| 
 | ||||
| <body> | ||||
| 
 | ||||
|   <nav class="navbar navbar-expand-lg navbar-dark bg-dark" style="padding-left:150px;padding-right:150px;margin:auto;"> | ||||
|     <a class="navbar-brand" href="~\..\index.php"> <img src="logo.png" style="width:30px;height:30px;"> LRR </a> | ||||
|     <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarColor02" aria-controls="navbarColor02" aria-expanded="false" aria-label="Toggle navigation"> | ||||
|       <span class="navbar-toggler-icon"></span> | ||||
|     </button> | ||||
| 
 | ||||
|     <div class="collapse navbar-collapse" id="navbarColor02"> | ||||
|       <ul class="navbar-nav mr-auto"> | ||||
|         <li class="nav-item active"> | ||||
| 
 | ||||
|         <li class="nav-item active"> | ||||
|           <!-- <a class='nav-link' href='~\..\Visitors.php'>     <i class='fa fa-globe'></i>  Visitor Portal <span class='sr-only'>(current)</span></a> --> | ||||
|         </li> | ||||
|         <?php | ||||
|         if (isset($_SESSION["user_fullname"])) { | ||||
| 
 | ||||
|           echo "       <a class='nav-link' href='~\..\Courses.php'><i class='fa fa-book'></i> Courses <span class='sr-only'>(current)</span></a>"; | ||||
|         ?>
 | ||||
|           </li> | ||||
|       </ul> | ||||
|       <form class="form-inline my-2 my-lg-0" style="color:#fff;"> | ||||
|         Welcome   <b> <?php echo $_SESSION['user_fullname']; ?> </b>  
 | ||||
| 
 | ||||
|         <?php | ||||
|           $c_date =  date("Y-m-d H:i"); | ||||
|           if (isset($_SESSION['user_student_id'])) | ||||
|             echo "(" . $_SESSION['user_type'] . " - " . $_SESSION['user_student_id'] . ")   "; | ||||
|           else | ||||
|             echo "(" . $_SESSION['user_type'] . ")   "; | ||||
|         ?>
 | ||||
| 
 | ||||
|         <?php | ||||
|           if ($_SESSION['user_type'] == "Lecturer") { | ||||
|             echo  "     <i class=\"fa fa-cog\" style=\"color:#fff;\"> </i>  <a style='color:#fff !important' href=\"~\..\Admin.php\" id=\"admin_tab\">Admin </a>"; | ||||
|           } | ||||
|         ?>
 | ||||
| 
 | ||||
|             <i class="fa fa-user" style="color:#fff;"> </i> | ||||
|          <a href="#" style='color:#fff !important' onclick="updatePass(<?php echo $_SESSION['user_id']; ?>)">Update password</a> | ||||
|             <i class="fa fa-lock" style="color:#fff;"> </i>  <a style='color:#fff !important' href="~\..\logout.php">Logout </a> | ||||
| 
 | ||||
|       <?php | ||||
|         } | ||||
|       ?>
 | ||||
|       </form> | ||||
|     </div> | ||||
|   </nav> | ||||
|   <script src="./js/CustomDropdown.js" type="text/javascript"></script> | ||||
|   | ||||
|     <style> | ||||
|     .nav-item { | ||||
|       border-color: #00ff66;
 | ||||
|       .bd-placeholder-img { | ||||
|         font-size: 1.125rem; | ||||
|         text-anchor: middle; | ||||
|         -webkit-user-select: none; | ||||
|         -moz-user-select: none; | ||||
|         user-select: none; | ||||
|       } | ||||
| 
 | ||||
|     .nav-tabs { | ||||
|       border-color: #00ff66;
 | ||||
|       /*Rule to include a block of CSS properties only if a certain condition is true.*/ | ||||
|       /*https://www.w3schools.com/css/css_rwd_mediaqueries.asp*/ | ||||
|       @media (min-width: 768px) { | ||||
|         .bd-placeholder-img-lg { | ||||
|           font-size: 3.5rem; | ||||
|         } | ||||
| 
 | ||||
|     .btn-default { | ||||
|       border: 2px solid #00ff66;
 | ||||
|       width: 100%; | ||||
|       text-align: left; | ||||
|       margin: 3px auto; | ||||
|       font-weight: bold; | ||||
|       font-size: 13pt; | ||||
|     } | ||||
| 
 | ||||
|     .table-bordered { | ||||
|       padding: 5px !important; | ||||
|     } | ||||
| 
 | ||||
|     .alert { | ||||
|       font-weight: bold; | ||||
|     } | ||||
| 
 | ||||
|     h1, | ||||
|     h2, | ||||
|     h3, | ||||
|     h4 { | ||||
|       color: #03407B;
 | ||||
|     } | ||||
| 
 | ||||
|     a { | ||||
|       color: #03407B;
 | ||||
|     } | ||||
| 
 | ||||
|     .break-word { | ||||
|       word-wrap: break-word; | ||||
|       white-space: -moz-pre-wrap !important; | ||||
|       /* Mozilla, since 1999 */ | ||||
|       white-space: -pre-wrap; | ||||
|       /* Opera 4-6 */ | ||||
|       white-space: -o-pre-wrap; | ||||
|       /* Opera 7 */ | ||||
|       white-space: pre-wrap; | ||||
|       /* css-3 */ | ||||
|       word-wrap: break-word; | ||||
|       /* Internet Explorer 5.5+ */ | ||||
|       white-space: -webkit-pre-wrap; | ||||
|       /* Newer versions of Chrome/Safari*/ | ||||
|       word-break: break-all; | ||||
|       white-space: normal; | ||||
|     } | ||||
| 
 | ||||
|     .ui-widget-content.ui-dialog { | ||||
|       border: 2px solid #03488B;
 | ||||
| 
 | ||||
|     } | ||||
| 
 | ||||
|     .ui-dialog>.ui-widget-header { | ||||
|       background: #03488B;
 | ||||
|       color: white | ||||
|     } | ||||
| 
 | ||||
|     .ui-button { | ||||
|       background: #03488B;
 | ||||
|       color: white | ||||
|       } | ||||
|     </style> | ||||
| 
 | ||||
|   <script> | ||||
|     function updatePass(id) { | ||||
| 
 | ||||
|  | @ -169,3 +69,72 @@ if (mysqli_connect_errno()) { | |||
|       window.location.href = "\Script.php\?action=statuschange&uid=" + id + "&status=" + status; | ||||
|     } | ||||
|   </script> | ||||
| </head> | ||||
| 
 | ||||
| <body> | ||||
| 
 | ||||
|   | ||||
| <nav class="navbar navbar-expand-md navbar-dark bg-primary sticky-top"> | ||||
|   <div class="container-fluid">  | ||||
|     <a class="navbar-brand" href="~\..\index.php"> <img src="logo.png" width="30" height="30"> LRR </a> | ||||
| 
 | ||||
|         <?php   | ||||
|           if (isset($_SESSION["user_fullname"]))  | ||||
|           {  | ||||
|         ?>
 | ||||
|             <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive"> | ||||
|             <span class="navbar-toggler-icon"></span> | ||||
|             </button> | ||||
| 
 | ||||
|         <?php | ||||
|           } | ||||
|         ?>
 | ||||
| 
 | ||||
|     <div class="collapse navbar-collapse" id="navbarResponsive"> | ||||
|        | ||||
|         <?php | ||||
|         if (isset($_SESSION["user_fullname"])) { | ||||
|           echo "<ul class=\"navbar-nav mr-auto\">"; | ||||
|           echo "<li class=\"nav-item active\">"; | ||||
|           echo "<a class='nav-link' href='~\..\Courses.php'><i class='fa fa-book'></i> Courses</a>"; | ||||
|           echo "</li></ul>";  | ||||
|         ?>
 | ||||
|          | ||||
|     <ul class="nav navbar-nav navbar-right"> | ||||
|         <li class="nav-item"> | ||||
|           <a class="nav-link text-light" href="#">Welcome <b> <?php echo $_SESSION['user_fullname']; ?> </b>
 | ||||
| 
 | ||||
|           <?php | ||||
|             $c_date =  date("Y-m-d H:i"); | ||||
|             if (isset($_SESSION['user_student_id'])) | ||||
|               echo "(" . $_SESSION['user_type'] . " - " . $_SESSION['user_student_id'] . ")   "; | ||||
|             else | ||||
|               echo "(" . $_SESSION['user_type'] . ")   "; | ||||
|           ?>
 | ||||
|           </a> | ||||
|         </li> | ||||
|         <li class="nav-item dropdown"> | ||||
|           <a class="nav-link dropdown-toggle text-light"  id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> Menu </a> | ||||
|           <div class="dropdown-menu" aria-labelledby="navbarDropdown"> | ||||
|             <a href="#" class="dropdown-item" onclick="updatePass(<?php echo $_SESSION['user_id']; ?>)"><i class="fa fa-user ">Update passwor</i></a> | ||||
|             | ||||
|             <?php | ||||
|                 if ($_SESSION['user_type'] == "Lecturer") { | ||||
|                   echo  "<a class=\"dropdown-item\" href=\"~\..\Admin.php\"><i class=\"fa fa-cog\" >Admin</i> </a>"; | ||||
|                 } | ||||
|               ?>  
 | ||||
|           </div> | ||||
|         </li> | ||||
|         <li class="nav-item"> | ||||
|             <a class="nav-link text-light" href="~\..\logout.php"><i class="fa fa-lock" > Logout</i> </a> | ||||
|         </li> | ||||
|       </ul> | ||||
| 
 | ||||
|       <?php | ||||
|         } | ||||
|       ?>
 | ||||
| 
 | ||||
|     </div> | ||||
| 
 | ||||
|   </div> | ||||
| </nav>  | ||||
|  | @ -0,0 +1,15 @@ | |||
| /* Sticky footer styles | ||||
| -------------------------------------------------- */ | ||||
| html { | ||||
|   position: relative; | ||||
|   min-height: 100%; | ||||
| } | ||||
| body { | ||||
|   margin-bottom: 100px; /* Margin bottom by footer height */ | ||||
| } | ||||
| .footer { | ||||
|   position: absolute; | ||||
|   bottom: 0; | ||||
|   width: 100%; | ||||
|   height: 100px; /* Set the fixed height of the footer here */  | ||||
| } | ||||
							
								
								
									
										109
									
								
								index.php
								
								
								
								
							
							
						
						
									
										109
									
								
								index.php
								
								
								
								
							|  | @ -1,7 +1,7 @@ | |||
| <?php | ||||
|   $page='Home'; | ||||
|   require 'Header.php'; | ||||
|   session_start(); | ||||
| $page='Home'; | ||||
| require 'Header.php'; | ||||
| session_start(); | ||||
| ?>
 | ||||
| 
 | ||||
| <?php | ||||
|  | @ -10,42 +10,40 @@ if (isset($_SESSION["user_fullname"])) { | |||
|     header("Location: Courses.php"); | ||||
| } | ||||
| ?>
 | ||||
| <div class="album py-5 bg-white"> | ||||
|         <div class="container bg-white"> | ||||
| 
 | ||||
| <br><br><br> | ||||
|           <div class="row align-items-center">  | ||||
| 
 | ||||
| <div class="row" style="width:85%;margin:auto;"> | ||||
|   <div class="col-md-4"> | ||||
|     <br><br> | ||||
|     <img src="logo.png" style="width:40%; position:relative; right:-95px; top:1px;"> | ||||
|     <br><br> | ||||
|     <div style="width:20%; position:relative; right:-90px; font-family: Poppins-Regular;"> | ||||
|     <h1>Lab Report Repository</h1> | ||||
|     <br><br> | ||||
|             <div class="col-md-6"> | ||||
|               <div class="mb-6 box-shadow"> | ||||
|                  <img class="mx-auto d-block" src="logo.png" />   | ||||
|                 <div class="card-body"> | ||||
|                   <h1 style="font-family: Poppins-Regular;">Lab Report Repository</h1> | ||||
|                 </div> | ||||
|               </div> | ||||
|     <br> | ||||
|     <div style = "position:relative; left:240px; top:-2px;"> | ||||
|             </div>  | ||||
| 
 | ||||
|             <div class="col-md-6"> | ||||
|               <div class="card mb-6 box-shadow"> | ||||
|                     <div class="card-header bg-primary" >   | ||||
|                         <h4 class="list-group-item active" style="font-weight:normal;font-family: Poppins-Regular;"> Sign in </h4> | ||||
|     <div class="list-group-item"> | ||||
| 
 | ||||
|     <div class="panel-body"> | ||||
| 
 | ||||
|                     </div>  | ||||
|                  <div class="card-body"> | ||||
|                    <form  method="post" action="Script.php" name="frm_login"> | ||||
|                     <input type="hidden" name="frm_login" value="true"/> | ||||
|     Student ID / Instructor Email | ||||
|     <input type="text" name="user" placeholder="Email / Student Number" class="form-control" required="required" id="user_name" /> | ||||
|                     <p>Student ID / Instructor Email</p> | ||||
|                     <input type="text" name="user" placeholder="Email / Student Number" class="form-control" required="required" /> | ||||
|                     <br> | ||||
|     Password | ||||
|     <input type="password" class="form-control"  name="password" placeholder="password" required="required" id="user_password" /> | ||||
|                     <p>Password</p> | ||||
|                     <input type="password" class="form-control"  name="password" placeholder="Password" required="required" /> | ||||
|                     <div class="text-center"> | ||||
|     <br><input type="submit" class="btn-primary" value="Login" id="login_btn"> | ||||
|                         <br><input type="submit" class="btn btn-primary my-2 btn-lg btn-block" value="Login"> | ||||
|                     </div> | ||||
|     <br> <a href="recover_password.php" style="font-weight:normal;color:#2471A3; font-family: Poppins-Regular;
 | ||||
|     font-size: 17px;">Reset my password</a>
 | ||||
|                     <br> <a href="recover_password.php">Reset my password</a> | ||||
|                     <div class="text-center"> | ||||
|     <br><span class="txt1">Don't have an account?</span> | ||||
|          <a class="txt2" href="signup.php" style="font-weight:normal" id="signup_link">Sign Up</a> | ||||
|         </a> | ||||
|                         <br><span >Don't have an account?</span> | ||||
|                         <a href="signup.php" >Sign Up</a>  | ||||
|                     </div>  | ||||
| 
 | ||||
|             <?php  | ||||
|  | @ -71,58 +69,19 @@ if (isset($_SESSION["user_fullname"])) { | |||
|             } | ||||
|             ?>
 | ||||
|   | ||||
|     </div> | ||||
|                 </form> | ||||
|                 </div> | ||||
| </div> | ||||
| </div> | ||||
| </div> | ||||
| 
 | ||||
| </div> | ||||
| 
 | ||||
| 
 | ||||
| <div id="footer"> | ||||
|     LRR was originally developed as a <a href="http://lanlab.org/course/2018f/se/homepage.html" style="color:white;">software engineering course project</a> by Mohamed Nor and Elmahdi Houzi.  Please submit your suggestions or bug reports to  lanhui _at_ zjnu.edu.cn.  Last updated on 18/04/2020 by Ashly. <a href="./homepage" style="color:white;">More information ...</a> | ||||
|               </div> | ||||
|             </div>  | ||||
|           </div> | ||||
|         </div> | ||||
|       </div> | ||||
| 
 | ||||
| <?php  | ||||
| require 'Footer.php';  | ||||
| ?>
 | ||||
| 
 | ||||
| </body> | ||||
| 
 | ||||
| <style> | ||||
|     /*------------------------------------------------------------------ | ||||
| [ Login Button ]*/ | ||||
| .btn-primary { | ||||
|             color: white; | ||||
|             border-radius: 5px; | ||||
|             text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); | ||||
|             background: rgb(75, 184, 240); | ||||
|             padding:5px 100px; | ||||
|             font-family: Poppins-Regular; | ||||
|             font-size: 23px; | ||||
|             line-height: 1.5; | ||||
|         } | ||||
| 
 | ||||
| #footer{
 | ||||
| position:fixed; | ||||
| bottom:0; | ||||
| left:0; | ||||
| background-color:#03417C;
 | ||||
| color:#FFF;
 | ||||
| text-align:center; | ||||
| width:100%; | ||||
| } | ||||
| .txt1 { | ||||
|   font-family: Poppins-Regular; | ||||
|   font-size: 18px; | ||||
|   line-height: 1.5; | ||||
|   color: #666666;
 | ||||
| } | ||||
| .txt2 { | ||||
|   font-family: Poppins-Regular; | ||||
|   font-size: 19px; | ||||
|   line-height: 1.5; | ||||
|   color: #2471A3;
 | ||||
| } | ||||
| 
 | ||||
| </style> | ||||
| 
 | ||||
| </html> | ||||
|  |  | |||
|  | @ -0,0 +1,9 @@ | |||
| $(document).ready(function(e){ | ||||
|     $('.search-panel .dropdown-menu').find('a').click(function(e) { | ||||
| 		e.preventDefault(); | ||||
| 		var param = $(this).attr("href").replace("#",""); | ||||
| 		var concept = $(this).text(); | ||||
| 		$('.search-panel span#search_concept').text(concept); | ||||
| 		$('.input-group #search_param').val(param); | ||||
| 	}); | ||||
| }); | ||||
							
								
								
									
										48
									
								
								signup.php
								
								
								
								
							
							
						
						
									
										48
									
								
								signup.php
								
								
								
								
							|  | @ -6,35 +6,37 @@ include 'NoDirectPhpAcess.php'; | |||
| include 'Header.php'; | ||||
| ?>
 | ||||
| 
 | ||||
| <div class="row"> | ||||
| <div class="album py-5 bg-white"> | ||||
|     <div class="container bg-white"> | ||||
|   | ||||
|     <div class="col-md-4 list-group" style="margin:auto;"> | ||||
|     <div class="col-md-6 panel panel-primary" > | ||||
| 
 | ||||
|         <br> | ||||
| 
 | ||||
|         <h4 class="list-group-item active"> Please fill in each field below </h4> | ||||
|         <div class="list-group-item"> | ||||
| 
 | ||||
|             <div class="panel-body"> | ||||
|             <div class="panel panel-primary"> | ||||
| 
 | ||||
|                 <form method="post" action="Script.php" id="signup_form"> | ||||
|                 <form method="post" action="Script.php"> | ||||
|                     <input type="hidden" name="frm_signup_2" value="true" /> | ||||
|                     Full Name | ||||
|                     <input type="text" name="fullname" placeholder="Your full name" class="form-control" value="<?php echo $_SESSION['user_fullname']; ?>" required="required" id="full_name"/> | ||||
|                     <p>Full Name</p> | ||||
|                     <input type="text" name="fullname" placeholder="Your full name" class="form-control" value="<?php echo $_SESSION['user_fullname']; ?>" required="required" /> | ||||
| 
 | ||||
|                     Student ID | ||||
|                     <input type="text" name="user_student_id" placeholder="Entre your student ID" class="form-control" value="<?php echo $_SESSION['user_student_id']; ?>" required="required" id="student_id"> | ||||
|                     <p>Student ID</p> | ||||
|                     <input type="text" name="user_student_id" placeholder="Entre your student ID" class="form-control" value="<?php echo $_SESSION['user_student_id']; ?>" required="required"> | ||||
| 
 | ||||
|                     Email | ||||
|                     <input type="text" name="email" placeholder="Email" class="form-control" value="<?php echo $_SESSION['user_email']; ?>" required="required" id="email" /> | ||||
|                     <p>Email</p> | ||||
|                     <input type="text" name="email" placeholder="Email" class="form-control" value="<?php echo $_SESSION['user_email']; ?>" required="required" /> | ||||
| 
 | ||||
|                     Password (<i>must include uppercase and lowercase letters, digits and special characters</i>) | ||||
|                     <input type="password" class="form-control" name="password" placeholder="Enter password" required="required" id="password1" /> | ||||
|                     <p>Password (<i>must include uppercase and lowercase letters, digits and special characters</i>)</p> | ||||
|                     <input id="password" type="password" pattern="^(?=.*[A-Za-z])(?=.*\d)(?=.*[@$!%*#?&])[A-Za-z\d@$!%*#?&]{4,}$" title="Password must have at least characters that include lowercase letters, uppercase letters, numbers and sepcial characters (e.g., !?.,*^)." class="form-control" name="password" placeholder="Enter password" required="required"  onchange="if(this.checkValidity()) form.password_two.pattern = this.value;" /> | ||||
| 
 | ||||
|                     Confirm Password | ||||
|                     <input type="password" class="form-control" name="confirmpassword" placeholder="Confirm password" required="required" id="password2" /> | ||||
|                     <p>Confirm Password</p> | ||||
|                     <input id="password_two" type="password" pattern="^(?=.*[A-Za-z])(?=.*\d)(?=.*[@$!%*#?&])[A-Za-z\d@$!%*#?&]{4,}$" title="Password must have at least characters that include lowercase letters, uppercase letters, numbers and sepcial characters" class="form-control" name="confirmpassword" placeholder="Confirm password" required="required" onchange="this.setCustomValidity(this.validity.patternMismatch ? 'Please enter the same Password as above' : '');" /> | ||||
|                     <br> | ||||
|                     <input type="submit" class="btn-primary" value="Sign up" id="signup_btn"> | ||||
| 
 | ||||
|                     <input type="submit" class="btn btn-primary" value="Sign up"> | ||||
|                     <?php | ||||
|                     error_reporting(E_ALL); | ||||
|                     if (isset($_SESSION['info_signup2'])) { | ||||
|  | @ -48,17 +50,5 @@ include 'Header.php'; | |||
|         </div> | ||||
|     </div> | ||||
| </div> | ||||
| <style> | ||||
|     /*------------------------------------------------------------------ | ||||
| [ Login Button ]*/ | ||||
|     .btn-primary { | ||||
|         color: white; | ||||
|         border-radius: 5px; | ||||
|         text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); | ||||
|         background: rgb(75, 184, 240); | ||||
|         padding: 5px 105px; | ||||
|         font-family: Poppins-Regular; | ||||
|         font-size: 23px; | ||||
|         line-height: 1.5; | ||||
|     } | ||||
| </style> | ||||
| </div> | ||||
| 
 | ||||
|  |  | |||
|  | @ -32,12 +32,12 @@ class Admin(Actor): | |||
| 
 | ||||
| 			#Locate "Admin" tab. | ||||
| 			wait = WebDriverWait(driver, 10) | ||||
| 			admin = wait.until(EC.presence_of_element_located((By.ID, "admin_tab"))) | ||||
| 			admin = wait.until(EC.presence_of_element_located((By.XPATH, "/html/body/nav/div/form/a[1]"))) | ||||
| 			admin.click() | ||||
| 
 | ||||
| 			#Locate "Create Lecturer/TA account" form | ||||
| 			wait2 = WebDriverWait(driver, 10) | ||||
| 			new_account_form = wait2.until(EC.presence_of_element_located((By.ID, "create_account_form"))) | ||||
| 			new_account_form = wait2.until(EC.presence_of_element_located((By.ID, "frm_create_acc"))) | ||||
| 
 | ||||
| 			#Fill in the form fields | ||||
| 			name_field = new_account_form.find_element(By.XPATH, "//input[@name='fullname']") | ||||
|  | @ -53,13 +53,13 @@ class Admin(Actor): | |||
| 
 | ||||
| 			#If "Lecturer" is specified in type parameter, select Lecturer account type, else use default | ||||
| 			if type == "Lecturer": | ||||
| 				type_radio = new_account_form.find_element(By.ID, "role_lecturer") | ||||
| 				type_radio = new_account_form.find_element(By.XPATH, "//input[@value='Lecturer']") | ||||
| 			else: | ||||
| 				type_radio = new_account_form.find_element(By.ID, "role_TA") | ||||
| 				type_radio = new_account_form.find_element(By.XPATH, "//input[@value='TA']") | ||||
| 
 | ||||
| 			type_radio.click() | ||||
| 
 | ||||
| 			submit_btn = new_account_form.find_element(By.ID, "create_btn") | ||||
| 			submit_btn = new_account_form.find_element(By.XPATH, "//input[@type='submit'][@value='Create']") | ||||
| 			submit_btn.click() | ||||
| 
 | ||||
| 			return 0 | ||||
|  | @ -92,23 +92,23 @@ class Admin(Actor): | |||
| 
 | ||||
| 			#Locate the "Admin" tab. | ||||
| 			wait = WebDriverWait(driver, 10) | ||||
| 			admin = wait.until(EC.presence_of_element_located((By.ID, "admin_tab"))) | ||||
| 			admin = wait.until(EC.presence_of_element_located((By.XPATH, "/html/body/nav/div/form/a[1]"))) | ||||
| 			admin.click() | ||||
| 
 | ||||
| 			#Navigate to "Batch create form" | ||||
| 			wait2 = WebDriverWait(driver, 10) | ||||
| 			batch_tab = wait2.until(EC.presence_of_element_located((By.ID, "batch_tab"))) | ||||
| 			batch_tab = wait2.until(EC.presence_of_element_located((By.XPATH, "/html/body/div[2]/div[1]/div/ul/li[2]/a"))) | ||||
| 			batch_tab.click() | ||||
| 
 | ||||
| 			#Fill in the form | ||||
| 			wait3 = WebDriverWait(driver, 10) | ||||
| 			batch_form = wait3.until(EC.presence_of_element_located((By.ID, "batch_form"))) | ||||
| 			batch_form = wait3.until(EC.presence_of_element_located((By.ID, "frm_batch_acc"))) | ||||
| 			 | ||||
| 			text_area = batch_form.find_element(By.XPATH, "//textarea[@name='users']") | ||||
| 			for i in range(len(lst)): | ||||
| 				text_area.send_keys(lst[i]+" ") | ||||
| 
 | ||||
| 			submit_btn = batch_form.find_element(By.ID, "register_btn") | ||||
| 			submit_btn = batch_form.find_element(By.XPATH, "//input[@type='submit'][@value='Create All']") | ||||
| 			submit_btn.click() | ||||
| 
 | ||||
| 		except: | ||||
|  | @ -139,22 +139,22 @@ class Admin(Actor): | |||
| 
 | ||||
| 			#Locate the "Admin" tab. | ||||
| 			wait = WebDriverWait(driver, 10) | ||||
| 			admin = wait.until(EC.presence_of_element_located((By.ID, "admin_tab"))) | ||||
| 			admin = wait.until(EC.presence_of_element_located((By.XPATH, "/html/body/nav/div/form/a[1]"))) | ||||
| 			admin.click() | ||||
| 
 | ||||
| 			#Navigate to "Exisitin Accounts" table | ||||
| 			wait2 = WebDriverWait(driver, 10) | ||||
| 			exist_acc_tab = wait2.until(EC.presence_of_element_located((By.ID, "existing_accounts_tab"))) | ||||
| 			exist_acc_tab = wait2.until(EC.presence_of_element_located((By.XPATH, "/html/body/div[2]/div[1]/div/ul/li[3]/a"))) | ||||
| 			exist_acc_tab.click()		 | ||||
| 			 | ||||
| 			#Alternate between block and activate | ||||
| 			if op == "block": | ||||
| 				#Locate first account and block it on existing account table | ||||
| 				wait3 = WebDriverWait(driver, 10) | ||||
| 				button = driver.find_element(By.ID, "block_account_1") | ||||
| 				button = driver.find_element_by_id("block_acc_1") | ||||
| 			elif op == "activate": | ||||
| 				wait3 = WebDriverWait(driver, 10) | ||||
| 				button = driver.find_element(By.ID, "activate_account_1") | ||||
| 				button = driver.find_element_by_id("activate_acc_1") | ||||
| 			 | ||||
| 			driver.execute_script("arguments[0].click();", button) | ||||
| 
 | ||||
|  |  | |||
|  | @ -60,25 +60,26 @@ class Instructor(Actor): | |||
| 
 | ||||
| 			#wait until the lab submission form shows up | ||||
| 			wait2 = WebDriverWait(driver, 10) | ||||
| 			new_lab_assignment_form = wait2.until(EC.presence_of_element_located((By.ID, "newlab_form"))) | ||||
| 			new_lab_assignment_form = wait2.until(EC.presence_of_element_located((By.XPATH, "//form[@id='nlaf']"))) | ||||
| 			 | ||||
| 			#Fill the required form fields and submit. | ||||
| 			lab_date = new_lab_assignment_form.find_element(By.ID, "date") | ||||
| 			lab_date.send_keys(dateStr) | ||||
| 			lab_title = new_lab_assignment_form.find_element(By.ID, "lab_title") | ||||
| 			lab_date = new_lab_assignment_form.find_element(By.XPATH, "//input[@id='date'][@name='deadlinedate']") | ||||
| 			timeStr = self.utility.getTodayDate() | ||||
| 			lab_date.send_keys(timeStr) | ||||
| 			lab_title = new_lab_assignment_form.find_element(By.XPATH, "//form[@id='nlaf']/input[@id='ltitle']") | ||||
| 			lab_title.send_keys("TESTASSIGNMENT"+str(dateStr)) | ||||
| 			lab_instructions = new_lab_assignment_form.find_element(By.ID, "lab_instructor") | ||||
| 			lab_instructions = new_lab_assignment_form.find_element(By.XPATH, "//form[@id='nlaf']/textarea[@id='linstruct']") | ||||
| 			lab_instructions.send_keys("TESTINSTRUCTIONS"+str(dateStr)) | ||||
| 			lab_marks = new_lab_assignment_form.find_element(By.ID, "lab_mark") | ||||
| 			lab_marks = new_lab_assignment_form.find_element(By.XPATH, "//form[@id='nlaf']/input[@id='lmark']") | ||||
| 			lab_marks.send_keys("4") | ||||
| 
 | ||||
| 			#if group == 0 select individual submission, if group == 1 select group submission | ||||
| 			if group == 0:		 | ||||
| 				submission_type = new_lab_assignment_form.find_element(By.ID, "lab_individual") | ||||
| 				submission_type = new_lab_assignment_form.find_element(By.XPATH, "//form[@id='nlaf']/input[@id='lindi']") | ||||
| 			elif group == 1: | ||||
| 				submission_type = new_lab_assignment_form.find_element(By.ID, "lab_group") | ||||
| 				submission_type = new_lab_assignment_form.find_element(By.XPATH, "//form[@id='nlaf']/input[@id='lgrp']") | ||||
| 			submission_type.click() | ||||
| 			submit = new_lab_assignment_form.find_element(By.ID, "submit_btn") | ||||
| 			submit = new_lab_assignment_form.find_element(By.XPATH, "//form[@id='nlaf']/input[@id='lbtn']") | ||||
| 			submit.click() | ||||
| 			return 0 | ||||
| 		except: | ||||
|  | @ -114,25 +115,25 @@ class Instructor(Actor): | |||
| 			timeStr = self.utility.getTime() | ||||
| 			 | ||||
| 			#Fill the required form fields and submit | ||||
| 			course_name = driver.find_element(By.ID, "course_name") | ||||
| 			course_name = driver.find_element(By.ID, "cname") | ||||
| 			course_name.send_keys("TESTCOURSE"+str(dateStr)+str(timeStr)) | ||||
| 			 | ||||
| 			#This URL is needed to access the same created course via its link in post_lab_report() method. | ||||
| 			global courseURL | ||||
| 			courseURL = "TESTCOURSE"+str(dateStr)+str(timeStr) | ||||
| 			course_code = driver.find_element(By.ID, "course_code") | ||||
| 			course_code = driver.find_element(By.ID, "ccode") | ||||
| 			course_code.send_keys("TC"+str(dateStr)+str(timeStr)) | ||||
| 			self.utility.storeCourseCode("TC"+str(dateStr)+str(timeStr))#Store course code to be used | ||||
| 			academic_year = driver.find_element(By.ID, "academic_year")				#later by student. | ||||
| 			academic_year = driver.find_element(By.ID, "ayear")				#later by student. | ||||
| 			academic_year.send_keys("2021") | ||||
| 			faculty = driver.find_element(By.ID, "faculty") | ||||
| 			faculty = driver.find_element(By.ID, "fac") | ||||
| 			faculty.send_keys("TESTING DEPARTMENT") | ||||
| 
 | ||||
| 			#If joining == 0 does not require join approval, if joining == 1 requires join approval | ||||
| 			if joining == 0 : | ||||
| 				joining_students = driver.find_element(By.ID, "join_no") | ||||
| 				joining_students = driver.find_element(By.ID, "jno") | ||||
| 			elif group == 1: | ||||
| 				joining_students = driver.find_element(By.ID, "join_yes") | ||||
| 				joining_students = driver.find_element(By.ID, "jyes") | ||||
| 			joining_students.click() | ||||
| 			submit = driver.find_element(By.ID, "portal_btn") | ||||
| 			submit.click() | ||||
|  |  | |||
|  | @ -55,10 +55,10 @@ class Student(Actor): | |||
| 
 | ||||
| 			#Wait until the course is found, and join. | ||||
| 			wait2 = WebDriverWait(driver, 10) | ||||
| 			join_btn = wait2.until(EC.element_to_be_clickable((By.ID, "join_btn"))) | ||||
| 			join_btn.click() | ||||
| 			course_card = wait.until(EC.element_to_be_clickable((By.LINK_TEXT, str("Join Course")))) | ||||
| 			course_card.click() | ||||
| 
 | ||||
| 			#If joined course successfully, proceed. | ||||
| 			#If the joined course successfully, proceed. | ||||
| 			wait3 = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "/html/body/div[1]/div[1]/span"))) | ||||
| 			return 0 | ||||
| 
 | ||||
|  |  | |||
|  | @ -44,7 +44,6 @@ class MyUtility: | |||
| 		""" | ||||
| 		try: | ||||
| 			driver = webdriver.Chrome() | ||||
| 			driver.maximize_window() | ||||
| 			driver.get(self.getPageURL()) | ||||
| 			return driver | ||||
| 		except: | ||||
|  | @ -70,11 +69,11 @@ class MyUtility: | |||
| 		try: | ||||
| 			driver = self.getSession() | ||||
| 			WebDriverWait(driver, 10) | ||||
| 			username = driver.find_element(By.ID, "user_name") | ||||
| 			username = driver.find_element(By.ID, "uname") | ||||
| 			username.send_keys(obj.getStudentID()) | ||||
| 			password = driver.find_element(By.ID, "user_password") | ||||
| 			password = driver.find_element(By.ID, "upass") | ||||
| 			password.send_keys(obj.getPassword()) | ||||
| 			login = driver.find_element(By.ID, "login_btn") | ||||
| 			login = driver.find_element(By.ID, "log_btn") | ||||
| 			login.click() | ||||
| 			return driver | ||||
| 		except: | ||||
|  | @ -105,35 +104,26 @@ class MyUtility: | |||
| 			driver = self.getSession() | ||||
| 			wait = WebDriverWait(driver, 10, ignored_exceptions='StaleElementReferenceException') | ||||
| 
 | ||||
| 			#Click the sign up button, and fill the sign up form | ||||
| 			signup_btn = wait.until(EC.presence_of_element_located((By.ID, "signup_link"))) | ||||
| 			signup_btn.click() | ||||
| 			 | ||||
| 			#Find and fill full student name | ||||
| 			wait2 = WebDriverWait(driver, 10) | ||||
| 			signup_form = wait2.until(EC.presence_of_element_located((By.ID, "signup_form"))) | ||||
| 			name_field = signup_form.find_element(By.ID, "full_name") | ||||
| 			name_field.send_keys(name) | ||||
| 
 | ||||
| 			#Find and fill student ID | ||||
| 			student_id = signup_form.find_element(By.ID, "student_id") | ||||
| 			#Locate the signup form and fill in the student ID | ||||
| 			signup_form = wait.until(EC.presence_of_element_located((By.ID, "signup_frm"))) | ||||
| 			student_id = signup_form.find_element(By.ID, "std_id") | ||||
| 			std_id = self.fetch_new_student_id() | ||||
| 			student_id.send_keys(std_id) | ||||
| 			next_btn = signup_form.find_element(By.ID, "next_btn") | ||||
| 			next_btn.click() | ||||
| 
 | ||||
| 			#Find and fill email | ||||
| 			email_field = signup_form.find_element(By.ID, "email") | ||||
| 			#Fill in student data and sign up. | ||||
| 			wait2 = WebDriverWait(driver, 10, ignored_exceptions='StaleElementReferenceException') | ||||
| 			reg_form = wait2.until(EC.presence_of_element_located((By.ID, "frm"))) | ||||
| 			name_field = reg_form.find_element(By.XPATH, "//form/input[2]") | ||||
| 			name_field.send_keys(name) | ||||
| 			email_field = reg_form.find_element(By.XPATH, "//form/input[3]") | ||||
| 			email_field.send_keys(email) | ||||
| 			 | ||||
| 			#Find and fill password | ||||
| 			password_field = signup_form.find_element(By.ID, "password1") | ||||
| 			password_field = reg_form.find_element(By.XPATH, "//form/input[4]") | ||||
| 			password_field.send_keys(password) | ||||
| 			 | ||||
| 			#Find and fill password confirmation | ||||
| 			re_password_field = signup_form.find_element(By.ID, "password2") | ||||
| 			re_password_field = reg_form.find_element(By.XPATH, "//form/input[5]") | ||||
| 			re_password_field.send_keys(password) | ||||
| 			 | ||||
| 			#Sign up new student | ||||
| 			submit = signup_form.find_element(By.ID, "signup_btn") | ||||
| 			submit = reg_form.find_element(By.XPATH, "//form/input[6]") | ||||
| 			submit.click() | ||||
| 			return 0 | ||||
| 
 | ||||
|  | @ -312,12 +302,3 @@ class MyUtility: | |||
| 			ls.append(chr(random.randint(97,122))) | ||||
| 
 | ||||
| 		return ''.join(ls) | ||||
| 
 | ||||
| 	def clean(self, file): | ||||
| 		"""This method clean the test scripts directory by resetting some | ||||
| 		.txt files. | ||||
| 		""" | ||||
| 
 | ||||
| 		#Clean 'course_code.txt' file | ||||
| 		f = open(file, "w+") | ||||
| 		f.close() | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue