Skip to content
Snippets Groups Projects
Select Git revision
  • ebca12ee1c97722a7200c22bd0bfc5152c0b1ffd
  • master default protected
  • rednatco-v2
  • rednatco
  • test
  • ntc-tube-uniform-color
  • ntc-tube-missing-atoms
  • restore-vertex-array-per-program
  • watlas2
  • dnatco_new
  • cleanup-old-nodejs
  • webmmb
  • fix_auth_seq_id
  • update_deps
  • ext_dev
  • ntc_balls
  • nci-2
  • plugin
  • bugfix-0.4.5
  • nci
  • servers
  • v0.5.0-dev.1
  • v0.4.5
  • v0.4.4
  • v0.4.3
  • v0.4.2
  • v0.4.1
  • v0.4.0
  • v0.3.12
  • v0.3.11
  • v0.3.10
  • v0.3.9
  • v0.3.8
  • v0.3.7
  • v0.3.6
  • v0.3.5
  • v0.3.4
  • v0.3.3
  • v0.3.2
  • v0.3.1
  • v0.3.0
41 results

state.ts

Blame
  • show_SourceActivity.php 1.57 KiB
    <?
    
    include("db.php");
    $db=$db;
    
    if(IsSet($_GET['source']) && !IsSet($_POST['source'])) { 
    	$_POST['source'] = $_GET['source'];
    	$_POST['limit'] = "";
    	$_POST['btnSubmit'] = "Submit";
    }
    
    #http://www.midnighthax.com/quickform.php
    require_once "HTML/QuickForm.php";
    
    print json_encode(($_POST));
    
    if(IsSet($_POST['limit']) && !is_numeric($_POST['limit'])){
            $_POST['limit'] = 5000;
    }
    
    ?>
    <table width="100%" border=1>
    <tr><td width="1px">
    <?
    $form = new HTML_QuickForm('formRemote', 'post');
    
    $form->addElement('text', 'source', 'source');
    
    $form->addElement('text', 'limit', 'limit');
    $form->addElement('submit', 'btnSubmit', 'Submit');
    
    $form->display();
    
    ?>
    </td><td width=1px>COSI
    <?
            #fuck mvc
    ?>
    </td><td>
    <?
           if(! empty($_POST["source"])) {
           print("<iframe src=\"graph_SourceActivity_html.php?per=day&source=".$_POST['source']."\" style=\"width:100%; height:500\"></iframe>");
    }
    ?>
    
    </td>
    </tr>
    </table>
    
    <hr>
    <?
    
    #TODO: strip vsechny superznaky
    
    if( IsSet($_POST["btnSubmit"])) {
    
            if( ! empty($_POST['source'])) {
    		$where = "source like'".$_POST['source']."'";
    		//$where = "source like '".$_POST['source']."%'";
    		$q = "SELECT * FROM events WHERE $where ORDER BY detected DESC LIMIT ".$_POST['limit'];
                    $res = mysql_query($q, $db);
    		print "Query: ".json_encode($q)."<br>";
                    print "Found: ".mysql_num_rows($res)."<br>";
                    print("<pre>");
    		while ($tmp = mysql_fetch_assoc($res)) { 
    			#var_dump($tmp);
                            print json_encode(view_recode($tmp))."\n";
    		}
                    print("</pre>");
            }