Exemple #1
0
<?php

/**
 * 
 * MemberMouse(TM) (http://www.membermouse.com)
 * (c) MemberMouse, LLC. All rights reserved.
 */
global $current_user;
$view = new MM_DiagnosticsView();
$currentMode = MM_DiagnosticLog::getMode();
$modeList = MM_DiagnosticLog::getModeLabels();
$modeListHtml = MM_HtmlUtils::generateSelectionsList($modeList, $currentMode);
// determine if this user's preference is to have the advanced search open
$showFilterOptionName = MM_OptionUtils::$OPTION_KEY_SHOW_DIAGNOSTICS_LOG_FILTERS . "-" . $current_user->ID;
$showFilterOptionValue = MM_OptionUtils::getOption($showFilterOptionName);
$showFilters = $showFilterOptionValue == "1";
?>
<div class="mm-wrap">
	<div>
		<table>
			<tr>
				<td>Current Mode:</td>
				<td><?php 
echo $modeList[$currentMode];
?>
</td>
			</tr>
			<tr>
				<td>Change mode to: </td>
				<td><select id="newMode" name="newMode">
						<?php 
<?php

/**
 *
 * MemberMouse(TM) (http://www.membermouse.com)
 * (c) MemberMouse, LLC. All rights reserved.
 */
// get data based on filters and datagrid settings
$view = new MM_DiagnosticsView();
$dataGrid = new MM_DataGrid($_REQUEST, "event_date", "desc", 100);
$data = $view->filter($_REQUEST, $dataGrid);
$dataGrid->setTotalRecords($data);
$dataGrid->recordName = "event";
// define datagrid headers
$headers = array('type' => array('content' => '<a onclick="mmjs.sort(\'type\');" href="#">Type</a>'), 'ip_address' => array('content' => '<a onclick="mmjs.sort(\'ip_address\');" href="#">IP</a>'), 'session' => array('content' => '<a onclick="mmjs.sort(\'session\');" href="#">Session</a>'), 'location' => array('content' => '<a onclick="mmjs.sort(\'location\');" href="#">Location</a>'), 'line' => array('content' => '<a onclick="mmjs.sort(\'line\');" href="#">Line</a>'), 'event' => array('content' => '<a onclick="mmjs.sort(\'event\');" href="#">Event Data</a>'), 'event_date' => array('content' => '<a onclick="mmjs.sort(\'event_date\');" href="#">Timestamp</a>'));
$rows = array();
// process data
foreach ($data as $item) {
    switch ($item->type) {
        case 'mm-error':
            $eventType = "<i class='fa fa-times-circle' style='color:#ff0000' title='error response'></i>\n";
            break;
        case 'php-error':
            $eventType = "<i class='fa fa-code' style='color:#ff0000' title='php error'></i>\n";
            break;
        case 'php-warning':
            $eventType = "<i class='fa fa-exclamation-triangle' style='color:#eeee00' title='php warning'></i>\n";
            break;
        case 'mm-success':
        default:
            $eventType = "<i class='fa fa-thumbs-o-up' style='color:#00ee00' title='success response'></i>\n";