function controlPanel()
    {
        //hack for JOomla 13 ADRIEN
        unset($GLOBALS["task"]);
        unset($_REQUEST["task"]);
        ?>

<link rel="stylesheet" href="components/com_acajoom/cssadmin/acajoom.css" type="text/css" >
<div align="center" class="centermain">
<div id="acajoom">
		<table class="acajoomcss">
            <tr>
         	<td width="58%" valign="top">
				<?php 
        echo backHTML::iconsPanel();
        ?>
			</td>
			<td width="42%" valign="top">

			<div style="width=100%;">
			<form action="index2.php" method="post" name="adminForm">
			<?php 
        $tabs = new mosTabs(1);
        $tabs->startPane('acaControlPanel');
        $tabs->startTab(_ACA_MENU_TAB_SUM, "acaControlPanel.Summary");
        ?>
			<table class="acajoom_stats" style="text-align: left; width: 100%; " cellpadding="2" cellspacing="0">
			<tbody>
				<tr>
					 <th style="text-align: center;"><?php 
        echo '#';
        ?>
					 </th>
					 <th style="text-align: center;"><?php 
        echo _ACA_MENU_TAB_LIST;
        ?>
</th>
					 <th style="text-align: center;"><?php 
        echo _ACA_MENU_MAILING_TITLE;
        ?>
</th>
					 <th style="text-align: center;"><?php 
        echo _ACA_SENT_MAILING;
        ?>
</th>
					 <th style="text-align: center;"><?php 
        echo _ACA_DESC_SUBSCRIBERS;
        ?>
</th>
				</tr>
			 <?php 
        $html = '';
        $totalist = 0;
        $totalmail = 0;
        $totalsub = 0;
        $totalsent = 0;
        $nb = explode(',', $GLOBALS[ACA . 'activelist']);
        $size = sizeof($nb);
        for ($i = 0; $i < $size; $i++) {
            $index = $nb[$i];
            if ($GLOBALS[ACA . 'listshow' . $index] > 0 and $GLOBALS[ACA . 'listype' . $index] == 1) {
                $html .= '<tr>';
                $html .= '<td><b>' . @constant($GLOBALS[ACA . 'listnames' . $index]) . '</b></td>';
                $html .= '<td style="text-align: center; ">' . $GLOBALS[ACA . 'act_totallist' . $index] . ' </td>';
                $html .= '<td style="text-align: center; ">' . $GLOBALS[ACA . 'act_totalmailing' . $index] . ' </td>';
                $html .= '<td style="text-align: center; ">' . $GLOBALS[ACA . 'totalmailingsent' . $index] . ' </td>';
                $html .= '<td style="text-align: center; ">' . $GLOBALS[ACA . 'act_totalsubcribers' . $index] . ' </td>';
                $html .= '</tr>';
                $totalist = $totalist + $GLOBALS[ACA . 'act_totallist' . $index];
                $totalmail = $totalmail + $GLOBALS[ACA . 'act_totalmailing' . $index];
                $totalsent = $totalsent + $GLOBALS[ACA . 'totalmailingsent' . $index];
                if ($GLOBALS[ACA . 'act_totalsubcribers' . $index] < $totalsub) {
                    $totalsub = $GLOBALS[ACA . 'act_totalsubcribers' . $index];
                }
            }
        }
        $html .= '<tr>';
        $html .= '<td><b>' . _ACA_CP_TOTAL . '</b></td>';
        $html .= '<td style="text-align: center; ">' . $totalist . ' </td>';
        $html .= '<td style="text-align: center; ">' . $totalmail . ' </td>';
        $html .= '<td style="text-align: center; ">' . $totalsent . ' </td>';
        $html .= '<td style="text-align: center; ">' . $totalsub . ' </td>';
        $html .= '</tr>';
        echo $html;
        ?>
			 </tbody></table>
			 <br />
			<?php 
        if (class_exists('auto')) {
            echo auto::showQueue();
        }
        $tabs->endTab();
        $tabs->startTab(_ACA_MENU_SUBSCRIBERS, "acaControlPanel.Subscribers");
        $emailsearch = '';
        $listId = 0;
        $start = mosGetParam($_REQUEST, 'start', 0);
        $limit = mosGetParam($_REQUEST, 'limit', 15);
        $order = mosGetParam($_REQUEST, 'order', 'date');
        $total = 0;
        $subscribers = subscribers::getSubscribers($start, $limit, $emailsearch, $total, $listId, '', 1, 1, 'sub_dateD');
        mosCommonHTML::loadOverlib();
        ?>
			<script type="text/javascript">
				function checkcid(myField) {
					myField.checked = true;
					isChecked(true);
				}
			</script>
<!--			<div id="overDiv" style="position:absolute; visibility:hidden; z-index:10000;"></div>  -->

			<form action="index2.php" method="post" name="adminForm">
				<input type="hidden" name="option" value="com_acajoom" />
				<input type="hidden" name="act" value="acajoom" />
				<input type="hidden" name="task" value="" />
				<input type="hidden" name="userid" value="" />
		    	<input type="hidden" name="boxchecked" value="0" />
				<input type="hidden" name="listid" value="<?php 
        echo $listId;
        ?>
" />
				<input type="hidden" name="start" value="<?php 
        echo $start;
        ?>
" />
				<input type="hidden" name="limit" value="<?php 
        echo $limit;
        ?>
" />
				<input type="hidden" name="emailsearch" value="<?php 
        echo $emailsearch;
        ?>
" />
			<table width="100%"  border="0" cellspacing="0" cellpadding="4" class="adminlist">
				<tr>
					<th class="title">#</th>
					<th class="title" style="text-align: left;"><?php 
        echo _ACA_INPUT_NAME;
        ?>
</th>
					<th class="title" style="text-align: left;"><?php 
        echo _ACA_INPUT_EMAIL;
        ?>
</th>
					<th class="title" style="text-align: center;"><?php 
        echo _ACA_SIGNUP_DATE;
        ?>
</th>
				</tr>

				<?php 
        $i = 0;
        foreach ($subscribers as $subscriber) {
            ?>
				<tr class="row<?php 
            echo $i++ % 2;
            ?>
">
					<td><?php 
            echo $i + $start;
            ?>
</td>
					<td style="text-align: left;">
					<a href="index2.php?option=com_acajoom&act=subscribers&task=show&userid=<?php 
            echo $subscriber->id;
            ?>
" >
					<?php 
            echo $subscriber->name;
            ?>
</a></td>
					<td style="text-align: left;"><?php 
            echo $subscriber->email;
            ?>
</td>
					<td style="text-align: center;"><?php 
            echo mosFormatDate($subscriber->subscribe_date, '%x');
            ?>
</td>
				</tr>
				<?php 
        }
        ?>
			</table>
			</form>
			<?php 
        backHTML::footerCounts($start, $limit, $emailsearch, $total, 4, '', $listId, '');
        $tabs->endTab();
        $tabs->startTab(_ACA_MENU_TAB_LIST, "acaControlPanel.Lists");
        $lists = lists::getLists(0, 0, 1, '', false, false, false);
        ?>
			<table class="adminlist">
				<tr>
					<th class="title">#</th>
					<th class="title" width="65%"  style="text-align: left;"><?php 
        echo _ACA_LIST_NAME;
        ?>
</th>
					<th class="title" width="25%"  style="text-align: left;"><?php 
        echo _ACA_LIST_TYPE;
        ?>
</th>
					<th class="title"  style="text-align: center;">#id</th>
				</tr>
			<?php 
        $i = 0;
        foreach ($lists as $list) {
            $i++;
            $link = 'index2.php?option=com_acajoom&act=mailing&task=show&listid=' . $list->id;
            ?>
				<tr>
					<td><?php 
            echo $i;
            ?>
</td>
					<td  style="text-align: left;">
						<a href="<?php 
            echo $link;
            ?>
">
							<?php 
            echo $list->list_name;
            ?>
</a>
					</td>
					<td  style="text-align: left;"><a href='index2.php?option=com_acajoom&act=mailing&listype=<?php 
            echo $list->list_type;
            ?>
'><?php 
            echo @constant($GLOBALS[ACA . 'listname' . $list->list_type]);
            ?>
</a></td>
					<td  style="text-align: center;"><?php 
            echo $list->id;
            ?>
</td>
					</tr>
			<?php 
        }
        ?>
			<tr>
				<th colspan="4">
				</th>
			</tr>
			</table>
			<?php 
        $tabs->endTab();
        $tabs->endPane();
        ?>
			</form>
		</div>
		<div style="clear:both; float:left;">
		<?php 
        echo acajoom::printM('blue', _ACA_SERVER_LOCAL_TIME . ' :' . mosFormatDate(acajoom::getNow(), '%A, %d %B %Y %H:%M', 0));
        ?>
		</div>
   <td>
   </tr>
   </table>
   </div>
</div>
<?php 
    }