Example #1
0
    $log_res = $mysqli->query($query) or write_log($mysqli->error, __FILE__, __LINE__);
    $num = $log_res->num_rows;
    if ($num > 0) {
        $logs = new MakeLog();
        $logs->time_difference = $system_time;
        $logdata .= $logs->make_log_entries($log_res, "system");
    }
    $log_res->close();
}
/**
 *    General log
 */
$sort = "DESC";
if (isset($_GET["glog_sort"]) && $_GET["glog_sort"] != "undefined") {
    if ($_GET["glog_sort"] == "asc") {
        $sort = "ASC";
    }
    if ($_GET["glog_sort"] == "desc") {
        $sort = "DESC";
    }
}
$query = "  SELECT SQL_CACHE\n            id, log_entry, stardate, pinned, title, audio\n            FROM user_log WHERE system_id = '' AND system_name = ''\n            ORDER BY -pinned, weight, stardate " . $sort . "\n            LIMIT 5";
$glog_res = $mysqli->query($query) or write_log($mysqli->error, __FILE__, __LINE__);
$gnum = $glog_res->num_rows;
if ($gnum > 0) {
    $general_logs = new MakeLog();
    $general_logs->time_difference = $system_time;
    $logdata .= $general_logs->make_log_entries($glog_res, "general");
}
$glog_res->close();
$data["log_data"] = $logdata;
Example #2
0
File: index.php Project: DBnR1/EDTB
$header->display_header();
/** @require MakeLog class */
require_once "MakeLog.php";
?>
<div class="entries">
    <div class="entries_inner">
        <?php 
/**
 * get system-specific log
 */
$esc_logsys_name = $mysqli->real_escape_string($logsystem);
$query = "  SELECT user_log.id, user_log.station_id, user_log.system_name, user_log.log_entry, user_log.stardate,\n                    user_log.pinned, user_log.type, user_log.title, user_log.audio,\n                    edtb_stations.name AS station_name\n                    FROM user_log\n                    LEFT JOIN edtb_stations ON edtb_stations.id = user_log.station_id\n                    WHERE user_log.system_id = '{$logsystem_id}'\n                    OR user_log.system_name = '{$esc_logsys_name}'\n                    ORDER BY -user_log.pinned, user_log.weight, user_log.stardate DESC";
$result = $mysqli->query($query) or write_log($mysqli->error, __FILE__, __LINE__);
$num = $result->num_rows;
if ($num > 0) {
    $log = new MakeLog();
    $log->time_difference = $system_time;
    echo $log->make_log_entries($result, "log");
} else {
    echo '<h2>No log entries for ' . $logsystem . '</h2><br />';
    echo '<a href="javascript:void(0)" id="toggle" onclick="toggle_log(\'' . addslashes($logsystem) . '\')" title="Add log entry" style="color:inherit">';
    echo 'Click here to add one</a>';
}
$result->close();
?>
    </div>
</div>
<?php 
/**
 * initiate page footer
 */
Example #3
0
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
 */
use EDTB\Log\MakeLog;
if (isset($_GET["do"])) {
    /** @require config */
    require_once $_SERVER["DOCUMENT_ROOT"] . "/source/config.inc.php";
    /** @require functions */
    require_once $_SERVER["DOCUMENT_ROOT"] . "/source/functions.php";
    /** @require MySQL */
    //require_once($_SERVER["DOCUMENT_ROOT"] . "/source/MySQL.php");
    /** @require MakeLog class */
    require_once "MakeLog.php";
    $data = json_decode($_REQUEST["input"]);
    $addLog = new MakeLog();
    $addLog->add_log($data);
    exit;
}
?>
<div class="input" id="addlog">
    <form method="post" id="log_form" action="/">
        <div class="input-inner">
            <div class="suggestions" id="suggestions_1" style="margin-left:8px;margin-top:130px"></div>
            <div class="suggestions" id="suggestions_41" style="margin-left:402px;margin-top:130px"></div>
            <table>
                <thead>
                    <tr>
                        <td class="heading" colspan="2">Add/Edit Log Entry
                            <span class="right">
                                <a href="javascript:void(0)" id="close_form" title="Close form">