Exemplo n.º 1
0
<?php

require_once 'config.php';
$history = re_db_select("history", array("url", "method", "params"), "id=" . $_GET['his']);
$his = $history[0];
$his['params'] = unserialize($his['params']);
echo json_encode($his);
Exemplo n.º 2
0
if ($_REQUEST['method'] == "POST") {
    curl_setopt($ch, CURLOPT_POST, $_REQUEST['method'] == "POST");
}
curl_setopt($ch, CURLOPT_HTTPGET, $_REQUEST['method'] == "GET");
if (in_array("Content-Type: application/json", $headerKeyValue)) {
    $keyValue = json_encode($keyValue);
}
if ($_REQUEST['method'] == "POST") {
    curl_setopt($ch, CURLOPT_POSTFIELDS, $_REQUEST['method'] == "POST" ? $keyValue : null);
}
curl_setopt($ch, CURLOPT_HTTPHEADER, $headerKeyValue);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLINFO_HEADER_OUT, false);
$result = curl_exec($ch);
if ($result === false) {
    $result = "<div style='color:red;'>" . curl_error($ch) . "</div>";
}
$headerSent = curl_getinfo($ch, CURLINFO_HEADER_OUT);
$insertData = array('url' => $_REQUEST['url'], 'params' => serialize(json_decode($keyValue, true)), 'method' => $_REQUEST['method'], 'response' => $result, 'time' => time());
$history_id = has_in_history($insertData);
if (!$history_id) {
    $id = re_db_insert("history", $insertData);
} else {
    $id = $history_id;
    re_db_update("history", $insertData, "id=" . $history_id);
}
$history = re_db_select("history", array("*"), "id = {$id}");
$his = $history[0];
$return = array("id" => $id, "history" => getHistoryAcc($his));
echo json_encode($return);
exit;
Exemplo n.º 3
0
<?php

require_once 'config.php';
$urls = re_db_select("urls", array("*"), "`url` like '%" . $_GET['term'] . "%'");
if ($urls) {
    foreach ($urls as $url) {
        $temp[] = $url['url'];
    }
}
echo json_encode($temp);
Exemplo n.º 4
0
<?php

require_once 'config.php';
$parseURL = parse_url($_REQUEST['url']);
$keys = re_db_select("`keys`", array("`key`"), "domain = '" . $parseURL['host'] . "'");
if ($keys) {
    foreach ($keys as $key) {
        $k[] = "'" . $key['key'] . "'";
    }
    echo "[" . implode(", ", $k) . "]";
} else {
    echo "[]";
}
Exemplo n.º 5
0
<?php

require_once 'config.php';
$his = re_db_select("history", array("response"), "id=" . $_GET['his']);
echo $his[0]['response'];
Exemplo n.º 6
0
<?php

require_once 'config.php';
$his = re_db_select("history", array("id", "response", "params"), "id=" . $_GET['his']);
?>
<link href="JqueryUI/css/smoothness/jquery-ui-1.9.2.custom.css" rel="stylesheet">
	<link href="style.css" rel="stylesheet">
	<link href="JSONViewer/jquery.jsonview.css" rel="stylesheet">
	<script src="JqueryUI/js/jquery-1.8.3.js"></script>
	<script src="JSONViewer/jquery.jsonview.js"></script>
	<script src="shortcut.js"></script>
	<script src="custom.js"></script>
	<script src="JqueryUI/js/jquery-ui-1.9.2.custom.js"></script>
	<style>
body{
	min-width: 700px;
	font: 82.5% "Trebuchet MS", sans-serif;
}
</style>
<div id="responseTabs" class="responseTabs">
	<ul>
		<li><a href="#hisTabs-2">Raw</a></li>
		<?php 
$isJson = false;
if (isJson($his[0]['response'])) {
    $isJson = true;
}
if ($isJson) {
    echo '<li><a href="#hisTabs-4">JSON Viewer</a></li>';
}
?>
Exemplo n.º 7
0
<?php

require_once 'config.php';
?>

<div>
  	<div><a href="javascript:void(0);" id="clearHistory">Clear History</a><br/><br/></div>
    <div id="accordion">
    	<?php 
$history = re_db_select("history", array("*"), "1=1 order by `time` desc limit 0," . HISTORY_RECORDS);
if ($history) {
    foreach ($history as $his) {
        $str .= getHistoryAcc($his);
    }
}
echo $str;
?>
  	</div>
  </div>
  
  <script type="text/javascript">
$(document).ready(function(){
	$( "#accordion" ).accordion({
	     collapsible: true,
	     heightStyle: "content"
	 }).find('a.openWithPoster').click(function(ev){
		 	ev.preventDefault();
		    ev.stopPropagation();
		    openWithPoster($(this).attr("hisid"));
		 });
Exemplo n.º 8
0
function has_in_history($data)
{
    $res = re_db_select("history", array("id"), "url='" . $data['url'] . "' AND method='" . $data['method'] . "' AND params='" . $data['params'] . "'");
    if ($res !== false) {
        return $res[0]['id'];
    } else {
        return false;
    }
}