Helpdesk System with jQuery, PHP & MySQL

A Helpdesk or service desk is a one-stop point of contact that provides centralized information and support management service to handle a company’s internal or external queries. A helpdesk software solution enables companies to resolve customer grievances faster and efficiently by simply automating the complaint resolution process with the ticket management system.
In this tutorial, we will learn how to Build a Helpdesk System with jQuery, PHP & MySQL. This is a very simple example, you can just copy-paste and change according to your requirement.
Before started to implement the Helpdesk System with jQuery, PHP & MySQL, look files structure:
  • helpdesk-system-php
    • class
      • Database.php
      • Users.php
      • Tickets.php
      • Department.php
      • Time.php
    • css
      • style.css
    • js
      • comman.js
      • department.js
      • tickets.js
      • user.js
    • templates
      • header.php
      • footer.php
    • config.php
    • menus.php
    • dbConfig.php
    • user.php
    • login.php
    • logout.php
    • user_action.php
    • add_ticket_model.php
    • ticket.php
    • ticket_action.php
    • view_ticket.php
    • department.php
    • department_action.php
Step 1: Create the database and Table
For this tutorial, you need a MySQL database with the following table:
Step 2: Database Connection class
Create a file named Database.php inside “class/” folder.
Step 3: Create a class file
Create a class file named Users.php inside “class/” folder.
  • The class handles the User process.
  • __construct() – Loads the required class.
  • isLoggedIn() – check login
  • login() – handle login process
  • getUserInfo() – get user record from database
  • listUser() – list users record from database
  • insert() – Insert recored in database
  • update() – update user record from database
  • delete() – Delete user record from database
Step 4: Create a class file
Create a class file named Ticket.php inside “class/” folder.
  • The class handles the Ticket process.
  • __construct() – Loads the required class.
  • getDepartments() – get departments list from database
  • closeTicket() – close ticket process
  • getTicketDetails() – get ticket record from database
  • gellAllTicket() – get tiecket record from database
  • createTicket() – Insert new recored in database
  • updateTicket() – update ticket record from database
  • ticketInfo() – ticket record from database
  • delete() – Delete tecket record from database
  • saveTicketReplies() – Save Ticket reply record in database
  • getTicketReplies() – get tecket replies record from database
  • updateTicketReadStatus() – update tecket replies record in database
Step 5: Create a class file
Create a class file named Department.php inside “class/” folder.
  • The class handles the Department process.
  • __construct() – Loads the required class.
  • listDepartment() – get departments list from database
  • getDepartmentDetails() – get department record from database
  • gellAllTicket() – get tiecket record from database
  • insert() – Insert new recored in database
  • update() – update department record from database
  • delete() – Delete department record from database
Step 6: Create a class file
Create a class file named Time.php inside “class/” folder.