Exemplo n.º 1
0
function pagination($limit)
{
    global $p;
    $curpage = $p;
    $next_page_num = 0;
    $prev_page_num = 0;
    $total_campaigns = totals($_GET['i']);
    $total_pages = @ceil($total_campaigns / $limit);
    if ($total_campaigns > $limit) {
        if ($curpage >= 2) {
            $next_page_num = $curpage + 1;
            $prev_page_num = $curpage - 1;
        } else {
            $next_page_num = 2;
        }
        echo '<div class="btn-group" id="pagination">';
        //Prev btn
        if ($curpage >= 2) {
            if ($prev_page_num == 1) {
                echo '<button class="btn" onclick="window.location=\'' . get_app_info('path') . '/templates?i=' . get_app_info('app') . '\'"><span class="icon icon icon-arrow-left"></span></button>';
            } else {
                echo '<button class="btn" onclick="window.location=\'' . get_app_info('path') . '/templates?i=' . get_app_info('app') . '&p=' . $prev_page_num . '\'"><span class="icon icon icon-arrow-left"></span></button>';
            }
        } else {
            echo '<button class="btn disabled"><span class="icon icon icon-arrow-left"></span></button>';
        }
        //Next btn
        if ($curpage == $total_pages) {
            echo '<button class="btn disabled"><span class="icon icon icon-arrow-right"></span></button>';
        } else {
            echo '<button class="btn" onclick="window.location=\'' . get_app_info('path') . '/templates?i=' . get_app_info('app') . '&p=' . $next_page_num . '\'"><span class="icon icon icon-arrow-right"></span></button>';
        }
        echo '</div>';
    }
}
Exemplo n.º 2
0
function report_csv($module, $name, $values)
{
    $report = get_report($module, $name);
    if ($report === NULL) {
        die;
    }
    $reportRun = $report->run($values);
    ob_clean();
    $output = fopen("php://output", "rb+");
    if (!$report->isGrouping()) {
        fputcsv($output, array("Pastèque", ""), ";");
        $line = $report->getHeaders();
        fputcsv($output, $line, ";");
        while ($line = $reportRun->fetch()) {
            $data = array();
            foreach ($report->getFields() as $field) {
                $data = init_data($report, $data, $line, $field);
            }
            fputcsv($output, $data, ";");
        }
    } else {
        while ($line = $reportRun->fetch()) {
            $data = array();
            if ($reportRun->isGroupEnd()) {
                if ($report->hasSubtotals()) {
                    write_subtotals($output, $report, $reportRun);
                }
                fputcsv($output, array(), ";");
            }
            if ($reportRun->isGroupStart()) {
                fputcsv($output, array($reportRun->getCurrentGroup()), ";");
                fputcsv($output, $report->getHeaders(), ";");
            }
            foreach ($report->getFields() as $field) {
                $data = init_data($report, $data, $line, $field);
            }
            fputcsv($output, $data, ";");
            unset($data);
        }
        if ($report->hasSubtotals()) {
            write_subtotals($output, $report, $reportRun);
            fputcsv($output, array(), ";");
        }
    }
    if ($report->hasTotals()) {
        fputcsv($output, array(\i18n("Total")), ";");
        fputcsv($output, totalHeader($report, $reportRun), ";");
        fputcsv($output, totals($report, $reportRun), ";");
    }
}
Exemplo n.º 3
0
</th>
		      <th><?php 
echo _('Unsubscribe');
?>
</th>
		      <th><?php 
echo _('Delete');
?>
</th>
		    </tr>
		  </thead>
		  <tbody>
		  	
		  	<?php 
