Skip to content

Latest commit

 

History

History
335 lines (270 loc) · 12.1 KB

File metadata and controls

335 lines (270 loc) · 12.1 KB

📚 Library Management System

PHP MySQL Bootstrap License

🎯 Project Overview

Library Management System is a comprehensive web-based application designed to manage library operations efficiently. The system provides separate interfaces for administrators and students, enabling seamless book management, issue/return tracking, and user management with modern UI/UX design.

✨ Features: Complete library automation with admin panel, student portal, PDF reports, and responsive design.

🚀 Key Features

👨‍💼 Admin Features

  • 📊 Admin Dashboard: Comprehensive overview of library operations
  • 📚 Book Management: Add, view, update, and delete books
  • 👥 Student Management: Add, view, edit, and delete student records
  • 📖 Issue/Return Books: Issue books to students and manage returns
  • 📋 Book Requests: Approve or reject student book requests
  • 📄 PDF Reports: Generate and download issued books reports
  • 🔍 Advanced Search: Search books and students with pagination
  • 📱 Responsive Design: Works seamlessly on all devices

🎓 Student Features

  • 🏠 Student Dashboard: Personalized dashboard with quick access
  • 📚 Browse Books: View all available books in the library
  • 📖 Request Books: Request books for issue
  • 📋 Issued Books: Track currently issued books
  • 🔄 Return Books: Return books with automatic fine calculation
  • 🔍 Search Functionality: Search books by title, author, or category
  • 📱 Mobile Friendly: Optimized for mobile devices

🎨 UI/UX Features

  • 🌙 Modern Dark Theme: Elegant dark theme with gradient effects
  • 💫 Interactive Animations: Smooth transitions and hover effects
  • 📱 Responsive Design: Bootstrap-based responsive layout
  • 🎯 User-Friendly: Intuitive interface for both admin and students
  • ⚡ Fast Loading: Optimized performance with minimal load times

🛠️ Technology Stack

Backend

  • PHP - Server-side scripting language
  • MySQL - Relational database management
  • mysqli - PHP MySQL database connection

Frontend

  • HTML5 - Modern markup language
  • CSS3 - Advanced styling with animations
  • Bootstrap 5.3.0 - Responsive CSS framework
  • JavaScript - Interactive functionality
  • Font Awesome 6.0 - Icon library

Libraries & Tools

  • FPDF - PDF generation library
  • PHPMailer 6.9 - Email functionality
  • SweetAlert2 - Beautiful alert dialogs
  • Google Fonts (Poppins) - Modern typography

🗄️ Database Schema

Tables Structure

-- Admins Table
admins (username, password)

-- Students Table  
students (student_id, name, email, username, password)

-- Books Table
books (book_id, title, author, category, status)

-- Transactions Table
transactions (transaction_id, book_id, student_id, issue_date, return_date, status, fine_amount)

Key Relationships

  • Books ↔ Transactions: One-to-Many (One book can have multiple transactions)
  • Students ↔ Transactions: One-to-Many (One student can have multiple transactions)
  • Transactions: Junction table linking books and students

🏗️ Project Structure

library-management/
├── 📁 student/                 # Student portal files
│   ├── auth.php               # Student authentication
│   ├── dashboard.php          # Student dashboard
│   ├── books.php              # Browse available books
│   ├── issued_books.php       # View issued books
│   ├── request_book.php       # Request book functionality
│   └── return_book.php        # Return book functionality
├── 📁 src/                    # PHPMailer source files
├── 📁 vendor/                 # Composer dependencies
├── 📁 fpdf186/                # FPDF library files
├── 📁 font/                   # Font files for PDF
├── 🌐 index.html              # Landing page
├── 🔐 login1.php              # Admin login
├── 📊 admin_dashboard.php     # Admin dashboard
├── 📚 add_book1.php           # Add new books
├── 📖 issue_book1.php         # Issue books to students
├── 👥 add_student1.php        # Add new students
├── 📋 view_books.php          # View all books
├── 📊 view_issued_books.php   # View issued books
├── 👥 view_members.php        # View all students
├── 📋 book_requests.php       # Manage book requests
├── ✅ approve_request.php     # Approve book requests
├── ❌ reject_request.php      # Reject book requests
├── 🔄 return_book.php         # Return book functionality
├── 📄 generate_pdf.php        # PDF report generation
├── 🗄️ db_connection.php       # Database connection
├── 🚪 logout.php              # Logout functionality
├── 🎨 style.css               # Custom styles
└── 📝 composer.json           # PHP dependencies

⚡ Quick Start

Prerequisites

  • XAMPP/WAMP/LAMP - Local server environment
  • PHP 7.4+ - Server-side scripting
  • MySQL 5.7+ - Database server
  • Web Browser - Chrome, Firefox, Safari, etc.

