Update Course.php

SIMPLICITY_Bug-189_Course_Delete_btn
enockkays 2021-06-12 19:07:54 +08:00 committed by GitHub
parent dd46a63611
commit aa9f47e1db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 20 additions and 47 deletions

View File

@ -100,15 +100,9 @@ if( $_SESSION['user_type'] == "Student")
<a class="nav-link" data-toggle="tab" href="#menu4">Marked</a> <a class="nav-link" data-toggle="tab" href="#menu4">Marked</a>
</li> </li>
<!----------Delete Course-----------> <!----------Delete Course Button----------->
<li>
<li style="padding-left:15em"> <html>
<html lang="en">
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"
integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm"crossorigin="anonymous">
</head>
<body> <body>
<div class="modal fade" id="delcourse"> <div class="modal fade" id="delcourse">
@ -119,15 +113,14 @@ if( $_SESSION['user_type'] == "Student")
<button type="button" class="close red" data-dismiss="modal"> <button type="button" class="close red" data-dismiss="modal">
<span>&times;</span> <span>&times;</span>
</button> </button>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<p>Are you sure about deleting this course? This action can not be reversed!</p> <p>Are you sure about deleting this course? This action can not be reversed!</p>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<form method="POST" action=""> <form method="POST" action="">
<button type="button" class="btn action-button shadow animate blue" data-dismiss="modal">Cancel</button> <button type="button" class="btn action-button blue" data-dismiss="modal">Cancel</button>
<input type="submit" name="submit" class="action-button shadow animate red" value="Delete Course" /> <input type="submit" name="submit" class="btn action-button red" value="Delete"/>
</form> </form>
</div> </div>
@ -137,14 +130,16 @@ if( $_SESSION['user_type'] == "Student")
</div> </div>
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<button type="button" class="btn action-button shadow animate red" data-toggle="modal" data-target="#delcourse">Delete Course</button> <button type="button" class="btn action-button red" data-toggle="modal" data-target="#delcourse">Delete Course</button>
</div>
</div> </div>
</div> </div>
</div> </div>
<?php <?php
// Connect to MySQL database // Connect to MySQL database
$con = mysqli_connect("localhost", $mysql_username, $mysql_password, "lrr"); $con = mysqli_connect("localhost","username","password","lrr");
// Check connection // Check connection
if (mysqli_connect_errno()) if (mysqli_connect_errno())
@ -156,59 +151,37 @@ if(isset($_POST['submit'])){
$result = mysqli_query($con, "DELETE FROM course_students_table WHERE Course_ID='$course_id'"); $result = mysqli_query($con, "DELETE FROM course_students_table WHERE Course_ID='$course_id'");
} }
?> ?>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN"
crossorigin="anonymous"></script> crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"
integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q"
crossorigin="anonymous"></script> crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"
integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl"
crossorigin="anonymous"></script> crossorigin="anonymous"></script>
<style> <style>
/*--------------------[ Delete Course Button ]*/ /*--------------------[ Delete Course Button ]*/
.animate
{
transition: all 0.1s;
-webkit-transition: all 0.1s;
}
a:hover { text-decoration: none;
}
.action-button { .action-button {
position: relative;
padding: 5px 15px;
margin: 0px 5px 5px 0px;
float: left;
border-radius: 5px;
font-family: 'Pacifico', cursive; font-family: 'Pacifico', cursive;
font-size: 18px; font-size: 18px;
color: #FFF; color: #FFF;
text-decoration: none; text-decoration: none;
} }
.red {
.red
{
background-color: #E74C3C; background-color: #E74C3C;
border-bottom: 5px solid #BD3E31; border-bottom: 5px solid #BD3E31;
text-shadow: 0px -2px #BD3E31; text-shadow: 0px -2px #BD3E31;
} }
.blue .blue {
{
background-color: #4d4dff; background-color: #4d4dff;
border-bottom: 5px solid #4d4dff; border-bottom: 5px solid #4d4dff;
text-shadow: 0px -2px #4d4dff; text-shadow: 0px -2px #4d4dff;
} }
.action-button:active
{
transform: translate(0px,5px);
-webkit-transform: translate(0px,5px);
border-bottom: 1px solid;
}
</style> </style>
</body> </body>
</html> </html>
</li> </li>