$limit = 20;
$total_subs = totals($lid);
$total_pages = ceil($total_subs / $limit);
if ($p != null) {
    $offset = ($p - 1) * $limit;
} else {
    $offset = 0;
}
if ($s == '') {
    if ($a == '' && $c == '' && $u == '' && $b == '' && $cp == '') {
        $q = 'SELECT * FROM subscribers WHERE list = ' . mysqli_real_escape_string($mysqli, $lid) . ' ORDER BY timestamp DESC LIMIT ' . $offset . ',' . $limit;
    } else {
        if ($a != '') {
            $q = 'SELECT * FROM subscribers WHERE list = ' . mysqli_real_escape_string($mysqli, $lid) . ' AND confirmed = 1 AND unsubscribed = 0 AND bounced = 0 AND complaint = 0 ORDER BY timestamp DESC LIMIT ' . $offset . ',' . $limit;
        } else {
            if ($c != '') {
                $q = 'SELECT * FROM subscribers WHERE list = ' . mysqli_real_escape_string($mysqli, $lid) . ' AND confirmed = ' . $c . ' ORDER BY timestamp DESC LIMIT ' . $offset . ',' . $limit;
Exemplo n.º 4
0
</th>
		      <th><?php 
echo _('Duplicate');
?>
</th>
		      <th><?php 
echo _('Delete');
?>
</th>
		    </tr>
		  </thead>
		  <tbody>
		  	
		  	<?php 
$limit = 10;
$total_subs = totals($_GET['i']);
$total_pages = ceil($total_subs / $limit);
$p = isset($_GET['p']) ? $_GET['p'] : null;
$offset = $p != null ? ($p - 1) * $limit : 0;
$q = 'SELECT * FROM campaigns WHERE userID = ' . get_app_info('main_userID') . ' AND app=' . get_app_info('app') . ' ORDER BY id DESC LIMIT ' . $offset . ',' . $limit;
$r = mysqli_query($mysqli, $q);
if ($r && mysqli_num_rows($r) > 0) {
    while ($row = mysqli_fetch_array($r)) {
        $id = stripslashes($row['id']);
        $timezone = stripslashes($row['timezone']);
        if ($timezone == '' || $timezone == 0) {
            date_default_timezone_set(get_app_info('timezone'));
        } else {
            date_default_timezone_set($timezone);
        }
        $title = stripslashes(htmlentities($row['title'], ENT_QUOTES, "UTF-8"));
Exemplo n.º 5
0
</th>
		      <th><?php 
echo _('Unique Clicks');
?>
</th>
		      <th><?php 
echo _('Delete');
?>
</th>
		    </tr>
		  </thead>
		  <tbody>
		  	
		  	<?php 
$limit = 10;
$total_subs = totals($_GET['i'], 'reports');
$total_pages = ceil($total_subs / $limit);
$p = isset($_GET['p']) ? $_GET['p'] : null;
$offset = $p != null ? ($p - 1) * $limit : 0;
$q = 'SELECT * FROM campaigns WHERE userID = ' . get_app_info('main_userID') . ' AND app=' . get_app_info('app') . ' AND sent != "" ORDER BY id DESC LIMIT ' . $offset . ',' . $limit;
$r = mysqli_query($mysqli, $q);
if ($r && mysqli_num_rows($r) > 0) {
    while ($row = mysqli_fetch_array($r)) {
        $id = stripslashes($row['id']);
        $title = stripslashes(htmlentities($row['title'], ENT_QUOTES, "UTF-8"));
        $campaign_title = $row['label'] == '' ? $title : stripslashes(htmlentities($row['label'], ENT_QUOTES, "UTF-8"));
        $recipients = stripslashes($row['recipients']);
        $sent = stripslashes($row['sent']);
        $opens = stripslashes($row['opens']);
        $from_email = stripslashes($row['from_email']);
        $error_stack = stripslashes($row['errors']);
Exemplo n.º 6
0
</th>
		      <th><?php 
echo _('Unsubscribe');
?>
</th>
		      <th><?php 
echo _('Delete');
?>
</th>
		    </tr>
		  </thead>
		  <tbody>
		  	
		  	<?php 
$limit = 20;
$total_subs = totals($_GET['l']);
$total_pages = ceil($total_subs / $limit);
if ($p != null) {
    $offset = ($p - 1) * $limit;
} else {
    $offset = 0;
}
if ($s == '') {
    if ($a == '' && $c == '' && $u == '' && $b == '' && $cp == '') {
        $q = 'SELECT * FROM subscribers WHERE list = ' . mysqli_real_escape_string($mysqli, $_GET['l']) . ' ORDER BY timestamp DESC LIMIT ' . $offset . ',' . $limit;
    } else {
        if ($a != '') {
            $q = 'SELECT * FROM subscribers WHERE list = ' . mysqli_real_escape_string($mysqli, $_GET['l']) . ' AND confirmed = 1 AND unsubscribed = 0 AND bounced = 0 AND complaint = 0 ORDER BY timestamp DESC LIMIT ' . $offset . ',' . $limit;
        } else {
            if ($c != '') {
                $q = 'SELECT * FROM subscribers WHERE list = ' . mysqli_real_escape_string($mysqli, $_GET['l']) . ' AND confirmed = ' . $c . ' ORDER BY timestamp DESC LIMIT ' . $offset . ',' . $limit;
Exemplo n.º 7
0
function pagination($limit)
{
    global $s;
    global $c;
    global $p;
    global $a;
    global $u;
    global $b;
    global $cp;
    $curpage = $p;
    $next_page_num = 0;
    $prev_page_num = 0;
    $total_subs = totals($_GET['l']);
    $total_pages = @ceil($total_subs / $limit);
    if ($s != '') {
        $s_more = '&s=' . $s;
    } else {
        $s_more = '';
    }
    $more = '';
    if ($a != '') {
        $more = '&a=' . $a;
    } else {
        if ($c != '') {
            $more = '&c=' . $c;
        } else {
            if ($u != '') {
                $more = '&u=' . $u;
            } else {
                if ($b != '') {
                    $more = '&b=' . $b;
                } else {
                    if ($cp != '') {
                        $more = '&cp=' . $cp;
                    }
                }
            }
        }
    }
    if ($total_subs > $limit) {
        if ($curpage >= 2) {
            $next_page_num = $curpage + 1;
            $prev_page_num = $curpage - 1;
        } else {
            $next_page_num = 2;
        }
        echo '<div class="btn-group" id="pagination">';
        //Prev btn
        if ($curpage >= 2) {
            if ($prev_page_num == 1) {
                echo '<button class="btn" onclick="window.location=\'' . get_app_info('path') . '/subscribers?i=' . get_app_info('app') . '&l=' . $_GET['l'] . $s_more . $more . '\'"><span class="icon icon icon-arrow-left"></span></button>';
            } else {
                echo '<button class="btn" onclick="window.location=\'' . get_app_info('path') . '/subscribers?i=' . get_app_info('app') . '&l=' . $_GET['l'] . $s_more . $more . '&p=' . $prev_page_num . '\'"><span class="icon icon icon-arrow-left"></span></button>';
            }
        } else {
            echo '<button class="btn disabled"><span class="icon icon icon-arrow-left"></span></button>';
        }
        //Next btn
        if ($curpage == $total_pages) {
            echo '<button class="btn disabled"><span class="icon icon icon-arrow-right"></span></button>';
        } else {
            echo '<button class="btn" onclick="window.location=\'' . get_app_info('path') . '/subscribers?i=' . get_app_info('app') . '&l=' . $_GET['l'] . $s_more . $more . '&p=' . $next_page_num . '\'"><span class="icon icon icon-arrow-right"></span></button>';
        }
        echo '</div>';
    }
}