garybarr Posted March 7, 2020 Share Posted March 7, 2020 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"); ?> 0 Quote Link to comment Share on other sites More sharing options...
amit177 Posted March 8, 2020 Share Posted March 8, 2020 Fetch all of the departments from tblticketdepartments and then loop through tbltickets using the department id. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.