Skip to content
Open
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
Binary file added Library/LibraryJTP.jar
Binary file not shown.
Binary file added Library/bin/AdminLogin$1.class
Binary file not shown.
Binary file added Library/bin/AdminLogin$2.class
Binary file not shown.
Binary file added Library/bin/AdminLogin.class
Binary file not shown.
Binary file added Library/bin/AdminSuccess$1.class
Binary file not shown.
Binary file added Library/bin/AdminSuccess$2.class
Binary file not shown.
Binary file added Library/bin/AdminSuccess$3.class
Binary file not shown.
Binary file added Library/bin/AdminSuccess$4.class
Binary file not shown.
Binary file added Library/bin/AdminSuccess$5.class
Binary file not shown.
Binary file added Library/bin/AdminSuccess.class
Binary file not shown.
Binary file added Library/bin/BookDao.class
Binary file not shown.
Binary file added Library/bin/BooksForm$1.class
Binary file not shown.
Binary file added Library/bin/BooksForm$2.class
Binary file not shown.
Binary file added Library/bin/BooksForm.class
Binary file not shown.
Binary file added Library/bin/DB.class
Binary file not shown.
Binary file added Library/bin/DeleteLibrarian$1.class
Binary file not shown.
Binary file added Library/bin/DeleteLibrarian$2.class
Binary file not shown.
Binary file added Library/bin/DeleteLibrarian$3.class
Binary file not shown.
Binary file added Library/bin/DeleteLibrarian.class
Binary file not shown.
Binary file added Library/bin/IssueBookDao.class
Binary file not shown.
Binary file added Library/bin/IssueBookForm$1.class
Binary file not shown.
Binary file added Library/bin/IssueBookForm$2.class
Binary file not shown.
Binary file added Library/bin/IssueBookForm$3.class
Binary file not shown.
Binary file added Library/bin/IssueBookForm.class
Binary file not shown.
Binary file added Library/bin/LibrarianDao.class
Binary file not shown.
Binary file added Library/bin/LibrarianForm$1.class
Binary file not shown.
Binary file added Library/bin/LibrarianForm$2.class
Binary file not shown.
Binary file added Library/bin/LibrarianForm$3.class
Binary file not shown.
Binary file added Library/bin/LibrarianForm.class
Binary file not shown.
Binary file added Library/bin/LibrarianLogin$1.class
Binary file not shown.
Binary file added Library/bin/LibrarianLogin$2.class
Binary file not shown.
Binary file added Library/bin/LibrarianLogin.class
Binary file not shown.
Binary file added Library/bin/LibrarianSuccess$1.class
Binary file not shown.
Binary file added Library/bin/LibrarianSuccess$2.class
Binary file not shown.
Binary file added Library/bin/LibrarianSuccess$3.class
Binary file not shown.
Binary file added Library/bin/LibrarianSuccess$4.class
Binary file not shown.
Binary file added Library/bin/LibrarianSuccess$5.class
Binary file not shown.
Binary file added Library/bin/LibrarianSuccess$6.class
Binary file not shown.
Binary file added Library/bin/LibrarianSuccess$7.class
Binary file not shown.
Binary file added Library/bin/LibrarianSuccess.class
Binary file not shown.
Binary file added Library/bin/Library$1.class
Binary file not shown.
Binary file added Library/bin/Library$2.class
Binary file not shown.
Binary file added Library/bin/Library$3.class
Binary file not shown.
Binary file added Library/bin/Library.class
Binary file not shown.
Binary file added Library/bin/ReturnBook$1.class
Binary file not shown.
Binary file added Library/bin/ReturnBook$2.class
Binary file not shown.
Binary file added Library/bin/ReturnBook$3.class
Binary file not shown.
Binary file added Library/bin/ReturnBook.class
Binary file not shown.
Binary file added Library/bin/ReturnBookDao.class
Binary file not shown.
Binary file added Library/bin/ViewBooks$1.class
Binary file not shown.
Binary file added Library/bin/ViewBooks.class
Binary file not shown.
Binary file added Library/bin/ViewIssuedBooks$1.class
Binary file not shown.
Binary file added Library/bin/ViewIssuedBooks.class
Binary file not shown.
Binary file added Library/bin/ViewLibrarian$1.class
Binary file not shown.
Binary file added Library/bin/ViewLibrarian.class
Binary file not shown.
54 changes: 54 additions & 0 deletions Library/bin/books.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
-- phpMyAdmin SQL Dump
-- version 3.4.5
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jul 19, 2016 at 07:40 PM
-- Server version: 5.5.16
-- PHP Version: 5.4.0beta2-dev

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

