Skip to content

fixed bug and make book not permanently deleted #293

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@
header('Location: manage.php');
}
if($_POST['deletereq']){

$query = $link->prepare('DELETE FROM `books` WHERE `book_id` = ?');
$query -> bind_param("i", $_POST['deletereq']);
$query->bind_param("i", $_POST['deletereq']);
if($query->execute()){
header('Location: dashboard.php');
}
Expand All @@ -27,10 +26,8 @@
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">

<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">

<!-- Site Icon -->
<link rel="icon" href="Resources/A-Dot-Icon.png">
<!-- Custom Css -->
Expand Down Expand Up @@ -58,8 +55,6 @@
<br><br><br><br><br>

<div class="container">


<div class="row">
<div class="col"></div>
<div class="col">
Expand Down Expand Up @@ -144,22 +139,13 @@

</div>
<div class="row">
<div class="col">
<form method="post">
<input type="hidden" value="<?=$books['book_id']?>" name="deletereq">
<button class="know-more-btn" type="submit">
Delete Book
</button>
</form>
</div>
<div class="col">
<button class="know-more-btn" type="button" data-bs-toggle="collapse" data-bs-target="#my<?=$idnum?>" aria-expanded="false" aria-controls="collapseExample">
View Details &#8594
</button>
</div>
</div>
<br>

</div>
</div>
<div class="collapse" id="my<?=$idnum?>">
Expand Down Expand Up @@ -195,7 +181,6 @@
</div>
<br>
<?php

}
}
else{
Expand All @@ -209,18 +194,8 @@
}
}
?>






<br>

</div>


<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>

</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@
if(isset($_COOKIE["email"])){
header('Location: index.php');
}


require_once "connection.php";


if($_POST){

$msg = '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,7 @@

<div class="row">
<div class="col">
<strong> Name :</strong> <?= $row['user_id'];?>

<strong> Name :</strong> <?= $row['name'];?>
</div>
<div class="col">
<strong> Email:</strong> <?=$row['email']?>
Expand All @@ -138,15 +137,6 @@


</div>
<!-- <div class="row">
<div class="col"></div>
<div class="col">
<button class="know-more-btn" type="button" data-bs-toggle="collapse" data-bs-target="#my2" aria-expanded="false" aria-controls="collapseExample">
On View Details &#8594
</button>
</div>
</div> -->
<!-- <br> -->

</div>
</div>
Expand Down