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 
    }
    function showSubscribers($subscribers, $action, $listId, &$lists, $start, $limit, $total, $showAdmin, $theLetterId, $emailsearch, $forms)
    {
        global $my;
        echo $forms['select'];
        ?>
		<input type="hidden" name="option" value="com_acajoom" />
		<input type="hidden" name="act" value="<?php 
        echo $action;
        ?>
" />
		<input type="hidden" name="task" value="" />
    	<input type="hidden" name="boxchecked" value="0" />
		<input type="hidden" name="listid" value="<?php 
        echo $listId;
        ?>
" />
		<input type="hidden" name="limit" value="<?php 
        echo $limit;
        ?>
" />

		<table style="text-align: left; width: 100%;" border="0"
	 cellpadding="2" cellspacing="0"><tbody><tr>
	 <td style="text-align: left; padding-left: 20px;"><span class="sectionname">
	 <?php 
        if ($listId == 0) {
            echo _ACA_SUSCRIB_LIST;
        } else {
            $lt_name = lists::getLists($listId, 0, null, '', false, false, true);
            echo _ACA_SUSCRIB_LIST_UNIQUE . "<span style='color: rgb(51, 51, 51);'>" . $lt_name[0]->list_name . "</span>";
        }
        ?>
	 </span>
	 </td>
	 <td style="text-align: right;">
	 <?php 
        echo _ACA_SEL_LIST . ' : ' . $lists['listid'] . " ";
        ?>
 <?php 
        echo _ACA_FILTER;
        ?>
 :
	<input type="text" name="emailsearch" value="<?php 
        echo $emailsearch;
        ?>
" class="inputbox" onChange="document.AcajoomFilterForm.submit();" />
	</td></tr></tbody></table>
	</form>

	<?php 
        echo $forms['main'];
        ?>
		<input type="hidden" name="option" value="com_acajoom" />
		<input type="hidden" name="act" value="<?php 
        echo $action;
        ?>
" />
		<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">&nbsp;</th>
			<th class="title"><?php 
        echo _ACA_INPUT_NAME;
        ?>
</th>
			<th class="title"><?php 
        echo _ACA_INPUT_EMAIL;
        ?>
</th>
			<th class="title"><?php 
        echo _ACA_SIGNUP_DATE;
        ?>
</th>
			<th class="title"><center><?php 
        echo _ACA_REGISTERED;
        ?>
?</center></th>
			<th class="title"><center><?php 
        echo _ACA_CONFIRMED;
        ?>
?</center></th>
			<th class="title"><center><?php 
        echo _ACA_HTML;
        ?>
?</center></th>
	<?php 
        if ($my->usertype == 'Administrator' or $my->usertype == 'Super Administrator') {
            ?>
			<th class="title">id#</th>
	<?php 
        }
        ?>
		</tr>
		<?php 
        $i = 0;
        if (!empty($subscribers)) {
            foreach ($subscribers as $subscriber) {
                if ($subscriber->user_id != 0) {
                    $img = 'tick.png';
                    $alt = 'Registered';
                } else {
                    $img = 'publish_x.png';
                    $alt = 'Unregistered';
                }
                if ($subscriber->confirmed == 1) {
                    $imgC = 'tick.png';
                    $altC = 'Confirmed';
                } else {
                    $imgC = 'publish_x.png';
                    $altC = 'Not confirmed';
                }
                if ($subscriber->receive_html == 1) {
                    $imgH = 'tick.png';
                    $altH = 'HTML';
                } else {
                    $imgH = 'publish_x.png';
                    $altH = 'TEXT';
                }
                ?>
				<tr class="row<?php 
                echo ($i + 1) % 2;
                ?>
">
					<td><?php 
                echo $i + 1 + $start;
                ?>
</td>
					<td>
						<input type="checkbox" name="cid[<?php 
                echo $i;
                ?>
]" value="<?php 
                echo $subscriber->id;
                ?>
" onclick="isChecked(this.checked);" />
					</td>
					<td>
					<a href="index2.php?option=com_acajoom&act=<?php 
                echo $action;
                ?>
&task=show&userid=<?php 
                echo $subscriber->id;
                ?>
" >
					<?php 
                echo $subscriber->name;
                ?>
</a></td>
					<td><?php 
                echo $subscriber->email;
                ?>
</td>
					<td><?php 
                echo $subscriber->subscribe_date;
                ?>
</td>
					<td align="center">
						<img src="images/<?php 
                echo $img;
                ?>
" width="12" height="12" border="0" alt="<?php 
                echo $alt;
                ?>
" />
					</td>

					<td align="center">
						<img src="images/<?php 
                echo $imgC;
                ?>
" width="12" height="12" border="0" alt="<?php 
                echo $altC;
                ?>
" />
					</td>
					<td align="center">
						<img src="images/<?php 
                echo $imgH;
                ?>
" width="12" height="12" border="0" alt="<?php 
                echo $altH;
                ?>
" />
					</td>
					<?php 
                $i++;
                if ($my->usertype == 'Administrator' or $my->usertype == 'Super Administrator') {
                    echo '<td align="center">' . $subscriber->id . '</td>';
                }
            }
        }
        ?>
			</tr>
	</table>
	</form>
	<?php 
        backHTML::footerCounts($start, $limit, $emailsearch, $total, 9, $action, $listId, '');
    }