Jump to content

WHMCS v5.0 Upcoming Domains and Hosting renewal


starnetwork

Recommended Posts

Fixed.

 

This is my end code that worked for me..

 

<?php

 

function widget_upcoming_renewals($vars) {

 

$title = "Upcoming Renewals";

$content =

$content .= '<h3 align="center">Upcoming Hosting 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>Domain</td><td>Billing Cycle</td><td>Payment Method</td><td>Next Due Date</td><td>Amount</td></tr>';

 

$i=1; $range = "<= 30";

$result = mysql_query("SELECT * FROM `tblhosting` WHERE DATEDIFF(`nextduedate`, Now()) $range AND `server` > 0 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['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 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>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 = "<= 30";

$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

  • 8 months later...

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