#!/usr/bin/perl
our
$VERSION
=
'0.05'
;
my
$sp
= HTML::SearchPage->new(
page_title
=>
'HTML::SearchPage Demo'
,
header
=>
'[Placeholder for header]'
,
css
=>
''
,
temp_dir
=>
qq[/usr/local/demo/html/demo/tmp]
,
instructions
=>
'[Placeholder for instructions]'
,
footer
=>
'[Placeholder for footer]'
,
base_sql_table
=>
qq[
html_searchpage_experiment hse
JOIN html_searchpage_person hsp ON (hsp.person_id = hse.person_id)
]
,
base_sql_fields
=> [
'hsp.name'
,
'hse.temperature'
,
'hse.sample_size'
,
'hse.attribute'
,
'hse.result'
,
'hse.comments'
,
],
base_output_headers
=> [
'Researcher:hsp.name'
,
'Temperature (F):hse.temperature'
,
'Sample Size:hse.sample_size'
,
'Attribute:hse.attribute'
,
'Result:hse.result'
,
'Comments'
,
],
sort_fields
=> 2,
method
=>
'GET'
,
page_size
=> 20,
db_access_params
=>
[
'DBI:mysql:database=temp;host=localhost;port=3306'
,
'test'
,
'test'
],
debug_level
=> 1,
);
my
$pf
;
$pf
= HTML::SearchPage::Param->new(
-label
=>
'Temperature (F):'
,
-sql_column
=>
'hse.temperature'
,
-form_name
=>
'temperature'
,
-operator_list
=> [
'<:less than'
,
'=:equals'
,
'>:greater than'
],
-operator_default
=>
'<'
,
-param_type
=>
'text:12'
,
-param_list
=>
'first'
,
) or
$sp
->display_error_page($@);
$sp
->param_field(
'temperature'
,
$pf
);
$pf
= HTML::SearchPage::Param->new(
-label
=>
'Sample Size:'
,
-sql_column
=>
'hse.sample_size'
,
-form_name
=>
'sample_size'
,
-operator_list
=> [
'<:less than'
,
'=:equals'
,
'>:greater than'
],
-operator_default
=>
'>'
,
-param_type
=>
'text:12'
,
) or
$sp
->display_error_page($@);
$sp
->param_field(
'sample_size'
,
$pf
);
$pf
= HTML::SearchPage::Param->new(
-label
=>
'Attribute:'
,
-sql_column
=>
'hse.attribute'
,
-form_name
=>
'attribute'
,
-operator_list
=> [
'=:equals'
],
-param_type
=>
'drop_down'
,
-param_list
=>
[
'DISTINCT:SELECT DISTINCT attribute FROM html_searchpage_experiment'
],
-auto_all
=> 1,
-auto_null
=> 1,
) or
$sp
->display_error_page($@);
$sp
->param_field(
'attribute'
,
$pf
);
$pf
= HTML::SearchPage::Param->new(
-label
=>
'Result:'
,
-sql_column
=>
'hse.result'
,
-form_name
=>
'result'
,
-operator_list
=> [
'=:equals'
],
-param_type
=>
'drop_down'
,
-param_list
=>
[
'DISTINCT:SELECT DISTINCT result FROM html_searchpage_experiment'
],
-auto_all
=> 1,
-auto_null
=> 1,
) or
$sp
->display_error_page($@);
$sp
->param_field(
'result'
,
$pf
);
$sp
->display_page;