<div class="wrapper purple-content">
    	<div class="container">
        	<div class="content-heading white whmcsportal">
    			<h2>{$pagetitle}</h2>
                <small>{$LANG.headertext}</small>
            </div>
            <div class="search-wiki">
            <form method="post" action="knowledgebase.php?action=search">
   				<input type="text" name="search" placeholder="Search Knowledgebase"/> <input type="submit" value="{$LANG.knowledgebasesearch}" />
			</form>	
            </div>
		</div>
    </div>
     <div class="wrapper purple optionbar">
    	<div class="container">
                 <ul><li><a href="serverstatus.php"><i class="fa fa-info-circle"></i>{$LANG.serverstatustitle}</a><span></span></li><li class="active"><a href="clientarea.php"><i class="fa fa-home"></i>{$LANG.clientareatitle}</a><span></span></li><li><a href="knowledgebase.php"><i class="fa fa-info-circle"></i>{$LANG.knowledgebasetitle}</a><span></span></li></ul>
        </div>
    </div>
    <div class="wrapper" id="maincontent">
	<div class="container">
			
            <div class="whmcssection homeclient" id="knowledgebase">
{foreach from=$addons_html item=addon_html}
<div style="margin:15px 0 15px 0;">{$addon_html}</div>
{/foreach}
<p id="loading"><img src="templates/activehost/img/loading.gif" /></p>
<div class="row clientarea" id="clientarehometope">
{if in_array('tickets',$contactpermissions)}
<div class="col-md-6">
<div>
<div class="titleheading"><span>{$clientsstats.numactivetickets}</span> {$LANG.supportticketsopentickets} <i class="fa fa-ticket"></i></div>
  {foreach key=num item=ticket from=$tickets}
    <div class="ticketlist">
    <a href="viewticket.php?tid={$ticket.tid}&amp;c={$ticket.c}">{if $ticket.unread}<strong>{/if}#{$ticket.tid} - {$ticket.subject}{if $ticket.unread}</strong>{/if}</a>
    <div>{$ticket.status|replace:'color':'background-color'}</div>
    </div>
  {foreachelse}
{$LANG.norecordsfound}
  {/foreach}
   <a href="submitticket.php" class="submitnew btn-lg" style="margin-top:30px;">{$LANG.supportticketssubmitticket}</a>
</div>
</div>
{/if}
<div class="col-md-6 blue">
<div>
	<div class="titleheading">{$LANG.clientareanavdetails} <i class="fa fa-user"></i></div>
    <div class="ticketlist">
        {$LANG.clientareafirstname}: <strong>{$clientsdetails.firstname}</strong>
    </div>
    <div class="ticketlist">
        {$LANG.clientarealastname}: <strong>{$clientsdetails.lastname}</strong>
    </div>
	<div class="ticketlist">
        {$LANG.clientareacompanyname}: <strong>{$clientsdetails.companyname}</strong>
    </div>
    <div class="ticketlist">
        {$LANG.clientareaemail}: <strong>{$clientsdetails.email}</strong>
    </div>
    
    <a href="clientarea.php?action=details" class="submitnew btn-lg" style="margin-top:30px;">{$LANG.clientareaupdateyourdetails} </a>
</div>
</div>
{if in_array('invoices',$contactpermissions)}
<div class="col-md-6 red">
<div>
<div class="titleheading"><span>{$clientsstats.numdueinvoices}</span> {$LANG.invoicesdue} <i class="fa fa-files-o"></i></div>
<form method="post" action="clientarea.php?action=masspay">
<table class="data">
  <tr>
    {if $masspay}<th width="15"></th>{/if}
    <th>{$LANG.invoicesdatedue}</th>
    <th>{$LANG.invoicestotal}</th>
    <th>{$LANG.invoicesstatus}</th>
    <th>&nbsp;</th>
  </tr>
  {foreach key=num item=invoice from=$invoices}
  <tr>
    {if $masspay}<td><input type="checkbox" name="invoiceids[]" value="{$invoice.id}" /></td>{/if}
    <td>{$invoice.datedue}</td>
    <td>{$invoice.total}</td>
    <td>{$invoice.status}</td>
    <td style="text-align:center;"><a class="btn-red btn-md btn" style="margin:0; color:#fff;" href="viewinvoice.php?id={$invoice.id}" target="_blank">{$LANG.invoicesview}</a></td>
  </tr>
  {foreachelse}
  <p>{$LANG.norecordsfound}</p>
  {/foreach}
  {if $invoices}
  <tr style="font-weight:bold;">
    <td colspan="2">{if $masspay}<input type="submit" class="submitnew" value="{$LANG.masspayselected}" />{/if}</td>
    <td>{$totalbalance}</td>
    <td colspan="2">{if $masspay}<a href="clientarea.php?action=masspay&all=true" class="submitnew">{$LANG.masspayall}</a>{/if}</td>
  </tr>
  {/if}
