Jump to content

baymax

Senior Member
  • Content Count

    38
  • Joined

  • Last visited

Community Reputation

5 Neutral

About baymax

  • Rank
    Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. This should get you started... SELECT tblclients.firstname AS `Client`, tblproducts.name AS `Product Name`, tblhosting.domain AS `Hostname`, tblcurrencies.code AS `Currency`, tblhosting.amount AS `Amount`, tblhosting.paymentmethod AS `Payment Method`, tblhosting.billingcycle AS `Billing Cycle` FROM tblclients INNER JOIN tblhosting ON tblclients.id = tblhosting.userid INNER JOIN tblproducts ON tblhosting.packageid = tblproducts.id INNER JOIN tblproductgroups ON tblproducts.gid = tblproductgroups.id INNER JOIN tblcurrencies ON tblclients.currency = tblcurrencies.id
  2. I learned a lot from Brian as well 😉
  3. maybe this query if all 60 clients are in the same group currently. UPDATE tblclients SET groupid='new-group-ID' WHERE groupid='current-group-ID'; Replace the parts in green.
  4. So strange... it's still working as hyperlinks for everything except Domains. Still just a text. And I've tested it on several domain invoices..
  5. Hey @Kian @brian! Thanks for the feedback. I fixed the URL for addons. Since you've confirmed that both versions work on the latest WHMCS, I didn't bother changing the code for that. What does this line do? $('input[name^="itemids"][value="'+ e.id +'"]').closest('tr').children('*').eq(-2).html('<img src="unknown.png" style="height: 16px;width: 16px;">'); The icon is still not appearing for anything *Domains* though. If I remove the code for Addons, Domains seems to be working but not when I include the code for Addons. See below. <?php use WHMCS\Database\Capsule; add_hook('AdminAreaHeaderOutput', 1, function($vars) { if ($vars['filename'] == 'invoices' AND $_GET['id']) { $Data = Capsule::select(Capsule::raw('SELECT id, type, relid FROM tblinvoiceitems WHERE invoiceid = "' . $_GET['id'] . '"')); $Data = json_encode($Data, true); $output .= <<<HTML <script type="text/javascript"> $(document).ready(function(){ var rel = {$Data}; var rows = $('.datatable td > input[name^="itemids"]').first().closest('tbody').children('tr'); $.each(rows, function(i,e){ $(e).children('*').last().clone().html('').insertBefore($(e).children('*').last()); }) rows.first().children('th').eq(-2).text('Link'); $.each(rel, function(i,e){ if (e.type == 'Hosting') { var url = 'clientsservices.php?id=' + e.relid; var faicon = 'fa-server'; } else if (e.type.includes('DomainRegister', 'DomainTransfer', 'Domain')) { var url = 'clientsdomains.php?id=' + e.relid; var faicon = 'fa-globe'; } else if (e.type.includes('Addon', 'Setup')) { var url = 'clientsservices.php?id=' + e.relid; var faicon = 'fa-sliders-h'; } if (url) { $('input[name^="itemids"][value="'+ e.id +'"]').closest('tr').children('*').eq(-2).html('<a href="'+ url +'" target="_blank"><i class="fas '+ faicon +'"></i></a>'); } // else // { // $('input[name^="itemids"][value="'+ e.id +'"]').closest('tr').children('*').eq(-2).html('<img src="unknown.png" style="height: 16px;width: 16px;">'); // } }) }) </script> HTML; return $output; } });
  6. Here's mine: <?php use WHMCS\Database\Capsule; add_hook('AdminAreaHeaderOutput', 1, function($vars) { if ($vars['filename'] == 'invoices' AND $_GET['id']) { $Data = Capsule::select(Capsule::raw('SELECT id, type, relid FROM tblinvoiceitems WHERE invoiceid = "' . $_GET['id'] . '"')); $Data = json_encode($Data, true); $output .= <<<HTML <script type="text/javascript"> $(document).ready(function(){ var rel = {$Data}; var rows = $('.datatable td > input[name^="itemids"]').first().closest('tbody').children('tr'); $.each(rows, function(i,e){ $(e).children('*').last().clone().html('').insertBefore($(e).children('*').last()); }) rows.first().children('th').eq(-2).text('Link'); $.each(rel, function(i,e){ if (e.type == 'Hosting') { var url = 'clientsservices.php?id=' + e.relid; var faicon = 'fa-server'; } else if (e.type.includes('DomainRegister', 'DomainTransfer', 'Domain')) { var url = 'clientsdomains.php?id=' + e.relid; var faicon = 'fa-globe'; } else if (e.type.includes('Addon', 'Setup')) { var url = 'clientsdomains.php?id=' + e.relid; var faicon = 'fa-sliders-h'; } if (url) { $('input[name^="itemids"][value="'+ e.id +'"]').closest('tr').children('*').eq(-2).html('<a href="'+ url +'" target="_blank"><i class="fas '+ faicon +'"></i></a>'); } // else // { // $('input[name^="itemids"][value="'+ e.id +'"]').closest('tr').children('*').eq(-2).html('<img src="unknown.png" style="height: 16px;width: 16px;">'); // } }) }) </script> HTML; return $output; } });
  7. Figured it out. Works for 'Hosting' but the anything *Domains* is *not* showing the fa-globe icon nor the link. Instead, it displays the image file per the code at the bottom OR shows the Services icon instead. Please assist 🙂
  8. Hi, I managed to get this hook added and it did add a new column for me to the invoice. They're blank though and I suspect fa-server and fa-globe is the problem. Where do these images go or come from?
  9. I receive the daily report which shows SSL is synced however when I go to the SSL Monitoring page, it hasn't updated the expiry dates for all the SSL. Some of the last update dates show over a month ago. And when I click the Revalidate SSL Status button, it refreshes the SSL dates but not for all of them. Refreshing the page reverts it back to old dates.
  10. Hey Brian. Something to do with tblhosting.userid and tblcurrencies.id? 🙂
  11. I was using 7.9.1 and the Transactions report's filter for Currency is not working. I've updated to 7.9.2 but it looks like this hasn't changed. Is anyone else experiencing this problem? It does produce the currency but it just does not filter if I enter a specific currency to be filtered.
  12. You know what's messed up? I totally understand what we are trying to do here and where to get the information, but I've got zero clue how to get it into the Services report and make it show up (lol). SQL newbie here...
  13. Brian! Here's what I've done. Tested the query from the above code: SELECT `name` FROM `tblproducts` WHERE `tblproducts`.`id`=`tblhosting`.`packageid` This did not work so I made some adjustments and came up with the following: SELECT `name` FROM `tblproducts` inner join `tblhosting` on `tblproducts`.`id`=`tblhosting`.`packageid` This worked but the Services page still produced errors about 'packagename'. I'm stumped.
  14. sentq I need this as well. However, the code above didn't work for me. Please and thank you!
×
×
  • 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