Jump to content

Sparky's Admin Upcoming Domain Renewals V4 template


Recommended Posts

I have 4.0.xx and can't upgrade, not an option at this time. I have over 50 sites on that server all running a program I wrote over 6 years ago, all using 4.0 MySQL. All paying customers.

 

I may just end up moving it to another server eventually I have 13 of them, and out of that only 2 use the older MySQL, the rest use the newest.

 

It would of just been nice to see it work on the older 4.0.x mysql. I still don't understand why this was removed from WHMCS in the first place. Use to be in the old 3.x series, why remove it, it was a good tool to have. Oh well...

 

Try this:

 

<!-- 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 DATE_ADD(`expirydate`, 90) >= NOW() AND `status` = 'Active' ORDER BY `expirydate` ASC");



global $currency;

   while ($data = @mysql_fetch_array ($result)) {
   $domainid = $data['id'];
   # get currency info using the client of this domain name
   # populate global $currency array for formatCurrency function

   $sql_defcurrency2 = "SELECT tblcurrencies.code, tblcurrencies.prefix, tblcurrencies.suffix, tblcurrencies.format FROM `tbldomains`, tblclients, tblcurrencies WHERE tbldomains.userid = tblclients.id AND tblcurrencies.id = tblclients.currency AND tbldomains.id = '$domainid' LIMIT 1";
   $result_defcurrency2 = mysql_query($sql_defcurrency2);
   $currency_code = mysql_result($result_defcurrency2,0,'code');
   $currency_prefix = mysql_result($result_defcurrency2,0,'prefix');
   $currency_suffix = mysql_result($result_defcurrency2,0,'suffix');
   $currency_format = mysql_result($result_defcurrency2,0,'format');
   mysql_free_result($result_defcurrency2);

   $currency = array("code"=>"$currency_code","prefix"=>"$currency_prefix","suffix"=>"$currency_suffix","format"=>"$currency_format");


       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 -->

Link to comment
Share on other sites

  • 1 month later...
  • Replies 144
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

I just came across this thread a couple of days ago. I really like having this domain renewal in the admin.

 

I took the original code one step further. This will make it only show the table if there are domains coming up for renewal in the specified time, otherwise it hides the table.

 

<!-- START ADMIN UPCOMING DOMAIN RENEWALS -->
{php}
   $x=1; $range = "<= 10";
   $result = mysql_query("SELECT * FROM `tbldomains` WHERE DATEDIFF(`expirydate`, Now()) $range AND `status` = 'Active' ORDER BY `expirydate` ASC");
   if (mysql_num_rows($result) != 0) {
echo '<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>';
   }
   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 '';
{/php}
</table>
<br />
<!-- END ADMIN UPCOMING DOMAIN RENEWALS -->

 

Hope this helps someone.

 

And special thanks to Sparky for all of his great work.

 

Eddie

Edited by eseelke
Correction
Link to comment
Share on other sites

  • 4 months later...
  • 2 weeks later...

This is the code that I still use on my homepage

<!-- START ADMIN UPCOMING DOMAIN RENEWALS -->
<h3 align="center">Upcoming Domain Renewals (Next 90 Days)</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>Payment Method</td><td>Amount</td><td>Do Not<br />Renew</td></tr>
{php}
   global $currency;$i=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)) {
       $currency=getCurrency($data['userid']);
       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>'.$data['paymentmethod'].'</td><td>'.formatCurrency($data['recurringamount']).'</td><td>'.$data['donotrenew'].'</td></tr>'; $i=0;
   }
   if($i) echo '<tr bgcolor="#ffffff" style="text-align:center;"><td colspan="8">No upcoming domain renewals</td></tr>';
{/php}
</table>
<br />
<!-- END UPCOMING DOMAIN RENEWALS -->

Link to comment
Share on other sites

Thanks Sparky for your reply.

I now have the code entered into the admin area.

 

I could be wrong but I'm sure I have seen that this code could be adapted to display within the client area also. On a per client basis of course.

 