--
-- Database: `test`
--

-- --------------------------------------------------------

--
-- Table structure for table `books`
--

CREATE TABLE IF NOT EXISTS `books` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`callno` varchar(100) NOT NULL,
`name` varchar(100) NOT NULL,
`author` varchar(100) NOT NULL,
`publisher` varchar(100) NOT NULL,
`quantity` int(10) NOT NULL,
`issued` int(10) NOT NULL,
`added_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `callno` (`callno`),
UNIQUE KEY `callno_2` (`callno`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;

--
-- Dumping data for table `books`
--

INSERT INTO `books` (`id`, `callno`, `name`, `author`, `publisher`, `quantity`, `issued`, `added_date`) VALUES
(1, 'A@4', 'C In Depth', 'Shrivastav', 'BPB', 2, 2, '2016-07-19 19:37:56'),
(2, 'B@1', 'DBMS', 'Korth', 'Pearson', 3, 0, '2016-07-18 18:39:52'),
(3, 'G@12', 'Let''s see', 'Yashwant Kanetkar', 'BPB', 10, 0, '2016-07-18 23:02:14');

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
50 changes: 50 additions & 0 deletions Library/bin/issuebooks.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
-- phpMyAdmin SQL Dump
-- version 3.4.5
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jul 19, 2016 at 07:40 PM
-- Server version: 5.5.16
-- PHP Version: 5.4.0beta2-dev

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

--
-- Database: `test`
--

-- --------------------------------------------------------

--
-- Table structure for table `issuebooks`
--

CREATE TABLE IF NOT EXISTS `issuebooks` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`bookcallno` varchar(50) NOT NULL,
`studentid` int(11) NOT NULL,
`studentname` varchar(50) NOT NULL,
`studentcontact` varchar(20) NOT NULL,
`issueddate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=8 ;

--
-- Dumping data for table `issuebooks`
--

INSERT INTO `issuebooks` (`id`, `bookcallno`, `studentid`, `studentname`, `studentcontact`, `issueddate`) VALUES
(4, 'A@4', 23, 'kk', '932992932', '2016-07-19 18:43:16'),
(6, 'A@4', 335, 'Sumedh', '95676565756', '2016-07-19 18:44:34'),
(7, 'A@4', 87, 'abhishek', '9329882382', '2016-07-19 18:46:12');

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
51 changes: 51 additions & 0 deletions Library/bin/librarian.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
-- phpMyAdmin SQL Dump
-- version 3.4.5
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jul 19, 2016 at 07:40 PM
-- Server version: 5.5.16
-- PHP Version: 5.4.0beta2-dev

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

--
-- Database: `test`
--

-- --------------------------------------------------------

--
-- Table structure for table `librarian`
--

