sparky Posted May 15, 2009 Share Posted May 15, 2009 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 --> 0 Quote Link to comment Share on other sites More sharing options...
Gazza Posted May 15, 2009 Share Posted May 15, 2009 useful addition thank you 0 Quote Link to comment Share on other sites More sharing options...
redrat Posted May 15, 2009 Share Posted May 15, 2009 Thanks for this. You're becoming quite a legend mate. 0 Quote Link to comment Share on other sites More sharing options...
Impact-John Posted May 16, 2009 Share Posted May 16, 2009 again steve you out did your self as always 0 Quote Link to comment Share on other sites More sharing options...
ljesh Posted May 16, 2009 Share Posted May 16, 2009 Wonderful, thank you very much 0 Quote Link to comment Share on other sites More sharing options...
cmo Posted May 16, 2009 Share Posted May 16, 2009 Sparky, I already set up your script but the currency symbol, which is our local currency is not showing up and what shows is USD. Any fix here. We are using dual currencies. 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted May 16, 2009 Author Share Posted May 16, 2009 Check the prefix and suffix in your currency settings 0 Quote Link to comment Share on other sites More sharing options...
kahless2k Posted May 16, 2009 Share Posted May 16, 2009 My hero. Thank you. 0 Quote Link to comment Share on other sites More sharing options...
arhost Posted May 17, 2009 Share Posted May 17, 2009 Thank you. 0 Quote Link to comment Share on other sites More sharing options...
cmo Posted May 17, 2009 Share Posted May 17, 2009 Check the prefix and suffix in your currency settings Ok, I deleted the prefixes of the currencies and by default it shows the local amount without the currency symbol. So fa we can manage like this. Thanks! 0 Quote Link to comment Share on other sites More sharing options...
LemonBarley Posted May 18, 2009 Share Posted May 18, 2009 make upcoming hosting renewal too! lol 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted May 18, 2009 Author Share Posted May 18, 2009 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...
LemonBarley Posted May 18, 2009 Share Posted May 18, 2009 thats fast. then i think you should make something like this too http://forum.whmcs.com/showthread.php?t=19677 0 Quote Link to comment Share on other sites More sharing options...
hiddenko Posted May 18, 2009 Share Posted May 18, 2009 small changes to show only Active hosting renewals change $result = mysql_query("SELECT * FROM `tblhosting` WHERE DATEDIFF(`nextduedate`, Now()) $range AND `server` > 0 ORDER BY `nextduedate` ASC"); to: $result = mysql_query("SELECT * FROM `tblhosting` WHERE DATEDIFF(`nextduedate`, Now()) $range AND `domainstatus` = 'Active' AND `server` > 0 ORDER BY `nextduedate` ASC"); 0 Quote Link to comment Share on other sites More sharing options...
cmo Posted May 18, 2009 Share Posted May 18, 2009 Since we are using different registrars and the same our clients, domains that are not under our control don't need to be alerted for renewal. Is this something that can be done? We are using mainly OnlineNic registrar. And some of our clients have their own OnlineNic API or other registrars and don't need to be renewed with us. Did I make sense? 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted May 18, 2009 Author Share Posted May 18, 2009 small changes to show only Active hosting renewals change $result = mysql_query("SELECT * FROM `tblhosting` WHERE DATEDIFF(`nextduedate`, Now()) $range AND `server` > 0 ORDER BY `nextduedate` ASC"); to: $result = mysql_query("SELECT * FROM `tblhosting` WHERE DATEDIFF(`nextduedate`, Now()) $range AND `domainstatus` = 'Active' AND `server` > 0 ORDER BY `nextduedate` ASC"); I had that in just before I posted it but then thought that some may want to see if its coming up even if it was suspended. 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted May 18, 2009 Author Share Posted May 18, 2009 Since we are using different registrars and the same our clients, domains that are not under our control don't need to be alerted for renewal. If referring to upcoming domains Why would you want to have the domain in your whmcs if you are not managing it? If the client manages his own domain then it won't show in the list because it should not be stored in your whmcs. If referring to the upcoming hosting The domain is just a reference. When clicked is takes you to the hosting package. 0 Quote Link to comment Share on other sites More sharing options...
hiddenko Posted May 18, 2009 Share Posted May 18, 2009 I had that in just before I posted it but then thought that some may want to see if its coming up even if it was suspended. Sparky, is this will be correct ? (for hosting renewals) $result = mysql_query("SELECT * FROM `tblhosting` WHERE DATEDIFF(`nextduedate`, Now()) <= $range AND (`domainstatus` = 'Active' OR `domainstatus` = 'Suspended' ) AND `server` > 0 ORDER BY `nextduedate` ASC"); 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted May 18, 2009 Author Share Posted May 18, 2009 Sparky, is this will be correct ? (for hosting renewals) $result = mysql_query("SELECT * FROM `tblhosting` WHERE DATEDIFF(`nextduedate`, Now()) <= $range AND (`domainstatus` = 'Active' OR `domainstatus` = 'Suspended' ) AND `server` > 0 ORDER BY `nextduedate` ASC"); No... <= is a part of $range variable $result = mysql_query("SELECT * FROM `tblhosting` WHERE DATEDIFF(`nextduedate`, Now()) $range AND (`domainstatus` = 'Active' OR `domainstatus` = 'Suspended') AND `server` > 0 ORDER BY `nextduedate` ASC"); 0 Quote Link to comment Share on other sites More sharing options...
hiddenko Posted May 18, 2009 Share Posted May 18, 2009 Oh, right. Thanks for correction. 0 Quote Link to comment Share on other sites More sharing options...
cmo Posted May 20, 2009 Share Posted May 20, 2009 Sparky: The upcoming domain renewals got stuck. It shows from May 2 to June 11 and does not change. I set it up to 30 days. 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted May 20, 2009 Author Share Posted May 20, 2009 so $range = '<= 30'; Yes? or did you leave out the "<=" 0 Quote Link to comment Share on other sites More sharing options...
cmo Posted May 20, 2009 Share Posted May 20, 2009 Yes. Here is the code: $range = "<= 30"; 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted May 20, 2009 Author Share Posted May 20, 2009 @cmo: PM me the full code for the upcoming domains that you have there. 0 Quote Link to comment Share on other sites More sharing options...
abhy2007 Posted May 20, 2009 Share Posted May 20, 2009 what a great solution now m on cloud:lol: 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.