Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>Frames Test</title>
- <meta charset="utf8">
- <script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
- <script src="<?=PATH?>js/jquery.cookie.js"></script>
- <link rel="stylesheet" type="text/css" href="style.css">
- <script type="text/javascript" src="<?=PATH?>js/noty/packaged/jquery.noty.packaged.min.js"></script>
- <script type="text/javascript">
- function loadlog(showalert) {
- $.get( "logger.php?action=showlog", function(data) {
- if(data == "error") {
- $.noty.consumeAlert({layout: 'topCenter', type: 'error', dismissQueue: true});
- alert("Error whilst trying to load logfile! [1]");
- } else {
- if(showalert) {
- $.noty.consumeAlert({layout: 'topCenter', type: 'success', dismissQueue: true, timeout: 2000});
- alert("Logfile loaded!"); }
- $('#logcontent').html(data);
- }
- })
- .fail(function(data) {
- $.noty.consumeAlert({layout: 'topCenter', type: 'error', dismissQueue: true});
- alert("Error whilst trying to load logfile! [2]");
- });
- }
- function clearlog() {
- $.get( "logger.php?action=clearlog", function(data) {
- if(data == "cleared") {
- $.noty.consumeAlert({layout: 'topCenter', type: 'success', dismissQueue: true});
- alert("Logfile cleared!");
- $('#logcontent').html(data);
- loadlog(false);
- } else {
- $.noty.consumeAlert({layout: 'topCenter', type: 'error', dismissQueue: true, timeout: 3000});
- alert("Error whilst trying to clear logfile! [1]" + data);
- }
- })
- .fail(function(data) {
- $.noty.consumeAlert({layout: 'topCenter', type: 'error', dismissQueue: true, timeout: 3000});
- alert("Error whilst trying to clear logfile! [2]");
- });
- }
- function wakeup() {
- var invocations = 0;
- if (++invocations >= 200) {
- $.noty.consumeAlert({layout: 'topCenter', type: 'warning', dismissQueue: true, timeout: 3000});
- alert("Stopped loading!");
- clearInterval(handle);
- } else {
- loadlog(false);
- }
- }
- function opentab(id) {
- $("#container").html($("#page" + id).html());
- $.cookie("lixko1_lasttab", id);
- if(id == "2") {
- $(document).ready(function() {
- var handle = setInterval(wakeup, 2000);
- });
- } else {
- if(handle === false) {} else {clearInterval(handle);
- }
- }
- loadlog(true);
- }
- function notif() {
- $.noty.consumeAlert({layout: 'topRight', type: 'success', dismissQueue: true});
- alert("This is the same but noty consumed with options");
- }
- $(document).ready(function(){
- opentab($.cookie('lixko1_lasttab'));
- /*$('#submitbut').change(function(){
- $.ajax({
- type: "GET",
- url: "send.php",
- data: "query="+document.form.textarea.value,
- success: function(msg){
- document.getElementById("Div_Where_you_want_the_response").innerHTML = msg }
- })
- });*/
- });
- </script>
- </head>
- <body>
- <? logtofile("Page loaded!", "d"); ?>
- <div id="page">
- <div id="al">
- <div id="menu">
- <a href="#" name="link1" class="tab" onclick=opentab("1")>Debug</a>
- <a href="#" name="link1" class="tab" onclick=opentab("2")>Log</a>
- <a href="#" name="link1" class="tab" onclick=opentab("3")>Users</a>
- <a href="#" name="link1" class="tab" onclick=opentab("4")>Ahoj!</a>
- </div>
- <div id="content">
- <div id="container"></div>
- <div id="page1" class="hiddenpage">
- <b>Path: </b><?=PATH?><br />
- <b>Date: </b><? echo date("Y-m-d H:m:s") ?><br />
- <b>Logfile: </b><?=LOGFILE?><br />
- <b>Absolute path: </b> <?=ABSPATH?>
- </div>
- <div id="page2" class="hiddenpage">
- <input type="submit" name="submitbut" id="submitbut" value="Clear log!" onclick=clearlog(); /> Auto-refresh:<input type="checkbox" name="autoupdate" id="autoupdate" />
- <pre><div id="logcontent"></div></pre>
- <br />
- </div>
- <div id="page3" class="hiddenpage">
- <? if(LEVEL == "debug") {
- $array = ["firstname" => "Erik", "lastname" => "Bročko", "city" => "Trnava"];
- $jsoned = json_encode($array);
- echo($jsoned . "<br />");
- $original = json_decode($jsoned, true);
- // var_dump($original);
- echo("<b>First: </b>" . $original["firstname"] . " <b>Last: </b>" . $original["lastname"]);
- if(isset($original["city"])) { echo(" <b>City:</b>". $original["city"]); } else {echo(" <b>City</b> is not set! <br />"); } ?>
- <!-- <b>User 1: <? if(user_exists(1)){ echo("Exists!"); } ?></b><br /> -->
- <br /><b>Userdata: <? echo(get_userdata(1)); ?></b><br />
- <? } ?>
- <form>
- Name:
- <input type="submit" value="Register" name="registerbut" id="registerbut" />
- </form>
- <table class="gridtable">
- <tr>
- <th colspan="5" class="head">MySQL</th>
- <th colspan="3" class="head">JSON userdata</th>
- </tr>
- <tr>
- <th><b>#</b></th>
- <th><b>Username</b></th>
- <th><b>E-mail</b></th>
- <th><b>Rank</b></th>
- <th><b>Created</b></th>
- <th><b>First name</b></th>
- <th><b>Last name</b></th>
- <th><b>City</b></th>
- </tr>
- <?
- sql_connect();
- global $mysqli;
- $sql = "SELECT * FROM `users`";
- if(!$result = $mysqli->query($sql)){
- logtofile("There was an error running the query! (" . $mysqli->errno . ") " . $mysqli->error, "f");
- die('There was an error running the query [' . $mysqli->error . ']');
- }
- while($row = mysqli_fetch_array($result)) {
- $userdata = json_decode($row["data"], true); ?>
- <tr>
- <td><?=$row['id']?></td>
- <td><?=$row['username']?></td>
- <td><?=$row['email']?></td>
- <td><?=getrank(5)?></td>
- <td><?=$row['created']?></td>
- <td><?=$userdata['firstname']?></td>
- <td><?=$userdata['lastname']?></td>
- <td><?=$userdata['city']?></td>
- </tr>
- <? } ?>
- </table>
- </div>
- <div id="page4" class="hiddenpage">Stránka 4! ŠTVRTÁ!</div>
- </div>
- </div>
- <?php ?>
- <script type="text/javascript">
- if($.cookie('lixko1_lasttab') == '1' || $.cookie('lixko1_lasttab') == '2' || $.cookie('lixko1_lasttab') == '3' || $.cookie('lixko1_lasttab') == '4' ) {
- opentab($.cookie('lixko1_lasttab'));
- } else {
- opentab("1");
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment