<!-- logged in - main view -->

<!--
<ul class="nav">
	<li class="<?php echo $this->getNextPublicTabStyle();?>"><a href="index.php?fuse=clients&view=ShowCustomerData"><img src="templates/<?php echo $this->gTemplateName; ?>/images/public/icon_profile.png" alt="<?php echo $this->lang("Profile"); ?>" class="left" /><?php echo $this->lang("Profile"); ?></a></li>
    <li class="<?php echo $this->getNextPublicTabStyle();?>"><a href="index.php?fuse=support&amp;view=SubmitTicketForm"><img src="templates/<?php echo $this->gTemplateName; ?>/images/public/icon_submit_ticket.png" alt="<?php echo $this->lang("Submit Ticket"); ?>" class="middle left" /><?php echo $this->lang("Submit Ticket"); ?></a></li>
	<li class="<?php echo $this->getNextPublicTabStyle();?>"><a href="index.php?fuse=knowledgebase&amp;view=KB_MainView"><img src="templates/<?php echo $this->gTemplateName; ?>/images/public/icon_kb.png" alt="<?php echo $this->lang("Knowledgebase"); ?>" class="left" /><?php echo $this->lang("Knowledgebase"); ?></a></li>
	<li class="<?php echo $this->getNextPublicTabStyle();?>"><a href="index.php?fuse=admin&amp;view=Announcements"><img src="templates/<?php echo $this->gTemplateName; ?>/images/public/icon_announcement.png" alt="<?php echo $this->lang("Announcements"); ?>" class="left" /><?php echo $this->lang("Announcements"); ?></a></li>
	<li class="<?php echo $this->getNextPublicTabStyle();?>"><a href="index.php?fuse=files&amp;view=FileList"><img src="templates/<?php echo $this->gTemplateName; ?>/images/public/icon_Files.png" alt="<?php echo $this->lang("Downloads"); ?>" class="left" /><?php echo $this->lang("Downloads"); ?></a></li>
	<li class="<?php echo $this->getNextPublicTabStyle();?>"><a href="order.php"><img src="templates/<?php echo $this->gTemplateName; ?>/images/public/icon_order.png" alt="<?php echo $this->lang("Order"); ?>" class="left" /><?php echo $this->lang("Order"); ?></a></li>
</ul>
-->
<div class="clear"></div>

<!-- Recent Support Tickets -->

<div class="leftbox left">

        <div class="boxinner">
        <h2><?php echo $this->lang('Latest Announcement'); ?></h2>
        <div class="content">
            <?php if ( count($this->announcements) > 0 ) { ?>
                <?php $i = 0; foreach ($this->announcements as $announcement) { ?>
                    <?php if ($i != 0) { ?><div class="hr"></div><?php } ++$i; //end if ?>
                       <h3><a href="index.php?fuse=admin&amp;view=Announcements&amp;ann_id=<?php echo $announcement['annid']; ?>"><?php echo $announcement['title']; ?></a></h3>
                       <p class="anndesc"><strong><?php echo $this->lang("Date"); ?>:</strong> <?php echo $announcement['date'];?> &nbsp;|&nbsp; <strong><?php echo $this->lang("Posted by"); ?>:</strong> <?php echo $announcement['postedBy'];?> &nbsp;|&nbsp; <a href="index.php?fuse=admin&amp;view=Announcements&amp;ann_id=<?php echo $announcement['annid']; ?>"><?php echo $this->lang("Read Full"); ?></a></p>
                       <p><?php echo $announcement['excerpt']; ?></p>
                    <?php } //end loop announcements ?>
            <?php } else  { ?>
                <p><?php echo $this->lang("No Announcements"); ?></p>
            <?php } //end if ?>
        </div>
        <?php if ( count($this->announcements) > 0 ) { ?>
        <div class="viewall"><a href="index.php?fuse=admin&amp;view=Announcements"><?php echo $this->lang("See all announcements");?> &raquo;</a></div>
        <?php } ?>
    </div>
    
    <!-- Outstanding Invoices -->

    <div class="boxinner" style="margin-top:20px;">
        <h2><?php echo $this->lang('Outstanding Invoices'); ?></h2>
        <table class="ts" cellspacing="2">
            <tr class="caption">
                <td>&nbsp;<?php echo $this->lang('Invoice #'); ?></td>
                <td width="120" align="right"><?php echo $this->lang('Amount'); ?>&nbsp;</td>
                <td width="120" align="right"><?php echo $this->lang('Balance Due'); ?>&nbsp;</td>
                <td align="center" width="80"><?php echo $this->lang('Due Date'); ?></td>
            </tr>
            <?php foreach ($this->invoices as $invoices) { ?>
            <tr>
                <td>&nbsp;&nbsp;<?php echo $invoices['invoiceNumber']; ?></td>
                <td align="right"><?php echo $invoices['invoiceAmount']; ?>&nbsp;&nbsp;</td>
                <td align="right"><?php echo $invoices['invoiceBalanceDue']; ?>&nbsp;&nbsp;</td>
                <td align="center" class="<?php echo $invoices['invoiceDateClass']; ?>"><?php echo $invoices['invoiceDate']; ?></td>
            </tr>
            <?php } //ending foreach ?>
            <?php if (count($this->invoices) == 0) { ?>
            <tr>
                <td colspan="4" align="center"><?php echo $this->lang('There are currently no invoices due'); ?></td>
            </tr>
            <?php } ?>
        </table>
        <div class="viewall"><a href="index.php?fuse=clients&amp;view=ViewInvoices"><?php echo $this->lang("See all your invoices");?> &raquo;</a></div>
    </div> 

    <div class="boxinner" style="margin-top:20px;">
        <h2><?php echo $this->lang('Most Recent Support Tickets'); ?></h2>
        <table class="ts" cellspacing="2">
            <tr class="caption">
                <td align="center" width="70"><?php echo $this->lang('Ticket'); ?></td>
                <td><?php echo $this->lang('Subject'); ?></td>
                <td align="center"><?php echo $this->lang('Status'); ?></td>
                <td align="center" width="70"><?php echo $this->lang('Priority'); ?></td>
            </tr>
            <?php foreach ($this->tickets as $ticket) { ?>
            <tr>
                <td align="center"># <?php echo $ticket['ticketId']; ?></td>
                <td><?php echo $ticket['ticketSubject']; ?></td>
                <td align="center"><?php echo $ticket['ticketStatus']; ?></td>
                <td align="center" class="<?php echo $ticket['ticketPriorityClass']; ?>" ><?php echo $ticket['ticketPriority']; ?></td>
            </tr>
            <?php } //ending foreach ?>
            <?php if (count($this->tickets) == 0) { ?>
            <tr>
                <td colspan="4" align="center"><?php echo $this->lang('There are currently no support tickets'); ?></td>
            </tr>
            <?php } ?>
        </table>
        <div class="viewall"><a href="index.php?fuse=support&amp;view=TicketsOverview"><?php echo $this->lang("See all your tickets");?> &raquo;</a></div>
    </div>
