public static function controlPanel() { unset($GLOBALS["task"]); unset($_REQUEST["task"]); $doc = JFactory::getDocument(); $doc->addStyleSheet(JNEWS_URL_ADMIN . 'cssadmin/jnews.css'); ?> <div align="center" class="centermain"> <div id="jnews"> <table class=""> <tr> <td width="58%" valign="top"> <?php echo backHTML::iconsPanel(); ?> </td> <td width="42%" valign="top"> <div style="width=100%;"> <script type="text/javascript"> function checkcid(myField) { myField.checked = true; isChecked(true); } </script> <form action="index.php" method="post" name="adminForm" id="adminForm"> <input type="hidden" name="option" value="<?php echo JNEWS_OPTION; ?> " /> <input type="hidden" name="act" value="jnews" /> <input type="hidden" name="task" value="" /> <input type="hidden" name="userid" value="" /> <input type="hidden" name="boxchecked" value="0" /> <?php $tabs = new MosTabsjNews(1); $tabs->startPane('acaControlPanel'); $tabs->startTab(_JNEWS_MENU_TAB_SUM, "acaControlPanel.Summary"); ?> <table class="<?php echo jnews::myTheme(); ?> "> <tbody> <thead> <tr> <th class="title" style="text-align: center;"><?php echo '#'; ?> </th> <th class="title" style="text-align: center;"><?php echo _JNEWS_MENU_TAB_LIST; ?> </th> <th class="title" style="text-align: center;"><?php echo _JNEWS_MENU_MAILING_TITLE; ?> </th> </tr> </thead> <?php $html = ''; $totalist = 0; $totalmail = 0; $totalsub = $GLOBALS[JNEWS . 'act_totalsubcribers0']; $totalsent = 0; $nb = explode(',', $GLOBALS[JNEWS . 'activelist']); $size = sizeof($nb); $countOfLists[1] = jNews_Lists::countLists(1); $countOfLists[2] = jNews_Lists::countLists(2); $countOfLists[7] = jNews_Mailing::countMails(7, true); $countOfMailings[1] = jNews_Mailing::countMails(1); $countOfMailings[2] = jNews_Mailing::countMails(2); $countOfMailings[7] = jNews_Mailing::countMails(7); for ($i = 0; $i < $size; $i++) { $index = $nb[$i]; if ($GLOBALS[JNEWS . 'listshow' . $index] > 0 and $GLOBALS[JNEWS . 'listype' . $index] == 1) { $row = ($i + 1) % 2; $html .= '<tr class="row' . $row . '">'; $html .= '<td><b>' . @constant($GLOBALS[JNEWS . 'listnames' . $index]) . '</b></td>'; // $html .= '<td style="text-align: center; ">' .$GLOBALS[JNEWS.'act_totallist'.$index].'1 </td>'; $html .= '<td style="text-align: center; ">' . $countOfLists[$index] . ' </td>'; //if the value to be is less than 0 we will display 0 if ($GLOBALS[JNEWS . 'act_totalmailing' . $index] > 0) { // $html .= '<td style="text-align: center; ">' .$GLOBALS[JNEWS.'act_totalmailing'.$index].' </td>'; $html .= '<td style="text-align: center; ">' . $countOfMailings[$index] . ' </td>'; } else { $html .= '<td style="text-align: center; ">0</td>'; } // $html .= '<td style="text-align: center; ">' .$GLOBALS[JNEWS.'totalmailingsent'.$index].' </td>'; $html .= '</tr>'; // $totalist = $totalist + $GLOBALS[JNEWS.'act_totallist'.$index]; $totalist = array_sum($countOfLists); // $totalmail = $totalmail + $GLOBALS[JNEWS.'act_totalmailing'.$index]; $totalmail = array_sum($countOfMailings); $totalsent = $totalsent + $GLOBALS[JNEWS . 'totalmailingsent' . $index]; if ($GLOBALS[JNEWS . 'act_totalsubcribers' . $index] > $totalsub) { $totalsub = $GLOBALS[JNEWS . 'act_totalsubcribers' . $index]; } } } $html .= '<tr>'; $html .= '<td style="background-color: #CCFFFF;"><b>' . _JNEWS_CP_TOTAL . '</b></td>'; $html .= '<td style="text-align: center; text-decoration: bold; background-color: #CCFFFF; border-top: 1px solid #000; ">' . $totalist . ' </td>'; $html .= '<td style="text-align: center; text-decoration: bold; background-color: #CCFFFF; border-top: 1px solid #000; ">' . $totalmail . ' </td>'; // $html .= '<td style="text-align: center; text-decoration: bold; background-color: #CCFFFF; border-top: 1px solid #000; ">' .$totalsent.' </td>'; //$html .= '<td style="text-align: center; ">' .$totalsub.' </td>'; $html .= '</tr>'; echo $html; ?> </tbody></table> <br /> <?php if (class_exists('jNews_Auto')) { echo jNews_Auto::showQueue(); } $tabs->endTab(); $tabs->startTab(_JNEWS_MENU_SUBSCRIBERS, "acaControlPanel.Subscribers"); $emailsearch = ''; $listId = 0; $limittotal = jNews_Subscribers::getSubscribersCount($listId); $setLimitSubs = jnews::setLimitPagination($limittotal); ?> <input type="hidden" name="listid" value="<?php echo $listId; ?> " /> <input type="hidden" name="start" value="<?php echo $setLimitSubs->start; ?> " /> <input type="hidden" name="limit" value="<?php echo $setLimitSubs->end; ?> " /> <input type="hidden" name="listsearch" value="<?php echo $emailsearch; ?> " /> <div style="margin-top: 10px;"><?php echo jnews::setTop('', '', $setLimitSubs); ?> </div> <table class="<?php echo jnews::myTheme(); ?> "> <thead> <tr> <th class="title">#</th> <th class="title" style="text-align: left;"><?php echo _JNEWS_INPUT_NAME; ?> </th> <th class="title" style="text-align: left;"><?php echo _JNEWS_INPUT_EMAIL; ?> </th> <th class="title" style="text-align: center;"><?php echo _JNEWS_SIGNUP_DATE; ?> </th> </tr> </thead> <?php $subscribers = jNews_Subscribers::getSubscribers($setLimitSubs->start, $setLimitSubs->end, $emailsearch, $setLimitSubs->total, $listId, '', 0, 0, 'sub_dateD', 0, 0, null, 0); $i = 0; foreach ($subscribers as $subscriber) { $i++; if (!jNews_Subscribers::validEmail($subscriber->email)) { continue; } ?> <tr class="row<?php echo ($i + 2) % 2; ?> "> <td><center><?php echo $i + $setLimitSubs->start; ?> </center></td> <td style="text-align: left;"> <a href="index.php?option=<?php echo JNEWS_OPTION; ?> &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 date('l, jS F Y h:i:s A', jnews::getNow(0, true, $subscriber->subscribe_date)); ?> </td> </tr> <?php } ?> </table> <?php $tabs->endTab(); $tabs->startTab(_JNEWS_MENU_TAB_LIST, "acaControlPanel.Lists"); $listsearch = ''; $lists = jNews_Lists::getLists(0, 0, 1, '', false, false, false); $limittotal = count($lists); $setLimitLists = jnews::setLimitPagination($limittotal); ?> <input type="hidden" name="listid" value="<?php echo $listId; ?> " /> <input type="hidden" name="start" value="<?php echo $setLimitLists->start; ?> " /> <input type="hidden" name="limit" value="<?php echo $setLimitLists->end; ?> " /> <input type="hidden" name="listsearch" value="<?php echo $listsearch; ?> " /> <div style="margin-top: 10px;"><?php echo jnews::setTop('', '', $setLimitLists); ?> </div> <table class="<?php echo jnews::myTheme(); ?> "> <thead> <tr> <th class="title">#</th> <th class="title" width="65%" style="text-align: left;"><?php echo _JNEWS_LIST_NAME; ?> </th> <th class="title" width="25%" style="text-align: left;"><?php echo _JNEWS_LIST_TYPE; ?> </th> <th class="title" style="text-align: center;">ID</th> </tr> </thead> <?php $lists = jNews_Lists::getLists(0, 0, 1, 'listtypeA', false, false, false, false, false, $listsearch, $setLimitLists, 0, 0); $i = 0; foreach ($lists as $list) { $i++; $link = 'index.php?option=' . JNEWS_OPTION . '&act=mailing&task=show&listid=' . $list->id; ?> <tr class="row<?php echo ($i + 2) % 2; ?> "> <td><?php echo $i + $setLimitLists->start; ?> </td> <td style="text-align: left;"> <a href="<?php echo $link; ?> "> <?php echo $list->list_name; ?> </a> </td> <td style="text-align: left;"><?php if ($list->list_type == 1) { echo _JNEWS_LIST; } else { echo _JNEWS_AR; } ?> </td> <td style="text-align: center;"><?php echo $list->id; ?> </td> </tr> <?php } ?> <tr> <th colspan="4"> </th> </tr> </table> <?php $tabs->endTab(); ?> <?php $tabs->endPane(); ?> </form> </div> <div style="clear:both; float:left; margin-top: 10px;"> <?php echo jnews::printM('ok', _JNEWS_SERVER_LOCAL_TIME . ' : ' . date('l, j F Y H:i:s', jnews::getNow(0, true))); // - date('Z') ?> </div> <td> </tr> </table> </div> </div> <?php }