Skip to content

Commit a2ecadf

Browse files
committed
aplication
1 parent 6c52765 commit a2ecadf

File tree

95 files changed

+61708
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+61708
-0
lines changed

SQL /library.sql

+253
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,253 @@
1+
-- phpMyAdmin SQL Dump
2+
-- version 4.4.14
3+
-- http://www.phpmyadmin.net
4+
--
5+
-- Host: 127.0.0.1
6+
-- Generation Time: Jul 17, 2017 at 06:15 PM
7+
-- Server version: 5.6.26
8+
-- PHP Version: 5.5.28
9+
10+
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
11+
SET time_zone = "+00:00";
12+
13+
14+
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
15+
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
16+
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
17+
/*!40101 SET NAMES utf8mb4 */;
18+
19+
--
20+
-- Database: `library`
21+
--
22+
23+
-- --------------------------------------------------------
24+
25+
--
26+
-- Table structure for table `admin`
27+
--
28+
29+
CREATE TABLE IF NOT EXISTS `admin` (
30+
`id` int(11) NOT NULL,
31+
`FullName` varchar(100) DEFAULT NULL,
32+
`AdminEmail` varchar(120) DEFAULT NULL,
33+
`UserName` varchar(100) NOT NULL,
34+
`Password` varchar(100) NOT NULL,
35+
`updationDate` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP
36+
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
37+
38+
--
39+
-- Dumping data for table `admin`
40+
--
41+
42+
INSERT INTO `admin` (`id`, `FullName`, `AdminEmail`, `UserName`, `Password`, `updationDate`) VALUES
43+
(1, 'Anuj Kumar', '[email protected]', 'admin', 'f925916e2754e5e03f75dd58a5733251', '2017-07-16 18:11:42');
44+
45+
-- --------------------------------------------------------
46+
47+
--
48+
-- Table structure for table `tblauthors`
49+
--
50+
51+
CREATE TABLE IF NOT EXISTS `tblauthors` (
52+
`id` int(11) NOT NULL,
53+
`AuthorName` varchar(159) DEFAULT NULL,
54+
`creationDate` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
55+
`UpdationDate` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP
56+
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1;
57+
58+
--
59+
-- Dumping data for table `tblauthors`
60+
--
61+
62+
INSERT INTO `tblauthors` (`id`, `AuthorName`, `creationDate`, `UpdationDate`) VALUES
63+
(1, 'Anuj kumar', '2017-07-08 12:49:09', '2017-07-08 15:16:59'),
64+
(2, 'Chetan Bhagatt', '2017-07-08 14:30:23', '2017-07-08 15:15:09'),
65+
(3, 'Anita Desai', '2017-07-08 14:35:08', NULL),
66+
(4, 'HC Verma', '2017-07-08 14:35:21', NULL),
67+
(5, 'R.D. Sharma ', '2017-07-08 14:35:36', NULL),
68+
(9, 'fwdfrwer', '2017-07-08 15:22:03', NULL);
69+
70+
-- --------------------------------------------------------
71+
72+
--
73+
-- Table structure for table `tblbooks`
74+
--
75+
76+
CREATE TABLE IF NOT EXISTS `tblbooks` (
77+
`id` int(11) NOT NULL,
78+
`BookName` varchar(255) DEFAULT NULL,
79+
`CatId` int(11) DEFAULT NULL,
80+
`AuthorId` int(11) DEFAULT NULL,
81+
`ISBNNumber` int(11) DEFAULT NULL,
82+
`BookPrice` int(11) DEFAULT NULL,
83+
`RegDate` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
84+
`UpdationDate` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP
85+
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
86+
87+
--
88+
-- Dumping data for table `tblbooks`
89+
--
90+
91+
INSERT INTO `tblbooks` (`id`, `BookName`, `CatId`, `AuthorId`, `ISBNNumber`, `BookPrice`, `RegDate`, `UpdationDate`) VALUES
92+
(1, 'PHP And MySql programming', 5, 1, 222333, 20, '2017-07-08 20:04:55', '2017-07-15 05:54:41'),
93+
(3, 'physics', 6, 4, 1111, 15, '2017-07-08 20:17:31', '2017-07-15 06:13:17');
94+
95+
-- --------------------------------------------------------
96+
97+
--
98+
-- Table structure for table `tblcategory`
99+
--
100+
101+
CREATE TABLE IF NOT EXISTS `tblcategory` (
102+
`id` int(11) NOT NULL,
103+
`CategoryName` varchar(150) DEFAULT NULL,
104+
`Status` int(1) DEFAULT NULL,
105+
`CreationDate` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
106+
`UpdationDate` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP
107+
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=latin1;
108+
109+
--
110+
-- Dumping data for table `tblcategory`
111+
--
112+
113+
INSERT INTO `tblcategory` (`id`, `CategoryName`, `Status`, `CreationDate`, `UpdationDate`) VALUES
114+
(4, 'Romantic', 1, '2017-07-04 18:35:25', '2017-07-06 16:00:42'),
115+
(5, 'Technology', 1, '2017-07-04 18:35:39', '2017-07-08 17:13:03'),
116+
(6, 'Science', 1, '2017-07-04 18:35:55', '0000-00-00 00:00:00'),
117+
(7, 'Management', 0, '2017-07-04 18:36:16', '0000-00-00 00:00:00');
118+
119+
-- --------------------------------------------------------
120+
121+
--
122+
-- Table structure for table `tblissuedbookdetails`
123+
--
124+
125+
CREATE TABLE IF NOT EXISTS `tblissuedbookdetails` (
126+
`id` int(11) NOT NULL,
127+
`BookId` int(11) DEFAULT NULL,
128+
`StudentID` varchar(150) DEFAULT NULL,
129+
`IssuesDate` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
130+
`ReturnDate` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
131+
`RetrunStatus` int(1) NOT NULL,
132+
`fine` int(11) DEFAULT NULL
133+
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1;
134+
135+
--
136+
-- Dumping data for table `tblissuedbookdetails`
137+
--
138+
139+
INSERT INTO `tblissuedbookdetails` (`id`, `BookId`, `StudentID`, `IssuesDate`, `ReturnDate`, `RetrunStatus`, `fine`) VALUES
140+
(1, 1, 'SID002', '2017-07-15 06:09:47', '2017-07-15 11:15:20', 1, 0),
141+
(2, 1, 'SID002', '2017-07-15 06:12:27', '2017-07-15 11:15:23', 1, 5),
142+
(3, 3, 'SID002', '2017-07-15 06:13:40', NULL, 0, NULL),
143+
(4, 3, 'SID002', '2017-07-15 06:23:23', '2017-07-15 11:22:29', 1, 2),
144+
(5, 1, 'SID009', '2017-07-15 10:59:26', NULL, 0, NULL),
145+
(6, 3, 'SID011', '2017-07-15 18:02:55', NULL, 0, NULL);
146+
147+
-- --------------------------------------------------------
148+
149+
--
150+
-- Table structure for table `tblstudents`
151+
--
152+
153+
CREATE TABLE IF NOT EXISTS `tblstudents` (
154+
`id` int(11) NOT NULL,
155+
`StudentId` varchar(100) DEFAULT NULL,
156+
`FullName` varchar(120) DEFAULT NULL,
157+
`EmailId` varchar(120) DEFAULT NULL,
158+
`MobileNumber` char(11) DEFAULT NULL,
159+
`Password` varchar(120) DEFAULT NULL,
160+
`Status` int(1) DEFAULT NULL,
161+
`RegDate` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
162+
`UpdationDate` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP
163+
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=latin1;
164+
165+
--
166+
-- Dumping data for table `tblstudents`
167+
--
168+
169+
INSERT INTO `tblstudents` (`id`, `StudentId`, `FullName`, `EmailId`, `MobileNumber`, `Password`, `Status`, `RegDate`, `UpdationDate`) VALUES
170+
(1, 'SID002', 'Anuj kumar', '[email protected]', '9865472555', 'f925916e2754e5e03f75dd58a5733251', 1, '2017-07-11 15:37:05', '2017-07-15 18:26:21'),
171+
(4, 'SID005', 'sdfsd', '[email protected]', '8569710025', '92228410fc8b872914e023160cf4ae8f', 0, '2017-07-11 15:41:27', '2017-07-15 17:43:03'),
172+
(8, 'SID009', 'test', '[email protected]', '2359874527', 'f925916e2754e5e03f75dd58a5733251', 1, '2017-07-11 15:58:28', '2017-07-15 13:42:44'),
173+
(9, 'SID010', 'Amit', '[email protected]', '8585856224', 'f925916e2754e5e03f75dd58a5733251', 1, '2017-07-15 13:40:30', NULL),
174+
(10, 'SID011', 'Sarita Pandey', '[email protected]', '4672423754', 'f925916e2754e5e03f75dd58a5733251', 1, '2017-07-15 18:00:59', NULL);
175+
176+
--
177+
-- Indexes for dumped tables
178+
--
179+
180+
--
181+
-- Indexes for table `admin`
182+
--
183+
ALTER TABLE `admin`
184+
ADD PRIMARY KEY (`id`);
185+
186+
--
187+
-- Indexes for table `tblauthors`
188+
--
189+
ALTER TABLE `tblauthors`
190+
ADD PRIMARY KEY (`id`);
191+
192+
--
193+
-- Indexes for table `tblbooks`
194+
--
195+
ALTER TABLE `tblbooks`
196+
ADD PRIMARY KEY (`id`);
197+
198+
--
199+
-- Indexes for table `tblcategory`
200+
--
201+
ALTER TABLE `tblcategory`
202+
ADD PRIMARY KEY (`id`);
203+
204+
--
205+
-- Indexes for table `tblissuedbookdetails`
206+
--
207+
ALTER TABLE `tblissuedbookdetails`
208+
ADD PRIMARY KEY (`id`);
209+
210+
--
211+
-- Indexes for table `tblstudents`
212+
--
213+
ALTER TABLE `tblstudents`
214+
ADD PRIMARY KEY (`id`),
215+
ADD UNIQUE KEY `StudentId` (`StudentId`);
216+
217+
--
218+
-- AUTO_INCREMENT for dumped tables
219+
--
220+
221+
--
222+
-- AUTO_INCREMENT for table `admin`
223+
--
224+
ALTER TABLE `admin`
225+
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=2;
226+
--
227+
-- AUTO_INCREMENT for table `tblauthors`
228+
--
229+
ALTER TABLE `tblauthors`
230+
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=10;
231+
--
232+
-- AUTO_INCREMENT for table `tblbooks`
233+
--
234+
ALTER TABLE `tblbooks`
235+
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=4;
236+
--
237+
-- AUTO_INCREMENT for table `tblcategory`
238+
--
239+
ALTER TABLE `tblcategory`
240+
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=8;
241+
--
242+
-- AUTO_INCREMENT for table `tblissuedbookdetails`
243+
--
244+
ALTER TABLE `tblissuedbookdetails`
245+
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=7;
246+
--
247+
-- AUTO_INCREMENT for table `tblstudents`
248+
--
249+
ALTER TABLE `tblstudents`
250+
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=11;
251+
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
252+
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
253+
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

admin/add-author.php

+100
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
<?php
2+
session_start();
3+
error_reporting(0);
4+
include('includes/config.php');
5+
if(strlen($_SESSION['alogin'])==0)
6+
{
7+
header('location:index.php');
8+
}
9+
else{
10+
11+
if(isset($_POST['create']))
12+
{
13+
$author=$_POST['author'];
14+
$sql="INSERT INTO tblauthors(AuthorName) VALUES(:author)";
15+
$query = $dbh->prepare($sql);
16+
$query->bindParam(':author',$author,PDO::PARAM_STR);
17+
$query->execute();
18+
$lastInsertId = $dbh->lastInsertId();
19+
if($lastInsertId)
20+
{
21+
$_SESSION['msg']="Author Listed successfully";
22+
header('location:manage-authors.php');
23+
}
24+
else
25+
{
26+
$_SESSION['error']="Something went wrong. Please try again";
27+
header('location:manage-authors.php');
28+
}
29+
30+
}
31+
?>
32+
<!DOCTYPE html>
33+
<html xmlns="http://www.w3.org/1999/xhtml">
34+
<head>
35+
<meta charset="utf-8" />
36+
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
37+
<meta name="description" content="" />
38+
<meta name="author" content="" />
39+
<title>Online Library Management System | Add Author</title>
40+
<!-- BOOTSTRAP CORE STYLE -->
41+
<link href="assets/css/bootstrap.css" rel="stylesheet" />
42+
<!-- FONT AWESOME STYLE -->
43+
<link href="assets/css/font-awesome.css" rel="stylesheet" />
44+
<!-- CUSTOM STYLE -->
45+
<link href="assets/css/style.css" rel="stylesheet" />
46+
<!-- GOOGLE FONT -->
47+
<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css' />
48+
49+
</head>
50+
<body>
51+
<!------MENU SECTION START-->
52+
<?php include('includes/header.php');?>
53+
<!-- MENU SECTION END-->
54+
<div class="content-wra
55+
<div class="content-wrapper">
56+
<div class="container">
57+
<div class="row pad-botm">
58+
<div class="col-md-12">
59+
<h4 class="header-line">Add Author</h4>
60+
61+
</div>
62+
63+
</div>
64+
<div class="row">
65+
<div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3"">
66+
<div class="panel panel-info">
67+
<div class="panel-heading">
68+
Author Info
69+
</div>
70+
<div class="panel-body">
71+
<form role="form" method="post">
72+
<div class="form-group">
73+
<label>Author Name</label>
74+
<input class="form-control" type="text" name="author" autocomplete="off" required />
75+
</div>
76+
77+
<button type="submit" name="create" class="btn btn-info">Add </button>
78+
79+
</form>
80+
</div>
81+
</div>
82+
</div>
83+
84+
</div>
85+
86+
</div>
87+
</div>
88+
<!-- CONTENT-WRAPPER SECTION END-->
89+
<?php include('includes/footer.php');?>
90+
<!-- FOOTER SECTION END-->
91+
<!-- JAVASCRIPT FILES PLACED AT THE BOTTOM TO REDUCE THE LOADING TIME -->
92+
<!-- CORE JQUERY -->
93+
<script src="assets/js/jquery-1.10.2.js"></script>
94+
<!-- BOOTSTRAP SCRIPTS -->
95+
<script src="assets/js/bootstrap.js"></script>
96+
<!-- CUSTOM SCRIPTS -->
97+
<script src="assets/js/custom.js"></script>
98+
</body>
99+
</html>
100+
<?php } ?>

0 commit comments

Comments
 (0)