Jump to content

Problem including .tpl file inside clientareahome.tpl


Lawrence

Recommended Posts

Hi,

 

I've been trying to integrate the Upcoming Domain Renewals bit into my clients area for our clients. I can get it to work fine when coded directly into clientareahome.tpl. Below is the code I am using:

 

{php}
$display_domain=0;
$result = mysql_query("SELECT *  FROM tbldomains WHERE userid = ".$_SESSION['uid']." AND status = 'Active' LIMIT 1");
if(mysql_num_rows($result) > 0){
   $display_domain=1;
}

if($display_domain){
{/php}
<p><strong>Upcoming Domain Renewals</strong></p>
<table align="center" style="width:90%" class="clientareatable" cellspacing="1">
<tr class="clientareatableheading"><td>Domain</td><td>Expiration Date</td><td></td></tr>
{php}
$i=1;
//$range = "<= 30";
//$range = "<= 45";
//$range = "<= 60";
$range = "BETWEEN 15 AND 60";
//$range = "BETWEEN 30 AND 60";
$result = mysql_query("SELECT *, DATE_FORMAT(expirydate, '%d/%m/%Y') AS fdate FROM tbldomains WHERE userid='".$_SESSION['uid']."' AND DATEDIFF(expirydate, NOW()) ".$range." AND status='Active' AND id NOT IN (SELECT relid FROM tblinvoiceitems t1 INNER JOIN tblinvoices t2 ON t1.invoiceid = t2.id WHERE t1.type = 'Domain' AND t2.status != 'Paid') ORDER BY `expirydate` ASC ");
while($data = mysql_fetch_array($result))
{
   echo '<tr class="clientareatableactive"><td>'.$data['domain'].'</td><td>'.$data['fdate'].'</td><td><form method="post" action="clientarea.php?action=domainrenew"><input name="domainid" value="'.$data['id'].'" type="hidden"><input value="Renew Domain" class="button" type="submit"></form></td></tr>';
   $i=0;
}

if($i)echo '<tr class="clientareatableactive"><td colspan="2">No upcoming domain renewals</td><td><a href="clientarea.php?action=domains">View Domains</a></td></tr>';
{/php}
</table>
{php}
}
{/php}

 

However, when I move this to "upcomingdomainrenewals.tpl" and include the file on clientareahome.tpl using the following code, nothing appears (no content or errors):

 

{include file='upcomingdomainrenewals.tpl'};

 

Any advice?

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