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 
    }
Exemple #2
0
    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 
    }