School Asset Inventory Category Module

School Asset Inventory Category Module

Introduction

The School Asset Inventory System is designed to help schools efficiently track and manage their valuable assets. From computers and lab equipment to furniture and teaching materials, keeping an accurate record of these resources is essential for proper management, maintenance, and budgeting.

In this tutorial, we’ll focus on the Category Module, a crucial part of the system. The Category Module allows users to organize assets into specific categories, making it easier to sort and track items based on their type or purpose. For example, assets can be grouped under categories like “Technology,” “Furniture,” or “Laboratory Equipment.” This helps streamline inventory management and ensures that assets are properly categorized for reporting and decision-making.

Key Features of the Category Module:

  • Add Categories: Easily create new categories to organize school assets.
  • Update Categories: Modify existing categories to reflect changes in the inventory.
  • Delete Categories: Remove categories that are no longer needed.
  • View Categories: Display a list of all available categories, providing a clear overview of the asset organization.

By the end of this tutorial, you’ll learn how to build a fully functional Category Module that simplifies managing school assets and improves overall efficiency.

Understanding the tbl_category Table in the School Asset Inventory System

The tbl_category table plays a fundamental role in the School Asset Inventory System by organizing assets into manageable groups or classifications. It helps maintain an efficient and well-structured inventory, allowing for easy tracking and management of various assets.

Here is a breakdown of the structure of the tbl_category table:

  1. category_id (Primary Key)
    • This is the unique identifier for each category.
    • It is an auto-incrementing integer that ensures each category has a distinct ID, allowing the system to easily differentiate between categories.
  2. category_name
    • This column stores the name of the category (e.g., “Computers,” “Furniture,” “Laboratory Equipment”).
    • It is a varchar field that holds a descriptive name, making it easier for users to identify and group assets by type or purpose.
  3. description
    • This field holds additional information or details about the category.
    • It is a text field where users can input a more detailed explanation of what the category represents or how it should be used within the system (e.g., “All computers and related peripherals,” “Classroom furniture and fixtures”).

Purpose of the tbl_category Table

The tbl_category table ensures that each asset entered into the inventory system can be assigned to a specific category. This categorization:

  • Makes it easier to locate and track assets.
  • Helps in generating reports and data insights based on asset types.
  • Simplifies asset management by creating clear groupings.

In summary, the tbl_category table is essential for creating a structured and efficient School Asset Inventory System. It provides a clear classification for all assets, improving overall organization and management.

Explanation of Files in the Category Module

The Category Module in the School Asset Inventory System contains several important files that handle the core functionalities of managing categories. Below is an explanation of each file’s purpose and how they contribute to the module.

  1. category_list.php
  • Purpose: This file serves as the main interface for viewing all the categories in the system.
  • Functionality:
    • Displays a list of categories pulled from the database.
    • Provides action buttons to add new categories, edit existing categories, or delete them.
    • It may include pagination or search functionality to manage large sets of data efficiently.
  1. add_modal.php
  • Purpose: This file contains the modal form for adding new categories to the system.
  • Functionality:
    • When the user clicks the “Add Category” button, a modal pops up.
    • The modal includes input fields for category_name and description.
    • Upon submission, the form data is sent to the addCategory.php script in the function folder for processing.
  1. edit_delete_modal.php
  • Purpose: This file provides the modal forms for editing or deleting categories.
  • Functionality:
    • Edit Modal: Displays pre-filled data of the selected category, allowing the user to modify the category_name and description.
    • Delete Modal: Prompts the user to confirm deletion of a selected category.
    • Both forms send requests to their respective PHP scripts for updating or deleting categories in the database.

Files in the function Folder

The function folder contains the PHP scripts that handle database operations, ensuring that category-related tasks are executed efficiently.

  1. addCategory.php
  • Purpose: This file processes the addition of a new category into the database.
  • Functionality:
    • Receives data from add_modal.php.
    • Validates the inputs (e.g., ensures category_name is not empty).
    • Inserts the new category into the tbl_category table.
    • If successful, the user is redirected to the category_list.php page with a success message.
  1. checkDuplicate.php
  • Purpose: This script checks for duplicate category names before adding or updating a category.
  • Functionality:
    • Prevents the creation of categories with identical names to avoid data redundancy.
    • Before adding or editing a category, this script queries the tbl_category table to ensure no existing category has the same name.
  1. deleteCategory.php
  • Purpose: Handles the deletion of a category from the database.
  • Functionality:
    • Receives the category_id from the edit_delete_modal.php.
    • Executes a query to remove the category from the tbl_category table.
    • Ensures that category deletion doesn’t violate any data integrity constraints (e.g., assets assigned to the category).
  1. editCategory.php
  • Purpose: This file processes the updating of an existing category.
  • Functionality:
    • Receives updated data (e.g., category_name, description) from the edit modal.
    • Validates inputs and updates the corresponding record in the tbl_category table.
    • Redirects back to category_list.php with an appropriate success or error message.

Each file in the Category Module plays a vital role in managing the categories of assets in the School Asset Inventory System. Together, they allow users to efficiently add, update, delete, and view categories, ensuring the inventory remains well-organized and easy to manage.

NOTE: The files should be placed in the category folder inside the pages folder of the project. This ensures proper organization and access within the system.

Screenshots

School Asset Inventory Category Module - Delete Modal
School Asset Inventory Category Module – Delete Modal
School Asset Inventory Category Module - Edit and Update Modal
School Asset Inventory Category Module – Edit and Update Modal
School Asset Inventory Category Module - Add Modal
School Asset Inventory Category Module – Add Modal
School Asset Inventory Category Module - Category List
School Asset Inventory Category Module – Category List

Source code and Demo

FREE DOWNLOAD SOURCE CODE

Summary

In this part of the tutorial, we covered the School Asset Inventory Category Module, focusing on how to manage asset categories within the system. We discussed the structure of the tbl_category table, which stores category information such as category_id, category_name, and description. We also walked through the key files involved, including category_list.php, add_modal.php, edit_delete_modal.php, and the functions in the function folder like addCategory.php, checkDuplicate.php, deleteCategory.php, and editCategory.php. These files should be placed in the category folder inside the pages folder of the project. With this module, users can efficiently add, update, delete, and view asset categories.

Previous tutorial

School Asset Inventory Project Template

You may visit our Facebook page for more information, inquiries, and comments. Please subscribe also to our YouTube Channel to receive free capstone projects resources and computer programming tutorials.

Hire our team to do the project

, , , , , ,

Post navigation