Hmmm!.. Still looking for it. :(

 

How can your code be adapted and which file does it need to be added to?..

Link to comment
Share on other sites

  • 4 weeks later...

Hi Sparky,

 

Those are two excellent pieces of code and very useful.

 

However, on the hosting services list, its showing any free services in the list also.

 

What do I need to add to this so that any Free Accounts are not included

 

$result = mysql_query("SELECT * FROM `tblhosting` WHERE DATEDIFF(`nextduedate`, Now()) $range AND `domainstatus` = 'Active' AND `server` > 0 ORDER BY `nextduedate` ASC");

 

Thanks.

 

Kindest Regards

Craig Edmonds

Link to comment
Share on other sites

Hi Sparky,

 

Found an answer myself.

 

I actually just added - AND `domainstatus` like 'Active' - to your string and it showed me a list of all the valid hostings coming up for renewal as I dont want to see the terminated or cancelled ones.

 

$result = mysql_query("SELECT * FROM `tblhosting` WHERE DATEDIFF(`nextduedate`, Now()) $range AND `server` > 0 AND `domainstatus` like 'Active' ORDER BY `nextduedate` ASC");

 

Kindest Regards

Craig Edmonds

Link to comment
Share on other sites

  • 4 weeks later...

Hi,

i configure to display only Next 90 Days, but i see Internationalized Domain Name with Expiration Date of 01.05.2011, any idea ?

(other domains view work grate)

 

Using the follow code

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

<h3 align="center">Upcoming Domain Renewals (Next 90 Days)</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>Payment Method</td><td>Amount</td><td>Do Not<br />Renew</td></tr>

{php}

global $currency;$i=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)) {

$currency=getCurrency($data['userid']);

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>'.$data['paymentmethod'].'</td><td>'.formatCurrency($data['recurringamount']).'</td><td>'.$data['donotrenew'].'</td></tr>'; $i=0;

}

if($i) echo '<tr bgcolor="#ffffff" style="text-align:center;"><td colspan="8">No upcoming domain renewals</td></tr>';

{/php}

</table>

<br />

<!-- END UPCOMING DOMAIN RENEWALS -->

 

Best Regards,

Star Network.

Link to comment
Share on other sites

  • 1 month later...

i popped in both of those, the domain renewal 14 days ahead" shows renewals from today but goes to up to 3 months ahead, and the hosting renewals show up as from 2 years back! but then it does seem to stop at 14 days ahead .

 

ill try to puzzle it out but coding and sql queries are not my forte...

cheers

will

Link to comment
Share on other sites

Is this what you mean?

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

 

<h3 align="center">Upcoming Hosting Renewals (Next 14 Days)</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>Billing Cycle</td><td>Payment Method</td><td>Next Due Date</td><td>Amount</td></tr>

{php}

global $currency;$i=1; $range = "<= 14";

$result = mysql_query("SELECT * FROM `tblhosting` WHERE DATEDIFF(`nextduedate`, Now()) $range AND (`domainstatus` = 'Active' OR `domainstatus` = 'Suspended') AND `server` > 0 ORDER BY `nextduedate` ASC");

while ($data = @mysql_fetch_array ($result)) {

$currency=getCurrency($data['userid']);

echo '<tr bgcolor="#ffffff" style="text-align:center;"><td><a href="clientshosting.php?userid='.$data['userid'].'&id='.$data['id'].'">'.$data['domain'].'</a></td><td>'.$data['billingcycle'].'</td><td>'.$data['paymentmethod'].'</td><td>'.fromMySQLDate($data['nextduedate']).'</td><td>'.formatCurrency($data['amount']).'</td></tr>'; $i=0;

}

if($i) echo '<tr bgcolor="#ffffff" style="text-align:center;"><td colspan="7">No upcoming hosting renewals</td></tr>';

{/php}

</table>

<br />

<!-- END UPCOMING HOSTING RENEWALS -->

Link to comment
Share on other sites

  • 2 months later...

This code show all products really? or show only hosting, server, other produtcs accounts?

 

This will show any hosting renewals due for the next 14 days.

 

Change $range to adjust to your liking for the number of days ahead to view.

 

Place in your homepage.tpl for your template in admin

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

<h3 align="center">Upcoming Hosting Renewals (Next 14 Days)</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>Billing Cycle</td><td>Payment Method</td><td>Next Due Date</td><td>Amount</td></tr>
{php}
   $i=1; $range = "<= 14";
   $result = mysql_query("SELECT * FROM `tblhosting` WHERE DATEDIFF(`nextduedate`, Now()) $range AND `server` > 0 ORDER BY `nextduedate` ASC");
   while ($data = @mysql_fetch_array ($result)) {
       echo '<tr bgcolor="#ffffff" style="text-align:center;"><td><a href="clientshosting.php?userid='.$data['userid'].'&id='.$data['id'].'">'.$data['domain'].'</a></td><td>'.$data['billingcycle'].'</td><td>'.$data['paymentmethod'].'</td><td>'.fromMySQLDate($data['nextduedate']).'</td><td>'.formatCurrency($data['amount']).'</td></tr>'; $i=0;
   }
   if($i) echo '<tr bgcolor="#ffffff" style="text-align:center;"><td colspan="7">No upcoming hosting renewals</td></tr>';
{/php}
</table>
<br />
<!-- END UPCOMING HOSTING RENEWALS -->