CREATE TABLE IF NOT EXISTS `librarian` (
`id` int(5) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`password` varchar(100) NOT NULL,
`email` varchar(100) NOT NULL,
`address` varchar(200) NOT NULL,
`city` varchar(100) NOT NULL,
`contact` varchar(20) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ;

--
-- Dumping data for table `librarian`
--

INSERT INTO `librarian` (`id`, `name`, `password`, `email`, `address`, `city`, `contact`) VALUES
(1, 'Prabhakar', 'ppp', 'prabhakar@gmail.com', 'javatpoint', 'noida', '9998328238'),
(4, 'sumedh', 'sumesh', 'sumesh@gmail.com', 'Kuch Bhi', 'noida', '93823932823'),
(6, 'abhi', 'abhi', 'abhi@gmail.com', 'javatpoint', 'noida', '92393282323');

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
121 changes: 121 additions & 0 deletions Library/src/AdminLogin.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JLabel;
import javax.swing.JOptionPane;

import java.awt.Font;
import java.awt.Color;
import javax.swing.JTextField;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JPasswordField;

public class AdminLogin extends JFrame {
static AdminLogin frame;
private JPanel contentPane;
private JTextField textField;
private JPasswordField passwordField;

/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
frame = new AdminLogin();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}

/**
* Create the frame.
*/
public AdminLogin() {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 450, 300);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);

JLabel lblAdminLoginForm = new JLabel("Admin Login Form");
lblAdminLoginForm.setForeground(Color.GRAY);
lblAdminLoginForm.setFont(new Font("Tahoma", Font.PLAIN, 18));

JLabel lblEnterName = new JLabel("Enter Name:");

JLabel lblEnterPassword = new JLabel("Enter Password:");

textField = new JTextField();
textField.setColumns(10);

JButton btnLogin = new JButton("Login");
btnLogin.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
String name=textField.getText();
String password=String.valueOf(passwordField.getPassword());
if(name.equals("admin")&&password.equals("admin123")){
AdminSuccess.main(new String[]{});
frame.dispose();
}else{
JOptionPane.showMessageDialog(AdminLogin.this, "Sorry, Username or Password Error","Login Error!", JOptionPane.ERROR_MESSAGE);
textField.setText("");
passwordField.setText("");
}
}
});

passwordField = new JPasswordField();
GroupLayout gl_contentPane = new GroupLayout(contentPane);
gl_contentPane.setHorizontalGroup(
gl_contentPane.createParallelGroup(Alignment.TRAILING)
.addGroup(gl_contentPane.createSequentialGroup()
.addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)
.addGroup(gl_contentPane.createSequentialGroup()
.addGap(124)
.addComponent(lblAdminLoginForm))
.addGroup(gl_contentPane.createSequentialGroup()
.addGap(19)
.addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)
.addComponent(lblEnterName)
.addComponent(lblEnterPassword))
.addGap(47)
.addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING, false)
.addComponent(passwordField)
.addComponent(textField, GroupLayout.DEFAULT_SIZE, 172, Short.MAX_VALUE))))
.addContainerGap(107, Short.MAX_VALUE))
.addGroup(gl_contentPane.createSequentialGroup()
.addContainerGap(187, Short.MAX_VALUE)
.addComponent(btnLogin, GroupLayout.PREFERRED_SIZE, 86, GroupLayout.PREFERRED_SIZE)
.addGap(151))
);
gl_contentPane.setVerticalGroup(
gl_contentPane.createParallelGroup(Alignment.LEADING)
.addGroup(gl_contentPane.createSequentialGroup()
.addComponent(lblAdminLoginForm)
.addGap(26)
.addGroup(gl_contentPane.createParallelGroup(Alignment.BASELINE)
.addComponent(lblEnterName)
.addComponent(textField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
.addGap(28)
.addGroup(gl_contentPane.createParallelGroup(Alignment.BASELINE)
.addComponent(lblEnterPassword)
.addComponent(passwordField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
.addGap(18)
.addComponent(btnLogin, GroupLayout.PREFERRED_SIZE, 37, GroupLayout.PREFERRED_SIZE)
.addContainerGap(80, Short.MAX_VALUE))
);
contentPane.setLayout(gl_contentPane);
}
}
117 changes: 117 additions & 0 deletions Library/src/AdminSuccess.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JLabel;
import java.awt.Color;
import java.awt.Font;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.LayoutStyle.ComponentPlacement;
import java.sql.*;
public class AdminSuccess extends JFrame {
static AdminSuccess frame;
private JPanel contentPane;

/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
frame = new AdminSuccess();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}

/**
* Create the frame.
*/
public AdminSuccess() {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 450, 371);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);

JLabel lblAdminSection = new JLabel("Admin Section");
lblAdminSection.setFont(new Font("Tahoma", Font.PLAIN, 22));
lblAdminSection.setForeground(Color.GRAY);

JButton btnNewButton = new JButton("Add Librarian");
btnNewButton.setFont(new Font("Tahoma", Font.PLAIN, 15));
btnNewButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
LibrarianForm.main(new String[]{});
frame.dispose();
}
});

