Classifieds Management

The Classifieds Management page provides a comprehensive interface for managing classified advertisements in your system. This page allows administrators to view, search, edit, activate, deactivate, and delete classified ads with full soft-delete capabilities and bulk operations support.

Quick Start

To get started: Use the search box to find specific ads, or click "Show All" to view all active classified advertisements. Select ads using checkboxes for bulk operations, or use individual action buttons for single ad management. The status indicator shows whether ads are active, inactive, or deleted.


The dark navy header bar displays essential system information:

Element Description
User Badge Shows current logged-in user with person icon (clickable to return to Control Panel)
Page Title Displays "Web CoPilot 2.0 - Manage Classifieds"
Current Date Shows current date in format "Monday Jan 15, 2026"

Toolbar Functions

The toolbar provides quick access to all primary functions for managing classified advertisements:

Button Function Notes
+ Add Opens new classified ad creation form in popup window 500x400px popup window
â?쳌 Back Returns to previous page in browser history Uses JavaScript history.back()
â?? Close Closes page and returns to Control Panel Detects if in frame or standalone
â?» Refreshes the current page Reloads data from database
Search Box Searches across ID, name, description, email, and category Press Enter or click search button
Show All Clears search filters and shows all active ads Resets to default view
UnDelete Switches to deleted ads view for restoration Only shows soft-deleted records
Record Counter Shows total number of ads in current view Updates based on filters applied

Data Table Columns

The main data table displays classified advertisements with the following columns:

Column Description Sortable
Checkbox Select individual ads for bulk operations No
Posting ID Unique posting identifier for the classified ad Yes
Email Contact email address (clickable mailto link) Yes
Ad Name Title or name of the classified advertisement Yes
Type Classification type (For Sale, Wanted, Services, etc.) Yes
Category Category classification from Class_Categories table Yes
Hits Number of times the ad has been viewed Yes
Actions Edit, Delete, and View action buttons No
Status Visual status indicator with toggle functionality No
ID Internal database ID for the classified ad Yes

Individual Action Buttons

Each classified ad row contains action buttons for individual record management:

Button Function Availability
Edit Opens the classified ad edit form Always available
Delete Soft-deletes the ad (sets status to 2) Only for active/inactive ads
View Opens public view of the ad in new tab Requires View permission

Delete Confirmation

The Delete button shows a JavaScript confirmation dialog displaying the ad name before performing the soft-delete operation. This helps prevent accidental deletions.


Status Indicators

The status column shows visual indicators that also function as toggle buttons:

Icon Status Action
â?쳌 Green Circle Active (status = 1) Click to deactivate
â?쳌 Gray Circle Inactive (status = 0) Click to activate
â?? Red X Deleted (status = 2) No action (indicator only)

Deleted rows are highlighted with a light red background to make them easily identifiable when viewing the deleted records.


Bulk Operations

The system supports bulk operations through checkbox selection and DataTables integration:

Selection Process

  1. Use the header checkbox to select/deselect all visible records
  2. Individual checkboxes work across all paginated pages
  3. Selected items persist when navigating between pages
  4. Bulk action buttons appear in the DataTables controls area

Available Bulk Actions

Action Availability Function
Delete Selected Active records view Soft-deletes all selected ads
Restore Selected Deleted records view Restores selected ads to active status
Permanently Delete Deleted records view Hard-deletes selected ads (irreversible)

Search Functionality

The search system provides comprehensive filtering capabilities:

Searchable Fields

  • Ad ID: Searches the Class_Ad_ID field
  • Ad Name: Searches the Class_Ad_Name field
  • Description: Searches the Class_Ad_Description field
  • Email: Searches the Class_Ad_Email field
  • Category: Searches the Class_Category_Name field

Search Behavior

  • Uses partial matching with SQL LIKE operators
  • Searches are case-insensitive
  • Results are combined with OR logic across all fields
  • Search terms are preserved in the URL for bookmarking

Permission System

The system implements role-based access control:

User Type Access Level Restrictions
Admin (ID = 1) Full access to all classifieds None
Users Permission Can access classifieds management Must have "Users" in permissions list
View Permission Can use View button for public ad display Must have "View" in permissions list
Regular User Only their own classifieds Filtered by email address
No Permission Redirected to access denied page Cannot access classifieds management

Soft Delete Workflow

The system implements a three-tier deletion system for data safety:

Deletion States

  1. Active (status = 1): Normal operational state
  2. Inactive (status = 0): Deactivated but recoverable
  3. Soft-Deleted (status = 2): Marked for deletion, hidden from normal view
  4. Hard-Deleted: Permanently removed from database

Deletion Workflow Steps

  1. Click Delete button on active/inactive ad
  2. Confirm deletion in JavaScript dialog
  3. Ad status changes to 2 (soft-deleted)
  4. Ad disappears from normal view
  5. Access deleted ads via "UnDelete" button
  6. Choose to restore or permanently delete

Restoration Process

  1. Click "UnDelete" button in toolbar
  2. View displays only soft-deleted ads
  3. Select ads to restore using checkboxes
  4. Click "Restore Selected" button
  5. Ads return to active status (status = 1)

DataTable Features

The page uses advanced DataTables functionality for optimal data management:

Feature Function Details
Sorting Click column headers to sort Default sort by ID descending
Pagination Navigate through large datasets 25, 50, 100, or All records per page
Column Filtering Filter results using DataTables search Searches all visible columns
State Saving Remembers sort, page, and search settings Persists between sessions
Responsive Design Adapts to different screen sizes Mobile-friendly interface

Common Workflows

Adding a New Classified

  1. Click the green "Add" button in the toolbar
  2. Complete the form in the popup window (500x400px)
  3. Save the new classified ad
  4. Return to the main page to see the new entry

Bulk Deleting Ads

  1. Use checkboxes to select multiple ads
  2. Check the header checkbox to select all visible ads
  3. Click "Delete Selected" button
  4. Confirm the bulk deletion operation
  5. Selected ads move to soft-deleted status

Restoring Deleted Ads

  1. Click "UnDelete" button in toolbar
  2. View switches to show only deleted ads
  3. Select ads to restore using checkboxes
  4. Click "Restore Selected" button
  5. Ads return to active status and normal view

Managing Ad Status

  1. Locate the ad in the data table
  2. Click the status indicator in the status column
  3. Green circle (active) â?? Gray circle (inactive)
  4. Gray circle (inactive) â?? Green circle (active)
  5. Status changes are applied immediately


Summary

The Classifieds Management page provides comprehensive tools for managing classified advertisements with modern Bootstrap 5 interface, DataTables functionality, and robust soft-delete capabilities. Users can search, filter, sort, and perform bulk operations on classified ads while maintaining data integrity through the three-tier deletion system. Permission-based access ensures appropriate security levels, and the responsive design works across all device types. The system balances powerful administrative features with user-friendly operation through intuitive controls and clear visual indicators.