Пример #1
0
" frameborder="0" style="width: 100%; height: 500px;"></iframe>
<?php 
} else {
    ob_start();
    $fines_data = array();
    // year
    $selected_year = date('Y');
    if (isset($_GET['year']) and !empty($_GET['year'])) {
        $selected_year = (int) $_GET['year'];
    }
    // month
    $selected_month = date('m');
    if (isset($_GET['month']) and !empty($_GET['month'])) {
        $selected_month = $_GET['month'];
    }
    // query fines data to database
    // echo "SELECT SUBSTRING(`fines_date`, -2) AS `mdate`, SUM(debet) AS `dtotal` FROM `fines` WHERE `fines_date` LIKE '$selected_year-$selected_month%' GROUP BY `fines_date`";
    $_fines_q = $dbs->query("SELECT SUBSTRING(`fines_date`, -2) AS `mdate`, SUM(debet) AS `dtotal` FROM `fines` WHERE `fines_date` LIKE '{$selected_year}-{$selected_month}%' GROUP BY `fines_date`");
    while ($_fines_d = $_fines_q->fetch_row()) {
        $date = (int) preg_replace('@^0+@i', '', $_fines_d[0]);
        $fines_data[$date] = '<div class="data">' . ($_fines_d[1] ? $_fines_d[1] : '0') . '</div>';
    }
    // generate calendar
    $output = simbio_date::generateCalendar($selected_year, $selected_month, $fines_data);
    // print out
    echo '<div class="printPageInfo">Fines Count Report for <strong>' . $months[$selected_month] . ', ' . $selected_year . '</strong> <a class="printReport" onclick="window.print()" href="#">' . __('Print Current Page') . '</a></div>' . "\n";
    echo $output;
    $content = ob_get_clean();
    // include the page template
    require SB . '/admin/' . $sysconf['admin_template']['dir'] . '/printed_page_tpl.php';
}
Пример #2
0
    ?>
" frameborder="0" style="width: 100%; height: 500px;"></iframe>
<?php 
} else {
    ob_start();
    $visitor_data = array();
    // year
    $selected_year = date('Y');
    if (isset($_GET['year']) and !empty($_GET['year'])) {
        $selected_year = (int) $_GET['year'];
    }
    // month
    $selected_month = date('m');
    if (isset($_GET['month']) and !empty($_GET['month'])) {
        $selected_month = $_GET['month'];
    }
    // query visitor data to database
    $_visitor_q = $dbs->query("SELECT SUBSTRING(`checkin_date`, 9, 2) AS `mdate`, COUNT(visitor_id) AS `vtotal` FROM `visitor_count` WHERE `checkin_date` LIKE '{$selected_year}-{$selected_month}%' GROUP BY DATE(`checkin_date`)");
    while ($_visitor_d = $_visitor_q->fetch_row()) {
        $date = (int) preg_replace('@^0+@i', '', $_visitor_d[0]);
        $visitor_data[$date] = '<div class="data">' . ($_visitor_d[1] ? $_visitor_d[1] : '0') . '</div>';
    }
    // generate calendar
    $output = simbio_date::generateCalendar($selected_year, $selected_month, $visitor_data);
    // print out
    echo '<div class="printPageInfo">Visitor Report for year <strong>' . $selected_year . '</strong> <a class="printReport" onclick="window.print()" href="#">[' . __('Print Current Page') . ']</a></div>' . "\n";
    echo $output;
    $content = ob_get_clean();
    // include the page template
    require SENAYAN_BASE_DIR . '/admin/' . $sysconf['admin_template']['dir'] . '/printed_page_tpl.php';
}