m107 Posted December 1, 2020 Share Posted December 1, 2020 @brian! yeah, actually got more complicated :)) 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted December 1, 2020 Author Share Posted December 1, 2020 10 minutes ago, m107 said: @brian! yeah, actually got more complicated :)) it got slightly simpler - in that now there is only one incorrect value and not two. 🙂 my suspicion is that there is something unique at play here - could be a third-party addon; some corruption in the tables; pending orders not being accepted in the right way.... for it to be 200+ out, that implies that whatever is causing this has been occurring for a while - i've no idea what it could be! 😕 0 Quote Link to comment Share on other sites More sharing options...
m107 Posted December 1, 2020 Share Posted December 1, 2020 Hmm, anyway to change the number to paid pending orders? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted December 2, 2020 Author Share Posted December 2, 2020 16 hours ago, m107 said: Hmm, anyway to change the number to paid pending orders? you could query the database for the result, but bear in mind (pedantic point coming!) that orders don't get paid, their invoices do, e.g there are scenarios where you could generate an order that doesn't have an invoice and so wouldn't be included in any such query. $pendingorders = Capsule::table('tblorders')->join('tblinvoices','tblorders.invoiceid','=','tblinvoices.id')->where('tblorders.status','Pending')->where('tblinvoices.status','Paid')->count(); 1 Quote Link to comment Share on other sites More sharing options...
m107 Posted December 9, 2020 Share Posted December 9, 2020 On 12/2/2020 at 4:32 PM, brian! said: you could query the database for the result, but bear in mind (pedantic point coming!) that orders don't get paid, their invoices do, e.g there are scenarios where you could generate an order that doesn't have an invoice and so wouldn't be included in any such query. $pendingorders = Capsule::table('tblorders')->join('tblinvoices','tblorders.invoiceid','=','tblinvoices.id')->where('tblorders.status','Pending')->where('tblinvoices.status','Paid')->count(); Worked! It is working man! 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted December 9, 2020 Author Share Posted December 9, 2020 8 hours ago, m107 said: Worked! It is working man! hurrah! 🎉 0 Quote Link to comment Share on other sites More sharing options...
cahdx Posted December 11, 2020 Share Posted December 11, 2020 Thanks for the hint and the hook brian ❤️ 0 Quote Link to comment Share on other sites More sharing options...
hoya8 Posted January 28, 2021 Share Posted January 28, 2021 Brian wins again ! is there any way to get that search bar from WHMCS 7 along with your this hook? (not going all back to 7 totally) (why WHMCS is going backward so much)? WHMCS8 needs to click first to enter search terms, yes one more click does matter hugely when you get busy 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted January 28, 2021 Author Share Posted January 28, 2021 3 hours ago, hoya8 said: is there any way to get that search bar from WHMCS 7 along with your this hook? (not going all back to 7 totally) I think my plan was to do that as an option when I publish the menu addon... one of the few things that makes me close to swearing about WHMCS is the idiotic menu system in v8 - the amount of time I waste because i've now got to go around the houses to get to the page I want in the admin area is just insane... surely, it's not rocket science to make a navigation menu that is sensible and not require multiple page clicks or searching. 1 Quote Link to comment Share on other sites More sharing options...
hoya8 Posted January 28, 2021 Share Posted January 28, 2021 I was also really shocked some of the issues (and features requested YES,) have been pending for YEARS Then every time they published new version, they simply go backward to make people create more "feature requests" that seems always pending 1 Quote Link to comment Share on other sites More sharing options...
hoya8 Posted February 3, 2021 Share Posted February 3, 2021 so we have have Pending Orders | Overdue Invoices | Ticket(s) Awaiting Reply on top, does anyone know that how to add one more item based on WHMCS 8.1- system setting -> "custom ticket status" ? such as Pending Orders | Overdue Invoices | Ticket(s) Awaiting Reply | waiting for billing dept thanks! 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted February 3, 2021 Author Share Posted February 3, 2021 3 hours ago, hoya8 said: on top, does anyone know that how to add one more item based on WHMCS 8.1- system setting -> "custom ticket status" ? it should just require a db lookup to get the count for your ticket conditions, e.g custom status, similar to some of the existing queries... almost certainly, that value won't be available by default and it will be need to be obtained from the database. 0 Quote Link to comment Share on other sites More sharing options...
hoya8 Posted February 3, 2021 Share Posted February 3, 2021 Hi Brian! please let me be your first client to buy your admin stat info ad-on 🙂 0 Quote Link to comment Share on other sites More sharing options...
Bidi Posted February 6, 2021 Share Posted February 6, 2021 (edited) Hello, Brian! frist thank you, this was a nightmare for me not having this. I optimize it a bit for mobile ...etc for those who need it. <style> #infostats { float: right; padding: 15px; position: absolute; width: 83%; max-height: 20px; text-align: right; } @media screen and (max-width: 500px) { #infostats { width: 100%; position: relative; padding-top: 10px; padding-bottom: 25px; background-color: #1a4d80; text-align: center; } } </style> <div id="infostats"> <div style="color: #fff; font-size: .8em; margin: 0;"> <a href="orders.php?status=Pending" style="color: #fff;"><span style="font-weight: 700; color: #fc0;">'.$pendingorders.'</span> '.AdminLang::trans('stats.pendingorders').'</a> | <a href="invoices.php?status=Overdue" style="color: #fff;"><span style="font-weight: 700; color: #fc0;">'.$overdueinvoices.'</span> '.AdminLang::trans('stats.overdueinvoices').'</a> | <a href="supporttickets.php" style="color: #fff;"><span style="font-weight: 700; color: #fc0;">'.$ticketsawaiting.'</span> '.AdminLang::trans('stats.ticketsawaitingreply').'</a> </div> </div> Edited February 6, 2021 by Bidi 1 Quote Link to comment Share on other sites More sharing options...
hoya8 Posted February 6, 2021 Share Posted February 6, 2021 hey Bidi thanks for this. I just tried it and liked the layout but logo of "WHMCS" 'is gone, not click-able to let us going back to index page, any way to add it back please? thanks 0 Quote Link to comment Share on other sites More sharing options...
Bidi Posted February 6, 2021 Share Posted February 6, 2021 (edited) 1 minute ago, hoya8 said: hey Bidi thanks for this. I just tried it and liked the layout but logo of "WHMCS" 'is gone, not click-able to let us going back to index page, any way to add it back please? thanks I sow now, i will edit my post, i fix it now 🙂 Edited February 6, 2021 by Bidi 0 Quote Link to comment Share on other sites More sharing options...
hoya8 Posted February 6, 2021 Share Posted February 6, 2021 HI Bidi so to be like this, but WHMCS logo is still not url-enabled 🙂 <?php # Stats Info Bar for v8 Blend # Written by brian! use WHMCS\Database\Capsule; use WHMCS\Billing\Invoice; use Carbon\Carbon; function admin_v8_infobar_hook($vars) { if ($vars['template'] == "blend") { $pendingstatuslist = Capsule::table('tblorderstatuses')->where('showpending','1')->pluck('title'); $pendingorders = Capsule::table('tblorders')->whereIn('status',$pendingstatuslist)->count(); $overdueinvoices = Invoice::overdue()->count(); $awaitingreplylist = Capsule::table('tblticketstatuses')->where('showawaiting','1')->pluck('title'); $ticketsawaiting = Capsule::table('tbltickets')->whereIn('status',$awaitingreplylist)->where('merged_ticket_id','0')->count(); $current_time = Carbon::now()->translatedFormat("l, j F Y, H:i"); $headerreturn = '<style> #infostats { float: right; padding: 15px; position: absolute; width: 83%; max-height: 20px; text-align: right; } @media screen and (max-width: 500px) { #infostats { width: 100%; position: relative; padding-top: 10px; padding-bottom: 25px; background-color: #1a4d80; text-align: center; } } </style> <div id="infostats"> <div style="color: #fff; font-size: .8em; margin: 0;"> <a href="orders.php?status=Pending" style="color: #fff;"><span style="font-weight: 700; color: #fc0;">'.$pendingorders.'</span> '.AdminLang::trans('stats.pendingorders').'</a> | <a href="invoices.php?status=Overdue" style="color: #fff;"><span style="font-weight: 700; color: #fc0;">'.$overdueinvoices.'</span> '.AdminLang::trans('stats.overdueinvoices').'</a> | <a href="supporttickets.php" style="color: #fff;"><span style="font-weight: 700; color: #fc0;">'.$ticketsawaiting.'</span> '.AdminLang::trans('stats.ticketsawaitingreply').'</a> </div> </div>'; return $headerreturn; } } add_hook("AdminAreaHeaderOutput",1,"admin_v8_infobar_hook"); 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted February 6, 2021 Author Share Posted February 6, 2021 5 minutes ago, hoya8 said: so to be like this, but WHMCS logo is still not url-enabled 🙂 the bottom half of the logo will still be hyperlinked. 0 Quote Link to comment Share on other sites More sharing options...
Bidi Posted February 6, 2021 Share Posted February 6, 2021 Just now, brian! said: the bottom half of the logo will still be hyperlinked. Yes but i whant to fix it 🙂 so i try to fix it now, i hope i can 🙂 0 Quote Link to comment Share on other sites More sharing options...
hoya8 Posted February 6, 2021 Share Posted February 6, 2021 (edited) right~~ still looking for a plugin/add-on to replace WHMCS 's tedious admin info bar Edited February 6, 2021 by hoya8 0 Quote Link to comment Share on other sites More sharing options...
Bidi Posted February 6, 2021 Share Posted February 6, 2021 (edited) 13 minutes ago, Bidi said: Yes but i whant to fix it 🙂 so i try to fix it now, i hope i can 🙂 <?php # Stats Info Bar for v8 Blend # Written by brian! use WHMCS\Database\Capsule; use WHMCS\Billing\Invoice; use Carbon\Carbon; function admin_v8_infobar_hook($vars) { if ($vars['template'] == "blend") { $pendingstatuslist = Capsule::table('tblorderstatuses')->where('showpending','1')->pluck('title'); $pendingorders = Capsule::table('tblorders')->whereIn('status',$pendingstatuslist)->count(); $overdueinvoices = Invoice::overdue()->count(); $awaitingreplylist = Capsule::table('tblticketstatuses')->where('showawaiting','1')->pluck('title'); $ticketsawaiting = Capsule::table('tbltickets')->whereIn('status',$awaitingreplylist)->where('merged_ticket_id','0')->count(); $current_time = Carbon::now()->translatedFormat("l, j F Y, H:i"); $headerreturn = ' <style> #infostats { float: right; padding: 15px; position: absolute; width: 83%; max-height: 20px; text-align: right; } #infostats2 { width: 50%; float: right;color: #fff; color: #fff; font-size: .8em; margin: 0; } #logoul { width: 125px; float:left; margin-top: -6px; margin-left: 20px; } @media screen and (max-width: 1300px) { #infostats { width: 100%; position: relative; padding-top: 10px; padding-bottom: 25px; background-color: #1a4d80; text-align: center; } #infostats2 { width: 100%; color: #fff; color: #fff; font-size: .8em; margin: 0; } #logoul { display: none; } } </style> <div id="infostats"> <a href="index.php" class="logo" title="Home"> <img src="templates/blend/images/logo.png" id="logoul"> </a> <div id="infostats2"style=""> <a href="orders.php?status=Pending" style="color: #fff;"><span style="font-weight: 700; color: #fc0;">'.$pendingorders.'</span> '.AdminLang::trans('stats.pendingorders').'</a> | <a href="invoices.php?status=Overdue" style="color: #fff;"><span style="font-weight: 700; color: #fc0;">'.$overdueinvoices.'</span> '.AdminLang::trans('stats.overdueinvoices').'</a> | <a href="supporttickets.php" style="color: #fff;"><span style="font-weight: 700; color: #fc0;">'.$ticketsawaiting.'</span> '.AdminLang::trans('stats.ticketsawaitingreply').'</a> </div> </div>'; return $headerreturn; } } add_hook("AdminAreaHeaderOutput",1,"admin_v8_infobar_hook"); Done now 🙂 is working for me om mobile, tablet, laptop, pc ...etc Edited February 6, 2021 by Bidi 0 Quote Link to comment Share on other sites More sharing options...
hoya8 Posted February 6, 2021 Share Posted February 6, 2021 Hi Bidi It now showed some line and odds around logo like this 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted February 6, 2021 Author Share Posted February 6, 2021 4 minutes ago, Bidi said: Done, go ahead test it for me works good on mobile, my laptop, tablet..etc you're over-engineering this... there were many reasons why I didn't try to do this in the original code. 2 minutes ago, hoya8 said: It now showed some line and odds around logo like this he's referencing an image that he must have uploaded locally, or the url is wrong... 0 Quote Link to comment Share on other sites More sharing options...
Bidi Posted February 6, 2021 Share Posted February 6, 2021 (edited) Change image url with the one belong, brian! he can help us with a php code whmcs for templates/blend/images/logo.png to get it right from templateurl, i know there was sompting like $themeurl 🙂 i dont remember but this is the only problem url of the logo, i`m on a coffe making this just for make it nice . I added the same logo of whmcs on top of my code div 🙂 <img src="templates/blend/images/logo.png" id="logoul"> Edited February 6, 2021 by Bidi 0 Quote Link to comment Share on other sites More sharing options...
Stuart Newton Posted February 16, 2021 Share Posted February 16, 2021 anyway to add "WHMCS - To-Do List" to this hook 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.