JButton btnViewLibrarian = new JButton("View Librarian");
btnViewLibrarian.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
ViewLibrarian.main(new String[]{});
}
});
btnViewLibrarian.setFont(new Font("Tahoma", Font.PLAIN, 15));

JButton btnDeleteLibrarian = new JButton("Delete Librarian");
btnDeleteLibrarian.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
DeleteLibrarian.main(new String[]{});
frame.dispose();
}
});
btnDeleteLibrarian.setFont(new Font("Tahoma", Font.PLAIN, 15));

JButton btnLogout = new JButton("Logout");
btnLogout.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
Library.main(new String[]{});
frame.dispose();
}
});
btnLogout.setFont(new Font("Tahoma", Font.PLAIN, 15));
GroupLayout gl_contentPane = new GroupLayout(contentPane);
gl_contentPane.setHorizontalGroup(
gl_contentPane.createParallelGroup(Alignment.TRAILING)
.addGroup(gl_contentPane.createSequentialGroup()
.addContainerGap(150, Short.MAX_VALUE)
.addComponent(lblAdminSection, GroupLayout.PREFERRED_SIZE, 151, GroupLayout.PREFERRED_SIZE)
.addGap(123))
.addGroup(Alignment.LEADING, gl_contentPane.createSequentialGroup()
.addGap(134)
.addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)
.addComponent(btnLogout, GroupLayout.PREFERRED_SIZE, 181, GroupLayout.PREFERRED_SIZE)
.addComponent(btnDeleteLibrarian, GroupLayout.PREFERRED_SIZE, 181, GroupLayout.PREFERRED_SIZE)
.addComponent(btnViewLibrarian, GroupLayout.PREFERRED_SIZE, 181, GroupLayout.PREFERRED_SIZE)
.addComponent(btnNewButton, GroupLayout.PREFERRED_SIZE, 181, GroupLayout.PREFERRED_SIZE))
.addContainerGap(109, Short.MAX_VALUE))
);
gl_contentPane.setVerticalGroup(
gl_contentPane.createParallelGroup(Alignment.LEADING)
.addGroup(gl_contentPane.createSequentialGroup()
.addComponent(lblAdminSection, GroupLayout.PREFERRED_SIZE, 40, GroupLayout.PREFERRED_SIZE)
.addGap(11)
.addComponent(btnNewButton, GroupLayout.PREFERRED_SIZE, 49, GroupLayout.PREFERRED_SIZE)
.addGap(18)
.addComponent(btnViewLibrarian, GroupLayout.PREFERRED_SIZE, 49, GroupLayout.PREFERRED_SIZE)
.addGap(18)
.addComponent(btnDeleteLibrarian, GroupLayout.PREFERRED_SIZE, 49, GroupLayout.PREFERRED_SIZE)
.addGap(18)
.addComponent(btnLogout, GroupLayout.PREFERRED_SIZE, 49, GroupLayout.PREFERRED_SIZE)
.addContainerGap(21, Short.MAX_VALUE))
);
contentPane.setLayout(gl_contentPane);
}
}
Loading