starnetwork Posted December 3, 2011 Share Posted December 3, 2011 Hi, I just Create widget for whmcs v5.0 to Display in homepage the next renewal domains and hosting accounts ENJOY! Download from this post or: Best Regards, Star Network. renewalwidget.zip 0 Quote Link to comment Share on other sites More sharing options...
subodh Posted December 3, 2011 Share Posted December 3, 2011 Could you please post some screenshots? So that we can check it before installing. 0 Quote Link to comment Share on other sites More sharing options...
starnetwork Posted December 5, 2011 Author Share Posted December 5, 2011 screenshot: 0 Quote Link to comment Share on other sites More sharing options...
starnetwork Posted December 5, 2011 Author Share Posted December 5, 2011 Screenshot Link: http://images-uploader.com/images/NGiyM.png 0 Quote Link to comment Share on other sites More sharing options...
WebHostingPeople Posted December 5, 2011 Share Posted December 5, 2011 Hi, It is nice. But where should I upload it. Hi,I just Create widget for whmcs v5.0 to Display in homepage the next renewal domains and hosting accounts ENJOY! Download from this post or: Best Regards, Star Network. 0 Quote Link to comment Share on other sites More sharing options...
bobvr Posted December 5, 2011 Share Posted December 5, 2011 Thanks, star network. Works great. Easily edited for more/less days too. Upload to your modules/widgets directory and tick to show widget in your admin roles settings. 0 Quote Link to comment Share on other sites More sharing options...
WebHostingPeople Posted December 5, 2011 Share Posted December 5, 2011 Hi, Thanks. It`s very helpful . Can we also setting coming days like 60 days to 30 days ? Thanks, star network. Works great. Easily edited for more/less days too. Upload to your modules/widgets directory and tick to show widget in your admin roles settings. 0 Quote Link to comment Share on other sites More sharing options...
WebHostingPeople Posted December 5, 2011 Share Posted December 5, 2011 Hello, I have done this. Thanks. Hi, Thanks. It`s very helpful . Can we also setting coming days like 60 days to 30 days ? 0 Quote Link to comment Share on other sites More sharing options...
tkalfaoglu Posted December 5, 2011 Share Posted December 5, 2011 That's a lovely widget! Many thanks! 0 Quote Link to comment Share on other sites More sharing options...
hostguin Posted December 5, 2011 Share Posted December 5, 2011 Hello, Thanks Starnetwork. Works great. 0 Quote Link to comment Share on other sites More sharing options...
swg Posted December 5, 2011 Share Posted December 5, 2011 We are showing closed hosting accounts from 2008,2009 and 2010 in the upcoming renewals for hosting. Double checked and the products are listed as cancelled. Any idea why? 0 Quote Link to comment Share on other sites More sharing options...
nick@molten-servers Posted December 6, 2011 Share Posted December 6, 2011 We are showing closed hosting accounts from 2008,2009 and 2010 in the upcoming renewals for hosting. Double checked and the products are listed as cancelled. Any idea why? Getting the same thing, im not sure as to why either. Will await the next cron to see if some settings i made change it and if so i will share them here. 0 Quote Link to comment Share on other sites More sharing options...
swg Posted December 6, 2011 Share Posted December 6, 2011 Getting the same thing, im not sure as to why either. Will await the next cron to see if some settings i made change it and if so i will share them here. Thanks, also is it possible to extend the currency out to the cents also? Like now shows 100 to 100.00...we have some strange pricing. Thank you! 0 Quote Link to comment Share on other sites More sharing options...
nick@molten-servers Posted December 6, 2011 Share Posted December 6, 2011 No changes after the cron, its like its calling for each user who has a product due soon or before 14days including those prior to today, this could be changed with some coding im sure. Should add in a line for if invoice is over 14days old dont show else show sort of code. 0 Quote Link to comment Share on other sites More sharing options...
Dedigeeks-Sean Posted December 7, 2011 Share Posted December 7, 2011 No changes after the cron, its like its calling for each user who has a product due soon or before 14days including those prior to today, this could be changed with some coding im sure. Should add in a line for if invoice is over 14days old dont show else show sort of code. Same with mine, it shows all the way back from 2009 - erm seems wrong to me 0 Quote Link to comment Share on other sites More sharing options...
nick@molten-servers Posted December 7, 2011 Share Posted December 7, 2011 I hope the OP does not mind. I have changed some of the code to fix above issues. <?php function widget_upcoming_renewals($vars) { $title = "Upcoming Renewals"; $content = $content .= '<h3 align="center">Upcoming Service Renewals (Next 7 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>UserID</td><td>Billing Cycle</td><td>Payment Method</td><td>Next Due Date</td><td>IP</td></tr>'; $i=1; $range = "<= 7"; $result = mysql_query("SELECT * FROM `tblhosting` WHERE DATEDIFF(`nextduedate`, Now()) $range AND `server` > 1 AND `domainstatus` = 'Active' ORDER BY `nextduedate` ASC"); while ($data = @mysql_fetch_array ($result)) { $content .= '<tr bgcolor="#ffffff" style="text-align:center;"><td><a href="clientshosting.php?userid='.$data['userid'].'&id='.$data['id'].'">'.$data['userid'].'</a></td><td>'.$data['billingcycle'].'</td><td>'.$data['paymentmethod'].'</td><td>'.fromMySQLDate($data['nextduedate']).'</td><td>'.$data['dedicatedip'].'</td></tr>'; $i=0; } if($i) $content .= '<tr bgcolor="#ffffff" style="text-align:center;"><td colspan="7">No upcoming hosting renewals</td></tr>'; $content .= '</table><br />'; $content .= '<h3 align="center">Upcoming Domain Renewals (Next 60 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>'; global $currency;$i=1; $range = "<= 60"; $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']); $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>'.$data['paymentmethod'].'</td><td>'.formatCurrency($data['recurringamount']).'</td><td>'.$data['donotrenew'].'</td></tr>'; $i=0; } if($i) $content .= '<tr bgcolor="#ffffff" style="text-align:center;"><td colspan="8">No upcoming domain renewals</td></tr>'; $content .= '</table><br />'; return array('title'=>$title,'content'=>$content); } add_hook("AdminHomeWidgets",1,"widget_upcoming_renewals"); ?> Ive set it to 7days and made it for Dedicated IP hosts and instead of the Domain link i made it UserID link. 0 Quote Link to comment Share on other sites More sharing options...
bullten Posted December 10, 2011 Share Posted December 10, 2011 nice work starnetwork 0 Quote Link to comment Share on other sites More sharing options...
AndyW Posted December 10, 2011 Share Posted December 10, 2011 I hope the OP does not mind. I have changed some of the code to fix above issues. <?php function widget_upcoming_renewals($vars) { $title = "Upcoming Renewals"; $content = $content .= '<h3 align="center">Upcoming Service Renewals (Next 7 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>UserID</td><td>Billing Cycle</td><td>Payment Method</td><td>Next Due Date</td><td>IP</td></tr>'; $i=1; $range = "<= 7"; $result = mysql_query("SELECT * FROM `tblhosting` WHERE DATEDIFF(`nextduedate`, Now()) $range AND `server` > 1 AND `domainstatus` = 'Active' ORDER BY `nextduedate` ASC"); while ($data = @mysql_fetch_array ($result)) { $content .= '<tr bgcolor="#ffffff" style="text-align:center;"><td><a href="clientshosting.php?userid='.$data['userid'].'&id='.$data['id'].'">'.$data['userid'].'</a></td><td>'.$data['billingcycle'].'</td><td>'.$data['paymentmethod'].'</td><td>'.fromMySQLDate($data['nextduedate']).'</td><td>'.$data['dedicatedip'].'</td></tr>'; $i=0; } if($i) $content .= '<tr bgcolor="#ffffff" style="text-align:center;"><td colspan="7">No upcoming hosting renewals</td></tr>'; $content .= '</table><br />'; $content .= '<h3 align="center">Upcoming Domain Renewals (Next 60 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>'; global $currency;$i=1; $range = "<= 60"; $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']); $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>'.$data['paymentmethod'].'</td><td>'.formatCurrency($data['recurringamount']).'</td><td>'.$data['donotrenew'].'</td></tr>'; $i=0; } if($i) $content .= '<tr bgcolor="#ffffff" style="text-align:center;"><td colspan="8">No upcoming domain renewals</td></tr>'; $content .= '</table><br />'; return array('title'=>$title,'content'=>$content); } add_hook("AdminHomeWidgets",1,"widget_upcoming_renewals"); ?> Ive set it to 7days and made it for Dedicated IP hosts and instead of the Domain link i made it UserID link. Hi, I'm trying to display the renewal amount for Services using your script using <td>'.formatCurrency($data['recurringamount']).'</td> but nothing comes up. Any idea what I should be using? 0 Quote Link to comment Share on other sites More sharing options...
nick@molten-servers Posted December 10, 2011 Share Posted December 10, 2011 What i have posted for the Domains section is the same default that was posted by the OP. I just ran a test with that line of code and it shows the price of the domain. 0 Quote Link to comment Share on other sites More sharing options...
Manchester Web Hosting Posted December 19, 2011 Share Posted December 19, 2011 (edited) Hi ALL, I changed the code slightly, hope the original OP's dont mind. i required renewals showing for hosting & services so i ammended the code. I also wanted to know the payment amounts which i added and domain it related too (useful for me) The amended code is : <?php function widget_upcoming_renewals($vars) { $title = "Upcoming Renewals"; $content = $content .= '<h3 align="center">Upcoming Service Renewals (Next 30 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>Client</td><td>UserID</td><td>Domain</td><td>Billing Cycle</td><td>Payment Method</td><td>Next Due Date</td><td>Amount</td><td>IP</td></tr>'; $i=1; $range = "<= 30"; $result = mysql_query("SELECT * FROM `tblhosting` WHERE DATEDIFF(`nextduedate`, Now()) $range AND `packageid` > 1 AND `domainstatus` = 'Active' ORDER BY `nextduedate` ASC"); while ($data = @mysql_fetch_array ($result)) { $content .= '<tr bgcolor="#ffffff" style="text-align:center;"> <td>'.$data['companyname'].'</td> <td><a href="clientshosting.php?userid='.$data['userid'].'&id='.$data['id'].'">'.$data['userid'].'</a></td><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><td>'.$data['dedicatedip'].'</td></tr>'; $i=0; } if($i) $content .= '<tr bgcolor="#ffffff" style="text-align:center;"><td colspan="7">No upcoming hosting renewals</td></tr>'; $content .= '</table><br />'; $content .= '<h3 align="center">Upcoming Domain Renewals (Next 60 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>'; global $currency;$i=1; $range = "<= 60"; $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']); $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>'.$data['paymentmethod'].'</td><td>'.formatCurrency($data['recurringamount']).'</td><td>'.$data['donotrenew'].'</td></tr>'; $i=0; } if($i) $content .= '<tr bgcolor="#ffffff" style="text-align:center;"><td colspan="8">No upcoming domain renewals</td></tr>'; $content .= '</table><br />'; return array('title'=>$title,'content'=>$content); } add_hook("AdminHomeWidgets",1,"widget_upcoming_renewals"); ?> Now 2 things i was trying to get in was the client name or company name.. and it would also be a great help if the actual product name was listed...I hope a more experienced member can help out here.. For those that dont need that , i hope this helps you, its working Edited December 19, 2011 by Manchester Web Hosting 0 Quote Link to comment Share on other sites More sharing options...
cmendes0101 Posted December 23, 2011 Share Posted December 23, 2011 Thanks starnetwork 0 Quote Link to comment Share on other sites More sharing options...
starnetwork Posted December 26, 2011 Author Share Posted December 26, 2011 Hi ALL, I changed the code slightly, hope the original OP's dont mind. i required renewals showing for hosting & services so i ammended the code. I also wanted to know the payment amounts which i added and domain it related too (useful for me) The amended code is : <?php function widget_upcoming_renewals($vars) { $title = "Upcoming Renewals"; $content = $content .= '<h3 align="center">Upcoming Service Renewals (Next 30 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>Client</td><td>UserID</td><td>Domain</td><td>Billing Cycle</td><td>Payment Method</td><td>Next Due Date</td><td>Amount</td><td>IP</td></tr>'; $i=1; $range = "<= 30"; $result = mysql_query("SELECT * FROM `tblhosting` WHERE DATEDIFF(`nextduedate`, Now()) $range AND `packageid` > 1 AND `domainstatus` = 'Active' ORDER BY `nextduedate` ASC"); while ($data = @mysql_fetch_array ($result)) { $content .= '<tr bgcolor="#ffffff" style="text-align:center;"> <td>'.$data['companyname'].'</td> <td><a href="clientshosting.php?userid='.$data['userid'].'&id='.$data['id'].'">'.$data['userid'].'</a></td><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><td>'.$data['dedicatedip'].'</td></tr>'; $i=0; } if($i) $content .= '<tr bgcolor="#ffffff" style="text-align:center;"><td colspan="7">No upcoming hosting renewals</td></tr>'; $content .= '</table><br />'; $content .= '<h3 align="center">Upcoming Domain Renewals (Next 60 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>'; global $currency;$i=1; $range = "<= 60"; $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']); $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>'.$data['paymentmethod'].'</td><td>'.formatCurrency($data['recurringamount']).'</td><td>'.$data['donotrenew'].'</td></tr>'; $i=0; } if($i) $content .= '<tr bgcolor="#ffffff" style="text-align:center;"><td colspan="8">No upcoming domain renewals</td></tr>'; $content .= '</table><br />'; return array('title'=>$title,'content'=>$content); } add_hook("AdminHomeWidgets",1,"widget_upcoming_renewals"); ?> Now 2 things i was trying to get in was the client name or company name.. and it would also be a great help if the actual product name was listed...I hope a more experienced member can help out here.. For those that dont need that , i hope this helps you, its working it's grate, I'm glad in other people's involvement 0 Quote Link to comment Share on other sites More sharing options...
cmendes0101 Posted December 29, 2011 Share Posted December 29, 2011 A couple things were not working for me. The Payment method was the true name instead of the alias thats configured as the name and the currency wasn't being set for host only domains. I moved global $currency; to the beginning of the function then within both While() statements added: $currency=getCurrency($data['userid']); $paymentmethod = $data["paymentmethod"]; $paymentmethod = $gatewaysarray[$paymentmethod]; And replaced both $data["paymentmethod"] with $paymentmethod <?php function widget_upcoming_renewals($vars) { global $currency; $title = "Upcoming Renewals"; if (!function_exists("getGatewaysArray")) require(ROOTDIR."/includes/gatewayfunctions.php"); $gatewaysarray = getGatewaysArray(); $content = $content .= '<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>'; $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)) { $currency=getCurrency($data['userid']); $paymentmethod = $data["paymentmethod"]; $paymentmethod = $gatewaysarray[$paymentmethod]; $content .= '<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>'.$paymentmethod.'</td><td>'.fromMySQLDate($data['nextduedate']).'</td><td>'.formatCurrency($data['amount']).'</td></tr>'; $i=0; } if($i) $content .= '<tr bgcolor="#ffffff" style="text-align:center;"><td colspan="7">No upcoming hosting renewals</td></tr>'; $content .= '</table><br />'; $content .= '<h3 align="center">Upcoming Domain Renewals (Next 60 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>'; $i=1; $range = "<= 60"; $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']); $paymentmethod = $data["paymentmethod"]; $paymentmethod = $gatewaysarray[$paymentmethod]; $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>'.$paymentmethod.'</td><td>'.formatCurrency($data['recurringamount']).'</td><td>'.$data['donotrenew'].'</td></tr>'; $i=0; } if($i) $content .= '<tr bgcolor="#ffffff" style="text-align:center;"><td colspan="8">No upcoming domain renewals</td></tr>'; $content .= '</table><br />'; return array('title'=>$title,'content'=>$content); } add_hook("AdminHomeWidgets",1,"widget_upcoming_renewals"); ?> 0 Quote Link to comment Share on other sites More sharing options...
Karl_Otto Posted June 4, 2013 Share Posted June 4, 2013 (edited) Hi, great script. I have made some changes and fixed the clients name in the table and the currency. Now you can set the range separately for services and domains by setting the two variables on the top of the script; it will show the name of the clients (not company, I don't need it, but it's easy to add it) and the range. Here is the corrected code: <?php function widget_upcoming_renewals($vars) { $title = "Upcoming Renewals"; $range_servizi = 30; $range_domini = 30; $content .= '<h3 align="center">Upcoming Service Renewals (Next '.$range_servizi.' 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>Client</td><td>UserID</td><td>Domain</td><td>Billing Cycle</td><td>Payment Method</td><td>Next Due Date</td><td>Amount</td><td>IP</td></tr>'; global $currency;$i=1; $range = "<= ".$range_servizi; $result = mysql_query("SELECT * FROM `tblhosting` INNER JOIN tblclients ON tblclients.id = tblhosting.userid WHERE DATEDIFF(`nextduedate`, Now()) $range AND `packageid` > 1 AND `domainstatus` = 'Active' ORDER BY `nextduedate` ASC"); while ($data = @mysql_fetch_array ($result)) { $currency=getCurrency($data['userid']); $content .= '<tr bgcolor="#ffffff" style="text-align:center;"> <td>'.$data['firstname'].' '.$data['lastname'].'</td> <td><a href="clientsservices.php?userid='.$data['userid'].'">'.$data['userid'].'</a></td><td><a href="clientsservices.php?userid='.$data['userid'].'">'.$data['domain'].'</a></td><td>'.$data['billingcycle'].'</td><td>'.$data['paymentmethod'].'</td><td>'.fromMySQLDate($data['nextduedate']).'</td><td>'.formatCurrency($data['amount']).'</td><td>'.$data['dedicatedip'].'</td></tr>'; $i=0; } if($i) $content .= '<tr bgcolor="#ffffff" style="text-align:center;"><td colspan="7">No upcoming hosting renewals.</td></tr>'; $content .= '</table><br />'; $content .= '<h3 align="center">Upcoming Domain Renewals (Next '.$range_domini.' 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>'; global $currency;$i=1; $range = "<= ".$range_domini; $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']); $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>'.$data['paymentmethod'].'</td><td>'.formatCurrency($data['recurringamount']).'</td><td>'.$data['donotrenew'].'</td></tr>'; $i=0; } if($i) $content .= '<tr bgcolor="#ffffff" style="text-align:center;"><td colspan="8">No upcoming domain renewals.</td></tr>'; $content .= '</table><br />'; return array('title'=>$title,'content'=>$content); } add_hook("AdminHomeWidgets",1,"widget_upcoming_renewals"); ?> Hope this can help someone. Edited June 4, 2013 by Karl_Otto 0 Quote Link to comment Share on other sites More sharing options...
djpete Posted June 26, 2014 Share Posted June 26, 2014 can someone help. My upcoming hosting does not work. No error just says none are due but they are. Here is my code.. <?php function widget_upcoming_renewals($vars) { $title = "Upcoming Renewals"; $content = $content .= '<h3 align="center">Upcoming Hosting Renewals (Next 60 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>'; $i=1; $range = "<= 60"; $result = mysql_query("SELECT * FROM `tblhosting` WHERE DATEDIFF(`nextduedate`, Now()) $range AND `status` = 'Active' ORDER BY `nextduedate` ASC"); while ($data = @mysql_fetch_array ($result)) { $content .= '<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) $content .= '<tr bgcolor="#ffffff" style="text-align:center;"><td colspan="7">No upcoming hosting renewals</td></tr>'; $content .= '</table><br />'; $content .= '<h3 align="center">Upcoming Domain Renewals (Next 60 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>'; global $currency;$i=1; $range = "<= 60"; $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']); $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>'.$data['paymentmethod'].'</td><td>'.formatCurrency($data['recurringamount']).'</td><td>'.$data['donotrenew'].'</td></tr>'; $i=0; } if($i) $content .= '<tr bgcolor="#ffffff" style="text-align:center;"><td colspan="8">No upcoming domain renewals</td></tr>'; $content .= '</table><br />'; return array('title'=>$title,'content'=>$content); } add_hook("AdminHomeWidgets",1,"widget_upcoming_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.