Example #1
0
@license: BSD
@description:
  This file is great.
*/
require "./login_is.php";
require "../includes/db.inc.php";
$db_dir = DB_DIR;
if (!preg_match("/[0-9]{6}-site-freetale.sqlite/", $_GET['db'])) {
    echo "BAD DATABSE";
    exit;
}
$db = new DBx(DB_DIR . $_GET['db']);
$sql = "\nSELECT * FROM tics \n  WHERE\n    id=:id and url=:url \n  LIMIT 1\n";
$db->p($sql);
$db->exec(array(":id" => $_GET['id'], ":url" => $_GET['url']));
$init = $db->f();
$_SESSION['id'] = $_GET['id'];
$_SESSION['url'] = $_GET['url'];
$_SESSION['db'] = $_GET['db'];
$_SESSION['replay_motion'] = 1;
$_SESSION['replay_summary'] = 0;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>
<title>FreeTale Replay</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
Example #2
0
    function MySQLReplicationStatus($host,$clusters) {

        $db = new DBx ($clusters[$host]['ip'],$clusters[$host]['user'],$clusters[$host]['password']);

        if (!$db->query($this->slave_status_query)) {
            printf ("<p><font color=red>Error from MySQL server %s: %s (%s) for query: %s</font>",$clusters[$host]['ip'],$db->Error,$db->Errno,$this->slave_status_query);
            return false;
        }

		$db->next_record();

        $this->slave_master         = $db->f('Master_Host');
        $this->slave_user           = $db->f('Master_User');
        $this->slave_master_port    = $db->f('Master_Port');
        $this->slave_log_file	    = $db->f('Master_Log_File');
        $this->slave_position       = $db->f('Read_Master_Log_Pos');
        $this->slave_sql_running	= $db->f('Slave_SQL_Running');
        $this->slave_io_running	    = $db->f('Slave_IO_Running');
        $this->slave_last_errno	    = $db->f('Last_Errno');
        $this->slave_last_error 	= $db->f('Last_Error');
        $this->slave_seconds_behind = $db->f('Seconds_Behind_Master');

        if (!$db->query($this->master_status_query)) {
            printf ("<p><font color=red>MySQL error: %s (%s) for query: %s</font>",$db->Error,$db->Errno,$this->slave_status_query);
            return;
        }

		$db->next_record();

    	$this->master_position	    = $db->f('Position');
    	$this->master_log_file	    = $db->f('File');
        $this->slave_of     	    = $clusters[$host]['slave_of'];
        $this->color         	    = $clusters[$host]['color'];
    }
}
$db_dir = DB_DIR;
$db = new DBx(DB_DIR . $_GET['db']);
$sql = "\nSELECT\n  id,\n  scroll,\n  time_elapsed\nFROM  tics\n";
$db->q($sql);
function last_scroll($scroll)
{
    if ($scroll == "") {
        return False;
    }
    $bits = explode("|", $scroll);
    return $bits[count($bits) - 1];
}
$motions = array();
$this_id = False;
while ($row = $db->f()) {
    if ($this_id != $row['id']) {
        $this_id = $row['id'];
        $last_time = 0;
        $last_scroll = 0;
    }
    $motions[$row['id']][][0] = $row['time_elapsed'] - $last_time;
    $last_time = $row['time_elapsed'];
    $motions[$row['id']][count($motions[$row['id']]) - 1][1] = last_scroll($row['scroll']);
    /** /
      echo "<pre>";
      print_r($row);
      echo "</pre>";
      /**/
}
/**/
Example #4
0
    }
    $url = filter_var($url, FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED);
    $url_string = htmlentities($url);
    $url_link = "\n<a href=\"{$url}\" target=\"_blank\">{$url_string}</a>\n";
    return $url_link;
}
if (!preg_match("/freetaleform.sqlite/", $_GET['db'])) {
    echo "BAD DATABSE";
    exit;
}
$db = new DBx(DB_DIR . $_GET['db']);
$prepare_vars = array(':id' => $_GET['id'], ':url' => $_GET['url']);
$sql = "\nSELECT * FROM \n  actions \nWHERE\n  id = :id\n   AND\n  url = :url\nORDER BY\n  unixtime\n";
$db->p($sql . " LIMIT 1");
$db->exec($prepare_vars);
$meta_row = $db->f();
$url_link = anchor_link($meta_row['url']);
$referer_link = anchor_link($meta_row['referer']);
$db->p($sql);
$db->exec($prepare_vars);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>
<title>Form Analytics</title>
<link rel="stylesheet" href="style.css" >
<meta http-equiv="content-type" content="text/html; charset=utf-8">
    }
    $url = filter_var($url, FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED);
    $url_string = htmlentities($url);
    $url_link = "\n<a href=\"{$url}\" target=\"_blank\">{$url_string}</a>\n";
    return $url_link;
}
if (!preg_match("/freetaleform.sqlite/", $_GET['db'])) {
    echo "BAD DATABSE";
    exit;
}
$db = new DBx(DB_DIR . $_GET['db']);
$prepare_vars = array(':url' => $_GET['url']);
$sql = "\nSELECT \n  *\nFROM \n  actions\nWHERE\n  url = :url \n    AND\n  input_type != 'landing'\nGROUP BY\n  input_name\nORDER BY\n  unixtime\n";
$db->p($sql . " LIMIT 1");
$db->exec($prepare_vars);
$meta_row = $db->f();
$url_link = anchor_link($meta_row['url']);
$referer_link = anchor_link($meta_row['referer']);
$db->p($sql);
$db->exec($prepare_vars);
$input_names = array();
while ($row = $db->f()) {
    $input_names[] = $row['input_name'];
}
$sql = "\nSELECT\n  input_type,\n  input_name,\n  key_ups,\n  form_id,\n  COUNT(*) AS count,\n  SUM(time_elapsed) AS total_time\nFROM \n  actions\nWHERE\n  input_name = :input_name\n";
$db->p($sql);
$form_time = 0;
$time_stats = array();
foreach ($input_names as $input_name) {
    $db->exec(array(":input_name" => $input_name));
    $time_stat = $db->f();