├── Installation Instructions
└── installation-steps.txt
├── add-author.php
├── add-book-issue.php
├── add-book.php
├── add-category.php
├── add-publisher.php
├── add-student.php
├── author.php
├── book-issue.php
├── book.php
├── category.php
├── change-password.php
├── config.php
├── css
├── bootstrap.css
└── style.css
├── dashboard.php
├── date-report.php
├── delete-author.php
├── delete-book.php
├── delete-category.php
├── delete-issue-book.php
├── delete-publisher.php
├── delete-student.php
├── footer.php
├── header.php
├── images
├── library-img.png
└── library.png
├── index.php
├── js
├── bootstrap.min.js
├── jquery-3.6.0.min.js
└── popper.min.js
├── logout.php
├── month-report.php
├── not-returned.php
├── publisher.php
├── reports.php
├── setting.php
├── sql
└── library_system.sql.zip
├── student.php
├── update-author.php
├── update-book.php
├── update-category.php
├── update-issue-book.php
├── update-publisher.php
├── update-student.php
└── view-student.php
/Installation Instructions/installation-steps.txt:
--------------------------------------------------------------------------------
1 | Installation Steps
2 | ================
3 |
4 | 1. Download zip file and Unzip file on your local server.
5 | 2. Put this file inside "c:/wamp/www/" OR "c:/xamp/htdocs/" .
6 |
7 | Database Configuration:
8 | ==================
9 |
10 | 1. Open phpmyadmin
11 | 2. Create New Database named "library_system".
12 | 3. Import database tables in newly created database "library_system" from downloaded folder -> sql -> library_system.sql.zip.
13 | 4. In "PROJECT-FOLDER/config.php" change the value of $conn (hostname,db_username,db_pasword,db_name).
14 | 5. Open Your browser put inside URL: "http://localhost/library-system/"
15 |
16 | login details:
17 | ====================
18 | Login Id : admin
19 | Password : admin
20 |
21 |
--------------------------------------------------------------------------------
/add-author.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
Add Author
7 |
8 |
11 |
12 |
13 |
14 |
21 | Author name required.
";
25 | }else{
26 | $author_name = mysqli_real_escape_string($conn, $_POST['authorname']);
27 | //query for check author name exists or not
28 | $sql = "SELECT author_name FROM author WHERE author_name = '{$author_name}'";
29 | $result = mysqli_query($conn, $sql) or die("Sql query failed.");
30 | //check result rows
31 | if(mysqli_num_rows($result) > 0){
32 | echo "
Author name already exist.
";
33 | }else{
34 | // insert query
35 | $sql1 = "INSERT INTO author(author_name) VALUES ('{$author_name}')";
36 | if(mysqli_query($conn, $sql1)){
37 | header("$base_url/author.php"); // redirect
38 | }
39 | }
40 | }
41 | } ?>
42 |
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/add-book-issue.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
Add Book Issue
7 |
8 |
11 |
12 |
13 |
14 | 0){
21 | $return_days = 0;
22 | while($row = mysqli_fetch_assoc($result)){
23 | $return_days = $row['return_days'];
24 | }
25 | }
26 | // --------------------
27 | if(empty($_POST['student_name']) || empty($_POST['book_name'])){
28 | echo "
Please Fill All the Fields.
";
29 | }else{
30 | // validate inputs
31 | $issue_name = mysqli_real_escape_string($conn, $_POST['student_name']);
32 | $issue_book = mysqli_real_escape_string($conn, $_POST['book_name']);
33 | $issue_date = date('Y-m-d');
34 | $return_date = date('Y-m-d',strtotime("+".$return_days." days"));
35 | //insert query
36 | $sql = "INSERT INTO book_issue(issue_name,issue_book,issue_date,return_date,issue_status) VALUES ('{$issue_name}','{$issue_book}','{$issue_date}','$return_date','N')";
37 | if(mysqli_query($conn, $sql)){
38 | $update = "UPDATE book SET book_status = 'N' WHERE book_id = {$issue_book}";
39 | $result = mysqli_query($conn, $update);
40 | header("$base_url/book-issue.php"); //redirect
41 | }else{
42 | echo "
Query failed.
";
43 | }
44 | }
45 | } ?>
46 |
77 |
78 |
79 |
80 |
81 |
82 |
--------------------------------------------------------------------------------
/add-book.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
Add Book
7 |
8 |
11 |
12 |
13 |
14 | Please Fill All the Fields.
";
18 | }else{
19 | //validate inputs
20 | $book_name = mysqli_real_escape_string($conn, $_POST['book_name']);
21 | $book_category = mysqli_real_escape_string($conn, $_POST['category']);
22 | $book_author = mysqli_real_escape_string($conn, $_POST['author']);
23 | $book_publisher = mysqli_real_escape_string($conn, $_POST['publisher']);
24 | // query for check book name exists or not
25 | $sql = "SELECT book_name FROM book WHERE book_name = '{$book_name}'";
26 | $result = mysqli_query($conn, $sql);
27 | if(mysqli_num_rows($result) > 0){ //check result rows
28 | echo "
Book name already exist.
";
29 | }else{
30 | //insert query
31 | $sql1 ="INSERT INTO book(book_name,book_category,book_author,book_publisher,book_status) VALUES ('{$book_name}','{$book_category}','{$book_author}','{$book_publisher}','Y')";
32 | if(mysqli_query($conn, $sql1)){
33 | header("$base_url/book.php"); // redirect
34 | }
35 | }
36 | }
37 | } ?>
38 |
87 |
88 |
89 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/add-category.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
Add Category
7 |
8 |
11 |
12 |
13 |
14 |
21 | Category name required.
";
25 | }else{
26 | //validate input
27 | $category_name = mysqli_real_escape_string($conn, $_POST['categoryname']);
28 | // select query for check category name already exists
29 | $sql = "SELECT category_name FROM category WHERE category_name = '{$category_name}'";
30 | $result = mysqli_query($conn, $sql) or die("SQL query failed");
31 |
32 | if(mysqli_num_rows($result) > 0){ // check result rows
33 | echo "
Category name already exist.
";
34 | }else{
35 | //insert query
36 | $sql1 = "INSERT INTO category(category_name) VALUES ('{$category_name}')";
37 | if(mysqli_query($conn, $sql1)){
38 | header("$base_url/category.php"); //redirect
39 | }
40 | }
41 | }
42 | } ?>
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/add-publisher.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
Add Publisher
7 |
8 |
11 |
12 |
13 |
14 |
21 | Publisher name required.
";
25 | }else{
26 | // validate input
27 | $publisher_name = mysqli_real_escape_string($conn, $_POST['publishername']);
28 | //check publisher name already exists in table
29 | $sql = "SELECT publisher_name FROM publisher WHERE publisher_name = '{$publisher_name}'";
30 | $result = mysqli_query($conn, $sql) or die("SQL query failed");
31 |
32 | if(mysqli_num_rows($result) > 0){ // check result rows
33 | echo "
Publisher name already exist.
";
34 | }else{
35 | //insert query
36 | $sql1 = "INSERT INTO publisher(publisher_name) VALUES ('{$publisher_name}')";
37 | if(mysqli_query($conn, $sql1)){
38 | header("$base_url/publisher.php"); // redirect
39 | }
40 | }
41 | }
42 | } ?>
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/add-student.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
Add Student
7 |
8 |
11 |
12 |
13 |
14 | Please Fill All the Fields.
";
18 | }else{
19 | //validate inputs
20 | $student_name = mysqli_real_escape_string($conn, $_POST['studentname']);
21 | $student_address = mysqli_real_escape_string($conn, $_POST['address']);
22 | $student_gender = mysqli_real_escape_string($conn, $_POST['gender']);
23 | $student_class = mysqli_real_escape_string($conn, $_POST['class']);
24 | $student_age = mysqli_real_escape_string($conn, $_POST['age']);
25 | $student_phone = mysqli_real_escape_string($conn, $_POST['phone']);
26 | $student_email = mysqli_real_escape_string($conn, $_POST['email']);
27 | //insert query
28 | $sql = "INSERT INTO student(student_name,student_address,student_gender,student_class,student_age,student_phone,student_email)
29 | VALUES ('{$student_name}','$student_address','$student_gender','$student_class','$student_age','$student_phone','$student_email')";
30 |
31 | if(mysqli_query($conn, $sql)){
32 | header("$base_url/student.php"); //redirect
33 | }else{
34 | echo "
Query failed.
";
35 | }
36 | }
37 | } ?>
38 |
72 |
73 |
74 |
75 |
76 |
77 |
--------------------------------------------------------------------------------
/author.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
All Authors
7 |
8 |
11 |
12 |
13 |
14 |
15 |
24 |
25 |
26 | S.No |
27 | Author Name |
28 | Edit |
29 | Delete |
30 |
31 |
32 | 0){
33 | $serial = $offset + 1;
34 | while($row= mysqli_fetch_assoc($result)){ ?>
35 |
36 | |
37 | |
38 |
39 | Edit
40 | |
41 |
42 | >Delete
43 | |
44 |
45 |
48 |
49 | No Authors Found |
50 |
51 |
52 |
53 |
54 | 0){
58 | $total_records = mysqli_num_rows($result);
59 |
60 | $total_page = ceil($total_records / $limit);
61 | // show pagination
62 | if($total_page > 1){
63 | $pagination = "";
79 | echo $pagination;
80 | }
81 | } ?>
82 |
83 |
84 |
85 |
86 |
87 |
88 |
103 |
104 |
--------------------------------------------------------------------------------
/book-issue.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
All Book Issue
7 |
8 |
11 |
12 |
13 |
14 |
28 |
29 |
30 | S.No |
31 | Student Name |
32 | Book Name |
33 | Phone |
34 | Email |
35 | Issue Date |
36 | Return Date |
37 | Status |
38 | Edit |
39 | Delete |
40 |
41 |
42 | 0){
43 | $serial = $offset + 1;
44 | while($row = mysqli_fetch_assoc($result)) {
45 | if((date('Y-m-d') > $row['return_date']) && $row['issue_status'] == "N"){
46 | $over = 'style="background:rgba(255,0,0,0.2)"';
47 | }else{ $over = ''; } ?>
48 | >
49 | |
50 | |
51 | |
52 | |
53 | |
54 | |
55 | |
56 |
57 | Returned";
59 | }else{
60 | echo "Issued";
61 | } ?>
62 | |
63 |
64 | Edit
65 | |
66 |
67 | Delete
68 | |
69 |
70 |
74 |
75 | No Books Issued |
76 |
77 |
78 |
79 |
80 | 0){
84 | $total_records = mysqli_num_rows($result1);
85 | $total_page = ceil($total_records / $limit);
86 | if($total_page > 1){
87 | $pagination = "";
103 | echo $pagination;
104 | }
105 | } ?>
106 |
107 |
108 |
109 |
110 |
111 |
--------------------------------------------------------------------------------
/book.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
All Books
7 |
8 |
11 |
12 |
13 |
14 |
15 |
31 |
32 |
33 | S.No |
34 | Book Name |
35 | Category |
36 | Author |
37 | Publisher |
38 | Status |
39 | Edit |
40 | Delete |
41 |
42 |
43 | 0){
44 | $serial = $offset + 1;
45 | while($row = mysqli_fetch_assoc($result)) { ?>
46 |
47 | |
48 | |
49 | |
50 | |
51 | |
52 |
53 | Available";
56 | }else{
57 | echo "Issued";
58 | } ?>
59 | |
60 |
61 | Edit
62 | |
63 |
64 | >Delete
65 | |
66 |
67 |
71 |
72 | No Books Found |
73 |
74 |
75 |
76 |
77 | 0){
81 | $total_records = mysqli_num_rows($result1);
82 | $total_page = ceil($total_records / $limit);
83 | if($total_page > 1){
84 | $pagination = "";
100 | echo $pagination;
101 | }
102 | } ?>
103 |
104 |
105 |
106 |
107 |
108 |
109 |
124 |
125 |
--------------------------------------------------------------------------------
/category.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
All categories
7 |
8 |
11 |
12 |
13 |
14 |
15 |
25 |
26 |
27 | S.No |
28 | Category Name |
29 | Edit |
30 | Delete |
31 |
32 |
33 | 0){
34 | $serial = $offset + 1;
35 | while($row = mysqli_fetch_assoc($result)) { ?>
36 |
37 | |
38 | |
39 |
40 | Edit
41 | |
42 |
43 | >Delete
44 | |
45 |
46 |
49 |
50 | No Categories Found |
51 |
52 |
53 |
54 |
55 | 0){
59 | $total_records = mysqli_num_rows($result1);
60 | $total_page = ceil($total_records / $limit);
61 | if($total_page > 1){
62 | $pagination = "";
78 | echo $pagination;
79 | }
80 | } ?>
81 |
82 |
83 |
84 |
85 |
86 |
87 |
102 |
103 |
--------------------------------------------------------------------------------
/change-password.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
Change Password
7 |
8 |
9 |
10 |
11 |
25 | Password changed successfully.
";
35 | }else{
36 | echo "
Failed to changed password.
";
37 | }
38 | } ?>
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/config.php:
--------------------------------------------------------------------------------
1 |
8 |
--------------------------------------------------------------------------------
/css/style.css:
--------------------------------------------------------------------------------
1 | /* COMMOM CSS */
2 | body{
3 | background: #F6F6F6;
4 | font-family: 'Open Sans', sans-serif;
5 | }
6 | a,
7 | a:hover,
8 | a:focus{
9 | text-decoration: none;
10 | outline: none;
11 | }
12 | ul{
13 | margin:0;
14 | padding:0;
15 | list-style:none;
16 | }
17 | /* Header Styling */
18 | #header{
19 | background: #F6F6F6;
20 | }
21 | .logo img{
22 | width: 100%;
23 | }
24 | .dropdown{
25 | text-align: right;
26 | padding: 34px 0;
27 | }
28 | .dropdown button{
29 | background: #A00000;
30 | border: none;
31 | opacity: 0.9;
32 | }
33 | .dropdown button:hover{
34 | background: #A00000;
35 | opacity: 0.9;
36 | }
37 | .btn-secondary:not(:disabled):not(.disabled):active:focus, .btn-secondary:not(:disabled):not(.disabled).active:focus, .show > .btn-secondary.dropdown-toggle:focus{
38 | box-shadow: none;
39 | }
40 | .btn-secondary:not(:disabled):not(.disabled):active, .btn-secondary:not(:disabled):not(.disabled).active, .show > .btn-secondary.dropdown-toggle{
41 | background: #A00000;
42 | opacity: 0.9;
43 | }
44 | .btn-secondary:focus, .btn-secondary.focus{
45 | border: none;
46 | background: #A00000;
47 | box-shadow: none;
48 | opacity: 0.9;
49 | }
50 | #menubar{
51 | background: #A00000;
52 | text-align: center;
53 | opacity: 0.9;
54 | }
55 | .menu li{
56 | display: inline-block;
57 | }
58 | .menu li a{
59 | color: #fff;
60 | font-size: 16px;
61 | font-weight: 600;
62 | text-transform: uppercase;
63 | padding: 10px 13px;
64 | display: block;
65 | transition: all 0.3s;
66 | }
67 | .menu li a:hover{
68 | background: #fff;
69 | color: #A00000;
70 | }
71 | /* Footer Styling */
72 | #footer{
73 | background: #A00000;
74 | color: #fff;
75 | text-align: center;
76 | padding: 10px 0;
77 | opacity: 0.9;
78 | }
79 | #footer span,
80 | #footer a{
81 | color: #fff;
82 | }
83 | /* ADMIN CONTENT */
84 | #admin-content{
85 | min-height: 80vh;
86 | padding: 20px 0 40px;
87 | }
88 | #admin-content .admin-heading{
89 | color: #0E0E0E;
90 | font-size: 30px;
91 | font-weight: 600;
92 | margin: 0 0 40px;
93 | position: relative;
94 | }
95 | #admin-content .admin-heading:after{
96 | content : "";
97 | background: #A00000;
98 | width: 100%;
99 | height: 3px;
100 | opacity: 0.9;
101 | position: absolute;
102 | left: 0;
103 | bottom: -10px;
104 | }
105 | #admin-content .add-new{
106 | background: #A00000;
107 | color: #fff;
108 | font-size: 15px;
109 | font-weight: 600;
110 | text-align: center;
111 | text-transform: uppercase;
112 | border: 2px solid transparent;
113 | padding: 7px 15px;
114 | display: block;
115 | opacity: 0.9;
116 | transition: all 0.3s;
117 | }
118 | #admin-content .add-new:hover{
119 | background: #fff;
120 | color: #A00000;
121 | border: 2px solid #A00000;
122 | opacity: 0.9;
123 | }
124 | #admin-content .content-table{
125 | width: 100%;
126 | margin: 0 0 20px;
127 | }
128 | #admin-content .content-table thead{
129 | background: #444;
130 | color: #fff;
131 | }
132 | #admin-content .content-table th{
133 | text-align: center;
134 | text-transform: uppercase;
135 | border: 1px solid #000;
136 | padding: 10px;
137 | }
138 | #admin-content .content-table tbody tr:nth-child(odd){
139 | background: #e7e7e7;
140 | }
141 | #admin-content .content-table tbody tr:nth-child(even){
142 | background: transparent;
143 | }
144 | #admin-content .content-table tbody td{
145 | text-align: center;
146 | border: 1px solid #000;
147 | padding: 10px;
148 | }
149 | #admin-content .content-table tbody td:nth-child(2),
150 | #admin-content .content-table tbody td:nth-child(5){
151 | text-align: left;
152 | }
153 | .pagination{
154 | text-align: center;
155 | display: block;
156 | }
157 | .pagination li{
158 | display: inline-block;
159 | margin-right: 8px;
160 | }
161 | .pagination li a{
162 | background: #A00000;
163 | color: #fff;
164 | font-size: 14px;
165 | padding: 6px 12px;
166 | opacity: 0.9;
167 | }
168 | .pagination li.active > a{
169 | background: #A00000;
170 | opacity: 0.7;
171 | }
172 | /* ADD AUTHOR */
173 | .yourform{
174 | background: lightgrey;
175 | padding: 25px;
176 | box-shadow: 0 4px 5px rgba(0,0,0,0.5);
177 | }
178 | .form-group label{
179 | color: #0E0E0E;
180 | font-weight: 600;
181 | }
182 | .form-group .form-control{
183 | font-size: 14px;
184 | }
185 | /* ADD CATEGORY */
186 | .radio{
187 | padding: 3px 0;
188 | }
189 | .radio input[type="radio"]{
190 | margin-right: 8px;
191 | }
192 | /* ADMIN LOGIN */
193 | #wrapper-admin{
194 | padding: 100px 0 0;
195 | }
196 | .border.border-danger{
197 | border: 5px solid #A00000 !important;
198 | opacity: 0.9;
199 | margin: 0 0 20px;
200 | }
201 | .heading{
202 | font-size: 20px;
203 | margin: 0 0 20px;
204 | display: inline-block;
205 | position: relative;
206 | }
207 | .heading:after{
208 | content: "";
209 | background: #A00000;
210 | width: 100%;
211 | height: 2px;
212 | position: absolute;
213 | left: 0;
214 | bottom: -10px;
215 | }
216 | /* MODAL BOX */
217 | #modal{
218 | background: rgba(0,0,0,0.7);
219 | position: fixed;
220 | left: 0;
221 | top: 0;
222 | width: 100%;
223 | height: 100%;
224 | z-index: 100;
225 | display: none;
226 | }
227 | #modal-form{
228 | background: #fff;
229 | width: 30%;
230 | position: relative;
231 | top: 20%;
232 | left: calc(50% - 15%);
233 | padding: 15px;
234 | border-radius: 4px;
235 | }
236 | #modal-form h2{
237 | margin: 0 0 15px;
238 | padding-bottom: 10px;
239 | border-bottom: 1px solid #000;
240 | display: block;
241 | }
242 | #close-btn{
243 | background: red;
244 | color: #fff;
245 | width: 30px;
246 | height: 30px;
247 | line-height: 30px;
248 | text-align: center;
249 | border-radius: 50%;
250 | position: absolute;
251 | top: -15px;
252 | right: -15px;
253 | cursor: pointer;
254 | }
255 |
256 | .card-body{
257 | background: #A00000;
258 | opacity: 0.9;
259 | padding: 40px 20px;
260 | }
261 |
262 | .card-body .card-text{
263 | color: #fff;
264 | font-size: 40px;
265 | font-weight: 600;
266 | line-height: 40px;
267 | margin: 0 0 10px;
268 | }
269 | .card-body .card-title{
270 | color: #fff;
271 | }
272 |
273 | #modal-form table tr{
274 | border-bottom: 1px solid grey;
275 | }
276 |
--------------------------------------------------------------------------------
/dashboard.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
Dashboard
7 |
8 |
9 |
10 |
11 | 0){
15 | while($row = mysqli_fetch_assoc($result)){ ?>
16 |
17 |
18 |
19 |
Authors Listed
20 |
21 |
22 |
24 |
25 |
26 | 0){
30 | while($row = mysqli_fetch_assoc($result)){ ?>
31 |
32 |
33 |
34 |
Publishers Listed
35 |
36 |
37 |
39 |
40 |
41 | 0){
45 | while($row = mysqli_fetch_assoc($result)){ ?>
46 |
47 |
48 |
49 |
Categories Listed
50 |
51 |
52 |
54 |
55 |
56 | 0){
60 | while($row = mysqli_fetch_assoc($result)){ ?>
61 |
62 |
63 |
64 |
Books Listed
65 |
66 |
67 |
69 |
70 |
71 | 0){
75 | while($row = mysqli_fetch_assoc($result)){ ?>
76 |
77 |
78 |
79 |
Register Students
80 |
81 |
82 |
84 |
85 |
86 | 0){
90 | while($row = mysqli_fetch_assoc($result)){ ?>
91 |
92 |
93 |
94 |
Book Issued
95 |
96 |
97 |
99 |
100 |
101 |
102 |
103 |
104 |
--------------------------------------------------------------------------------
/date-report.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
Date Wise Book Issue Report
7 |
8 |
9 |
19 | 0){ ?>
30 |
31 |
32 |
33 |
34 | S.No |
35 | Student Name |
36 | Book Name |
37 | Phone |
38 | Email |
39 | Issue Date |
40 | Return Date |
41 |
42 |
43 | $row['return_date']) && $row['issue_status'] == "N"){
46 | $over = 'style="background:rgba(255,0,0,0.2)"';
47 | }else{ $over = ''; } ?>
48 | >
49 | |
50 | |
51 | |
52 | |
53 | |
54 | |
55 | |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
64 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/delete-author.php:
--------------------------------------------------------------------------------
1 | 0){
8 | echo "Cant't delete author record this author is used in books.
";
9 | }else{
10 | //delete query
11 | $sql = "DELETE FROM author WHERE author_id = '{$author_id}'";
12 |
13 | if(mysqli_query($conn, $sql)){
14 | echo "Author deleted successfully.
";
15 | }else{
16 | echo "Server side error.
";
17 | }
18 | }
19 | mysqli_close($conn);
20 | ?>
21 |
--------------------------------------------------------------------------------
/delete-book.php:
--------------------------------------------------------------------------------
1 | 0){
10 | echo "Cant't delete book record this is used in book issue.
";
11 | }else{
12 | //delete query
13 | $sql = "DELETE FROM book WHERE book_id = '{$book_id}'";
14 |
15 | if(mysqli_query($conn, $sql)){
16 | echo "Book record deleted successfully.
";
17 | }else{
18 | echo "Server side error.
";
19 | }
20 | }
21 | mysqli_close($conn);
22 | ?>
23 |
--------------------------------------------------------------------------------
/delete-category.php:
--------------------------------------------------------------------------------
1 | 0){
9 | echo "Cant't delete category record this category is used in books.
";
10 | }else{
11 | //delete query
12 | $sql = "DELETE FROM category WHERE category_id = '{$category_id}'";
13 | if(mysqli_query($conn, $sql)){
14 | echo "Publisher deleted successfully.
";
15 | }else{
16 | echo "Server side error.
";
17 | }
18 | }
19 | mysqli_close($conn);
20 | ?>
21 |
--------------------------------------------------------------------------------
/delete-issue-book.php:
--------------------------------------------------------------------------------
1 | Cant't delete book issue record.";
11 | }
12 | mysqli_close($conn);
13 | ?>
14 |
--------------------------------------------------------------------------------
/delete-publisher.php:
--------------------------------------------------------------------------------
1 | 0){
9 | echo "Cant't delete publisher record this publisher is used in books.
";
10 | }else{
11 | //delete query
12 | $sql = "DELETE FROM publisher WHERE publisher_id = '{$publisher_id}'";
13 | if(mysqli_query($conn, $sql)){
14 | echo "Publisher deleted successfully.
";
15 | }else{
16 | echo "Server side error.
";
17 | }
18 | }
19 | mysqli_close($conn);
20 | ?>
21 |
--------------------------------------------------------------------------------
/delete-student.php:
--------------------------------------------------------------------------------
1 | 0){
9 | echo "Cant't delete this student. Book issued to this student.
";
10 | }else{
11 | //delete query
12 | $sql = "DELETE FROM student WHERE student_id = '{$student_id}'";
13 | if(mysqli_query($conn, $sql)){
14 | echo "Student deleted successfully.
";
15 | }else{
16 | echo "Server side error.
";
17 | }
18 | }
19 | mysqli_close($conn);
20 | ?>
21 |
--------------------------------------------------------------------------------
/footer.php:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
13 |
14 |
15 |