示例#1
0
    }
    $sOrder = substr_replace($sOrder, "", -2);
    if ($sOrder == "ORDER BY") {
        $sOrder = "";
    }
    $query .= " {$sOrder} ";
}
if (isset($_GET['iDisplayStart']) && $_GET['iDisplayLength'] != '-1') {
    $query .= " LIMIT " . $_GET['iDisplayStart'] . ", " . $_GET['iDisplayLength'];
}
$list = Database::find('review')->query($query);
$rowCount = (int) Database::find('review')->query_col('SELECT FOUND_ROWS()');
$totalCount = (int) Database::find('review')->query_col('SELECT COUNT(review.checksum) FROM ' . Database::escapeField($reviewhost['review_table']) . ' AS review');
$data = array();
$data['query'] = $query;
$data['sEcho'] = intval(@$_GET['sEcho']);
$data['iTotalRecords'] = $totalCount;
$data['iTotalDisplayRecords'] = $rowCount;
$data['aaData'] = array();
//$data['query']                  = $query;
while ($row = $list->fetch_assoc()) {
    $row['fingerprint'] = SqlParser::htmlPreparedStatement($row['fingerprint'], true);
    $dr = array();
    foreach ($aColumns as $col) {
        $dr[] = $row[$col];
    }
    $dr[] = '<a class="details" href="review.php?checksum=' . $row['checksum'] . '"><img src="images/details_open.png"></a>';
    $data['aaData'][] = $dr;
}
header('Content-type: application/json');
echo json_encode($data);
示例#2
0
require_once 'templates/header.php';
?>

<div class="tabs">
    <ul>
        <li><a href="#queryFingerprint">Fingerprint</a></li>
        <li><a href="#querySample">Example</a></li>
        <li><a href="#normalizedQuery">Normalized</a></li>
        <li><a href="pt-query-advisor.php?checksum=<?php 
echo $_REQUEST['checksum'];
?>
">Advisor</a></li>
        <li><a href="#queryReview">Review</a></li>
    </ul>
    <div id="queryFingerprint"><?php 
echo SqlParser::htmlPreparedStatement($reviewData['fingerprint']);
?>
</div>
    <div id="querySample">
		<div style="float: right">
			<button id="samplePrev"></button>
			<button id="sampleNext"></button>
		</div>
		<div id="querySampleContent"></div>
    </div>
    <div id="normalizedQuery">Please explain the query to view the normalized query.</div>
    <div id="queryReview">
        <form method="post">
            <label for="reviewed_by">Reviewed by </label> <input type="text" name="reviewed_by" value="<?php 
echo $reviewData['reviewed_by'];
?>