Jump to content

Sparky's Admin Upcoming Domain Renewals V4 template


Recommended Posts

@cmo: The code you PM'ed me is correct. The dates that you see are the expiry date and the next due date that you have set in whmcs for that particular domain.

The SQL query reads the expirydate and compares it to todays date and works out how many days is between those 2 dates. if that number is equal to or less than the number you have in $range then it will display.

Link to comment
Share on other sites

  • Replies 144
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

You set it for the next 5 days so it will show anything that will expire within the next 5 days as well as anything that has already expired.

If it has already expired and it wasn't renewed then you should have set the status of that domain to Expired. If you do that then it won't show up in the list.

Link to comment
Share on other sites

You set it for the next 5 days so it will show anything that will expire within the next 5 days as well as anything that has already expired.

If it has already expired and it wasn't renewed then you should have set the status of that domain to Expired. If you do that then it won't show up in the list.

 

That's it, thanks!

Link to comment
Share on other sites

  • 2 weeks later...

Sparky.

Is there any chance you can do a similar script for Upcoming Products/Services?

You see I have a lot of Maintenance contracts for 12 mths like my hosting.

This would then bring them both up.

 

I am fiddling myself but so far no success.

Link to comment
Share on other sites

Sparky.

Is there any chance you can do a similar script for Upcoming Products/Services?

You see I have a lot of Maintenance contracts for 12 mths like my hosting.

This would then bring them both up.

 

I am fiddling myself but so far no success.

See post #12 in this thread

Link to comment
Share on other sites

Really what I would like is a summary of everything for next 90 days on index page.

Something like this:

ID Domain Client Name Product/Service Price Billing Cycle Next Due Date

If it was possible to include everything as in

domains

Products/services

Maybe even billable items

In other words a quick snapshot of expiries coming up.

 

 

I would pay for this if that helps.

Link to comment
Share on other sites

Maybe I will need to play around this area then to get not just hosting show, but products and services too...

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;

Link to comment
Share on other sites

Maybe I will need to play around this area then to get not just hosting show, but products and services too...

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;

For what you want to do it needs to look up tblhosting and tblproducts to get the package names

Link to comment
Share on other sites

Ihave altered to this but I still dont get any products/services due

 

<!-- START ADMIN UPCOMING PRODUCTS/SERVICES RENEWALS -->

