2007-03-18 07:10:54 +00:00
< ?
/*
This file is part of the 'Science Fair In A Box' project
SFIAB Website : http :// www . sfiab . ca
Copyright ( C ) 2005 Sci - Tech Ontario Inc < info @ scitechontario . org >
Copyright ( C ) 2005 James Grant < james @ lightbox . org >
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 , version 2.
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 .
You should have received a copy of the GNU General Public License
along with this program ; see the file COPYING . If not , write to
the Free Software Foundation , Inc . , 59 Temple Place - Suite 330 ,
Boston , MA 02111 - 1307 , USA .
*/
?>
< ?
require ( " ../common.inc.php " );
2007-11-21 17:02:09 +00:00
require_once ( " ../user.inc.php " );
2007-11-18 23:50:23 +00:00
user_auth_required ( 'committee' , 'admin' );
2007-03-18 07:10:54 +00:00
require_once ( 'reports_students.inc.php' );
2007-03-18 19:59:02 +00:00
require_once ( 'reports_judges.inc.php' );
require_once ( 'reports_awards.inc.php' );
2007-03-20 06:24:18 +00:00
require_once ( 'reports_committees.inc.php' );
2007-09-13 18:57:56 +00:00
require_once ( 'reports_schools.inc.php' );
2007-11-16 05:32:04 +00:00
require_once ( 'reports_volunteers.inc.php' );
2007-12-20 01:05:04 +00:00
require_once ( 'reports_tours.inc.php' );
2009-09-18 05:35:13 +00:00
require_once ( 'reports_fairs.inc.php' );
2009-10-16 17:17:45 +00:00
require_once ( 'reports_fundraising.inc.php' );
2007-03-18 07:10:54 +00:00
require_once ( 'reports.inc.php' );
2010-03-25 04:27:33 +00:00
require_once ( '../tcpdf.inc.php' );
2007-03-18 07:10:54 +00:00
$fields = array ();
- BAM!
- Overhauled the report generator.. It's more versatile now
- Added 'filter' option to the generator, so you can filter any column by (=,
<=, >=, <, >, IS, IS NOT, LIKE, NOT LIKE). It doesn't support AND or OR
combinations, but that should cover what we need for now. Example: We can
filter "Award Name" LIKE "%Gold%" to generate a report of just the Gold medal
projects.
- Wipe out the report database, and create it again from scratch.
update.48.sql contains an example of how to add additional reports to the
system without knowing the report_ids, because after regions start adding
their own reports, we won't be able to just wipe out the whole report system
to add one.
- We handle more reports now, specifically nametags and table labels, so remove
those files, and update the reports.php file to link the old links to the new
report generator (so people don't get too confused in this transition).
- Beginnings of moving the report generator to proper LEFT JOIN style
constructs instead of just one big massive EQUALS JOIN.
2007-03-26 06:15:41 +00:00
$locs = array ( 'X' => 'x' , 'Y' => 'y' , 'W' => 'w' , 'H' => 'h' , 'Lines' => 'lines' );
2007-03-18 07:10:54 +00:00
function field_selector ( $name , $id , $selected )
{
global $fields ;
2010-04-04 18:57:27 +00:00
$in_optgroup = false ;
2007-03-18 07:10:54 +00:00
echo " <select name= \" $name\ " id = \ " $id\ " > " ;
echo " <option value= \" \" />-- None --</option> " ;
foreach ( $fields as $k => $f ) {
2010-02-02 19:40:56 +00:00
if ( $f [ 'editor_disabled' ] == true ) continue ;
2010-04-04 18:57:27 +00:00
if ( array_key_exists ( 'start_option_group' , $f )) {
if ( $in_optgroup ) echo '</optgroup>' ;
echo '<optgroup label="' . i18n ( $f [ 'start_option_group' ]) . '">' ;
}
2007-03-18 07:10:54 +00:00
$sel = ( $selected == $k ) ? 'selected=\"selected\"' : '' ;
echo " <option value= \" $k\ " $sel > { $f [ 'name' ]} </ option > " ;
}
2010-04-04 18:57:27 +00:00
if ( $in_optgroup ) echo '</optgroup>' ;
2007-03-18 07:10:54 +00:00
echo " </select> " ;
}
2007-12-24 19:38:06 +00:00
function selector ( $name , $a , $selected , $onchange = '' )
2007-03-19 06:51:44 +00:00
{
2007-12-24 19:38:06 +00:00
echo " <select name= \" $name\ " $onchange > " ;
2007-03-19 06:51:44 +00:00
foreach ( $a as $v => $val ) {
$sel = ( $selected == $v ) ? 'selected=\"selected\"' : '' ;
echo " <option value= \" $v\ " $sel > $val </ option > " ;
}
echo '</select>' ;
}
2007-03-18 07:10:54 +00:00
function parse_fields ( $f )
{
- BAM!
- Overhauled the report generator.. It's more versatile now
- Added 'filter' option to the generator, so you can filter any column by (=,
<=, >=, <, >, IS, IS NOT, LIKE, NOT LIKE). It doesn't support AND or OR
combinations, but that should cover what we need for now. Example: We can
filter "Award Name" LIKE "%Gold%" to generate a report of just the Gold medal
projects.
- Wipe out the report database, and create it again from scratch.
update.48.sql contains an example of how to add additional reports to the
system without knowing the report_ids, because after regions start adding
their own reports, we won't be able to just wipe out the whole report system
to add one.
- We handle more reports now, specifically nametags and table labels, so remove
those files, and update the reports.php file to link the old links to the new
report generator (so people don't get too confused in this transition).
- Beginnings of moving the report generator to proper LEFT JOIN style
constructs instead of just one big massive EQUALS JOIN.
2007-03-26 06:15:41 +00:00
global $locs ;
2007-03-18 07:10:54 +00:00
$ret = array ();
if ( ! is_array ( $_POST [ $f ])) return array ();
- BAM!
- Overhauled the report generator.. It's more versatile now
- Added 'filter' option to the generator, so you can filter any column by (=,
<=, >=, <, >, IS, IS NOT, LIKE, NOT LIKE). It doesn't support AND or OR
combinations, but that should cover what we need for now. Example: We can
filter "Award Name" LIKE "%Gold%" to generate a report of just the Gold medal
projects.
- Wipe out the report database, and create it again from scratch.
update.48.sql contains an example of how to add additional reports to the
system without knowing the report_ids, because after regions start adding
their own reports, we won't be able to just wipe out the whole report system
to add one.
- We handle more reports now, specifically nametags and table labels, so remove
those files, and update the reports.php file to link the old links to the new
report generator (so people don't get too confused in this transition).
- Beginnings of moving the report generator to proper LEFT JOIN style
constructs instead of just one big massive EQUALS JOIN.
2007-03-26 06:15:41 +00:00
$x = 0 ;
foreach ( $_POST [ $f ] as $o => $d ) {
if ( is_array ( $d )) {
$a = array ();
foreach ( $d as $l => $v ) {
/* Scrub the array data */
$floatloc = array_values ( $locs );
if ( $l == 'field' || $l == 'value' ) {
$v = stripslashes ( $v );
} else if ( in_array ( $l , $floatloc )) {
$v = floatval ( $v );
2007-12-22 20:49:33 +00:00
if ( $l == 'lines' && $v == 0 ) $v = 1 ;
- BAM!
- Overhauled the report generator.. It's more versatile now
- Added 'filter' option to the generator, so you can filter any column by (=,
<=, >=, <, >, IS, IS NOT, LIKE, NOT LIKE). It doesn't support AND or OR
combinations, but that should cover what we need for now. Example: We can
filter "Award Name" LIKE "%Gold%" to generate a report of just the Gold medal
projects.
- Wipe out the report database, and create it again from scratch.
update.48.sql contains an example of how to add additional reports to the
system without knowing the report_ids, because after regions start adding
their own reports, we won't be able to just wipe out the whole report system
to add one.
- We handle more reports now, specifically nametags and table labels, so remove
those files, and update the reports.php file to link the old links to the new
report generator (so people don't get too confused in this transition).
- Beginnings of moving the report generator to proper LEFT JOIN style
constructs instead of just one big massive EQUALS JOIN.
2007-03-26 06:15:41 +00:00
} else if ( $l == 'face' ) {
$v = ( $v == 'bold' ) ? 'bold' : '' ;
} else if ( $l == 'align' ) {
$aligns = array ( 'left' , 'right' , 'center' );
if ( ! in_array ( $v , $aligns )) {
echo " Invalid alignment $v " ;
exit ;
}
2007-10-05 20:12:19 +00:00
} else if ( $l == 'valign' ) {
2010-03-25 04:27:33 +00:00
$aligns = array ( 'vtop' , 'vbottom' , 'vcenter' , 'top' , 'middle' , 'bottom' );
2007-10-05 20:12:19 +00:00
if ( ! in_array ( $v , $aligns )) {
echo " Invalid valignment $v " ;
exit ;
}
2007-12-22 20:49:33 +00:00
}
- BAM!
- Overhauled the report generator.. It's more versatile now
- Added 'filter' option to the generator, so you can filter any column by (=,
<=, >=, <, >, IS, IS NOT, LIKE, NOT LIKE). It doesn't support AND or OR
combinations, but that should cover what we need for now. Example: We can
filter "Award Name" LIKE "%Gold%" to generate a report of just the Gold medal
projects.
- Wipe out the report database, and create it again from scratch.
update.48.sql contains an example of how to add additional reports to the
system without knowing the report_ids, because after regions start adding
their own reports, we won't be able to just wipe out the whole report system
to add one.
- We handle more reports now, specifically nametags and table labels, so remove
those files, and update the reports.php file to link the old links to the new
report generator (so people don't get too confused in this transition).
- Beginnings of moving the report generator to proper LEFT JOIN style
constructs instead of just one big massive EQUALS JOIN.
2007-03-26 06:15:41 +00:00
$a [ $l ] = $v ;
}
if ( trim ( $a [ 'field' ]) == '' ) continue ;
$ret [ $x ] = $a ;
} else {
if ( trim ( $d ) == '' ) continue ;
$ret [ $x ][ 'field' ] = stripslashes ( $d );
}
$x ++ ;
2007-03-18 07:10:54 +00:00
}
return $ret ;
}
function parse_options ( $f )
{
$ret = array ();
if ( ! is_array ( $_POST [ $f ])) return array ();
foreach ( $_POST [ $f ] as $c => $v ) {
if ( trim ( $c ) == '' ) continue ;
$ret [ $c ] = stripslashes ( $v );
}
return $ret ;
}
/* Decode the report */
$report = array ();
$report [ 'id' ] = intval ( $_POST [ 'id' ]);
$report [ 'name' ] = stripslashes ( $_POST [ 'name' ]);
$report [ 'creator' ] = stripslashes ( $_POST [ 'creator' ]);
$report [ 'desc' ] = stripslashes ( $_POST [ 'desc' ]);
$report [ 'type' ] = stripslashes ( $_POST [ 'type' ]);
$report [ 'col' ] = parse_fields ( 'col' );
$report [ 'group' ] = parse_fields ( 'group' );
$report [ 'sort' ] = parse_fields ( 'sort' );
$report [ 'distinct' ] = parse_fields ( 'distinct' );
$report [ 'option' ] = parse_options ( 'option' );
- BAM!
- Overhauled the report generator.. It's more versatile now
- Added 'filter' option to the generator, so you can filter any column by (=,
<=, >=, <, >, IS, IS NOT, LIKE, NOT LIKE). It doesn't support AND or OR
combinations, but that should cover what we need for now. Example: We can
filter "Award Name" LIKE "%Gold%" to generate a report of just the Gold medal
projects.
- Wipe out the report database, and create it again from scratch.
update.48.sql contains an example of how to add additional reports to the
system without knowing the report_ids, because after regions start adding
their own reports, we won't be able to just wipe out the whole report system
to add one.
- We handle more reports now, specifically nametags and table labels, so remove
those files, and update the reports.php file to link the old links to the new
report generator (so people don't get too confused in this transition).
- Beginnings of moving the report generator to proper LEFT JOIN style
constructs instead of just one big massive EQUALS JOIN.
2007-03-26 06:15:41 +00:00
$report [ 'filter' ] = parse_fields ( 'filter' );
2007-03-18 07:10:54 +00:00
- BAM!
- Overhauled the report generator.. It's more versatile now
- Added 'filter' option to the generator, so you can filter any column by (=,
<=, >=, <, >, IS, IS NOT, LIKE, NOT LIKE). It doesn't support AND or OR
combinations, but that should cover what we need for now. Example: We can
filter "Award Name" LIKE "%Gold%" to generate a report of just the Gold medal
projects.
- Wipe out the report database, and create it again from scratch.
update.48.sql contains an example of how to add additional reports to the
system without knowing the report_ids, because after regions start adding
their own reports, we won't be able to just wipe out the whole report system
to add one.
- We handle more reports now, specifically nametags and table labels, so remove
those files, and update the reports.php file to link the old links to the new
report generator (so people don't get too confused in this transition).
- Beginnings of moving the report generator to proper LEFT JOIN style
constructs instead of just one big massive EQUALS JOIN.
2007-03-26 06:15:41 +00:00
// print("<pre>");print_r($_POST);print("</pre>");
// print("<pre>");print_r($report);print("</pre>");
2007-03-18 19:59:02 +00:00
2007-12-24 19:38:06 +00:00
$reloadaction = $_POST [ 'reloadaction' ];
2007-03-18 07:10:54 +00:00
$loadaction = $_POST [ 'loadaction' ];
$colaction = $_POST [ 'colaction' ];
$repaction = $_POST [ 'repaction' ];
$repaction_save = $repaction ;
2007-12-24 19:38:06 +00:00
2007-03-18 07:10:54 +00:00
/* Sort out priorities */
2007-12-24 19:38:06 +00:00
if ( $reloadaction != '' ) {
$loadaction = '' ;
$colaction = '' ;
$repaction = '' ;
}
2007-03-18 07:10:54 +00:00
if ( $loadaction != '' ) {
2007-12-24 19:38:06 +00:00
$id = intval ( $_POST [ 'id' ]);
$report = report_load ( $id );
if ( $id == 0 ) $report [ 'type' ] = 'student' ;
2007-03-18 07:10:54 +00:00
$colaction = '' ;
$repaction = '' ;
}
2007-12-24 19:38:06 +00:00
2007-03-18 07:10:54 +00:00
if ( $colaction != '' ) {
$repaction = '' ;
}
if ( $repaction == 'try' ) {
2007-11-21 22:30:19 +00:00
/* Generate the report from what was passed through POST */
2007-03-18 07:10:54 +00:00
report_gen ( $report );
exit ;
}
2007-12-24 19:38:06 +00:00
2007-11-18 23:50:23 +00:00
send_header ( " Reports Editor " ,
array ( 'Committee Main' => 'committee_main.php' ,
2008-08-22 20:50:38 +00:00
'Administration' => 'admin/index.php' ),
" report_management "
2007-11-18 23:50:23 +00:00
);
2007-03-18 07:10:54 +00:00
2007-12-24 19:38:06 +00:00
?>
< script type = " text/javascript " >
function reportReload ()
{
document . forms . report . reloadaction . value = 'reload' ;
document . forms . report . submit ();
}
2008-10-16 19:13:59 +00:00
var canvasWidth = 0 ;
var canvasHeight = 0 ;
var canvasObjectIndex = 0 ;
2010-03-25 04:27:33 +00:00
var labelWidth = 0 ;
var labelHeight = 0 ;
2008-10-16 19:13:59 +00:00
2010-03-25 04:27:33 +00:00
function initCanvas ( w , h , lw , lh ) {
2008-10-16 19:13:59 +00:00
canvasWidth = w ;
canvasHeight = h ;
2010-03-25 04:27:33 +00:00
labelWidth = lw ;
labelHeight = lh ;
2008-10-16 19:13:59 +00:00
}
function createData ( x , y , w , h , l , face , align , valign , value ) {
var canvas = document . getElementById ( 'layoutcanvas' );
var newdiv = document . createElement ( 'div' );
if ( valign == " vcenter " ) verticalAlign = " middle " ;
else if ( valign == " vtop " ) verticalAlign = " top " ;
else if ( valign == " vbottom " ) verticalAlign = " bottom " ;
else verticalAlign = " top " ;
// alert(verticalAlign);
//convert x,y,w,h from % to absolute
var dx = Math . round ( x * canvasWidth / 100 );
var dy = Math . round ( y * canvasHeight / 100 );
var dw = Math . round ( w * canvasWidth / 100 );
var dh = Math . round ( h * canvasHeight / 100 );
// alert(dx+','+dy+','+dw+','+dh);
var fontheight = Math . round ( dh / l );
newdiv . setAttribute ( 'id' , 'o_' + canvasObjectIndex );
newdiv . style . display = " table-cell " ;
newdiv . style . position = " absolute " ;
newdiv . style . width = dw + " px " ;
newdiv . style . height = dh + " px " ;
newdiv . style . left = dx + " px " ;
newdiv . style . top = dy + " px " ;
newdiv . style . textAlign = align ;
newdiv . style . verticalAlign = verticalAlign ;
newdiv . style . padding = " 0 0 0 0 " ;
newdiv . style . margin = " 0 0 0 0 " ;
// newdiv.style.vertical-align=valign;
newdiv . style . border = " 1px solid blue " ;
newdiv . style . fontSize = fontheight + " px " ;
newdiv . style . lineHeight = fontheight + " px " ;
newdiv . style . fontFamily = " Verdana " ;
newdiv . style . fontSizeAdjust = 0.65 ;
var maxlength = Math . floor ( dw / ( fontheight * 0.7 )) * l ;
if ( value . length > maxlength ) value = value . substring ( 0 , maxlength );
newdiv . innerHTML = value ; //"Maple Test xxxx"; //value;
canvas . appendChild ( newdiv );
canvasObjectIndex ++ ;
2010-03-25 04:27:33 +00:00
}
function createDataTCPDF ( x , y , w , h , align , valign , fontname , fontstyle , fontsize , value ) {
var canvas = document . getElementById ( 'layoutcanvas' );
var newdiv = document . createElement ( 'div' );
var dx = Math . round ( x * canvasWidth / labelWidth );
var dy = Math . round ( y * canvasHeight / labelHeight );
var dw = Math . round ( w * canvasWidth / labelWidth );
var dh = Math . round ( h * canvasHeight / labelHeight );
2008-10-16 19:13:59 +00:00
2010-03-25 04:27:33 +00:00
var fontheight = ( fontsize * 25.4 / 72 ) * canvasHeight / labelHeight ;
var l = Math . floor ( h / fontheight );
if ( fontheight == 0 ) fontheight = 10 ;
if ( l == 0 ) l = 1 ;
// alert(dh + ", fh="+fontheight);
newdiv . setAttribute ( 'id' , 'o_' + canvasObjectIndex );
newdiv . style . display = " table-cell " ;
newdiv . style . position = " absolute " ;
newdiv . style . width = dw + " px " ;
newdiv . style . height = dh + " px " ;
newdiv . style . left = dx + " px " ;
newdiv . style . top = dy + " px " ;
newdiv . style . textAlign = align ;
newdiv . style . verticalAlign = valign ;
newdiv . style . padding = " 0 0 0 0 " ;
newdiv . style . margin = " 0 0 0 0 " ;
// newdiv.style.vertical-align=valign;
newdiv . style . border = " 1px solid blue " ;
newdiv . style . fontSize = fontheight + " px " ;
newdiv . style . lineHeight = fontheight + " px " ;
newdiv . style . fontFamily = fontname ;
newdiv . style . fontSizeAdjust = 0.65 ;
var maxlength = Math . floor ( dw / ( fontheight * 0.7 )) * l ;
if ( value . length > maxlength ) value = value . substring ( 0 , maxlength );
newdiv . innerHTML = value ;
canvas . appendChild ( newdiv );
canvasObjectIndex ++ ;
2008-10-16 19:13:59 +00:00
}
2010-03-25 04:27:33 +00:00
2007-12-24 19:38:06 +00:00
</ script >
< ?
2007-03-18 07:10:54 +00:00
if ( $repaction == 'save' ) {
/* Save the report */
$report [ 'id' ] = report_save ( $report );
echo happy ( i18n ( " Report Saved " ));
}
if ( $repaction == 'del' ) {
report_delete ( $report [ 'id' ]);
echo happy ( i18n ( " Report Deleted " ));
}
2007-03-20 06:24:18 +00:00
if ( $repaction == 'dupe' ) {
$report [ 'id' ] = 0 ;
$report [ 'id' ] = report_save ( $report );
echo happy ( i18n ( " Report Duplicated " ));
}
2007-12-03 22:07:23 +00:00
if ( $repaction == 'export' ) {
echo " <pre> " ;
$q = mysql_query ( " SELECT system_report_id FROM reports WHERE 1 ORDER BY system_report_id DESC " );
$r = mysql_fetch_assoc ( $q );
$sid = $r [ 'system_report_id' ] + 1 ;
$n = mysql_escape_string ( $report [ 'name' ]);
$c = mysql_escape_string ( $report [ 'creator' ]);
$d = mysql_escape_string ( $report [ 'desc' ]);
$t = mysql_escape_string ( $report [ 'type' ]);
echo " INSERT INTO `reports` (`id`, `system_report_id`, `name`, `desc`, `creator`, `type`) VALUES \n " ;
echo " \t ('', ' $sid ', ' $n ', ' $d ', ' $c ', ' $t '); \n " ;
echo " INSERT INTO `reports_items` (`id`, `reports_id`, `type`, `ord`, `field`, `value`, `x`, `y`, `w`, `h`, `lines`, `face`, `align`) VALUES " ;
/* Do the options */
$x = 0 ;
foreach ( $report [ 'option' ] as $k => $v ) {
echo " \n \t ('', LAST_INSERT_ID(), 'option', $x , ' $k ', ' $v ', 0, 0, 0, 0, 0, '', ''), " ;
$x ++ ;
}
/* Do the fields */
2010-02-02 19:40:55 +00:00
$fs = array ( 'col' , 'group' , 'sort' , 'distinct' , 'filter' );
2007-12-03 22:07:23 +00:00
$first = true ;
2010-02-02 19:40:55 +00:00
foreach ( $fs as $f ) {
2007-12-03 22:07:23 +00:00
foreach ( $report [ $f ] as $x => $v ) {
$k = $v [ 'field' ];
$vx = intval ( $v [ 'x' ]);
$vy = intval ( $v [ 'y' ]);
$vw = intval ( $v [ 'w' ]);
$vh = intval ( $v [ 'h' ]);
$vlines = intval ( $v [ 'lines' ]);
2007-12-22 20:49:33 +00:00
if ( $vlines == 0 ) $vlines = 1 ;
2007-12-03 22:07:23 +00:00
$face = $v [ 'face' ];
$align = $v [ 'align' ] . ' ' . $v [ 'valign' ];
$value = mysql_escape_string ( stripslashes ( $v [ 'value' ]));
if ( ! $first ) echo ',' ;
$first = false ;
echo " \n \t ('', LAST_INSERT_ID(), ' $f ', $x , ' $k ', ' $value ', $vx , $vy , $vw , $vh , $vlines , ' $face ', ' $align ') " ;
}
}
echo " ; \n " ;
echo " </pre> " ;
}
2007-03-18 07:10:54 +00:00
/* ---- Setup ------ */
$n_columns = intval ( $_POST [ 'ncolumns' ]);
$n = count ( $report [ 'col' ]) + 1 ;
if ( $n > $n_columns ) $n_columns = $n ;
if ( $colaction == 'add' ) $n_columns += 3 ;
2007-12-20 01:05:04 +00:00
$fieldvar = " report_ { $report [ 'type' ] } s_fields " ;
if ( isset ( $$fieldvar )) $fields = $$fieldvar ;
2007-03-18 07:10:54 +00:00
echo " <br /> " ;
echo " <form method= \" post \" name= \" reportload \" action= \" reports_editor.php \" onChange= \" document.reportload.submit() \" > " ;
echo " <input type= \" hidden \" name= \" loadaction \" value= \" load \" /> " ;
echo " <select name= \" id \" id= \" report \" > " ;
echo " <option value= \" 0 \" > " . i18n ( " Create New Report " ) . " </option> \n " ;
$reports = report_load_all ();
$x = 0 ;
foreach ( $reports as $r ) {
$sel = ( $report [ 'id' ] == $r [ 'id' ]) ? 'selected=\"selected\"' : '' ;
echo " <option value= \" { $r [ 'id' ] } \" $sel > { $r [ 'name' ] } </option> \n " ;
}
echo " </select> " ;
echo " <input type= \" submit \" value= \" Load \" ></form> " ;
echo " <hr /> " ;
echo " <form method= \" post \" name= \" report \" action= \" reports_editor.php \" > " ;
echo " <input type= \" hidden \" name= \" id \" value= \" { $report [ 'id' ] } \" /> " ;
echo " <input type= \" hidden \" name= \" ncolumns \" value= \" $n_columns\ " /> " ;
echo " <h4>Report Information</h4> " ;
echo " <table> " ;
echo " <tr><td>Name: </td> " ;
echo " <td><input type= \" text \" name= \" name \" size= \" 80 \" value= \" { $report [ 'name' ] } \" /></td> " ;
echo " </tr> " ;
echo " <tr><td>Created By: </td> " ;
echo " <td><input type= \" text \" name= \" creator \" size= \" 80 \" value= \" { $report [ 'creator' ] } \" /></td> " ;
echo " </tr> " ;
echo " <tr><td>Description: </td> " ;
echo " <td><textarea name= \" desc \" rows= \" 3 \" cols= \" 60 \" > { $report [ 'desc' ] } </textarea></td> " ;
echo " </tr> " ;
echo " <tr><td>Type: </td> " ;
2007-03-20 06:24:18 +00:00
echo " <td> " ;
selector ( 'type' , array ( 'student' => 'Student Report' , 'judge' => 'Judge Report' ,
2007-09-13 18:57:56 +00:00
'award' => 'Award Report' , 'committee' => 'Committee Member Report' ,
2007-12-20 01:05:04 +00:00
'school' => 'School Report' , 'volunteer' => 'Volunteer Report' ,
2009-10-16 17:17:45 +00:00
'tour' => 'Tour Report' , 'fair' => 'Feeder Fair Report' ,
'fundraising' => 'Fundraising Report' ),
2007-12-24 19:38:06 +00:00
$report [ 'type' ],
" onChange= \" reportReload(); \" " );
echo " <input type= \" hidden \" name= \" reloadaction \" value= \" \" > " ;
2007-03-20 06:24:18 +00:00
echo " </td> " ;
2007-03-18 07:10:54 +00:00
echo " </tr></table> " ;
echo " <h4>Report Data</h4> " ;
echo " <table> " ;
$x = 0 ;
2007-11-19 21:14:56 +00:00
//only go through the columns if there are columns to go through
if ( count ( $report [ 'col' ])) {
foreach ( $report [ 'col' ] as $o => $d ) {
2007-12-29 08:46:40 +00:00
echo " <tr><td>Column " . ( $x + 1 ) . " : </td> " ;
2007-11-19 21:14:56 +00:00
echo " <td> " ;
if ( intval ( $x ) != intval ( $o )) {
echo ( " WARNING, out of order! " );
}
field_selector ( " col[ $o ][field] " , " col $o " , $d [ 'field' ]);
echo " </td></tr> " ;
$x ++ ;
2008-10-16 19:13:59 +00:00
$canvasLabels [] = $fields [ $report [ 'col' ][ $o ][ 'field' ]][ 'name' ]; //['field'];
2007-11-19 21:14:56 +00:00
}
2007-03-18 07:10:54 +00:00
}
for (; $x < $n_columns ; $x ++ ) {
2007-12-29 08:46:40 +00:00
echo " <tr><td>Column " . ( $x + 1 ) . " : </td> " ;
2007-03-18 07:10:54 +00:00
echo " <td> " ;
- BAM!
- Overhauled the report generator.. It's more versatile now
- Added 'filter' option to the generator, so you can filter any column by (=,
<=, >=, <, >, IS, IS NOT, LIKE, NOT LIKE). It doesn't support AND or OR
combinations, but that should cover what we need for now. Example: We can
filter "Award Name" LIKE "%Gold%" to generate a report of just the Gold medal
projects.
- Wipe out the report database, and create it again from scratch.
update.48.sql contains an example of how to add additional reports to the
system without knowing the report_ids, because after regions start adding
their own reports, we won't be able to just wipe out the whole report system
to add one.
- We handle more reports now, specifically nametags and table labels, so remove
those files, and update the reports.php file to link the old links to the new
report generator (so people don't get too confused in this transition).
- Beginnings of moving the report generator to proper LEFT JOIN style
constructs instead of just one big massive EQUALS JOIN.
2007-03-26 06:15:41 +00:00
field_selector ( " col[ $x ][field] " , " col $x " , '' );
2007-03-18 07:10:54 +00:00
echo " </td></tr> " ;
2007-03-19 06:51:44 +00:00
2007-03-18 07:10:54 +00:00
}
echo " <tr><td></td> " ;
echo " <td align= \" right \" > " ;
echo " <select name= \" colaction \" ><option value= \" \" ></option><option value= \" add \" >Add more columns</option></select> " ;
echo " <input type= \" submit \" value= \" Go \" > " ;
echo " </td></tr> " ;
echo " </table> \n " ;
2010-03-25 04:27:33 +00:00
$doCanvasSample = false ;
$doCanvasSampletcpdf = false ;
2008-10-16 19:13:59 +00:00
$l_w = $report_stock [ $report [ 'option' ][ 'stock' ]][ 'label_width' ];
$l_h = $report_stock [ $report [ 'option' ][ 'stock' ]][ 'label_height' ];
2008-11-20 18:17:57 +00:00
if ( $l_w && $l_h && $report [ 'option' ][ 'type' ] == " label " ) {
echo " <h4>Label Data Locations</h4> " ;
2008-10-16 19:13:59 +00:00
$doCanvasSample = true ;
$ratio = $l_h / $l_w ;
$canvaswidth = 600 ;
$canvasheight = round ( $canvaswidth * $ratio );
echo " <div id= \" layoutcanvas \" style= \" border: 1px solid red; position: relative; width: { $canvaswidth } px; height: { $canvasheight } px; \" > " ;
echo " </div> \n " ;
2010-03-25 04:27:33 +00:00
echo " <script type= \" text/javascript \" >initCanvas( $canvaswidth , $canvasheight , $l_w , $l_h )</script> \n " ;
}
if ( $l_w && $l_h && $report [ 'option' ][ 'type' ] == " tcpdf_label " ) {
echo " <h4>Label Data Locations - TCPDF</h4> " ;
$l_w *= 25.4 ;
$l_h *= 25.4 ;
$doCanvasSampletcpdf = true ;
$ratio = $l_h / $l_w ;
$canvaswidth = 600 ;
$canvasheight = round ( $canvaswidth * $ratio );
echo " <div id= \" layoutcanvas \" style= \" border: 1px solid red; position: relative; width: { $canvaswidth } px; height: { $canvasheight } px; \" > " ;
echo " </div> \n " ;
echo " <script type= \" text/javascript \" >initCanvas( $canvaswidth , $canvasheight , $l_w , $l_h )</script> \n " ;
2008-10-16 19:13:59 +00:00
}
2010-03-25 04:27:33 +00:00
2007-03-19 06:51:44 +00:00
echo " <table> " ;
$x = 0 ;
2010-03-25 04:27:33 +00:00
if ( $report [ 'option' ][ 'type' ] == 'label' || $report [ 'option' ][ 'type' ] == 'tcpdf_label' ) {
$fontlist = array ( '' => 'Default' );
$fl = PDF :: getFontList ();
foreach ( $fl as $f ) $fontlist [ $f ] = $f ;
// print_r($fl);
- BAM!
- Overhauled the report generator.. It's more versatile now
- Added 'filter' option to the generator, so you can filter any column by (=,
<=, >=, <, >, IS, IS NOT, LIKE, NOT LIKE). It doesn't support AND or OR
combinations, but that should cover what we need for now. Example: We can
filter "Award Name" LIKE "%Gold%" to generate a report of just the Gold medal
projects.
- Wipe out the report database, and create it again from scratch.
update.48.sql contains an example of how to add additional reports to the
system without knowing the report_ids, because after regions start adding
their own reports, we won't be able to just wipe out the whole report system
to add one.
- We handle more reports now, specifically nametags and table labels, so remove
those files, and update the reports.php file to link the old links to the new
report generator (so people don't get too confused in this transition).
- Beginnings of moving the report generator to proper LEFT JOIN style
constructs instead of just one big massive EQUALS JOIN.
2007-03-26 06:15:41 +00:00
foreach ( $report [ 'col' ] as $o => $d ) {
$f = $d [ 'field' ];
echo " <tr><td align= \" right \" >Loc " . ( $o + 1 ) . " : </td> " ;
2007-03-19 06:51:44 +00:00
echo " <td> " ;
2008-10-16 19:13:59 +00:00
$script = " " ;
2007-03-19 06:51:44 +00:00
foreach ( $locs as $k => $v ) {
2010-03-25 04:27:33 +00:00
if ( $k == 'Lines' && $report [ 'option' ][ 'type' ] != 'label' ) continue ;
- BAM!
- Overhauled the report generator.. It's more versatile now
- Added 'filter' option to the generator, so you can filter any column by (=,
<=, >=, <, >, IS, IS NOT, LIKE, NOT LIKE). It doesn't support AND or OR
combinations, but that should cover what we need for now. Example: We can
filter "Award Name" LIKE "%Gold%" to generate a report of just the Gold medal
projects.
- Wipe out the report database, and create it again from scratch.
update.48.sql contains an example of how to add additional reports to the
system without knowing the report_ids, because after regions start adding
their own reports, we won't be able to just wipe out the whole report system
to add one.
- We handle more reports now, specifically nametags and table labels, so remove
those files, and update the reports.php file to link the old links to the new
report generator (so people don't get too confused in this transition).
- Beginnings of moving the report generator to proper LEFT JOIN style
constructs instead of just one big massive EQUALS JOIN.
2007-03-26 06:15:41 +00:00
echo " $k =<input type= \" text \" size= \" 3 \" name= \" col[ $x ][ $v ] \" value= \" { $d [ $v ] } \" > " ;
2008-10-16 19:13:59 +00:00
$script .= " { $d [ $v ] } , " ;
2007-03-19 06:51:44 +00:00
}
2010-03-25 04:27:33 +00:00
if ( $report [ 'option' ][ 'type' ] == 'label' ) {
echo 'Face=' ;
selector ( " col[ $x ][face] " , array ( '' => '' , 'bold' => 'Bold' ), $d [ 'face' ]);
}
2007-03-19 06:51:44 +00:00
echo 'Align' ;
- BAM!
- Overhauled the report generator.. It's more versatile now
- Added 'filter' option to the generator, so you can filter any column by (=,
<=, >=, <, >, IS, IS NOT, LIKE, NOT LIKE). It doesn't support AND or OR
combinations, but that should cover what we need for now. Example: We can
filter "Award Name" LIKE "%Gold%" to generate a report of just the Gold medal
projects.
- Wipe out the report database, and create it again from scratch.
update.48.sql contains an example of how to add additional reports to the
system without knowing the report_ids, because after regions start adding
their own reports, we won't be able to just wipe out the whole report system
to add one.
- We handle more reports now, specifically nametags and table labels, so remove
those files, and update the reports.php file to link the old links to the new
report generator (so people don't get too confused in this transition).
- Beginnings of moving the report generator to proper LEFT JOIN style
constructs instead of just one big massive EQUALS JOIN.
2007-03-26 06:15:41 +00:00
selector ( " col[ $x ][align] " , array ( 'center' => 'Center' , 'left' => 'Left' , 'right' => 'Right' ),
$d [ 'align' ]);
2007-10-05 20:12:19 +00:00
echo 'vAlign' ;
2010-03-25 04:27:33 +00:00
if ( $report [ 'option' ][ 'type' ] == 'label' ) {
selector ( " col[ $x ][valign] " , array ( 'vcenter' => 'Center' , 'vtop' => 'Top' , 'vbottom' => 'Bottom' ),
$d [ 'valign' ]);
} else {
selector ( " col[ $x ][valign] " , array ( 'middle' => 'Middle' , 'top' => 'Top' , 'bottom' => 'Bottom' ),
$d [ 'valign' ]);
echo 'Font=' ;
selector ( " col[ $x ][fontname] " , $fontlist , $d [ 'fontname' ]);
selector ( " col[ $x ][fontstyle] " , array ( '' => '' , 'bold' => 'Bold' ), $d [ 'fontstyle' ]);
echo " <input type= \" text \" size= \" 3 \" name= \" col[ $x ][fontsize] \" value= \" { $d [ 'fontsize' ] } \" > " ;
echo 'pt ' ;
echo 'OnOverflow=' ;
selector ( " col[ $x ][on_overflow] " , array ( 'tuncate' => 'Truncate' , '...' => 'Add ...' , 'scale' => 'Scale' ), $d [ 'on_overflow' ]);
}
2007-03-20 06:24:18 +00:00
if ( $f == 'static_text' ) {
- BAM!
- Overhauled the report generator.. It's more versatile now
- Added 'filter' option to the generator, so you can filter any column by (=,
<=, >=, <, >, IS, IS NOT, LIKE, NOT LIKE). It doesn't support AND or OR
combinations, but that should cover what we need for now. Example: We can
filter "Award Name" LIKE "%Gold%" to generate a report of just the Gold medal
projects.
- Wipe out the report database, and create it again from scratch.
update.48.sql contains an example of how to add additional reports to the
system without knowing the report_ids, because after regions start adding
their own reports, we won't be able to just wipe out the whole report system
to add one.
- We handle more reports now, specifically nametags and table labels, so remove
those files, and update the reports.php file to link the old links to the new
report generator (so people don't get too confused in this transition).
- Beginnings of moving the report generator to proper LEFT JOIN style
constructs instead of just one big massive EQUALS JOIN.
2007-03-26 06:15:41 +00:00
echo " <br />Text=<input type= \" text \" size= \" 40 \" name= \" col[ $x ][value] \" value= \" { $d [ 'value' ] } \" > " ;
2007-03-20 06:24:18 +00:00
} else {
- BAM!
- Overhauled the report generator.. It's more versatile now
- Added 'filter' option to the generator, so you can filter any column by (=,
<=, >=, <, >, IS, IS NOT, LIKE, NOT LIKE). It doesn't support AND or OR
combinations, but that should cover what we need for now. Example: We can
filter "Award Name" LIKE "%Gold%" to generate a report of just the Gold medal
projects.
- Wipe out the report database, and create it again from scratch.
update.48.sql contains an example of how to add additional reports to the
system without knowing the report_ids, because after regions start adding
their own reports, we won't be able to just wipe out the whole report system
to add one.
- We handle more reports now, specifically nametags and table labels, so remove
those files, and update the reports.php file to link the old links to the new
report generator (so people don't get too confused in this transition).
- Beginnings of moving the report generator to proper LEFT JOIN style
constructs instead of just one big massive EQUALS JOIN.
2007-03-26 06:15:41 +00:00
echo " <input type= \" hidden \" name= \" col[ $x ][value] \" value= \" \" > " ;
2007-03-20 06:24:18 +00:00
}
2008-10-16 19:13:59 +00:00
if ( $doCanvasSample )
echo " <script type= \" text/javascript \" >createData( { $script } ' { $d [ 'face' ] } ',' { $d [ 'align' ] } ',' { $d [ 'valign' ] } ',' { $canvasLabels [ $x ] } ')</script> \n " ;
2010-03-25 04:27:33 +00:00
if ( $doCanvasSampletcpdf )
echo " <script type= \" text/javascript \" >createDataTCPDF( { $script } ' { $d [ 'align' ] } ',' { $d [ 'valign' ] } ',' { $d [ 'fontname' ] } ',' { $d [ 'fontstyle' ] } ',' { $d [ 'fontsize' ] } ',' { $canvasLabels [ $x ] } ')</script> \n " ;
2007-03-20 06:24:18 +00:00
2007-03-19 06:51:44 +00:00
$x ++ ;
}
for (; $x < $n_columns ; $x ++ ) {
echo " <tr><td align= \" right \" >Loc " . ( $x + 1 ) . " : </td> " ;
echo " <td> " ;
foreach ( $locs as $k => $v ) {
2010-03-25 04:27:33 +00:00
if ( $k == 'Lines' && $report [ 'option' ][ 'type' ] != 'label' ) continue ;
- BAM!
- Overhauled the report generator.. It's more versatile now
- Added 'filter' option to the generator, so you can filter any column by (=,
<=, >=, <, >, IS, IS NOT, LIKE, NOT LIKE). It doesn't support AND or OR
combinations, but that should cover what we need for now. Example: We can
filter "Award Name" LIKE "%Gold%" to generate a report of just the Gold medal
projects.
- Wipe out the report database, and create it again from scratch.
update.48.sql contains an example of how to add additional reports to the
system without knowing the report_ids, because after regions start adding
their own reports, we won't be able to just wipe out the whole report system
to add one.
- We handle more reports now, specifically nametags and table labels, so remove
those files, and update the reports.php file to link the old links to the new
report generator (so people don't get too confused in this transition).
- Beginnings of moving the report generator to proper LEFT JOIN style
constructs instead of just one big massive EQUALS JOIN.
2007-03-26 06:15:41 +00:00
echo " $k =<input type= \" text \" size= \" 3 \" name= \" col[ $x ][ $v ] \" value= \" 0 \" > " ;
2007-03-19 06:51:44 +00:00
}
2010-03-25 04:27:33 +00:00
if ( $report [ 'option' ][ 'type' ] == 'label' ) {
echo 'Face=' ;
selector ( " col[ $x ][face] " , array ( '' => '' , 'bold' => 'Bold' ), '' );
}
2007-03-19 06:51:44 +00:00
echo 'Align' ;
- BAM!
- Overhauled the report generator.. It's more versatile now
- Added 'filter' option to the generator, so you can filter any column by (=,
<=, >=, <, >, IS, IS NOT, LIKE, NOT LIKE). It doesn't support AND or OR
combinations, but that should cover what we need for now. Example: We can
filter "Award Name" LIKE "%Gold%" to generate a report of just the Gold medal
projects.
- Wipe out the report database, and create it again from scratch.
update.48.sql contains an example of how to add additional reports to the
system without knowing the report_ids, because after regions start adding
their own reports, we won't be able to just wipe out the whole report system
to add one.
- We handle more reports now, specifically nametags and table labels, so remove
those files, and update the reports.php file to link the old links to the new
report generator (so people don't get too confused in this transition).
- Beginnings of moving the report generator to proper LEFT JOIN style
constructs instead of just one big massive EQUALS JOIN.
2007-03-26 06:15:41 +00:00
selector ( " col[ $x ][align] " , array ( 'center' => 'Center' , 'left' => 'Left' , 'right' => 'Right' ),
2007-03-19 06:51:44 +00:00
'center' );
2007-10-05 20:12:19 +00:00
echo 'vAlign' ;
2010-03-25 04:27:33 +00:00
if ( $report [ 'option' ][ 'type' ] == 'label' ) {
selector ( " col[ $x ][valign] " , array ( 'vcenter' => 'Center' , 'vtop' => 'Top' , 'vbottom' => 'Bottom' ),
'top' );
} else {
selector ( " col[ $x ][valign] " , array ( 'middle' => 'Middle' , 'top' => 'Top' , 'bottom' => 'Bottom' ), 'middle' );
echo 'Font=' ;
selector ( " col[ $x ][fontname] " , $fontlist , '' );
selector ( " col[ $x ][fontstyle] " , array ( '' => '' , 'bold' => 'Bold' ), '' );
echo " <input type= \" text \" size= \" 3 \" name= \" col[ $x ][fontsize] \" value= \" \" > " ;
echo 'pt ' ;
echo 'OnOverflow=' ;
selector ( " col[ $x ][on_overflow] " , array ( 'Truncate' => 'truncate' , 'Add ...' => '...' , 'Scale' => 'scale' ), '' );
}
- BAM!
- Overhauled the report generator.. It's more versatile now
- Added 'filter' option to the generator, so you can filter any column by (=,
<=, >=, <, >, IS, IS NOT, LIKE, NOT LIKE). It doesn't support AND or OR
combinations, but that should cover what we need for now. Example: We can
filter "Award Name" LIKE "%Gold%" to generate a report of just the Gold medal
projects.
- Wipe out the report database, and create it again from scratch.
update.48.sql contains an example of how to add additional reports to the
system without knowing the report_ids, because after regions start adding
their own reports, we won't be able to just wipe out the whole report system
to add one.
- We handle more reports now, specifically nametags and table labels, so remove
those files, and update the reports.php file to link the old links to the new
report generator (so people don't get too confused in this transition).
- Beginnings of moving the report generator to proper LEFT JOIN style
constructs instead of just one big massive EQUALS JOIN.
2007-03-26 06:15:41 +00:00
echo " <input type= \" hidden \" name= \" col[ $x ][value] \" value= \" \" > " ;
2007-03-19 06:51:44 +00:00
echo " </td></tr> " ;
}
}
echo " </table> \n " ;
2007-03-18 07:10:54 +00:00
echo " <h4>Grouping</h4> " ;
for ( $x = 0 ; $x < 2 ; $x ++ ) {
echo " Group By " . ( $x + 1 ) . " : " ;
- BAM!
- Overhauled the report generator.. It's more versatile now
- Added 'filter' option to the generator, so you can filter any column by (=,
<=, >=, <, >, IS, IS NOT, LIKE, NOT LIKE). It doesn't support AND or OR
combinations, but that should cover what we need for now. Example: We can
filter "Award Name" LIKE "%Gold%" to generate a report of just the Gold medal
projects.
- Wipe out the report database, and create it again from scratch.
update.48.sql contains an example of how to add additional reports to the
system without knowing the report_ids, because after regions start adding
their own reports, we won't be able to just wipe out the whole report system
to add one.
- We handle more reports now, specifically nametags and table labels, so remove
those files, and update the reports.php file to link the old links to the new
report generator (so people don't get too confused in this transition).
- Beginnings of moving the report generator to proper LEFT JOIN style
constructs instead of just one big massive EQUALS JOIN.
2007-03-26 06:15:41 +00:00
$f = $report [ 'group' ][ $x ][ 'field' ];
field_selector ( " group[ $x ] " , " group $x " , $f );
2007-03-18 07:10:54 +00:00
echo " <br /> " ;
}
echo " <h4>Sorting</h4> " ;
for ( $x = 0 ; $x < 3 ; $x ++ ) {
echo " Sort By " . ( $x + 1 ) . " : " ;
- BAM!
- Overhauled the report generator.. It's more versatile now
- Added 'filter' option to the generator, so you can filter any column by (=,
<=, >=, <, >, IS, IS NOT, LIKE, NOT LIKE). It doesn't support AND or OR
combinations, but that should cover what we need for now. Example: We can
filter "Award Name" LIKE "%Gold%" to generate a report of just the Gold medal
projects.
- Wipe out the report database, and create it again from scratch.
update.48.sql contains an example of how to add additional reports to the
system without knowing the report_ids, because after regions start adding
their own reports, we won't be able to just wipe out the whole report system
to add one.
- We handle more reports now, specifically nametags and table labels, so remove
those files, and update the reports.php file to link the old links to the new
report generator (so people don't get too confused in this transition).
- Beginnings of moving the report generator to proper LEFT JOIN style
constructs instead of just one big massive EQUALS JOIN.
2007-03-26 06:15:41 +00:00
$f = $report [ 'sort' ][ $x ][ 'field' ];
field_selector ( " sort[ $x ] " , " sort $x " , $f );
2007-03-18 07:10:54 +00:00
echo " <br /> " ;
}
echo " <h4>Distinct</h4> " ;
echo " Distinct Column: " ;
- BAM!
- Overhauled the report generator.. It's more versatile now
- Added 'filter' option to the generator, so you can filter any column by (=,
<=, >=, <, >, IS, IS NOT, LIKE, NOT LIKE). It doesn't support AND or OR
combinations, but that should cover what we need for now. Example: We can
filter "Award Name" LIKE "%Gold%" to generate a report of just the Gold medal
projects.
- Wipe out the report database, and create it again from scratch.
update.48.sql contains an example of how to add additional reports to the
system without knowing the report_ids, because after regions start adding
their own reports, we won't be able to just wipe out the whole report system
to add one.
- We handle more reports now, specifically nametags and table labels, so remove
those files, and update the reports.php file to link the old links to the new
report generator (so people don't get too confused in this transition).
- Beginnings of moving the report generator to proper LEFT JOIN style
constructs instead of just one big massive EQUALS JOIN.
2007-03-26 06:15:41 +00:00
$x = 0 ;
$f = $report [ 'distinct' ][ $x ][ 'field' ];
field_selector ( " distinct[ $x ] " , " distinct0 " , $f );
echo " <h4>Filtering</h4> " ;
echo " <table> " ;
for ( $x = 0 ; $x < 3 ; $x ++ ) {
echo " <tr><td>Filter " . ( $x + 1 ) . " :</td><td> " ;
field_selector ( " filter[ $x ][field] " , " filter $x " , $report [ 'filter' ][ $x ][ 'field' ]);
echo " <br /> " ;
selector ( " filter[ $x ][x] " , $filter_ops , $report [ 'filter' ][ $x ][ 'x' ]);
$v = $report [ 'filter' ][ $x ][ 'value' ];
echo " Text=<input type= \" text \" size= \" 20 \" name= \" filter[ $x ][value] \" value= \" $v\ " > " ;
echo " </td></tr> " ;
}
echo " </table> " ;
2007-03-18 07:10:54 +00:00
echo " <h4>Options</h4> " ;
2007-12-10 02:50:53 +00:00
foreach ( $report_options as $ok => $o ) {
2007-03-18 07:10:54 +00:00
echo " { $o [ 'desc' ] } : <select name= \" option[ $ok ] \" id= \" $ok\ " > " ;
foreach ( $o [ 'values' ] as $k => $v ) {
$sel = ( $report [ 'option' ][ $ok ] == $k ) ? 'selected=\"selected\"' : '' ;
echo " <option value= \" $k\ " $sel > $v </ option > " ;
}
echo " </select><br /> \n " ;
}
echo " <br /> " ;
2007-11-21 22:30:19 +00:00
if ( $report [ 'system_report_id' ] != 0 ) {
echo notice ( i18n ( 'This is a system report, it cannot be changed or deleted. To save changes you have made to it, please select the \'Save as a new report\' option.' ));
}
2007-03-18 07:10:54 +00:00
echo " <select name= \" repaction \" > " ;
2007-11-21 22:30:19 +00:00
if ( $report [ 'system_report_id' ] == 0 ) {
$sel = ( $repaction_save == 'save' ) ? " selected= \" selected \" " : '' ;
echo " <option value= \" save \" $sel >Save this report</option> " ;
$sel = ( $repaction_save == 'try' ) ? " selected= \" selected \" " : '' ;
echo " <option value= \" try \" $sel >Try this report</option> " ;
2007-12-03 22:07:23 +00:00
echo " <option value= \" export \" >Export this report</option> " ;
2007-11-21 22:30:19 +00:00
echo " <option value= \" \" ></option> " ;
echo " <option value= \" dupe \" >Save as a new report(duplicate)</option> " ;
echo " <option value= \" \" ></option> " ;
echo " <option value= \" del \" >Delete this report</option> " ;
} else {
echo " <option value= \" dupe \" >Save as a new report(duplicate)</option> " ;
$sel = ( $repaction_save == 'try' ) ? " selected= \" selected \" " : '' ;
echo " <option value= \" try \" $sel >Try this report</option> " ;
2007-12-03 22:07:23 +00:00
echo " <option value= \" export \" >Export this report</option> " ;
2007-11-21 22:30:19 +00:00
}
2007-03-18 07:10:54 +00:00
echo " </select> " ;
echo " <input type= \" submit \" value= \" Go \" > " ;
echo " </form> " ;
send_footer ();
?>