sonuyos Posted June 30, 2020 Share Posted June 30, 2020 I want to add a link here - https://prnt.sc/t9bjob Something that would let me click and go to a link directly, it is just a link, nothing special. Anyway to do it? I want to add it only on a specific module, say module/server/XYZModule/ I want it for that module only. Any idea how to do it? 0 Quote Link to comment Share on other sites More sharing options...
Kian Posted July 1, 2020 Share Posted July 1, 2020 (edited) Preview: Code: <?php /** * @writtenby Kian */ use WHMCS\Database\Capsule; add_hook('AdminAreaHeaderOutput', 1, function($vars) { if ($vars['filename'] == 'clientsservices') { $moduleName = 'cpanel'; // Replace with your server module name if (Capsule::select(Capsule::raw('SELECT t1.id FROM tblhosting AS t1 LEFT JOIN tblproducts AS t2 ON t1.packageid = t2.id WHERE t1.id = "' . $_GET['productselect'] . '" AND t2.servertype = "' . $moduleName . '"'))) { $output .= <<<HTML <script type="text/javascript"> $(document).ready(function(){ $("#inputDedicatedip").addClass("pull-left"); $("#inputDedicatedip").closest(".fieldarea").append('<a href="https://google.com" class="btn btn-danger pull-right"><i class="fas fa-shower"></i> Bath Time</a>'); }); </script> HTML; return $output; } } }); But there's a downside that I can't figure how to solve. When you click "Products/Services" tab WHMCS brings you to a "random" product/service. The ID for this specific product is not available hence the script can't be triggered. Edited July 1, 2020 by Kian 1 Quote Link to comment Share on other sites More sharing options...
sonuyos Posted July 2, 2020 Author Share Posted July 2, 2020 19 hours ago, Kian said: Preview: Code: <?php /** * @writtenby Kian */ use WHMCS\Database\Capsule; add_hook('AdminAreaHeaderOutput', 1, function($vars) { if ($vars['filename'] == 'clientsservices') { $moduleName = 'cpanel'; // Replace with your server module name if (Capsule::select(Capsule::raw('SELECT t1.id FROM tblhosting AS t1 LEFT JOIN tblproducts AS t2 ON t1.packageid = t2.id WHERE t1.id = "' . $_GET['productselect'] . '" AND t2.servertype = "' . $moduleName . '"'))) { $output .= <<<HTML <script type="text/javascript"> $(document).ready(function(){ $("#inputDedicatedip").addClass("pull-left"); $("#inputDedicatedip").closest(".fieldarea").append('<a href="https://google.com" class="btn btn-danger pull-right"><i class="fas fa-shower"></i> Bath Time</a>'); }); </script> HTML; return $output; } } }); But there's a downside that I can't figure how to solve. When you click "Products/Services" tab WHMCS brings you to a "random" product/service. The ID for this specific product is not available hence the script can't be triggered. Thanks, however that didnt work, so i rectified the code a littlle, and now it works. $pid = (int) $_REQUEST['id']; if (Capsule::select(Capsule::raw('SELECT t1.id FROM tblhosting AS t1 LEFT JOIN tblproducts AS t2 ON t1.packageid = t2.id WHERE t1.id = "' . $pid . '" AND t2.servertype = "' . $moduleName . '"'))) 0 Quote Link to comment Share on other sites More sharing options...
ManagedCloud-Hosting Posted August 26, 2020 Share Posted August 26, 2020 (edited) Hi @Kian If I want to add this to Admin Home Page what should I do ? ScreenShot below - Edited August 26, 2020 by VirtualWorldGlobal 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 26, 2020 Share Posted August 26, 2020 3 hours ago, VirtualWorldGlobal said: If I want to add this to Admin Home Page what should I do ? enable the Staff Online widget.... 0 Quote Link to comment Share on other sites More sharing options...
ManagedCloud-Hosting Posted August 26, 2020 Share Posted August 26, 2020 I am so sorry I uploaded the wrong screenshot. Actually I want to add a link in the Admin Area maybe within the Staff Online section so that we can click and reach another website. I will PM you once I add everyone to the specific account login and update you on any issues if I face. 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.