Jump to content

Sparky's Admin Upcoming Domain Renewals V4 template


Recommended Posts

  • 3 weeks later...
  • Replies 143
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

  • 1 month later...

BUG?

 

I have some hosting I give for free. The upcoming hosting renewals continues to show them despite them having no Next Due Date - see attachments.

 

Maybe it needs a tweak "if amount due == $0 then do not display". If I wasn't heading away for 6 weeks from Saturday I would try to sort it myself.

 

whmcs.jpg

whmcs.png

Edited by xxxmicrobexxx
Link to comment
Share on other sites

  • 2 weeks later...
Show Upcoming Domain Renewals on the Admin V4 homepage that will expire in the next 90 days.

Change the number in $range = "<= 90"; to the number of days before expiry that you want to display.

 

Open admin/templates/v4/homepage.tpl

 

Find:

<div class="errorbox" style="font-size:14px;"><a href="supporttickets.php">{$sidebarstats.tickets.awaitingreply} Ticket(s) Awaiting Reply</a> || <a href="cancelrequests.php">{$stats.cancellations.pending} Pending Cancellation(s)</a> || <a href="todolist.php">{$stats.todoitems.due} To-Do Item(s) Due</a> || <a href="networkissues.php">{$stats.networkissues.open} Open Network Issue(s)</a></div>

<br />

Underneath it insert this code:

<!-- START ADMIN UPCOMING DOMAIN RENEWALS -->

<h3 align="center">Upcoming Domain Renewals</h3>

<table bgcolor="#cccccc" align="center" style="margin-bottom:5px;width:100%;" cellspacing="1">
<tr bgcolor="#efefef" style="text-align:center;font-weight:bold;"><td>Domain</td><td>Registrar</td><td>Period</td><td>Next Due Date</td><td>Expiration Date</td><td>Amount</td><td>Do Not<br />Renew</td></tr>
{php}
   $x=1; $range = "<= 90";
   $result = mysql_query("SELECT * FROM `tbldomains` WHERE DATEDIFF(`expirydate`, Now()) $range AND `status` = 'Active' ORDER BY `expirydate` ASC");
   while ($data = @mysql_fetch_array ($result)) {
       echo '<tr bgcolor="#ffffff" style="text-align:center;"><td><a href="clientsdomains.php?userid='.$data['userid'].'&id='.$data['id'].'">'.$data['domain'].'</a></td><td>'.$data['registrar'].'</td><td>'.$data['registrationperiod'].'</td><td>'.fromMySQLDate($data['nextduedate']).'</td><td>'.fromMySQLDate($data['expirydate']).'</td><td>'.formatCurrency($data['recurringamount']).'</td><td>'.$data['donotrenew'].'</td></tr>'; $x=0;
   }
   if($x) echo '<tr bgcolor="#ffffff" style="text-align:center;"><td colspan="7">No upcoming domain renewals</td></tr>';
{/php}
</table>
<br />
<!-- END ADMIN UPCOMING DOMAIN RENEWALS -->

 

Perfect, thank you!

Link to comment
Share on other sites

BUG?

 

I have some hosting I give for free. The upcoming hosting renewals continues to show them despite them having no Next Due Date - see attachments.

 

Maybe it needs a tweak "if amount due == $0 then do not display". If I wasn't heading away for 6 weeks from Saturday I would try to sort it myself.

 

[ATTACH=CONFIG]4486[/ATTACH] [ATTACH=CONFIG]4483[/ATTACH]

 

This is not a bug, you had set the product as free, by this not there renews, if you change to monthly or anyone, will change to true date.

Link to comment
Share on other sites

  • 11 months later...

If anyone is interested, I've taken Sparky's code and created a Widget for the homepage. This is running on my version 5.3.5

 

