Jump to content

Sparky's Admin Upcoming Domain Renewals V4 template


Recommended Posts

  • 2 weeks later...
  • Replies 144
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

  • 2 weeks later...
Has anyone managed to make this work with version 5.0?

 

The only part that doesn't work with 5.0.2/5.0.3 is that the amounts are rounding up to the nearest dollar for some reason (and I can't for the life of me see why). I wish I wasn't so anal and could just ignore that....LOL!

 

Everything else works, you just need to copy the mod into the new homepage.tpl (before or after the new widgets code).

Link to comment
Share on other sites

  • 3 weeks later...
  • 4 weeks later...
  • 2 weeks later...

@lopqafezqww05: You are probably using the wrong version... should be the one from posts #60 and #61

@infojurman: try this

<!-- START ADMIN UPCOMING ADDON RENEWALS -->
<h3 align="center">Upcoming Addon 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>Company/User Name</td><td>Product/Service</td><td>Addon Name</td><td>Billing Cycle</td><td>Payment Method</td><td>Next Due Date</td><td>Next Invoice Date</td><td>Amount</td></tr>
{php}
   global $currency;$i=1; $range = "<= 30"; $data=$data2=$data3='';
   $query3 = "SELECT * FROM tblhostingaddons WHERE status='Active' AND billingcycle!='Free' AND billingcycle!='One Time' AND DATEDIFF(nextinvoicedate, Now()) $range ORDER BY nextduedate ASC";
   $result3=full_query($query3);
   while ($data = mysql_fetch_assoc($result3)) {
       $id = $data["id"];
       $hostingid = $data["hostingid"];
       $name = $data["name"];
       $nextduedate = $data["nextduedate"];
       $nextinvoicedate = $data["nextinvoicedate"];
       $result2=select_query("tblhosting","",array("id"=>$hostingid));
       $data2 = mysql_fetch_array($result2);
       $productname = $data2['domain'];
       $userid = $data2["userid"];
       $result2=select_query("tblclients","",array("id"=>$userid));
       $data2 = mysql_fetch_array($result2);
       $usersname = $data2["firstname"]." ".$data2["lastname"];
       $groupid = $data2["groupid"];
       $result4=select_query("tblclientgroups","susptermexempt",array("id"=>$groupid));
       $data3 = mysql_fetch_array($result4);
       $susptermexempt = $data3["susptermexempt"];;
       echo '<tr bgcolor="#ffffff" style="text-align:center;"><td><a href="clientssummary.php?userid='.$userid.'">'.(($data2['companyname'])?$data2['companyname']:$usersname).'</a></td><td><a href="clientshosting.php?userid='.$userid.'&id='.$hostingid.'">'.$productname.'</a></td><td><a href="clientshosting.php?userid='.$userid.'&id='.$hostingid.'">'.$name.'</a></td><td>'.$data['billingcycle'].'</td><td>'.$data['paymentmethod'].'</td><td>'.fromMySQLDate($data['nextduedate']).'</td><td>'.fromMySQLDate($data['nextinvoicedate']).'</td><td>'.formatCurrency($data['recurring']).'</td></tr>'; $i=0;
   }
   if($i) echo '<tr bgcolor="#ffffff" style="text-align:center;"><td colspan="7">No upcoming addon renewals</td></tr>';
{/php}
</table>
<br />
<!-- END UPCOMING ADDON RENEWALS -->

Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...
  • 4 weeks later...
  • 1 month later...
I will be updating these when I update to V5.1 (I am currently still using V4.5.2)

 

Hello sparky!

 

From the list of posts I've read, I realized that you did a great job. If possible, update to 5.0.3 as I can and I appreciate this script.

 

Thank you for understanding.

Link to comment
Share on other sites

  • 4 months later...
Is there a way to have it show domains within 90 days and another section for domains that expired within 30 days?

Yes just add it in twice one with 90 days and the other with 30 days

Note: This will be updated for V5.1.2 now that I have finally upgraded very soon.

Link to comment
Share on other sites

  • 4 weeks later...

It is very common that the "next due date" on the hosting accounts is past than the "todays date" this can be because:

 

A) The invoice hasn't been paid

or

B) there is an error on the next due date.

 

for the second case (B) If you have many clients this is a problem because you might be loosing money when the invoice is not being automactly created.

 

So on the great code Sparky gave us I did a modification to color the "TDs" that are Past today.

 

So your administrative staff can have a detailed look on those accounts.

 

I hope it helps:

 




<!-- START ADMIN UPCOMING HOSTING RENEWALS -->

<h3 align="center">Próximas Renovaciones de Hosting (10 días)</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}
global $currency;$i=1; $range = "<= 10";
$result = mysql_query("SELECT * FROM `tblhosting` WHERE DATEDIFF(`nextduedate`, Now()) $range AND (`domainstatus` = 'Active' OR `domainstatus` = 'Suspended') AND `server` > 0 ORDER BY `nextduedate` ASC");
while ($data = @mysql_fetch_array ($result)) {
$currency=getCurrency($data['userid']);



$laduedate = $data['nextduedate'];
$todays_date = date("Y-m-d");


$hoytoday = strtotime($todays_date);
$proximopagodate = strtotime($laduedate);

if ($proximopagodate < $hoytoday) {
    $colorear = "#FFFF99";
} else {
    $colorear = "#FFFFFF";
}






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 bgcolor="'.$colorear.'">'.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 -->


Link to comment
Share on other sites

  • 5 weeks later...
  • 3 weeks later...
Note: This will be updated for V5.1.2 now that I have finally upgraded very soon.

 

Looking forward to an updated version of this. Trying to reverse-engineer how to best implement the v4 version on our 5.1.3 system is not pretty (for a non-programmer, at least... ;) ).

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