Skip to content
Snippets Groups Projects
Select Git revision
  • d2f37ebe4d4d87d1a8af30aa624f6134150e2360
  • master default protected
  • devel
  • hruska-feature-clients-api
  • malostik-#5066-deduplicate-idea-ids
  • warden-postgresql-port
  • hruska-feature-#6799-filter-keys
  • hruska-feature-5066-duplicateIdeaID
  • warden-client-3.0-beta3
  • warden-server-3.0-beta3
  • warden-client-2.2-final
  • warden-server-2.2-final
  • warden-client-3.0-beta2
  • warden-server-3.0-beta2
  • warden-client-2.2
  • warden-server-2.2-patch3
  • warden-client-3.0-beta1
  • warden-server-3.0-beta1
  • warden-server-2.2-patch1
  • warden-client-3.0-beta0
  • warden-server-3.0-beta0
  • warden-server-2.2
  • warden-server-2.1-patch1
  • warden-client-2.1
  • warden-server-2.1
  • warden-server-2.1-beta6
  • warden-server-2.1-beta5
  • warden-server-2.1-beta4
28 results

show_SourceActivity.php

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>");
            }