<div style="display: none;" id="dialog_add_client" title="Deregister Modules">
		<form class="full validate" method="POST" action="module_deregister.php">
			<div class="row">
				<label for="d2_role">
					<strong>Module</strong>
				</label>
				<div>
					<select name="module" style="padding-bottom: 10px" id="d2_role" required class="search required" data-placeholder="Choose a Role">
						<option></option>
						<?php
							$query2 = "SELECT mr.module_code,m.term,m.module FROM module_reg mr,modules m WHERE(mr.st_id='$user' AND mr.module_code=m.code) AND (mr.year=m.year) AND mr.year='$y' order by m.term";
							$subject_set2 = mysqli_query($connection,$query2); 

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