</div>
<div class="rightbox right">
    <div class="boxinner">
        <h2><?php echo $this->lang('Account Details'); ?></h2>
        <div class="content">
        	<?php echo $this->user->getFullName(); 
			if ( $this->user->getOrganization() )
				echo ' (' . $this->user->getFirstName() . ' ' . $this->user->getLastName() . ')';
			?>
			<br />
    	    <?php echo $this->user->getEmail(); ?><br />
        	<?php echo $this->user->getAddress() .', '. $this->user->getCity() .','; ?><br />
        	<?php echo $this->user->getState() .', '. $this->user->getZipCode() .', '. $this->user->getCountry(); ?><br />
        	<?php echo $this->lang('Phone number') .': '. $this->user->getPhone(); ?><br />
        	<a href="index.php?fuse=clients&view=ShowCustomerData"><?php echo $this->lang('Edit Your Details'); ?></a>
    	</div> 
        
        <h2><?php echo $this->lang('Account Statistics'); ?></h2>
        <table class="ts" cellspacing="2">
            <tr>
                <td width="100%" style="background:#f6f6f6;"><?php echo $this->lang('Account Status'); ?>:</td>
                <td><?php echo $this->user->convertStatus($this->user->getStatus()); ?></td>
            </tr>
            <tr>
                <td style="background:#f6f6f6;"><?php echo $this->lang('No. of Active Products'); ?>:</td>
                <td><a href="index.php?fuse=clients&amp;view=Profile_Products"><?php echo $this->user->getTotalActiveProducts(); ?></a></td>
            </tr>
            <tr>
                <td style="background:#f6f6f6;"><?php echo $this->lang('No. of Active Recurring Charges'); ?>:</td>
                <td><a href="index.php?fuse=clients&amp;view=ViewInvoices_Recurring"><?php echo $this->user->getTotalActiveRecurringFees(); ?></a></td>
            </tr>
            <tr>
                <td style="background:#f6f6f6;"><?php echo $this->lang('No. of Support Tickets'); ?>:</td>
                <td><a href="index.php?fuse=support&view=TicketsOverview"><?php echo $this->user->getTotalTickets(); ?></a></td>
            </tr>
            <tr>
                <td style="background:#f6f6f6;"><?php echo $this->lang('Account Credit Balance'); ?>:</td>
                <td><?php echo $this->user->getFormatedCreditBalance(); ?></td>
            </tr>
            <tr>
                <td style="background:#f6f6f6;"><?php echo $this->lang('Due Invoice Balance'); ?>:</td>
                <td><?php echo $this->user->getFormatedTotalAmountDue(); ?></td>
            </tr>
        </table>
    </div>

    <?php if (count($this->snapins) > 0) { ?>
    <div class="boxinner" style="margin-top:20px;">
        <h2><?php echo $this->lang("Extra Services"); ?></h2>
        <ul class="articlelist">
            <?php foreach ($this->snapins as $snapin) { ?>
            <li>
                <div style="">
                    <img src="templates/<?php echo $this->gTemplateName; ?>/images/public/icon_article.png" alt="icon" class="icon" /><?php echo $snapin->getURL();?>
                </div>
            </li>
            <?php } // end popular articles ?>
        </ul>
    </div>
    <?php } //end if ?>

</div>

<div class="clear"></div>