<%doc>
# 
# $Id: sql-test.html,v 1.1 2001/12/17 13:55:16 adulau Exp $
#
# sql-test.html is an example of how to use sql queries

# Authors : Tycho Fruru <tycho@fruru.com>
#           Alexandre Dulaunoy <alex@thinkingsecure.com>
# Copyright (C) 2001 Tycho Fruru <tycho@fruru.com>
# Copyright (C) 2001 Conostix S.A. Luxembourg - Tycho Fruru <tycho@conostix.com>

# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
# for more details.
#
</%doc><%args>
$session
</%args>

<%perl>

#if ($session->{query} eq "")
#{
$session->{query} = "select agent_id,agent_type_name from agents";
#} 

my @results = $m->comp('../internal/sql-query.ipfc',query=>$session->{query});

</%perl>

<%perl>
my $return = $m->comp('../internal/head-page.html',title=>'Initial workscreen',session=>$session);
</%perl>

<body>
<hr noshade>
<table> 
  <tr bgcolor=#BBBBBB>
    <td> Agent ID</td> <td> Agent type 
</td>
  </tr>
% foreach my $current_line (@results) {
  <tr>
%	my $cpt;
% 	my $weblocal;
%	foreach my $current_entry (@{$current_line}) {
%	if ($cpt == 0)
%	 {
	<td><a href="./events.html?web_agent_id=<% $current_entry %>&web_like"> <% $current_entry %></a></td>
%	$weblocal = $current_entry;

%	 }
%	else {	
	<td>
	Type : <% $current_entry %> <form action=events.html method=post>
	<input type=hidden name=web_agent_id value=<% $weblocal %>>
	<input type=hidden name=web_like value="">
	<select name=event_type>
	<option> events </option>
	<option> log	</option>
	<option> status </option>
	</select>
	<input type=submit name=view value="view message">
	</form>
	</td>
%	 }
%	$cpt++;
%	}
  </tr>
% }
</table>

</body>
<form action=events.html method=post>
<input type=hidden name=web_agent_id value="">
<input type=text name=web_like>
<input type=submit name=fulltext value="Full text search in all events">
</form>

<%perl>
my $endbody = $m->comp('../internal/end-page.html');
</%perl>