</table>
</form>
<a href="clientarea.php?action=invoices" class="submitnew btn-lg" style="margin-top:30px;">{$LANG.invoices}</a>
</div>
</div>
<div class="col-md-6">
<div>
<div class="titleheading"><span>{$services|@count}</span> {$LANG.clientareaproducts} <i class="fa fa-list-alt"></i></div>
<table class="table data">
    <thead>
        <tr>
            <th>{$LANG.orderproduct}</th>
            <th>{$LANG.orderprice}</th>
            <th>{$LANG.clientareahostingnextduedate}</th>
            <th>&nbsp;</th>
        </tr>
    </thead>
    <tbody>
{foreach from=$services item=service name=serviceloop}
{if $smarty.foreach.serviceloop.iteration <=5}
        <tr>
            <td>{$service.group} - {$service.name}</td>
            <td>{$service.amount}</td>
            <td>{$service.nextduedate}</td>
            <td><a class="btn btn-green btn-md" style="color:#fff; margin:0;" href="clientarea.php?action=productdetails&id={$service.id}"> <i class="icon icon-list-alt"></i> {$LANG.clientareaviewdetails}</a></td>
        </tr>
{/if}
{foreachelse}
        <tr>
            <td colspan="6" class="textcenter">{$LANG.norecordsfound}</td>
        </tr>
{/foreach}
        <tr>
        <td colspan="6" style="text-align:center">
        <a href="cart.php" class="submitnew btn-md" style="margin:0 15px 0 0">{$LANG.navservicesorder}</a>
		<a href="cart.php?gid=addons" class="submitnew btn-md" style="margin:0 0 0 0">{$LANG.clientareaviewaddons}</a></td>
        </tr>
    </tbody>
</table>
<a href="clientarea.php?action=products" class="submitnew btn-lg">{$LANG.clientareaproducts}</a>
</div>
</div>
<div class="col-md-6 blue">
<div>
<div class="titleheading"><span>{$domains|@count}</span> {$LANG.clientareanavdomains} <i class="fa fa-globe"></i></div>
<table class="table data">
    <thead>
        <tr>
            <th>{$LANG.clientareahostingdomain}</th>
            <th>{$LANG.clientareahostingregdate}</th>
            <th>{$LANG.clientareahostingnextduedate}</th>
            <th>&nbsp;</th>
        </tr>
    </thead>
    <tbody>
{foreach key=num item=domain from=$domains name=domainloop}
{if $smarty.foreach.domainloop.iteration <=5}
        <tr>
            <td><a href="http://{$domain.domain}/" target="_blank">{$domain.domain}</a></td>
            <td>{$domain.registrationdate}</td>
            <td>{$domain.nextduedate}</td>
            <td>
                <a class="btn btn-blue btn-md" style="color:#fff" href="clientarea.php?action=domaindetails&id={$domain.id}">{$LANG.managedomain}</a>
            </td>
        </tr>
{/if}
{foreachelse}
        <tr>
            <td colspan="7" class="textcenter">{$LANG.norecordsfound}</td>
        </tr>
{/foreach}
		<tr>
         <td colspan="7" style="text-align:center">
        	{if $condlinks.domainreg}<a class="submitnew btn-md" style="margin:0 15px 0 0; color:#fff; text-decoration:none"  id="Menu-Domains-Register_a_New_Domain" href="cart.php?a=add&domain=register">{$LANG.navregisterdomain}</a>{/if}
{if $condlinks.domaintrans}<a class="submitnew btn-md" style="margin:0 0 0 0; color:#fff; text-decoration:none"  id="Menu-Domains-Transfer_Domains_to_Us" href="cart.php?a=add&domain=transfer">{$LANG.navtransferdomain}</a>{/if}
</td>
        </tr>
    </tbody>
</table>
<a href="clientarea.php?action=domains" class="submitnew btn-lg">{$LANG.clientareanavdomains}</a>
</div>
</div>
<div class="col-md-6">
<div style="background:rgba(46,49,52,1)">
<div class="titleheading">{$LANG.clientareaemails} <i class="fa fa-envelope"></i></div>

<table class="table data">
    <thead>
        <tr>
            <th>{$LANG.clientareaemailsdate}</th>
            <th>{$LANG.clientareaemailssubject}</th>
            <th>&nbsp;</th>
        </tr>
    </thead>
    <tbody>
{foreach key=num item=email from=$emails}
        <tr>
            <td>{$email.date}</td>
            <td>{$email.subject}</td>
            <td style="text-align:right;"><input type="button" class="btn btn-md btn-dark" value="{$LANG.emailviewmessage}" onclick="popupWindow('viewemail.php?id={$email.id}','emlmsg',650,400)" /></td>
        </tr>
{foreachelse}
        <tr>
            <td colspan="3" class="textcenter">{$LANG.norecordsfound}</td>
        </tr>
{/foreach}
    </tbody>
</table>
<a href="clientarea.php?action=emails" class="submitnew btn-lg">{$LANG.clientareaemails} </a>
</div>
</div>
{/if}
{if $files}
<div class="col-md-6 green">
<div>
<div class="titleheading">{$LANG.clientareafiles} <i class="fa fa-download"></i></div>
<table class="data">
  <tr>
    <th>{$LANG.clientareafilesdate}</th>
    <th>{$LANG.clientareafilesfilename}</th>
  </tr>
  {foreach key=num item=file from=$files}
  <tr>
    <td>{$file.date}</td>
    <td><i class="fa fa-download"></i> <a href="dl.php?type=f&id={$file.id}"><strong>{$file.title}</strong></a></td>
  </tr>
  {/foreach}
</table>
</div>
</div>
{/if}
</div>
</div>
</div>
</div>