Jump to content

Admin Client Summary - Adding Count Totals to The Summary Tables


brian!

Recommended Posts

in the thread below, a question was asked about how to show totals within the Client Summary (Summary Tab)...

if you wanted to show count totals for the Domains table, using labels, the code inside the 'clientsummary.tpl' template would be...

{$domainstatuscount = array_count_values(array_column($domainsummary, 'status'))}
     {foreach $domainstatuscount as $domainlabel => $domainstatus}
        <span class="label label-success">{$domainlabel} ({$domainstatus})</span>
    {/foreach} 

E0zJwVm.png

if you want to do the same for Products / Service...

{$productstatuscount = array_count_values(array_column($productsummary, 'domainstatus'))}
     {foreach $productstatuscount as $productlabel => $productstatus}
        <span class="label label-success">{$productlabel} ({$productstatus})</span>
    {/foreach} 

for addons..

{$addonstatuscount = array_count_values(array_column($addonsummary, 'status'))}
     {foreach $addonstatuscount as $addonlabel => $addonstatus}
        <span class="label label-success">{$addonlabel} ({$addonstatus})</span>
    {/foreach} 

and quotes...

{$quotestatuscount = array_count_values(array_column($quotes, 'stage'))}
     {foreach $quotestatuscount as $quotelabel => $quotestatus}
        <span class="label label-success">{$quotelabel} ({$quotestatus})</span>
    {/foreach}

if you want to use buttons instead (before you ask - they will not filter the table!)...

8xBoZzk.png

{$domainstatuscount = array_count_values(array_column($domainsummary, 'status'))}
     {foreach $domainstatuscount as $domainlabel => $domainstatus}
        <button type="button" class="btn btn-primary">{$domainlabel} <span class="badge">{$domainstatus}</span></button> 
    {/foreach} 

for products...

<button type="button" class="btn btn-primary">{$productlabel} <span class="badge">{$productstatus}</span></button> 

for addons...

<button type="button" class="btn btn-primary">{$addonlabel} <span class="badge">{$addonstatus}</span></button> 

and quotes...

<button type="button" class="btn btn-primary">{$quotelabel} <span class="badge">{$quotestatus}</span></button> 
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