Lawrence Posted August 26, 2009 Share Posted August 26, 2009 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 --> 0 Quote Link to comment Share on other sites More sharing options...
acko Posted October 3, 2009 Share Posted October 3, 2009 thank you i was searching for this modification. 0 Quote Link to comment Share on other sites More sharing options...
incredipete Posted October 9, 2009 Share Posted October 9, 2009 Thanks for the great addition, Sparky. At this point, half my site was written by you! 0 Quote Link to comment Share on other sites More sharing options...
Patty Posted October 9, 2009 Share Posted October 9, 2009 I just want to thank Sparky for another great mod. Big help big time! Tks a lot, you're wonderful! 0 Quote Link to comment Share on other sites More sharing options...
eseelke Posted October 9, 2009 Share Posted October 9, 2009 (edited) 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 October 9, 2009 by eseelke Correction 0 Quote Link to comment Share on other sites More sharing options...
rdavis Posted March 8, 2010 Share Posted March 8, 2010 I love it, works great! Thanks Steve and Eddie for all your work. 0 Quote Link to comment Share on other sites More sharing options...
lanquest Posted March 20, 2010 Share Posted March 20, 2010 Hi Guys, After reading through the whole thread, I am somewhat confused as to the final code being used for this very potentially useful mod. I am currently using Version: 4.1.2 and about to move to Version: 4.2 Nice work Sparky. 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted March 20, 2010 Author Share Posted March 20, 2010 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 --> 0 Quote Link to comment Share on other sites More sharing options...
lanquest Posted March 21, 2010 Share Posted March 21, 2010 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?.. 0 Quote Link to comment Share on other sites More sharing options...
vchosting Posted March 21, 2010 Share Posted March 21, 2010 If you purchase Sparky's client area home page mod it does just what you are asking plus a whole deal more. Really worth the few pounds it cost me. 0 Quote Link to comment Share on other sites More sharing options...
craigedmonds Posted April 14, 2010 Share Posted April 14, 2010 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 0 Quote Link to comment Share on other sites More sharing options...
craigedmonds Posted April 14, 2010 Share Posted April 14, 2010 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 0 Quote Link to comment Share on other sites More sharing options...
oscarenzo Posted May 7, 2010 Share Posted May 7, 2010 Exellent, code. Thank you. 0 Quote Link to comment Share on other sites More sharing options...
starnetwork Posted May 8, 2010 Share Posted May 8, 2010 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. 0 Quote Link to comment Share on other sites More sharing options...
tcsi Posted June 26, 2010 Share Posted June 26, 2010 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 0 Quote Link to comment Share on other sites More sharing options...
labelhosting.com Posted July 1, 2010 Share Posted July 1, 2010 HI, That was Very good addon, I have added it and it works good. Can you please find the Solution same as domain, For web hosting on Dashboard. Thanks in advance. 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted July 1, 2010 Author Share Posted July 1, 2010 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 --> 0 Quote Link to comment Share on other sites More sharing options...
BarginHosts Posted July 9, 2010 Share Posted July 9, 2010 (edited) Thanks Man this is the best addon i find it very useful already Oh and thank you for sharing the Hosting one thats Very Sexy indead You make so far the mods i find useful and of course free and easy to set up Edited July 9, 2010 by BarginHosts 0 Quote Link to comment Share on other sites More sharing options...
oscarenzo Posted October 4, 2010 Share Posted October 4, 2010 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 --> 0 Quote Link to comment Share on other sites More sharing options...
JofleyUK Posted January 13, 2011 Share Posted January 13, 2011 one little note... it seems to show the "one time" in the renewals... any chance of the of a fix to exclude the one time products 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted January 13, 2011 Author Share Posted January 13, 2011 The version that I have does not have that problem. Is it possible that you are using a hacked up version from this thread? 0 Quote Link to comment Share on other sites More sharing options...
Blueberry3.14 Posted March 10, 2011 Share Posted March 10, 2011 Sorry I'm so late to this party, but I just came across this mod and it works beautifully (on v4.4.2). Thank you! 0 Quote Link to comment Share on other sites More sharing options...
ghazan_learningsoft Posted September 24, 2011 Share Posted September 24, 2011 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 0 Quote Link to comment Share on other sites More sharing options...
aboutnet Posted October 4, 2011 Share Posted October 4, 2011 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 --> 0 Quote Link to comment Share on other sites More sharing options...
aboutnet Posted October 4, 2011 Share Posted October 4, 2011 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 --> 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.