Jump to content

Hook to add up tickets in a department


garybarr

Recommended Posts

I am wanting to add to the header.tpl a total for department tickets that are open.   So like:

"0 Pending Orders | 9 Overdue Invoices | 33 Active Tickets | 0 AWAITING REPLY | Support 16 | Sales 5 | Web Design 12"

I have a thing I got to give those number for a status (which I included below)..., but not totaling a department.

 

Can anyone help?

 

----------------------------------------------------------------------------------------------

<?php

use Illuminate\Database\Capsule\Manager as Capsule;

#If making another Variable, use a different hook name

# **** Variable for ISP-Inquiry-Answered ****
function hook_ticket_status_active_ispanswered($vars) 
{
   $ticketsispanswered = Capsule::table('tbltickets')
               ->whereIn('status', array('Answered'))
               ->count();

   return array("ticketsispanswered" => $ticketsispanswered);
}
add_hook("AdminAreaPage", 1, "hook_ticket_status_active_ispanswered");

?>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated