Jump to content

WHMCS v5.0 Upcoming Domains and Hosting renewal


starnetwork

Recommended Posts

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.

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

  • 2 weeks later...

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

Edited by Manchester Web Hosting
Link to comment
Share on other sites

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

 

it's grate, I'm glad in other people's involvement :)

Link to comment
Share on other sites

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");

?>

Link to comment
Share on other sites

  • 1 year later...

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 by Karl_Otto
Link to comment
Share on other sites

  • 1 year later...

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");

?>

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