Just create a new file in modules/widgets and paste this code in. Then head over to Setup > Staff Management > Administrator Roles > Edit and scroll down to Widgets and then tick yours (in this example it's called "Expiring Domains".

 

I've no idea if this is the correct way to do it or won't break everything and make the sky fall down but it works for me.

 

<?php

if (!defined("WHMCS"))
   die("This file cannot be accessed directly");

function widget_domains_expiring() {

$content = '<table bgcolor="#cccccc" align="center" style="margin-bottom:5px;width:100%;" cellspacing="1">
<tr bgcolor="#efefef" style="text-align:center;font-weight:bold;"><td>Domain</td><td>Registrar</td><td>Period</td><td>Next Due Date</td><td>Expiration Date</td><td>Amount</td><td>Do Not<br />Renew</td></tr>';

$x=1; $range = "<= 90";
   $result = mysql_query("SELECT * FROM `tbldomains` WHERE DATEDIFF(`expirydate`, Now()) $range AND `status` = 'Active' ORDER BY `expirydate` ASC");
   while ($data = @mysql_fetch_array ($result)) {
       $content .= '<tr bgcolor="#ffffff" style="text-align:center;"><td><a href="clientsdomains.php?userid='.$data['userid'].'&id='.$data['id'].'">'.$data['domain'].'</a></td><td>'.$data['registrar'].'</td><td>'.$data['registrationperiod'].'</td><td>'.fromMySQLDate($data['nextduedate']).'</td><td>'.fromMySQLDate($data['expirydate']).'</td><td>'.formatCurrency($data['recurringamount']).'</td><td>'.$data['donotrenew'].'</td></tr>'; $x=0;
   }
   if($x) $content =  '<tr bgcolor="#ffffff" style="text-align:center;"><td colspan="7">No upcoming domain renewals</td></tr>';
$content .= '</table>';

   return array( 'title' => 'Expiring Domains', 'content' => $content );
}

add_hook("AdminHomeWidgets",1,"widget_domains_expiring");

?>

Edited by Dgital Essence
Added PHP code tags around code
Link to comment
Share on other sites

  • 6 months later...
If anyone is interested, I've taken Sparky's code and created a Widget for the homepage. This is running on my version 5.3.5

 

Just create a new file in modules/widgets and paste this code in. Then head over to Setup > Staff Management > Administrator Roles > Edit and scroll down to Widgets and then tick yours (in this example it's called "Expiring Domains".

 

I've no idea if this is the correct way to do it or won't break everything and make the sky fall down but it works for me.

 

Thank you!

 

This is fantastic and I've already integrated it. In one of my whmcs installs I changed the range to 30 days so the list wasn't so long.

 

bh

Link to comment
Share on other sites

  • 5 months later...
  • 2 months later...

@Dgital Essence,

 

This is great. It works with 5.3.13.

Could you help do the rest as well and convert them to widget? It could be hosting expiring and add-on expiring.

 

 

Regards

Stephen

 

 

If anyone is interested, I've taken Sparky's code and created a Widget for the homepage. This is running on my version 5.3.5

 

Just create a new file in modules/widgets and paste this code in. Then head over to Setup > Staff Management > Administrator Roles > Edit and scroll down to Widgets and then tick yours (in this example it's called "Expiring Domains".

 

I've no idea if this is the correct way to do it or won't break everything and make the sky fall down but it works for me.

 

<?php

if (!defined("WHMCS"))
   die("This file cannot be accessed directly");

function widget_domains_expiring() {

$content = '<table bgcolor="#cccccc" align="center" style="margin-bottom:5px;width:100%;" cellspacing="1">
<tr bgcolor="#efefef" style="text-align:center;font-weight:bold;"><td>Domain</td><td>Registrar</td><td>Period</td><td>Next Due Date</td><td>Expiration Date</td><td>Amount</td><td>Do Not<br />Renew</td></tr>';

$x=1; $range = "<= 90";
   $result = mysql_query("SELECT * FROM `tbldomains` WHERE DATEDIFF(`expirydate`, Now()) $range AND `status` = 'Active' ORDER BY `expirydate` ASC");
   while ($data = @mysql_fetch_array ($result)) {
       $content .= '<tr bgcolor="#ffffff" style="text-align:center;"><td><a href="clientsdomains.php?userid='.$data['userid'].'&id='.$data['id'].'">'.$data['domain'].'</a></td><td>'.$data['registrar'].'</td><td>'.$data['registrationperiod'].'</td><td>'.fromMySQLDate($data['nextduedate']).'</td><td>'.fromMySQLDate($data['expirydate']).'</td><td>'.formatCurrency($data['recurringamount']).'</td><td>'.$data['donotrenew'].'</td></tr>'; $x=0;
   }
   if($x) $content =  '<tr bgcolor="#ffffff" style="text-align:center;"><td colspan="7">No upcoming domain renewals</td></tr>';
$content .= '</table>';

   return array( 'title' => 'Expiring Domains', 'content' => $content );
}

add_hook("AdminHomeWidgets",1,"widget_domains_expiring");

?>

Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...
  • 1 month later...

@brian can you plz share your widget code with us, I tried to create the widget with Sparky's code but it broke down the whmcs Admin home page, thus i had to revert back.

 

Also I wud request Sparky to update this code snippet in widget form so that its easier for all of us to use this one.

 

Thanks

Link to comment
Share on other sites

@brian can you plz share your widget code with us, I tried to create the widget with Sparky's code but it broke down the whmcs Admin home page, thus i had to revert back.

 

Also I wud request Sparky to update this code snippet in widget form so that its easier for all of us to use this one.

 

Thanks

 

A couple of posts up is the code for a widget version of the script.

it is working just fine in ver 6.02

Link to comment
Share on other sites

@brian can you plz share your widget code with us, I tried to create the widget with Sparky's code but it broke down the whmcs Admin home page, thus i had to revert back.

i've posted my code in the thread you started.

 

http://forum.whmcs.com/showthread.php?105270-Admin-Home-Page-Widget-for-Upcoming-Hosting-Renewals-v6-template&p=433535#post433535

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