DEV Community

Cover image for πŸš€ Day 5: Sales Tracking Module in CRM
Ashish prajapati
Ashish prajapati

Posted on

πŸš€ Day 5: Sales Tracking Module in CRM

Hi everyone! πŸ‘‹ Welcome to Day 5 of my CRM development journey in PHP and MySQL. Today, I worked on the Sales Tracking Module, a critical feature for monitoring and analyzing sales activities effectively. Here's what I achieved:


πŸ—‚οΈ Folder Structure

I expanded the project by organizing files for the Sales Tracking Module:

Admin Folder Structure

  • add_sales.php: A form to record new sales with details like date, amount, payment method, and order status.
  • view_sales.php: Displays a list of all sales with options to sort and search.
  • Charts Folder:
    • sales_by_date.php: Visualizes sales trends over time.
    • sales_by_payment_method.php: Analyzes total sales based on payment methods.
    • sales_status_distro.php: Displays sales distribution by order status.

✍️ Features Implemented

1️⃣ Add Sales

I created the Add Sales Page (add_sales.php), where admins can record sales data.

  • Includes fields for date, amount, payment method, and order status.
  • Validation ensures no empty or invalid entries.

2️⃣ View Sales Records

The View Sales Page (view_sales.php) provides an overview of all recorded sales.

  • A sortable and searchable sales table.
  • Pagination to handle large datasets efficiently.

3️⃣ Analytics with Charts

The analytics section features three distinct charts powered by Chart.js:

  • Sales By Date: A line chart to visualize sales trends over time.
  • Sales By Payment Method: A bar chart analyzing total sales by payment methods (e.g., cash, card, online payment).
  • Sales Status Distribution: A pie chart showing sales distribution by order status (e.g., completed, pending, refunded).
    • Dynamic Chart Type Selection: Users can switch between chart types via a dropdown menu.

πŸ”‘ What I Learned Today

  1. Data Visualization: Implementing multiple chart types to provide insights into sales data.
  2. User-Friendly Interfaces: Designing sortable, searchable tables for better navigation.
  3. Dynamic Charts with Chart.js: Switching between chart types seamlessly using dropdown menus.

πŸ“Έ Image Areas

Dashboard

Image description

  1. Add Sales Page

Image description

  1. View Sales Records

Image description

Charts

Image description

  1. Sales By Date Chart

Image description

  1. Sales By Payment Method Chart

Image description

  1. Sales Status Distribution Chart

Image description


πŸ’‘ Key Takeaway

The Sales Tracking Module adds immense value to the CRM by offering sales monitoring and detailed analytics. Integrating multiple charts provides users with actionable insights to make data-driven decisions.


That’s it for Day 5! Stay tuned for Day 6, where I’ll dive into User Permissions and other exciting features. Let me know if you have feedback or ideas! 😊

Top comments (0)