Installation Steps

  1. Clone the Repository

    git clone https://github.com/yourusername/library-management.git
    cd library-management
  2. Setup Local Server

    • Start XAMPP/WAMP control panel
    • Start Apache and MySQL services
    • Copy project folder to htdocs/ (XAMPP) or www/ (WAMP)
  3. Create Database

    -- Open phpMyAdmin (http://localhost/phpmyadmin)
    -- Create new database
    CREATE DATABASE library_management;
    
    -- Create tables
    USE library_management;
    
    -- Admins table
    CREATE TABLE admins (
        id INT AUTO_INCREMENT PRIMARY KEY,
        username VARCHAR(50) UNIQUE NOT NULL,
        password VARCHAR(255) NOT NULL
    );
    
    -- Students table
    CREATE TABLE students (
        student_id INT AUTO_INCREMENT PRIMARY KEY,
        name VARCHAR(100) NOT NULL,
        email VARCHAR(100) UNIQUE NOT NULL,
        username VARCHAR(50) UNIQUE NOT NULL,
        password VARCHAR(255) NOT NULL
    );
    
    -- Books table
    CREATE TABLE books (
        book_id INT AUTO_INCREMENT PRIMARY KEY,
        title VARCHAR(200) NOT NULL,
        author VARCHAR(100) NOT NULL,
        category VARCHAR(50) NOT NULL,
        status ENUM('Available', 'Issued') DEFAULT 'Available'
    );
    
    -- Transactions table
    CREATE TABLE transactions (
        transaction_id INT AUTO_INCREMENT PRIMARY KEY,
        book_id INT NOT NULL,
        student_id INT NOT NULL,
        issue_date DATE NOT NULL,
        return_date DATE NULL,
        status ENUM('Requested', 'Issued', 'Returned') DEFAULT 'Requested',
        fine_amount DECIMAL(10,2) DEFAULT 0.00,
        FOREIGN KEY (book_id) REFERENCES books(book_id),
        FOREIGN KEY (student_id) REFERENCES students(student_id)
    );
  4. Configure Database Connection

    // Edit db_connection.php
    $servername = "localhost";
    $username = "root";
    $password = "";        // Your MySQL password
    $dbname = "library_management";
  5. Install Dependencies

    composer install
  6. Create Admin Account

    -- Insert default admin
    INSERT INTO admins (username, password) VALUES ('admin', 'admin123');
  7. Launch Application

    Open browser and navigate to:
    http://localhost/library-management/
    

Default Login Credentials

  • Admin: username: admin, password: admin123
  • Student: Register new account from student portal

📖 Usage Guide

For Administrators

  1. Login: Access admin panel via login1.php
  2. Add Books: Navigate to "Add New Book" from dashboard
  3. Manage Students: Add/view/edit student records
  4. Issue Books: Issue books to registered students
  5. Track Books: Monitor all issued books and returns
  6. Generate Reports: Download PDF reports of issued books

For Students

  1. Register: Create account from student portal
  2. Browse Books: View all available books
  3. Request Books: Send book request to admin
  4. Track Issues: Monitor your issued books
  5. Return Books: Return books with automatic fine calculation

🎨 Features Showcase

Modern UI Design

  • Dark Theme: Elegant dark color scheme with gradient effects
  • Responsive Layout: Works perfectly on desktop, tablet, and mobile
  • Interactive Elements: Smooth hover effects and transitions
  • Font Awesome Icons: Beautiful icons throughout the interface

Advanced Functionality

  • Search & Filter: Advanced search across books and students
  • Pagination: Efficient data loading with pagination
  • PDF Generation: Professional reports with FPDF
  • Session Management: Secure user authentication
  • Input Validation: Client and server-side validation

User Experience

  • Intuitive Navigation: Easy-to-use interface for all users
  • Quick Actions: One-click operations for common tasks
  • Status Indicators: Clear visual feedback for all operations
  • Error Handling: Graceful error messages and validation

🔧 Customization

Styling

  • Edit style.css and styles.css for custom themes
  • Modify Bootstrap classes for layout changes
  • Update color variables in CSS for different color schemes

Functionality

  • Add new features by creating new PHP files
  • Extend database schema as needed
  • Integrate additional libraries via Composer

Configuration

  • Database settings in db_connection.php
  • Email settings for PHPMailer (if implemented)
  • PDF styling in generate_pdf.php

🤝 Contributing

We welcome contributions! Here's how you can help:

  1. Fork the Repository
  2. Create Feature Branch (git checkout -b feature/NewFeature)
  3. Commit Changes (git commit -m 'Add New Feature')
  4. Push to Branch (git push origin feature/NewFeature)
  5. Open Pull Request

Contribution Guidelines

  • Follow PHP PSR coding standards
  • Add comments for complex functionality
  • Test thoroughly before submitting
  • Update documentation if needed

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

What this means:

  • Free to use for personal and commercial projects
  • Modify and distribute as needed
  • Private use allowed
  • ⚠️ Include copyright notice when redistributing
  • ⚠️ No warranty provided

🙏 Credits & Attribution

Developer: Tabrez Rabbani

Acknowledgments

  • Bootstrap - For responsive CSS framework
  • Font Awesome - For beautiful icons
  • FPDF - For PDF generation capabilities
  • PHPMailer - For email functionality
  • SweetAlert2 - For elegant alert dialogs

📞 Support

Having issues? Need help with customization?

🎯 Future Enhancements

  • Email Notifications - Automated email alerts for due dates
  • Barcode Integration - Barcode scanning for books
  • Advanced Analytics - Detailed reports and analytics
  • Mobile App - Native mobile application
  • API Integration - RESTful API for external integrations
  • Multi-branch Support - Support for multiple library branches

⭐ If you find this project helpful, please give it a star! It motivates me to create more open-source projects.

💡 Found this useful? Consider buying me a coffee: PayPal