Пример #1
0
    }
    $s .= '</select>';
    return $s;
}
function input_time($id)
{
    $value = !empty($_SESSION[$id]) && strlen($_SESSION[$id]) < 5 ? $_SESSION[$id] : "0";
    $c = '<label for="' . $id . '" class="ml">' . $id . '</label> ';
    $c .= '<input type="text" class="text" size="2" id="' . $id . '" name="' . $id . '" value="' . $value . '" />';
    return $c;
}
?>
      </div>
      
		<?php 
if (db_records()) {
    ?>
		
      <hr />
		
      <h1 class="mt" id="mine">Mine results</h1>
      <?php 
    check_notified_request("mine");
    ?>
      
      <em>Leave fields blank for default values</em>
      <form id="filter" class="center" action="filter.php" method="post">
        <fieldset class="smallround">
          <legend>Filter by</legend>
          <?php 
    echo select_client();
Пример #2
0
    echo display_text($_displayType["ERROR"], $msg, 'div');
}
/*
// if no errors are found, display a success message
if (!$dberror) {
  echo '<p class="success">The MySQL server is up and running properly.</p>';
}
*/
if (!is_dir(CACHE_DIR)) {
    echo display_text($_displayType["ERROR"], 'The cache dir does not exist.');
} else {
    $cache = count_dir_files(CACHE_DIR);
    if (!$cache) {
        echo display_text($_displayType["WARNING"], 'The log cache is empty.');
    }
    $dblog = db_records();
    if ($cache > $dblog) {
        echo display_text($_displayType["WARNING"], 'There are ' . $cache . ' logs in cache dir, but there are ' . $dblog . ' in database, which is something weird :/');
    }
    // ensure that logs can be written
    if (!is_writeable(CACHE_DIR)) {
        $perms = substr(decoct(fileperms(CACHE_DIR)), 2);
        if (($perms != "775" || $perms != "777") && !chmod(CACHE_DIR, 0775)) {
            echo display_text($_displayType["ERROR"], 'Settings permissions to <strong>' . CACHE_DIR . '</strong> failed.
                         You must set write permissions to that directory manually.');
        }
    }
}
if (is_admin()) {
    ?>
Пример #3
0
$format = isset($_POST['format']) ? $_POST['format'] : "csv";
switch ($format) {
    case 'txt':
    case 'xml':
        die("Sorry, TXT and XML formats are not yet implemented.");
        break;
    case 'csv':
    default:
        $delimiter = ";";
        break;
    case 'tsv':
        $delimiter = "\t";
        break;
}
// get column names first
$headers = db_records(true);
// parse DSV formats
$dsv = implode(",", $headers);
foreach ($records as $i => $r) {
    $row = array();
    foreach ($headers as $h) {
        // exclude interacted elements?
        if ($h != "hovered" && $h != "clicked") {
            $row[] = '"' . $r[$h] . '"';
        }
    }
    $dsv .= PHP_EOL . implode($delimiter, $row);
}
// set ZIP name (in a writeable dir)
$zipname = 'smt2logs-' . date("Ymd") . '.zip';
$zippath = CACHE_DIR . '/' . $zipname;
Пример #4
0
        $tablerow .= ' <td>' . $numNotes . '</td>' . PHP_EOL;
        $tablerow .= ' <td>' . PHP_EOL;
        if (!$receivingData) {
            if (isset($_SESSION['groupby']) && ($_SESSION['groupby'] == "client_id" || $_SESSION['groupby'] == "domain_id" || $_SESSION['groupby'] == "ip")) {
                $tablerow .= $GROUPED;
            } else {
                // apend dynamically the API to the query string, based on browser capabilities
                $tablerow .= '<a href="track.php?' . $displayId . '" class="view" title="Play log"><img src="styles/track-view.png" alt="view"/></a>' . PHP_EOL;
            }
            $tablerow .= ' <a href="analyze.php?' . $displayId . '" title="Analyze log"><img src="styles/track-analyze.png" alt="analyze"/></a>' . PHP_EOL;
            $tablerow .= ' <a href="download.php?' . $displayId . '" title="Download log"><img src="styles/track-download.png" alt="download"/></a>' . PHP_EOL;
            if ($ROOT) {
                $tablerow .= ' <a href="delete.php?' . $displayId . '" class="del" title="Delete log"><img src="styles/track-remove.png" alt="delete"/></a>' . PHP_EOL;
            }
        } else {
            //$tablerow .= '<em>please wait...</em>';
            $tablerow .= '<em><a href="track.php?' . $displayId . '">receiving data...</a></em>';
        }
        $tablerow .= ' </td>' . PHP_EOL;
        $tablerow .= '</tr>' . PHP_EOL;
    }
    echo $tablerow;
    // check both normal and async (ajax) requests
    if ($start + $show < db_records()) {
        $displayMoreButton = true;
    } else {
        echo '<!--' . $noMoreText . '-->' . PHP_EOL;
    }
} else {
    echo '<!--' . $noMoreText . '-->';
}