<div style="display: none;" id="dialog_add_client" title="Register Module">
		<form class="full validate" method="POST" action="module_register.php">
			<div class="row">
				<label for="d2_role">
					<strong>Module</strong>
				</label>
				<div>
					<select name="module[]" multiple style="padding-bottom: 10px" id="d2_role" required class="search required" data-placeholder="Choose a Role">
						<?php
								$query2 = "SELECT s.SubjectCode,m.module_name FROM subjectcourse s, enrolstudent e,modules m WHERE s.CourseCode= e.CourseCode AND e.StuNo='$user' AND s.SubjectCode=m.module_code";
								$subject_set2 = mysqli_query($connection,$query2);
									//4. Use return data

								while($row2 = mysqli_fetch_array($subject_set2))
								{?>
									 <option  <?php if($module == ($row2['SubjectCode'].','.$row2['module_name'])) echo 'selected="selected"'; ?> ><?php echo $row2['SubjectCode'].','.$row2['module_name']; ?></option>
								<?php
								}
							?>
					</select>
				</div>
			</div>
			<div class="row">
				<div class="right">
					<button type="submit" name="register">Register Module</button>
				</div>
			</div>
		</form>
	</div>