Link to comment
Share on other sites

  • 3 months later...
  • 1 month later...
  • 6 months later...
  • 2 weeks later...
Hi I want to show in upcoming product and services and Upcoming Domain Renewal Rem Days in Number example (80 days )

 

please tell me how to do that

Thaks

 

UPCOMING DOMAIN RENEWALS (mine version)

 

<!-- START ADMIN UPCOMING DOMAIN RENEWALS -->
<h3 align="center">Upcoming Domain Renewals (Next 80 Days)</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>Actions</td>
 <td>Registrar</td><td>Period</td><td>Next Due Date</td><td>Expiration Date</td><td>Payment Method</td><td>Amount</td><td>Do Not<br />Renew</td></tr>
{php}
   global $currency;$i=1; $range = "<= 80";
   $result = mysql_query("SELECT * FROM `tbldomains` WHERE DATEDIFF(`expirydate`, Now()) $range AND `status` = 'Active' ORDER BY `expirydate` ASC");
   while ($data = @mysql_fetch_array ($result)) {
       $currency=getCurrency($data['userid']);
       echo '<tr bgcolor="#ffffff" style="text-align:center;"><td><a href="clientsdomains.php?userid='.$data['userid'].'&id='.$data['id'].'">'.$data['domain'].'</a></td>
         <td><a href="http://www.'.$data['domain'].'" target="_blank" style="color:#cc0000">www</a>
<a href="whois.php?domain='.$data['domain'].'" target="_blank">whois</a>
<a href="http://www.intodns.com/'.$data['domain'].'" target="_blank" style="color:#009">intodns</a></td>
         <td>'.$data['registrar'].'</td><td>'.$data['registrationperiod'].'</td><td>'.fromMySQLDate($data['nextduedate']).'</td><td>'.fromMySQLDate($data['expirydate']).'</td><td>'.$data['paymentmethod'].'</td><td>'.formatCurrency($data['recurringamount']).'</td><td>'.$data['donotrenew'].'</td></tr>'; $i=0;
   }
   if($i) echo '<tr bgcolor="#ffffff" style="text-align:center;"><td colspan="9">No upcoming domain renewals</td></tr>';
{/php}
</table>
<br />
<!-- END UPCOMING DOMAIN RENEWALS -->

Link to comment
Share on other sites

Hi I want to show in upcoming product and services and Upcoming Domain Renewal Rem Days in Number example (80 days )

 

please tell me how to do that

Thaks

 

 

 

this my upcoming domain renewal

 

<!-- START ADMIN UPCOMING DOMAIN RENEWALS -->
<h3 align="center">Upcoming Domain Renewals (Next 80 Days)</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>Actions</td>
 <td>Registrar</td><td>Period</td><td>Next Due Date</td><td>Expiration Date</td><td>Payment Method</td><td>Amount</td><td>Do Not<br />Renew</td></tr>
{php}
   global $currency;$i=1; $range = "<= 80";
   $result = mysql_query("SELECT * FROM `tbldomains` WHERE DATEDIFF(`expirydate`, Now()) $range AND `status` = 'Active' ORDER BY `expirydate` ASC");
   while ($data = @mysql_fetch_array ($result)) {
       $currency=getCurrency($data['userid']);
       echo '<tr bgcolor="#ffffff" style="text-align:center;"><td><a href="clientsdomains.php?userid='.$data['userid'].'&id='.$data['id'].'">'.$data['domain'].'</a></td>
         <td><a href="http://www.'.$data['domain'].'" target="_blank" style="color:#cc0000">www</a>
<a href="whois.php?domain='.$data['domain'].'" target="_blank">whois</a>
<a href="http://www.intodns.com/'.$data['domain'].'" target="_blank" style="color:#009">intodns</a></td>
         <td>'.$data['registrar'].'</td><td>'.$data['registrationperiod'].'</td><td>'.fromMySQLDate($data['nextduedate']).'</td><td>'.fromMySQLDate($data['expirydate']).'</td><td>'.$data['paymentmethod'].'</td><td>'.formatCurrency($data['recurringamount']).'</td><td>'.$data['donotrenew'].'</td></tr>'; $i=0;
   }
   if($i) echo '<tr bgcolor="#ffffff" style="text-align:center;"><td colspan="9">No upcoming domain renewals</td></tr>';
{/php}
</table>
<br />
<!-- END UPCOMING DOMAIN RENEWALS -->

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