<h3 align="center">Upcoming Products/Services 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>Products/Services</td><td>Billing Cycle</td><td>Payment Method</td><td>Next Due Date</td><td>Amount</td></tr>
{php}
   $i=1; $range = "<= 90";
   $result = mysql_query("SELECT * FROM `tblproducts` 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['products'].'</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 producs/services renewals</td></tr>';
{/php}
</table>
<br />
<!-- END UPCOMING PRODUCTS/SERVICES RENEWALS -->

Link to comment
Share on other sites

Ihave altered to this but I still dont get any products/services due

Sorry to say but no where near it

I have not tested this yet but it should do what you need

<!-- START ADMIN UPCOMING PRODUCTS/SERVICES RENEWALS -->

<h3 align="center">Upcoming Products/Services 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>Product/Service</td><td>Billing Cycle</td><td>Payment Method</td><td>Next Due Date</td><td>Amount</td></tr>
{php}
   $i=1; $range = "<= 90";
   $result = mysql_query("SELECT tblhosting.*,tblproducts.name FROM `tblhosting`,`tblproducts` WHERE DATEDIFF(tblhosting.nextduedate, Now()) $range AND (tblhosting.domainstatus = 'Active' OR tblhosting.domainstatus = 'Suspended') AND tblhosting.packageid = tblproducts.id ORDER BY tblhosting.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['name'].'</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 producs/services renewals</td></tr>';
{/php}
</table>
<br />
<!-- END UPCOMING PRODUCTS/SERVICES RENEWALS --

Link to comment
Share on other sites

ooooooooooooooooooooh yeah.

Now if it could have company name field?

And also can domains be added also so everything is all in the one table?

 

A small donation will be coming your way Sparky (Done).

Edited by djpete
Link to comment
Share on other sites

ooooooooooooooooooooh yeah.

Now if it could have company name field?

And also can domains be added also so everything is all in the one table?

 

A small donation will be coming your way Sparky (Done).

Added the user ID only as some names may make the field too long to fit into the table

Also... Thank you

<!-- START ADMIN UPCOMING PRODUCTS/SERVICES RENEWALS -->

<h3 align="center">Upcoming Products/Services 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>User ID</td><td>Product/Service</td><td>Billing Cycle</td><td>Payment Method</td><td>Next Due Date</td><td>Amount</td></tr>
{php}
   $i=1; $range = "<= 90";
   $result = mysql_query("SELECT tblhosting.*,tblproducts.name FROM `tblhosting`,`tblproducts` WHERE DATEDIFF(tblhosting.nextduedate, Now()) $range AND (tblhosting.domainstatus = 'Active' OR tblhosting.domainstatus = 'Suspended') AND tblhosting.packageid = tblproducts.id ORDER BY tblhosting.nextduedate ASC");
   while ($data = @mysql_fetch_array ($result)) {
       echo '<tr bgcolor="#ffffff" style="text-align:center;"><td><a href="clientssummary.php?userid='.$data['userid'].'">'.$data['userid'].'</a></td><td><a href="clientshosting.php?userid='.$data['userid'].'&id='.$data['id'].'">'.$data['name'].'</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 producs/services renewals</td></tr>';
{/php}
</table>
<br />
<!-- END UPCOMING PRODUCTS/SERVICES RENEWALS --

Link to comment
Share on other sites

I managed to get this.

Looks great.

Just wish there was a way to also have domains in the listing.

My life would then be complete.

lol

 

<!-- START ADMIN UPCOMING PRODUCTS/SERVICES RENEWALS -->

<h3 align="center">Upcoming Products/Services 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>Product/Service</td><td>Billing Cycle</td><td>Payment Method</td><td>Next Due Date</td><td>Amount</td></tr>
{php}
   $i=1; $range = "<= 90";
   $result = mysql_query("SELECT tblhosting.*,tblproducts.name FROM `tblhosting`,`tblproducts` WHERE DATEDIFF(tblhosting.nextduedate, Now()) $range AND (tblhosting.domainstatus = 'Active' OR tblhosting.domainstatus = 'Suspended') AND tblhosting.packageid = tblproducts.id ORDER BY tblhosting.nextduedate ASC");
   while ($data = @mysql_fetch_array ($result)) {
       echo '<tr bgcolor="#ffffff" style="text-align:center;"><td><a href="clientssummary.php?userid='.$data['userid'].'">'.$data['domain'].'</a></td><td><a href="clientshosting.php?userid='.$data['userid'].'&id='.$data['id'].'">'.$data['name'].'</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 producs/services renewals</td></tr>';
{/php}
</table>
<br />
<!-- END UPCOMING PRODUCTS/SERVICES RENEWALS -->

Link to comment
Share on other sites

This is as near as I can get to what I want.

Now I can see everything that is upcoming in one (well 2 really) easy table!

Thanks again Sparky. I think it is not possible to merge domains in the same table because the fields are so different.?

 

<!-- START ADMIN UPCOMING DOMAINS/PRODUCTS/SERVICES RENEWALS -->

<h3 align="center">Upcoming Domains/Products/Services 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>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 />
<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>Product/Service</td><td>Billing Cycle</td><td>Payment Method</td><td>Next Due Date</td><td>Amount</td></tr>
{php}
   $i=1; $range = "<= 90";
   $result = mysql_query("SELECT tblhosting.*,tblproducts.name FROM `tblhosting`,`tblproducts` WHERE DATEDIFF(tblhosting.nextduedate, Now()) $range AND (tblhosting.domainstatus = 'Active' OR tblhosting.domainstatus = 'Suspended') AND tblhosting.packageid = tblproducts.id ORDER BY tblhosting.nextduedate ASC");
   while ($data = @mysql_fetch_array ($result)) {
       echo '<tr bgcolor="#ffffff" style="text-align:center;"><td><a href="clientssummary.php?userid='.$data['userid'].'">'.$data['domain'].'</a></td><td><a href="clientshosting.php?userid='.$data['userid'].'&id='.$data['id'].'">'.$data['name'].'</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 producs/services renewals</td></tr>';
{/php}
</table>
<br />
<!-- END UPCOMING DOMAINS/PRODUCTS/SERVICES RENEWALS -->

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 weeks later...
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 -->

 

Thanks sparky! You saved the day! :)

Link to comment
Share on other sites

Hi guys,

 

Just wanted to point out there is one bug on this. The price is not in the proper currency. This is because there is a variable that needs to be declared prior to using the formatCurrency() function which is not present here. I will check it out and post the corrected code later.

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