Still not quite there, I have
Code:
{php}
$userid = $this->_tpl_vars['clientsdetails']['id'];
$result = mysql_query("SELECT * FROM tblhosting,tblproducts WHERE userid =$userid AND tblhosting.packageid= tblproducts.id AND tblhosting.domainstatus='Active'");
$services = array();
while ($data = mysql_fetch_array($result)) {
array_push($services, $data);
}
$this->_tpl_vars['services'] = $services;
{/php}
Then to display
Code:
<div class="styled_title">
<h3>Active Accounts</h3>
</div>
<table class="zebra-striped">
<thead>
<tr>
<th{if $orderby eq "product"} class="headerSort{$sort}"{/if}><a href="clientarea.php?action=products{if $q}&q={$q}{/if}&orderby=product">{$LANG.orderproduct}</a></th>
<th{if $orderby eq "price"} class="headerSort{$sort}"{/if}><a href="clientarea.php?action=products{if $q}&q={$q}{/if}&orderby=price">{$LANG.orderprice}</a></th>
<th{if $orderby eq "billingcycle"} class="headerSort{$sort}"{/if}><a href="clientarea.php?action=products{if $q}&q={$q}{/if}&orderby=billingcycle">{$LANG.orderbillingcycle}</a></th>
<th{if $orderby eq "nextduedate"} class="headerSort{$sort}"{/if}><a href="clientarea.php?action=products{if $q}&q={$q}{/if}&orderby=nextduedate">{$LANG.clientareahostingnextduedate}</a></th>
<th{if $orderby eq "status"} class="headerSort{$sort}"{/if}><a href="clientarea.php?action=products{if $q}&q={$q}{/if}&orderby=status">{$LANG.clientareastatus}</a></th>
<th> </th>
</tr>
</thead>
<tbody>
{foreach from=$services item=service}
<tr>
<td>{$service.name}{if $service.domain}<br /><a href="http://{$service.domain}" target="_blank">{$service.domain}</a>{/if}</td>
<td>{$service.amount}</td>
<td>{$service.billingcycle}</td>
<td>{$service.nextduedate}</td>
<td><span class="label active">{$service.domainstatus}</span></td>
<td class="textcenter"><form method="get" action="{$smarty.server.PHP_SELF}?action=productdetails"><input type="hidden" name="id" value="{$service.id}" /><input type="submit" value="{$LANG.clientareaviewdetails}" class="btn info" /></form></td>
</tr>
I think the problem is with value of {$service.id} as on inspecting the element the value is 3, which so not correct for a service ID.
HTML Code:
<form action="/clientarea.php?action=productdetails" method="get"><input type="hidden" value="3" name="id"><input type="submit" class="btn info" value="View Details"></form>
Thx
Nev