From efc7ae411de74555dd2f0ed46bb119c0823a2eda Mon Sep 17 00:00:00 2001 From: dave Date: Mon, 26 Mar 2007 06:15:41 +0000 Subject: [PATCH] - 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. --- admin/reports.inc.php | 228 ++++++----- admin/reports.php | 25 +- admin/reports_committees.inc.php | 14 - admin/reports_editor.php | 135 ++++--- admin/reports_judges.inc.php | 8 +- admin/reports_judges_new.php | 258 ------------ admin/reports_nametags_committee.php | 132 ------- admin/reports_nametags_judges.php | 139 ------- admin/reports_nametags_students.php | 258 ------------ admin/reports_projects_judgingstickers.php | 111 ------ admin/reports_projects_tablelabels.php | 206 ---------- admin/reports_students.inc.php | 60 ++- db/db.code.version.txt | 2 +- db/db.update.47.sql | 432 +++++++++++++++++++++ db/db.update.48.sql | 22 ++ 15 files changed, 721 insertions(+), 1309 deletions(-) delete mode 100644 admin/reports_judges_new.php delete mode 100644 admin/reports_nametags_committee.php delete mode 100644 admin/reports_nametags_judges.php delete mode 100644 admin/reports_nametags_students.php delete mode 100644 admin/reports_projects_judgingstickers.php delete mode 100644 admin/reports_projects_tablelabels.php create mode 100644 db/db.update.47.sql create mode 100644 db/db.update.48.sql diff --git a/admin/reports.inc.php b/admin/reports.inc.php index b34d6c3e..244c46da 100644 --- a/admin/reports.inc.php +++ b/admin/reports.inc.php @@ -28,6 +28,17 @@ require_once('../lpdf.php'); require_once('../lcsv.php'); + $filter_ops = array( 0 => '=', + 1 => '<=', + 2 => '>=', + 3 => '<', + 4 => '>', + 5 => '!=', + 6 => 'IS', + 7 => 'IS NOT', + 8 => 'LIKE', + 9 => 'NOT LIKE ', + ); $options = array(); $options['type'] = array( 'desc' => 'Report Format', @@ -50,7 +61,7 @@ 'values' => array('no'=>'No', 'yes'=>'Yes') ); - + /* @@ -78,6 +89,17 @@ LRP 180 99765 5967 4 1 3/4 x 1/2 80 */ 'y_spacing' => 0, 'rows' => 1, ); + + $stock['fullpage_landscape'] = array('name' => 'Letter 8.5 x 11 Landscape', + 'page_width' => 11, + 'page_height' => 8.5, + 'label_width' => 11, + 'x_spacing' => 0, + 'cols' => 1, + 'label_height' => 8.5, + 'y_spacing' => 0, + 'rows' => 1, + ); $stock['5961'] = array('name' => 'Avery 5961, G&T 99189', 'page_width' => 8.5, @@ -150,25 +172,21 @@ foreach($stock as $n=>$v) { $x = 0; foreach($report[$type] as $k=>$v) { if($type == 'option') { - $field = $k; - $val = $v; + /* field, value, x, y, w, h, lines, face, align */ + $vals = "'$k','$v','0','0','0','0','0','',''"; } else { - $field = $v; - if($type == 'col') { - $val = $loc[$field]['text']; - } else { - $val = ''; - } + $vals = "'{$v['field']}','{$v['value']}', + '{$v['x']}','{$v['y']}','{$v['w']}', + '{$v['h']}','{$v['lines']}','{$v['face']}', + '{$v['align']}'"; } if($q != '') $q .= ','; - $q .= "({$report['id']}, '$field', '$type', '$val', $x, - '{$loc[$field]['xp']}', '{$loc[$field]['yp']}', '{$loc[$field]['wp']}', - '{$loc[$field]['hp']}', '{$loc[$field]['lhp']}','{$loc[$field]['face']}', - '{$loc[$field]['align']}')"; + $q .= "({$report['id']}, '$type','$x',$vals)"; $x++; } - mysql_query("INSERT INTO reports_items(`reports_id`,`field`,`type`,`value`,`order`, - `xp`, `yp`, `wp`, `hp`, `lhp`, `face`, `align`) + mysql_query("INSERT INTO reports_items(`reports_id`,`type`,`ord`, + `field`,`value`,`x`, `y`, `w`, `h`, + `lines`, `face`, `align`) VALUES $q;"); echo mysql_error(); @@ -194,6 +212,7 @@ foreach($stock as $n=>$v) { $report['group'] = array(); $report['distinct'] = array(); $report['options'] = array(); + $report['filter'] = array(); $report['loc'] = array(); $allow_fields = array(); @@ -206,7 +225,7 @@ foreach($stock as $n=>$v) { $q = mysql_query("SELECT * FROM reports_items WHERE reports_id='{$report['id']}' - ORDER BY `order`"); + ORDER BY `ord`"); print(mysql_error()); if(mysql_num_rows($q) == 0) return $ret; @@ -216,27 +235,27 @@ foreach($stock as $n=>$v) { $t = $a['type']; switch($t) { case 'option': + /* We dont' care about order, just construct + * ['option'][name] = value; */ if(!in_array($f, $allow_options)) { print("Type[$type] Field[$f] not allowed.\n"); continue; } $report['option'][$f] = $a['value']; break; - case 'col': - /* Get the coords, if they exist */ - $loc = array(); - $loc_fields = array('xp', 'yp', 'wp', 'hp', 'lhp', 'face', 'align', 'value'); - foreach($loc_fields as $lf) $loc[$lf] = $a[$lf]; - $loc['text'] = $loc['value']; - $report['loc'][$f] = $loc; - - /* Fall through */ default: if(!in_array($f, $allow_fields)) { print("Type[$type] Field[$f] not allowed.\n"); continue; } - $report[$t][] = $f; + /* Pull out all the data */ + $val = array(); + $col_fields = array('field', 'x', 'y', 'w', 'h', 'lines', 'face', 'align', 'value'); + foreach($col_fields as $lf) $val[$lf] = $a[$lf]; + + if($val['lines'] == 0) $val['lines'] = 1; + + $report[$t][$a['ord']] = $val; break; } } @@ -250,7 +269,14 @@ foreach($stock as $n=>$v) { mysql_query("INSERT INTO reports (`id`) VALUES ('')"); $report['id'] = mysql_insert_id(); } - + +/* + print("
");
+	print_r($_POST);
+	print_r($report);
+	print("
"); +*/ + mysql_query("UPDATE reports SET `name`='".mysql_escape_string($report['name'])."', `desc`='".mysql_escape_string($report['desc'])."', @@ -263,6 +289,7 @@ foreach($stock as $n=>$v) { report_save_field($report, 'sort', array()); report_save_field($report, 'distinct', array()); report_save_field($report, 'option', array()); + report_save_field($report, 'filter', array()); return $report['id']; } @@ -312,6 +339,7 @@ foreach($stock as $n=>$v) { { global $config, $report_students_fields, $report_judges_fields, $report_awards_fields; global $stock, $report_committees_fields; + global $filter_ops; //print_r($report); switch($report['type']) { @@ -331,14 +359,14 @@ foreach($stock as $n=>$v) { $table['option']=array(); if($report['option']['type']=='csv') { - $rep=new lcsv(i18n($report_name)); + $rep=new lcsv(i18n($report['name'])); $gen_mode = 'table'; } else if($report['option']['type']=='label') { /* Label */ $label_stock = $stock[$report['option']['stock']]; $rep=new lpdf( i18n($config['fairname']), - i18n($report_name), + i18n($report['name']), $_SERVER['DOCUMENT_ROOT'].$config['SFIABDIRECTORY']."/data/logo-200.gif"); $rep->setPageStyle("labels"); $rep->newPage($label_stock['page_width'], $label_stock['page_height']); @@ -360,8 +388,12 @@ foreach($stock as $n=>$v) { $sel = array(); $x=0; $group_by = array(); + $components = array(); + $order = array(); + /* Select columns to display */ - foreach($report['col'] as $f) { + foreach($report['col'] as $o=>$d) { + $f = $d['field']; $table['header'][] = i18n($fields[$f]['header']); $table['widths'][] = $fields[$f]['width']; $table['dataalign'][] = 'left'; @@ -369,78 +401,82 @@ foreach($stock as $n=>$v) { $fieldname[$f] = "C$x"; if(is_array($fields[$f]['group_by'])) $group_by = array_merge($group_by, $fields[$f]['group_by']); + + if(is_array($fields[$f]['components'])) { + $components = array_merge($components, + $fields[$f]['components']); + } $x++; } /* We also want to select any column groupings, but we won't display them */ - $x=0; - foreach($report['group'] as $f) { - if(isset($fieldname[$f])) continue; - $sel[] = "{$fields[$f]['table']} AS G$x"; - $fieldname[$f] = "G$x"; - $x++; + + foreach($report['group'] as $o=>$d) { + $f = $d['field']; + if(!isset($fieldname[$f])) { + $sel[] = "{$fields[$f]['table']} AS G$o"; + $fieldname[$f] = "G$o"; + } + + if(isset($fields[$f]['table_sort'])) + $order[] = $fields[$f]['table_sort']; + else + $order[] = $fieldname[$f]; + + if(is_array($fields[$f]['components'])) { + $components = array_merge($components, + $fields[$f]['components']); + } + } + + foreach($report['sort'] as $o=>$d) { + $f = $d['field']; + if(!isset($fieldname[$f])) { + $sel[] = "{$fields[$f]['table']} AS S$o"; + $fieldname[$f] = "S$o"; + } + + if(isset($fields[$f]['table_sort'])) + $order[] = $fields[$f]['table_sort']; + else + $order[] = $fieldname[$f]; } - $x=0; - foreach($report['sort'] as $f) { - if(isset($fieldname[$f])) continue; - $sel[] = "{$fields[$f]['table']} AS S$x"; - $fieldname[$f] = "S$x"; - $x++; + foreach($report['distinct'] as $o=>$d) { + $f = $d['field']; + if(!isset($fieldname[$f])) { + $sel[] = "{$fields[$f]['table']} AS D$o"; + $fieldname[$f] = "D$o"; + } + $group_by[] = $fieldname[$f]; } - - $x=0; - foreach($report['distinct'] as $f) { - if(isset($fieldname[$f])) continue; - $sel[] = "{$fields[$f]['table']} AS D$x"; - $fieldname[$f] = "D$x"; - $x++; + + foreach($report['filter'] as $o=>$d) { + $f = $d['field']; + if(!isset($fieldname[$f])) { + $sel[] = "{$fields[$f]['table']} AS F$o"; + $fieldname[$f] = "F$o"; + } + $t = $filter_ops[$d['x']]; + $filter[] = "{$fields[$f]['table']} $t '{$d['value']}'"; } $sel = implode(",", $sel); - - $order = array(); - - /* Setup the order: groups, then sort order */ - foreach($report['group'] as $f) { - if(isset($fields[$f]['table_sort'])) { - $order[] = $fields[$f]['table_sort']; - } else { - $order[] = $fieldname[$f];//ields[$f]['table']; - } - } - foreach($report['sort'] as $f) { - if(isset($fields[$f]['table_sort'])) { - $order[] = $fields[$f]['table_sort']; - } else { - $order[] = $fieldname[$f];//$fields[$f]['table']; - } - } $order = implode(",", $order); + if(!isset($report['year'])) { $report['year'] = $config['FAIRYEAR']; } - if(count($report['distinct'])) { - foreach($report['distinct'] as $f) { - $group_by[] = $fieldname[$f]; - } - } - + $group_query = ""; if(count($group_by)) { $group_query = "GROUP BY ".implode(",", $group_by); - } else { - $group_query = ""; + } + + $filter_query = ""; + if(count($filter)) { + $filter_query = " AND ".implode(" AND ", $filter); } - $components = array(); - foreach($report['col'] as $c) { - if(!is_array($fields[$c]['select_component'])) continue; - $components = array_merge($components, $fields[$c]['select_component']); - } - foreach($report['group'] as $c) { - if(!is_array($fields[$c]['select_component'])) continue; - $components = array_merge($components, $fields[$c]['select_component']); - } $q = ''; switch($report['type']) { @@ -450,7 +486,7 @@ foreach($stock as $n=>$v) { case 'committee': $q = report_committees_fromwhere($report, $components); break; } - $q = "SELECT $sel $q $group_query ORDER BY $order"; + $q = "SELECT $sel $q $filter_query $group_query ORDER BY $order"; // print("$q"); @@ -499,36 +535,34 @@ foreach($stock as $n=>$v) { } $data = array(); - $x=0; if($gen_mode == 'label') { $show_box = ($report['option']['label_box'] == 'yes') ? true : false; $show_fair = ($report['option']['label_fairname'] == 'yes') ? true : false; $show_logo = ($report['option']['label_logo'] == 'yes') ? true : false; $rep->newLabel($show_box, $show_fair, $show_logo); } - foreach($report['col'] as $c) { - if(is_array($fields[$c]['value_map'])) { - $v = $fields[$c]['value_map'][$i["C$x"]]; + foreach($report['col'] as $o=>$d) { + $f = $d['field']; + if(is_array($fields[$f]['value_map'])) { + $v = $fields[$f]['value_map'][$i["C$o"]]; } else { - $v = $i["C$x"]; + $v = $i["C$o"]; } if($gen_mode == 'table') { $data[] = $v; } else if($gen_mode == 'label') { - $d = $report['loc'][$c]; - /* Label text: x%, y%, width%, height%, text */ - $opt = array(); if($d['face'] == 'bold') $opt[] = 'bold'; $opt[] = $d['align']; /* Special column, override result with static text */ - if($c == 'static_text') $v = $d['text']; + if($f == 'static_text') $v = $d['value']; - $rep->addLabelText2($d['xp'], $d['yp'], $d['wp'], - $d['hp'], $d['lhp'], $v, $opt); + + $rep->addLabelText2($d['x'], $d['y'], $d['w'], + $d['h'], $d['h']/$d['lines'], + $v, $opt); } - $x++; } if(count($data)) $table['data'][] = $data; } diff --git a/admin/reports.php b/admin/reports.php index 9241521a..3324c888 100644 --- a/admin/reports.php +++ b/admin/reports.php @@ -102,19 +102,27 @@ while($catr=mysql_fetch_object($catq)) echo "
"; echo i18n("Project Table Labels").": "; - echo "PDF   "; + echo "PDF   "; +//echo "PDF   "; echo "
"; echo i18n("Project Summary Details").": "; echo "PDF   "; echo "
"; echo i18n("Nametags").": "; - echo "Students PDF   "; - echo "Students CSV   "; - echo "Judges PDF   "; - echo "Judges CSV   "; - echo "Committee PDF   "; - echo "Committee CSV   "; + echo "Students PDF   "; + echo "Students CSV   "; + echo "Judges PDF   "; + echo "Judges CSV   "; + echo "Committee PDF   "; + echo "Committee CSV   "; + +// echo "Students PDF   "; +// echo "Students CSV   "; +// echo "Judges PDF   "; +// echo "Judges CSV   "; +// echo "Committee PDF   "; +// echo "Committee CSV   "; echo "
"; @@ -145,7 +153,8 @@ while($catr=mysql_fetch_object($catq)) echo "
"; echo i18n("Project Identification Labels (for judging sheets)").": "; - echo "PDF   "; + echo "PDF   "; +// echo "PDF   "; echo "
"; diff --git a/admin/reports_committees.inc.php b/admin/reports_committees.inc.php index 0db5e071..6118028e 100644 --- a/admin/reports_committees.inc.php +++ b/admin/reports_committees.inc.php @@ -74,20 +74,6 @@ $report_committees_fields = array( $year = $report['year']; /* - $components = array(); - foreach($report['col'] as $c) { - if(!is_array($fields[$c]['select_component'])) continue; - $components = array_merge($components, $fields[$c]['select_component']); - } - - - $languages_from = ''; - $languages_where = ''; - if(in_array('languages', $components)) { - $languages_from = ', committees_languages'; - $languages_where = 'AND committees_languages.committees_id=committees_members.id'; - } - $teams_from = ''; $teams_where = ''; if(in_array('teams', $components)) { diff --git a/admin/reports_editor.php b/admin/reports_editor.php index f80ed917..a49a2690 100644 --- a/admin/reports_editor.php +++ b/admin/reports_editor.php @@ -32,7 +32,7 @@ require_once('reports.inc.php'); $fields = array(); - $locs = array('X' => 'xp', 'Y' => 'yp', 'W' => 'wp', 'H' => 'hp', 'LineHeight' => 'lhp'); + $locs = array('X' => 'x', 'Y' => 'y', 'W' => 'w', 'H' => 'h', 'Lines' => 'lines'); function field_selector($name, $id, $selected) { @@ -123,11 +123,38 @@ function reportChange() function parse_fields($f) { + global $locs; $ret = array(); if(!is_array($_POST[$f])) return array(); - foreach($_POST[$f] as $c) { - if(trim($c) == '') continue; - $ret[] = stripslashes($c); + $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); + } 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; + } + } + $a[$l] = $v; + } + if(trim($a['field']) == '') continue; + $ret[$x] = $a; + } else { + if(trim($d) == '') continue; + $ret[$x]['field'] = stripslashes($d); + } + $x++; } return $ret; } @@ -141,34 +168,6 @@ function reportChange() } return $ret; } - function parse_loc($f) - { - global $locs; - $ret = array(); - if(!is_array($_POST[$f])) return array(); - - foreach($_POST[$f] as $c=>$l) { - if(trim($c) == '') continue; - foreach($l as $ll=>$val) { - $floatloc = array_values($locs); - if(in_array($ll, $floatloc)) { - $val = floatval($val); - } else if($ll == 'face') { - $val = ($val == 'bold') ? 'bold' : ''; - } else if($ll == 'align') { - $aligns = array('left', 'right', 'center'); - if(!in_array($val, $aligns)) { - echo "Invalid alignment $val"; - exit; - } - } else if($ll = 'text') { - $val = stripslashes($val); - } - $ret[$c][$ll] = $val; - } - } - return $ret; - } //print_r($_POST); /* Decode the report */ @@ -184,9 +183,10 @@ function reportChange() $report['sort'] = parse_fields('sort'); $report['distinct'] = parse_fields('distinct'); $report['option'] = parse_options('option'); - $report['loc'] = parse_loc('loc'); + $report['filter'] = parse_fields('filter'); -// print_r($report); +// print("
");print_r($_POST);print("
"); +// print("
");print_r($report);print("
"); $loadaction = $_POST['loadaction']; $colaction = $_POST['colaction']; @@ -290,18 +290,21 @@ function reportChange() echo "

Report Data

"; echo ""; $x=0; - foreach($report['col'] as $f) { + foreach($report['col'] as $o=>$d) { echo ""; echo ""; - $x++; + } for(;$x<$n_columns;$x++) { echo ""; echo ""; } @@ -318,23 +321,22 @@ function reportChange() if($report['option']['type'] == 'label') { - foreach($report['col'] as $f) { - echo ""; + foreach($report['col'] as $o=>$d) { + $f = $d['field']; + echo ""; echo ""; echo ""; } } @@ -367,18 +363,35 @@ function reportChange() echo "

Grouping

"; for($x=0;$x<2;$x++) { echo "Group By".($x + 1).": "; - field_selector("group[]", "group$x", $report['group'][$x]); + $f = $report['group'][$x]['field']; + field_selector("group[$x]", "group$x", $f); echo "
"; } echo "

Sorting

"; for($x=0;$x<3;$x++) { echo "Sort By".($x + 1).": "; - field_selector("sort[]", "sort$x", $report['sort'][$x]); + $f = $report['sort'][$x]['field']; + field_selector("sort[$x]", "sort$x",$f); echo "
"; } echo "

Distinct

"; echo "Distinct Column: "; - field_selector("distinct[]", "distinct0", $report['distinct'][0]); + $x=0; + $f = $report['distinct'][$x]['field']; + field_selector("distinct[$x]", "distinct0", $f); + + echo "

Filtering

"; + echo "
Column ".($x + 1).": "; - field_selector("col[]", "col$x", $f); + if(intval($x) != intval($o)) { + echo ("WARNING, out of order!"); + } + field_selector("col[$o][field]", "col$o", $d['field']); echo "
Column ".($x + 1).": "; - field_selector("col[]", "col$x", ''); + field_selector("col[$x][field]", "col$x", ''); echo "
Loc ".($x+1).":
Loc ".($o+1).": "; foreach($locs as $k=>$v) { - echo "$k="; + echo "$k="; } echo 'Face='; - selector("loc[$f][face]", - array('' => '', 'bold' => 'Bold'), - $report['loc'][$f]['face']); + selector("col[$x][face]", array('' => '', 'bold' => 'Bold'), $d['face']); echo 'Align'; - selector("loc[$f][align]", array('center' => 'Center', 'left' => 'Left', 'right' => 'Right'), - $report['loc'][$f]['align']); + selector("col[$x][align]", array('center' => 'Center', 'left' => 'Left', 'right' => 'Right'), + $d['align']); if($f == 'static_text') { - echo ""; + echo "
Text="; } else { - echo ""; + echo ""; } $x++; @@ -342,21 +344,15 @@ function reportChange() for(;$x<$n_columns;$x++) { echo "
Loc ".($x+1).": "; - echo i18n('Define data for the Column first'); - /* foreach($locs as $k=>$v) { - echo "$k="; + echo "$k="; } echo 'Face='; - selector("new$x[face]", - array('' => '', 'bold' => 'Bold'), - ''); + selector("col[$x][face]", array('' => '', 'bold' => 'Bold'), ''); echo 'Align'; - selector("new$x[align]", - array('center' => 'Center', 'left' => 'Left', 'right' => 'Right'), + selector("col[$x][align]", array('center' => 'Center', 'left' => 'Left', 'right' => 'Right'), 'center'); - echo ""; - */ + echo ""; echo "
"; + for($x=0;$x<3;$x++) { + echo ""; + } + echo "
Filter".($x + 1).":"; + field_selector("filter[$x][field]", "filter$x",$report['filter'][$x]['field']); + echo "
"; + selector("filter[$x][x]", $filter_ops,$report['filter'][$x]['x']); + $v = $report['filter'][$x]['value']; + echo "Text="; + echo "
"; echo "

Options

"; foreach($options as $ok=>$o) { diff --git a/admin/reports_judges.inc.php b/admin/reports_judges.inc.php index 79407749..0c3a876d 100644 --- a/admin/reports_judges.inc.php +++ b/admin/reports_judges.inc.php @@ -104,7 +104,7 @@ $report_judges_fields = array( 'width' => 0.75, 'table' => "GROUP_CONCAT(judges_languages.languages_lang ORDER BY judges_languages.languages_lang SEPARATOR ' ')", 'group_by' => array('judges.id'), - 'select_component' => array('languages')), + 'components' => array('languages')), 'captain' => array( 'name' => 'Judge Team -- Captain?', @@ -112,21 +112,21 @@ $report_judges_fields = array( 'width' => 0.5, 'table' => 'judges_teams_link.captain', 'value_map' => array ('no' => 'No', 'yes' => 'Yes'), - 'select_component' => array('teams')), + 'components' => array('teams')), 'team' => array( 'name' => 'Judge Team -- Name', 'header' => 'Team Name', 'width' => 3.0, 'table' => 'judges_teams.name', - 'select_component' => array('teams')), + 'components' => array('teams')), 'teamnum' => array( 'name' => 'Judge Team -- Team Number', 'header' => 'Team', 'width' => 0.5, 'table' => 'judges_teams.num', - 'select_component' => array('teams')), + 'components' => array('teams')), 'complete' => array( 'name' => 'Judge -- Registration Complete', diff --git a/admin/reports_judges_new.php b/admin/reports_judges_new.php deleted file mode 100644 index bec71ef3..00000000 --- a/admin/reports_judges_new.php +++ /dev/null @@ -1,258 +0,0 @@ - - Copyright (C) 2005 James Grant - - 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. -*/ -?> - i18n('Judge ID'), - 'firstname' => i18n("Last Name"), - 'lastname' => i18n("First Name"), - 'email' => i18n("Email"), - 'homephone' => i18n("Phone Home"), - 'workphone' => i18n("Phone Work"), - 'workphoneext' => i18n("Phone Work Ext"), - 'cellphone' => i18n("Phone Cell"), - 'languages' => i18n("Languages"), - 'organization' => i18n("Organization"), - 'address' => i18n("Address"), - 'city' => i18n("City"), - 'province' => i18n("Province"), - 'postalcode' => i18n("Postal Code"), - 'questions' => i18n("Judging Questions Responses"), - 'expertise_other' => i18n("Expertise Other") - ); - - - -if(!$_GET['type']) $type="csv"; -else $type=$_GET['type']; - -if($type=="pdf") -{ - $rep=new lpdf( i18n($config['fairname']), - i18n("Judge List"), - $_SERVER['DOCUMENT_ROOT'].$config['SFIABDIRECTORY']."/data/logo-200.gif" - ); - - $rep->newPage(); - $rep->setFontSize(11); -} -else if($type=="csv") -{ - $rep=new lcsv(i18n("Judge List")); -} -else if($type=="txt") -{ - $rep = new ltxt(i18n("Judge List")); -} - -$table=array(); -$table['header']=array( i18n("ID"), - i18n("Last Name"), - i18n("First Name"), - i18n("Email"), - i18n("Phone Home"), - i18n("Phone Work"), - i18n("Phone Work Ext"), - i18n("Phone Cell"), - i18n("Languages"), - i18n("Organization"), - i18n("Address 1"), - i18n("Address 2"), - i18n("City"), - i18n("Province"), - i18n("Postal Code"), - i18n("Highest PostSecDeg"), - i18n("Professional Quals"), - i18n("Expertise Other")); - -/* Append headers for all the custom questions */ -$qs=questions_load_questions('judgereg', $config['FAIRYEAR']); -$keys = array_keys($qs); -foreach($keys as $qid) { - $table['header'][] = i18n($qs[$qid]['db_heading']); -} - - -//grab the list of divisions, because the last fields of the table will be the sub-divisions -$q=mysql_query("SELECT * FROM projectcategories WHERE year='".$config['FAIRYEAR']."' ORDER BY id"); -$numcats=mysql_num_rows($q); -$catheadings=array(); -while($r=mysql_fetch_object($q)) -{ - $cats[]=$r->id; - $catheadings[]="$r->category (out of 5)"; -} -//grab the list of divisions, because the last fields of the table will be the sub-divisions -$q=mysql_query("SELECT * FROM projectdivisions WHERE year='".$config['FAIRYEAR']."' ORDER BY id"); -$divheadings=array(); -while($r=mysql_fetch_object($q)) -{ - $divs[]=$r->id; - $divheadings[]="$r->division (out of 5)"; - $divheadings[]="$r->division subdivisions"; -} - -//now append the arrays together -$table['header']=array_merge($table['header'],array_merge($catheadings,$divheadings)); - - -//fill these in if we ever make this PDFable -$table['widths']=array(); -$table['dataalign']=array(); - -$q=mysql_query("SELECT - judges.* - FROM - judges, - judges_years - WHERE - judges.complete='yes' AND - judges_years.year='".$config['FAIRYEAR']."' AND - judges.id=judges_years.judges_id - ORDER BY - lastname, - firstname"); -while($r=mysql_fetch_object($q)) -{ - $expertise_other=str_replace("\n"," ",$r->expertise_other); - $expertise_other=str_replace("\r","",$expertise_other); - - $subdivq=mysql_query("SELECT judges_expertise.*, - projectsubdivisions.subdivision, - projectsubdivisions.projectdivisions_id AS parent_id - FROM judges_expertise - LEFT JOIN projectsubdivisions ON judges_expertise.projectsubdivisions_id=projectsubdivisions.id - WHERE - judges_id='$r->id' AND - judges_expertise.year='".$config['FAIRYEAR']."' - ORDER BY - projectdivisions_id, - projectsubdivisions_id"); - if(isset($judge_divs)) unset($judge_divs); $judge_divs=array(); - if(isset($judge_subdivs)) unset($judge_subdivs); $judge_subdivs=array(); - if(isset($divdata)) unset($divdata); $divdata=array(); - if(isset($catdata)) unset($catdata); $catdata=array(); - - while($subdivr=mysql_fetch_object($subdivq)) - { - if($subdivr->projectdivisions_id) - { - $judge_divs[$subdivr->projectdivisions_id]=$subdivr->val; - } - else - $judge_subdivs[$subdivr->parent_id][]=$subdivr->subdivision; - } - - - foreach($divs as $div) - { - $divdata[]=$judge_divs[$div]; - if(count($judge_subdivs[$div])) - $divdata[]=implode(",",$judge_subdivs[$div]); - else - $divdata[]=""; - } - - - $catprefq=mysql_query("SELECT judges_catpref.rank, projectcategories.category - FROM judges_catpref, - projectcategories - WHERE - projectcategories.year='".$config['FAIRYEAR']."' AND - judges_catpref.year='".$config['FAIRYEAR']."' AND - judges_catpref.judges_id='".$r->id."' AND - judges_catpref.projectcategories_id=projectcategories.id - ORDER BY - judges_catpref.projectcategories_id"); - if(mysql_num_rows($catprefq)!=$numcats) - { - //somethings messed up, we're missing data or have too much, so we really cant draw any conclusions from the data we have - //so instead, we will simply blank these out to 0 - for($x=0;$x<$numcats;$x++) - $catdata[]=0; - - } - else - { - while($cr=mysql_fetch_object($catprefq)) - { - //this is stored in teh db as -2 ... +2 so if we add 2 we get a nice 0 ... 5 - $catdata[]=$cr->rank+2; - } - } - - $languages=""; - //and finally, grab their languages - $langq=mysql_query("SELECT * FROM judges_languages WHERE judges_id='".$r->id."' ORDER BY languages_lang"); - while($langr=mysql_fetch_object($langq)) - $languages.=$langr->languages_lang."/"; - //stip off the last / - $languages=substr($languages,0,-1); - -// print_r($judge_divs); -// print_r($judge_subdivs); - - $qarray = array(); - $qans = questions_load_answers('judgereg', $r->id, $config['FAIRYEAR']); - $keys = array_keys($qans); - foreach($keys as $qid) { - $qarray[] = $qans[$qid]; - } - - $tmp=array( - $r->id, - $r->lastname, - $r->firstname, - $r->email, - $r->phonehome, - $r->phonework, - $r->phoneworkext, - $r->phonecell, - $languages, - $r->organization, - $r->address, - $r->address2, - $r->city, - $r->province, - $r->postalcode, - $r->highest_psd, - $r->professional_quals, - $expertise_other - ); - $tmp = array_merge($tmp, $qarray); - - $extradata=array_merge($catdata,$divdata); - $table['data'][]=array_merge($tmp,$extradata); -} - -$rep->addTable($table); -$rep->output(); - -?> diff --git a/admin/reports_nametags_committee.php b/admin/reports_nametags_committee.php deleted file mode 100644 index dbeba48d..00000000 --- a/admin/reports_nametags_committee.php +++ /dev/null @@ -1,132 +0,0 @@ - - Copyright (C) 2005 James Grant - - 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. -*/ -?> -setPageStyle("nametags"); - $rep->newPage(8.5,11); - $rep->setNametagDimensions($card_width,$card_height); - $rep->setFontSize(11); - } - else if($type=="csv") { - $rep=new lcsv(i18n("Committee Nametags")); - } - $q=mysql_query("SELECT - name, - organization - FROM - committees_members - WHERE - deleted='N' - ORDER BY - name - "); -// -/* - this is 4x3" on my screen, so i'll use it to figure - out what it should look like in a semi-proporational - layout. - -*********************************************************** -* * -* -------- * -* | | [ NAME OF THE SCIENCE FAIR GOES HERE ] * -* | logo | * -* | | [ NAME OF THE FAIR IN FRENCH GOES HERE ] * -* | | * -* -------- * -* * -* * -* [ ] * -* [ THE STUDENTS NAME IN BIG LETTERS ] * -* [ ] * -* * -* * -* [ ] * -* [ PROJECT TITLE GOES HERE ALSO FAIRLY BIG ] * -* [ ] * -* * -* * -* [ CATEGORY / DIVISION ] * -* * -* * -* PROJECT NUMBER * -* * -* * -*********************************************************** - - -on the page we have tagnum layout like this: - - 1 2 - 3 4 - 5 6 - -*/ - - if($type=="csv") - { - $table=array(); - $table['header'] = array(i18n("Name"),i18n("Organization")); - } - - while($r=mysql_fetch_object($q)) - { - if($type=="pdf") - { - $rep->newNametag(); - $rep->setFontSize(18); - $rep->addNametagText(0.25,"$r->name"); - $rep->setFontSize(14); - $rep->addNametagText(0.90,"Committee"); - $rep->setFontSize(12); - $rep->addNametagText(1.5,$r->organization); - } - else if($type=="csv") - { - $table['data'][]=array($r->name, $r->organization); - } - } - - if($type=="csv") - { - $rep->addTable($table); - } - - $rep->output(); - -?> diff --git a/admin/reports_nametags_judges.php b/admin/reports_nametags_judges.php deleted file mode 100644 index 1593baff..00000000 --- a/admin/reports_nametags_judges.php +++ /dev/null @@ -1,139 +0,0 @@ - - Copyright (C) 2005 James Grant - - 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. -*/ -?> -setPageStyle("nametags"); - $rep->newPage(8.5,11); - $rep->setNametagDimensions($card_width,$card_height); - $rep->setFontSize(11); - - } - else if($type=="csv") - { - $rep=new lcsv(i18n("Judge Nametags")); - } - $q=mysql_query("SELECT - judges.firstname, - judges.lastname, - judges.organization - FROM - judges, - judges_years - WHERE - judges.complete='yes' AND - judges_years.year='".$config['FAIRYEAR']."' AND - judges.id=judges_years.judges_id - ORDER BY - judges.lastname, judges.firstname - "); -// -/* - this is 4x3" on my screen, so i'll use it to figure - out what it should look like in a semi-proporational - layout. - -*********************************************************** -* * -* -------- * -* | | [ NAME OF THE SCIENCE FAIR GOES HERE ] * -* | logo | * -* | | [ NAME OF THE FAIR IN FRENCH GOES HERE ] * -* | | * -* -------- * -* * -* * -* [ ] * -* [ THE STUDENTS NAME IN BIG LETTERS ] * -* [ ] * -* * -* * -* [ ] * -* [ PROJECT TITLE GOES HERE ALSO FAIRLY BIG ] * -* [ ] * -* * -* * -* [ CATEGORY / DIVISION ] * -* * -* * -* PROJECT NUMBER * -* * -* * -*********************************************************** - - -on the page we have tagnum layout like this: - - 1 2 - 3 4 - 5 6 - -*/ - - if($type=="csv") - { - $table=array(); - $table['header'] = array(i18n("First Name"),i18n("Last Name"),i18n("Organization")); - } - - while($r=mysql_fetch_object($q)) - { - if($type=="pdf") - { - $rep->newNametag(); - $rep->setFontSize(18); - $rep->addNametagText(0.25,"$r->firstname $r->lastname"); - $rep->setFontSize(14); - $rep->addNametagText(0.90,"Judge"); - $rep->setFontSize(12); - $rep->addNametagText(1.5,$r->organization); - } - else if($type=="csv") - { - $table['data'][]=array($r->firstname, $r->lastname, $r->organization); - } - - } - - if($type=="csv") - { - $rep->addTable($table); - } - - $rep->output(); - -?> diff --git a/admin/reports_nametags_students.php b/admin/reports_nametags_students.php deleted file mode 100644 index 6ebcb585..00000000 --- a/admin/reports_nametags_students.php +++ /dev/null @@ -1,258 +0,0 @@ - - Copyright (C) 2005 James Grant - - 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. -*/ -?> -<< ".i18n("Back to Administration")."  "; - echo "<< ".i18n("Back to Reports")."
"; - echo "
"; - echo ""; - - /* - We need to prompt them for the fields. We will display check boxes for - every field. By default all of the fields are checked. - */ - echo "\n\n"; - echo "\n"; - echo "\n"; - - echo "
"; - echo i18n("Please select which fields you would like displayed on the name tags").": "; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo " Project Title\n"; - echo "
\n"; - echo " Project Number\n"; - echo "
\n"; - echo " Student's First Name\n"; - echo "
\n"; - echo " Student's Surname Name\n"; - echo "
\n"; - echo " Project Category\n"; - echo "
\n"; - echo " Project Division\n"; - echo "
\n"; - echo "\n"; - echo "
"; - echo "\n"; - - send_footer(); - - - } - else - { - if($type=="pdf") - { - $card_width=4; - $card_height=3; - - $rep=new lpdf( i18n($config['fairname']), - "Student Nametags", - $_SERVER['DOCUMENT_ROOT'].$config['SFIABDIRECTORY']."/data/logo-200.gif" - ); - - $rep->setPageStyle("nametags"); - $rep->newPage(8.5,11); - $rep->setNametagDimensions($card_width,$card_height); - $rep->setFontSize(11); - } - else if($type=="csv") - { - $rep=new lcsv(i18n("Student Nametags")); - } - $q=mysql_query("SELECT - registrations.id AS reg_id, - registrations.num AS reg_num, - projects.id, - projects.title, - projects.projectnumber, - projects.projectdivisions_id, - projects.projectcategories_id, - projectdivisions.division, - projectcategories.category, - students.firstname, - students.lastname - FROM - registrations - LEFT JOIN projects on projects.registrations_id=registrations.id - LEFT JOIN projectdivisions ON projectdivisions.id=projects.projectdivisions_id - LEFT JOIN projectcategories ON projectcategories.id=projects.projectcategories_id - LEFT JOIN students ON students.registrations_id=registrations.id - - WHERE - projects.year='".$config['FAIRYEAR']."' - AND projectdivisions.year='".$config['FAIRYEAR']."' - AND projectcategories.year='".$config['FAIRYEAR']."' - AND ( registrations.status='complete' OR registrations.status='paymentpending' ) - ORDER BY - projects.projectnumber - "); - echo mysql_error(); -// -/* - this is 4x3" on my screen, so i'll use it to figure - out what it should look like in a semi-proporational - layout. - -*********************************************************** -* * -* -------- * -* | | [ NAME OF THE SCIENCE FAIR GOES HERE ] * -* | logo | * -* | | [ NAME OF THE FAIR IN FRENCH GOES HERE ] * -* | | * -* -------- * -* * -* * -* [ ] * -* [ THE STUDENTS NAME IN BIG LETTERS ] * -* [ ] * -* * -* * -* [ ] * -* [ PROJECT TITLE GOES HERE ALSO FAIRLY BIG ] * -* [ ] * -* * -* * -* [ CATEGORY / DIVISION ] * -* * -* * -* PROJECT NUMBER * -* * -* * -*********************************************************** - - -on the page we have tagnum layout like this: - - 1 2 - 3 4 - 5 6 - -*/ - if($type=="csv") - { - $table=array(); - $table['header'] = array(i18n("First Name"),i18n("Last Name"),i18n("Project Title"),i18n("Category"),i18n("Division"),i18n("Project Number")); - } - - while($r=mysql_fetch_object($q)) - { - if($type=="pdf") - { - $rep->newNametag(); - $rep->setFontSize(18); - $studentName = " "; - if($firstname && $lastname) - $studentName = "$r->firstname $r->lastname"; - else if($firstname) - $studentName = "$r->firstname"; - else if($lastname) - $studentName = "$r->lastname"; - - $rep->addNametagText(0.0,"$studentName"); - $rep->setFontSize(14); - - if($title) - $rep->addNametagText(0.75,"$r->title"); - else - $rep->addNametagText(0.75," "); - - $rep->setFontSize(12); - - $categoryDivision = " "; - if($category && $division) - $categoryDivision = $r->category." - ".$r->division; - else if($category) - $categoryDivision = $r->category; - else if($division) - $categoryDivision = $r->division; - - $rep->addNametagText(1.5,$categoryDivision); - - $rep->setFontSize(16); - if($projectnumber) - $rep->addNametagText(1.75,"# $r->projectnumber"); - else - $rep->addNametagText(1.75," "); - - } - else if($type=="csv") - { - $table['data'][]=array($r->firstname, $r->lastname, $r->title, $r->category, $r->division, $r->projectnumber); - } - - } - if($type=="csv") - { - $rep->addTable($table); - } - - $rep->output(); - - } // Close the if-statement that governs whether or not to display the fields - -?> diff --git a/admin/reports_projects_judgingstickers.php b/admin/reports_projects_judgingstickers.php deleted file mode 100644 index 5b60bcdf..00000000 --- a/admin/reports_projects_judgingstickers.php +++ /dev/null @@ -1,111 +0,0 @@ - - Copyright (C) 2007 James Grant - - 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. -*/ -?> -setPageStyle("labels"); - $rep->newPage(8.5,11); - $rep->setLabelDimensions($card_width,$card_height,$xspacer,$yspacer,$fontsize); - } - else if($type=="csv") { - $rep=new lcsv(i18n("$reportname ")); - } - - $projq=mysql_query("SELECT - registrations.id AS reg_id, - registrations.num AS reg_num, - projects.id, - projects.title, - projects.projectnumber, - projects.projectdivisions_id, - projects.projectcategories_id, - projectdivisions.division, - projectcategories.category - FROM - registrations - LEFT JOIN projectdivisions ON projectdivisions.id=projects.projectdivisions_id - LEFT JOIN projectcategories ON projectcategories.id=projects.projectcategories_id - LEFT JOIN projects on projects.registrations_id=registrations.id - - WHERE - projects.year='".$config['FAIRYEAR']."' - AND projectdivisions.year='".$config['FAIRYEAR']."' - AND projectcategories.year='".$config['FAIRYEAR']."' - AND ( registrations.status='complete' OR registrations.status='paymentpending' ) - ORDER BY - projects.projectnumber - "); - echo mysql_error(); - - if($type=="csv") - { - $table=array(); - $table['header'] = array( - i18n("Project Number"), - i18n("Project Title"), - i18n("Division"), - i18n("Category")); - } - - while($proj=mysql_fetch_object($projq)) - { - if($type=="pdf") - { - $rep->newLabel(); - $rep->addLabelText(.05,$proj->projectnumber); - $rep->addLabelText(.300,$proj->category." / ".$proj->division); - $rep->addLabelText(.500,$proj->title); - - } - else if($type=="csv") - { - $table['data'][]=array($proj->projectnumber,$proj->title,$proj->division,$proj->category); - } - } - - if($type=="csv") - $rep->addTable($table); - - $rep->output(); -?> diff --git a/admin/reports_projects_tablelabels.php b/admin/reports_projects_tablelabels.php deleted file mode 100644 index 45d7e9d2..00000000 --- a/admin/reports_projects_tablelabels.php +++ /dev/null @@ -1,206 +0,0 @@ - - Copyright (C) 2005 James Grant - - 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. -*/ -?> -<< ".i18n("Back to Administration")."  "; - echo "<< ".i18n("Back to Reports")."
"; - echo "
"; - echo ""; - - /* - We need to prompt them for the fields. We will display check boxes for - every field. By default all of the fields are checked. - */ - echo "\n\n"; - echo "\n"; - echo "\n"; - - echo "
"; - echo i18n("Please select what fields you would like to display on the table labels").": "; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo " Project Title\n"; - echo "
\n"; - echo " Project Number\n"; - echo "
\n"; - echo " Student's First Name\n"; - echo "
\n"; - echo " Student's Surname Name\n"; - echo "
\n"; - echo " Project Category\n"; - echo "
\n"; - echo " Project Division\n"; - echo "
\n"; - echo "\n"; - echo "
"; - echo "\n"; - - send_footer(); - - - } - else - { - - if($type=="pdf") - { - - $rep=new lpdf( i18n($config['fairname']), - i18n(""), - $_SERVER['DOCUMENT_ROOT'].$config['SFIABDIRECTORY']."/data/logo-200.gif" - ); - - $rep->newPage(11,8.5); - $rep->setFontSize(11); - } - else if($type=="csv") - { - $rep=new lcsv(i18n("Table Labels")); - } - - $projq=mysql_query("SELECT - registrations.id AS reg_id, - registrations.num AS reg_num, - projects.id, - projects.title, - projects.projectnumber, - projects.projectdivisions_id, - projects.projectcategories_id, - projectdivisions.division, - projectcategories.category - FROM - registrations - LEFT JOIN projectdivisions ON projectdivisions.id=projects.projectdivisions_id - LEFT JOIN projectcategories ON projectcategories.id=projects.projectcategories_id - LEFT JOIN projects on projects.registrations_id=registrations.id - - WHERE - projects.year='".$config['FAIRYEAR']."' - AND projectdivisions.year='".$config['FAIRYEAR']."' - AND projectcategories.year='".$config['FAIRYEAR']."' - AND ( registrations.status='complete' OR registrations.status='paymentpending' ) - ORDER BY - projects.projectnumber - "); - echo mysql_error(); - - $num=mysql_num_rows($projq); - while($proj=mysql_fetch_object($projq)) - { - $rep->setFontSize(22); - if($title) - $rep->addtext($proj->title,"center"); - else - $rep->nextLine(); - - $rep->setFontSize(150); - $rep->yloc=6.75; - if($projectnumber) - $rep->addtext($proj->projectnumber,"center"); - else - $rep->nextLine(); - - $rep->setFontSize(22); - - - $sq=mysql_query("SELECT students.firstname, - students.lastname - FROM - students - WHERE - students.registrations_id='$proj->reg_id' - "); - - - $students=""; - $studnum=0; - while($studentinfo=mysql_fetch_object($sq)) - { - if($studnum>0) $students.=", "; - - if($firstname && $lastname) - $students.="$studentinfo->firstname $studentinfo->lastname"; - else if($firstname) - $students.="$studentinfo->firstname"; - else if($lastname) - $students.="$studentinfo->lastname"; - $studnum++; - } - $rep->nextLine(); - $rep->nextLine(); - $rep->addText($students,"center"); - $rep->nextLine(); - $rep->nextLine(); - if($category && $division) - $rep->addText(i18n($proj->category)." - ".i18n($proj->division),"center"); - else if($category) - $rep->addText(i18n($proj->category),"center"); - else if($division) - $rep->addText(i18n($proj->division),"center"); - - $index++; - if($index!=$num) - $rep->newPage(); - } - - $rep->output(); -} -?> diff --git a/admin/reports_students.inc.php b/admin/reports_students.inc.php index deb60f04..439e23b7 100644 --- a/admin/reports_students.inc.php +++ b/admin/reports_students.inc.php @@ -26,7 +26,7 @@ $report_students_fields = array( 'name' => 'Project Number', 'header' => '#', 'width' => 0.5, - 'table' => 'projects.projectnumber' ), + 'table' => 'CAST(projects.projectnumber AS UNSIGNED)' ), 'last_name' => array( 'name' => 'Student -- Last Name', @@ -58,19 +58,21 @@ $report_students_fields = array( 'name' => 'Student -- Partner Name', 'header' => 'Partner', 'width' => 1.5, - 'table' => "CONCAT(students2.lastname, ', ', students2.firstname)" ), + 'table' => "CONCAT(students2.lastname, ', ', students2.firstname)", + 'components' => array('partner') ), 'bothnames' => array( 'name' => "Student -- Both Student Names", 'header' => 'Student(s)', 'width' => 3.0, 'table' => "CONCAT(students.firstname, ' ', students.lastname, IF(students2.lastname IS NULL,'', CONCAT(', ', students2.firstname, ' ', students2.lastname)))", - 'table_sort' => 'students.lastname'), + 'table_sort' => 'students.lastname', + 'components' => array('partner') ), 'grade' => array( 'name' => 'Student -- Grade', - 'header' => 'Grade', - 'width' => 0.5, + 'header' => 'Gr.', + 'width' => 0.3, 'table' => 'students.grade'), 'gender' => array( @@ -83,9 +85,16 @@ $report_students_fields = array( 'birthdate' => array( 'name' => 'Student -- Birthdate', 'header' => 'Birthdate', - 'width' => 1, + 'width' => 0.9, 'table' => 'students.dateofbirth'), + 'age' => array( + 'name' => 'Student -- Age (when this report is created)', + 'header' => 'Age', + 'width' => 0.4, + 'table' => "DATE_FORMAT(FROM_DAYS(TO_DAYS(NOW())-TO_DAYS(students.dateofbirth)), '%Y')+0", + 'table_sort' => 'students.dateofbirth'), + 'title' => array( 'name' => 'Project -- Title', 'header' => 'Project Title', @@ -234,10 +243,9 @@ $report_students_fields = array( 'name' => 'Awards (warning: duplicates student for multiple awards!)', 'header' => 'Award Name', 'width' => 4, - 'table' => "CONCAT(IF(award_types.type='Other','Special',award_types.type), - ' ', award_awards.name)", + 'table' => "CONCAT(IF(award_types.type='Other','Special',award_types.type),' ', award_awards.name)", 'table_sort' => 'award_awards.order', - 'select_component' => array('awards')), + 'components' => array('awards')), 'pn_awards' => array( 'name' => 'Project Num + Award (will be unique)', @@ -245,23 +253,23 @@ $report_students_fields = array( 'width' => 4, 'table' => "CONCAT(projects.projectnumber,' ', award_awards.name)", 'table_sort' => 'award_awards.order', - 'select_component' => array('awards')), + 'components' => array('awards')), 'nom_awards' => array( 'name' => 'Award Nominations -- Award Name (warning: duplicates student for multiple awards!)', 'header' => 'Award Name', 'width' => 4, - 'table' => "CONCAT(award_types.type,' ',award_awards.name)", - 'table_sort' => 'award_awards.order', - 'select_component' => array('awards_nominations')), + 'table' => "CONCAT(award_types.type,' -- ',award_awards.name)", + 'table_sort' => 'award_awards.name', + 'components' => array('awards_nominations')), 'nom_pn_awards' => array( 'name' => 'Award Nominations -- Project Num + Award Name(will be unique)', 'header' => 'Award Name', 'width' => 4, 'table' => "CONCAT(projects.projectnumber,' ', award_awards.name)", - 'table_sort' => 'award_awards.order', - 'select_component' => array('awards_nominations')), + 'table_sort' => 'award_awards.name', + 'components' => array('awards_nominations')), 'req_elec' => array( 'name' => 'If the project requires electricity', @@ -288,21 +296,33 @@ $report_students_fields = array( 'header' => 'Emerg. Name', 'width' => 1.5, 'table' => "CONCAT(emergencycontact.firstname, ' ', emergencycontact.lastname)", - 'select_component' => array('emergencycontacts')), + 'components' => array('emergencycontacts')), 'emerg_relation' => array( 'name' => 'Emergency Contact -- Relationship', 'header' => 'Emerg. Rlt', 'width' => 1, 'table' => "emergencycontact.relation", - 'select_component' => array('emergencycontacts')), + 'components' => array('emergencycontacts')), 'emerg_phone' => array( 'name' => 'Emergency Contact -- Phone', 'header' => 'Emerg. Phone', 'width' => 1, 'table' => "CONCAT(emergencycontact.phone1, ' ', emergencycontact.phone2, ' ', emergencycontact.phone3, ' ', emergencycontact.phone4)", - 'select_component' => array('emergencycontacts')), + 'components' => array('emergencycontacts')), + + 'fair_year' => array ( + 'name' => 'Fair -- Year', + 'header' => 'Year', + 'width' => 0.5, + 'table' => "{$config['FAIRYEAR']}"), + + 'fair_name' => array ( + 'name' => 'Fair -- Name', + 'header' => 'Fair Name', + 'width' => 3, + 'table' => "'{$config['fairname']}'"), 'static_text' => array ( 'name' => 'Static Text (useful for labels)', @@ -346,14 +366,14 @@ $report_students_fields = array( $awards_join = "LEFT JOIN project_specialawards_link ON(projects.id=project_specialawards_link.projects_id), award_awards,award_types"; - $awards_where = " AND project_specialawards_link.award_awards_id=award_awards_id + $awards_where = " AND project_specialawards_link.award_awards_id=award_awards.id AND award_types.id=award_awards.award_types_id AND award_awards.year='$year' AND award_types.year='$year' "; } $partner_join = ''; - if(in_array('bothnames', $report['col']) || in_array('partner', $report['col'])) { + if(in_array('partner', $components)) { $partner_join = "LEFT JOIN students AS students2 ON(students2.registrations_id=students.registrations_id AND students2.id != students.id)"; diff --git a/db/db.code.version.txt b/db/db.code.version.txt index 9e5feb52..21e72e8a 100644 --- a/db/db.code.version.txt +++ b/db/db.code.version.txt @@ -1 +1 @@ -46 +48 diff --git a/db/db.update.47.sql b/db/db.update.47.sql new file mode 100644 index 00000000..c2a783cd --- /dev/null +++ b/db/db.update.47.sql @@ -0,0 +1,432 @@ + +DROP TABLE `reports`; + +CREATE TABLE `reports` ( + `id` int(11) NOT NULL auto_increment, + `name` varchar(128) NOT NULL default '', + `desc` tinytext NOT NULL, + `creator` varchar(128) NOT NULL default '', + `type` enum('student','judge','award','committee') NOT NULL default 'student', + PRIMARY KEY (`id`) +) ENGINE=MyISAM; + + +INSERT INTO `reports` VALUES (1, 'Student+Project -- Sorted by Last Name', 'Student Name, Project Number and Title, Category, Division short form sorted by Last Name', 'The Grant Brothers', 'student'); +INSERT INTO `reports` VALUES (2, 'Student+Project -- Sorted by Project Number', 'Student Name, Project Number and Title, Category sorted by Project Number', 'The Grant Brothers', 'student'); +INSERT INTO `reports` VALUES (3, 'Student+Project -- Grouped by Category', 'Student Name, Project Number and Title sorted by Last Name, grouped by Category', 'The Grant Brothers', 'student'); +INSERT INTO `reports` VALUES (4, 'Student+Project -- School Names sorted by Last Name', 'Student Name, Project Num, School Name sorted by Last Name', 'The Grant Brothers', 'student'); +INSERT INTO `reports` VALUES (5, 'Student+Project -- Grouped by School sorted by Last Name', 'Student Name, Project Number and Name sorted by Last Name, grouped by School Name', 'The Grant Brothers', 'student'); +INSERT INTO `reports` VALUES (6, 'Teacher -- Name and School Info sorted by Teacher Name', 'Teacher, School Info sorted by Teacher Name', 'The Grant Brothers', 'student'); +INSERT INTO `reports` VALUES (7, 'Teacher -- Names and Contact for each Student by School', 'Student Name, Teacher Name, Teacher Email, School Phone and Fax grouped by School Name with Addresses', 'The Grant Brothers', 'student'); +INSERT INTO `reports` VALUES (8, 'Awards -- Special Awards Nominations Data', 'listing of special award nominations for each project, lots of data for excel so you can slice and dice (and check additional requirements)', 'Ceddy', 'student'); +INSERT INTO `reports` VALUES (9, 'Check-in Lists', 'List of students and partners, project number and name, division, registration fees, tshirt size, sorted by project number, grouped by age category', 'The Grant Brothers', 'student'); +INSERT INTO `reports` VALUES (10, 'Student+Project -- Student (and Partner) grouped by School', 'Student Pairs, Project Name/Num Grouped by School', 'The Grant Brothers', 'student'); +INSERT INTO `reports` VALUES (11, 'Student+Project -- Grouped by School sorted by Project Number', 'Individual Students, Project Name/Num Grouped by School', 'The Grant Brothers', 'student'); +INSERT INTO `reports` VALUES (12, 'Student -- T-Shirt List by School', 'Individual Students, Project Num, TShirt, Grouped by School', 'The Grant Brothers', 'student'); +INSERT INTO `reports` VALUES (13, 'Media -- Program Guide', 'Project Number, Both student names, and Project Title, grouped by School', 'The Grant Brothers', 'student'); +INSERT INTO `reports` VALUES (14, 'Projects -- Titles and Grades from each School', 'Project Name/Num, Grade Grouped by School', 'The Grant Brothers', 'student'); +INSERT INTO `reports` VALUES (15, 'Media -- Award Winners List', 'Project Number, Student Name and Contact info, by each Award', 'The Grant Brothers', 'student'); +INSERT INTO `reports` VALUES (16, 'Projects -- Logistical Display Requirements', 'Project Number, Students, Electricity, Table, and special needs', 'The Grant Brothers', 'student'); +INSERT INTO `reports` VALUES (17, 'Emergency Contact Information', 'Emergency Contact Names, Relationship, and Phone Numbers for each student.', 'The Grant Brothers', 'student'); +INSERT INTO `reports` VALUES (18, 'Student -- Grouped by Grade and Gender (YSF Stats)', 'A list of students grouped by Grade and Gender. A quick way to total up the info for the YSF regional stats page.', 'The Grant Brothers', 'student'); +INSERT INTO `reports` VALUES (19, 'Student+Project -- Grouped by School, 1 per page', 'Both students names grouped by school, each school list begins on a new page.', 'The Grant Brothers', 'student'); +INSERT INTO `reports` VALUES (20, 'Judges -- Sorted by Last Name', 'A list of judge contact info, sorted by last name', 'The Grant Brothers', 'judge'); +INSERT INTO `reports` VALUES (21, 'Judges -- Judging Teams', 'A list of all the judges, sorted by team number.', 'The Grant Brothers', 'judge'); +INSERT INTO `reports` VALUES (22, 'Awards -- Grouped by Judging Team', 'List of each judging team, and the awards they are judging', 'The Grant Brothers', 'award'); +INSERT INTO `reports` VALUES (23, 'Awards -- Judging Teams grouped by Award', 'A list of each award, and the judging teams that will assign it', 'The Grant Brothers', 'award'); +INSERT INTO `reports` VALUES (24, 'Labels -- School Mailing Addresses', 'School Mailing Addresses with a blank spot for the teacher''s name, since each student apparently spells their teacher''s name differently.', 'The Grant Brothers', 'student'); +INSERT INTO `reports` VALUES (25, 'Labels -- Student Name and Project Number', 'Just the students names and project name/number on a label.', 'The Grant Brothers', 'student'); +INSERT INTO `reports` VALUES (26, 'Name Tags -- Students', 'Name Tags for Students', 'The Grant Brothers', 'student'); +INSERT INTO `reports` VALUES (27, 'Name Tags -- Judges', 'Name Tags for Judges', 'The Grant Brothers', 'judge'); +INSERT INTO `reports` VALUES (28, 'Name Tags -- Committee Members', 'Name Tags for Committee Members', 'The Grant Brothers', 'committee'); +INSERT INTO `reports` VALUES (29, 'Labels -- Project Identification (for judging sheets)', 'Project identification labels for judging sheets', 'The Grant Brothers', 'student'); +INSERT INTO `reports` VALUES (30, 'Labels -- Table Labels', 'Labels to go on each table, fullpage landscape version', 'The Grant Brothers', 'student'); +INSERT INTO `reports` VALUES (31, 'Awards -- Special Awards Nominations', 'Special award nominations for each project, grouped by special award, one award per page.', 'The Grant Brothers', 'student'); +INSERT INTO `reports` VALUES (32, 'Student+Project -- Grouped by School Board ID', 'Student Name, Project Number and Name sorted by Last Name, grouped by School Board ID', 'The Grant Brothers', 'student'); +INSERT INTO `reports` VALUES (33, 'Certificates -- Participation Certificates', 'A certificate template for each student with name, project name, fair name, and project number at the bottom', 'The Grant Brothers', 'student'); + +DROP TABLE `reports_items`; + +CREATE TABLE `reports_items` ( + `id` int(11) NOT NULL auto_increment, + `reports_id` int(11) NOT NULL default '0', + `type` enum('col','sort','group','distinct','option','filter') NOT NULL default 'col', + `ord` int(11) NOT NULL, + `field` varchar(64) NOT NULL, + `value` varchar(64) NOT NULL default '', + `x` float NOT NULL default '0', + `y` float NOT NULL default '0', + `w` float NOT NULL default '0', + `h` float NOT NULL default '0', + `lines` float NOT NULL default '0', + `face` enum('','bold') NOT NULL default '', + `align` enum('center','left','right') NOT NULL default 'center', + PRIMARY KEY (`id`) +) ENGINE=MyISAM; + + +INSERT INTO `reports_items` VALUES ('', 1, 'col', 5, 'grade', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 1, 'col', 4, 'div', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 1, 'sort', 0, 'last_name', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 2, 'col', 3, 'category', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 2, 'col', 0, 'pn', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 2, 'sort', 0, 'pn', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 3, 'col', 3, 'div', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 4, 'option', 2, 'allow_multiline', 'no', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 3, 'sort', 0, 'last_name', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 3, 'group', 0, 'category', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 4, 'col', 3, 'grade', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 4, 'col', 1, 'name', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 4, 'col', 0, 'pn', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 4, 'sort', 0, 'last_name', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 5, 'col', 3, 'category', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 5, 'col', 4, 'div', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 5, 'sort', 0, 'last_name', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 5, 'group', 0, 'school', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 6, 'col', 2, 'school_phone', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 6, 'col', 1, 'school', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 6, 'col', 0, 'teacher', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 6, 'sort', 0, 'teacher', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 6, 'distinct', 0, 'teacher', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 11, 'option', 2, 'allow_multiline', 'no', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 11, 'option', 1, 'group_new_page', 'no', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 11, 'option', 0, 'type', 'pdf', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 7, 'col', 5, 'school_fax', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 7, 'col', 4, 'school_phone', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 7, 'col', 3, 'teacheremail', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 7, 'sort', 0, 'pn', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 9, 'col', 6, 'div', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 9, 'col', 5, 'tshirt', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 9, 'col', 3, 'name', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 9, 'sort', 0, 'pn', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 9, 'group', 0, 'category', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 9, 'option', 0, 'type', 'pdf', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 10, 'col', 2, 'partner', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 10, 'col', 1, 'name', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 10, 'col', 0, 'pn', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 10, 'sort', 0, 'pn', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 10, 'group', 0, 'school', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 10, 'distinct', 0, 'pn', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 2, 'col', 2, 'title', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 11, 'col', 4, 'div', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 11, 'col', 3, 'category', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 11, 'sort', 0, 'pn', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 11, 'group', 0, 'school', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 12, 'col', 1, 'name', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 12, 'col', 0, 'pn', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 12, 'sort', 0, 'pn', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 12, 'group', 0, 'school', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 13, 'col', 1, 'bothnames', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 13, 'col', 0, 'pn', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 13, 'sort', 0, 'pn', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 13, 'group', 0, 'school', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 13, 'distinct', 0, 'pn', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 14, 'col', 0, 'pn', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 14, 'sort', 0, 'pn', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 14, 'group', 0, 'school', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 14, 'distinct', 0, 'pn', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 15, 'col', 5, 'postal', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 15, 'col', 4, 'province', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 15, 'col', 3, 'city', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 15, 'col', 2, 'address', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 15, 'col', 1, 'name', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 15, 'sort', 0, 'pn', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 15, 'group', 0, 'awards', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 1, 'option', 2, 'allow_multiline', 'yes', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 1, 'option', 1, 'group_new_page', 'no', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 1, 'option', 0, 'type', 'pdf', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 1, 'col', 3, 'category', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 1, 'col', 2, 'title', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 3, 'col', 1, 'name', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 3, 'option', 2, 'allow_multiline', 'no', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 3, 'option', 1, 'group_new_page', 'no', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 9, 'col', 4, 'partner', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 9, 'col', 2, 'title', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 9, 'option', 2, 'allow_multiline', 'no', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 9, 'col', 1, 'pn', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 9, 'option', 1, 'group_new_page', 'yes', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 5, 'col', 5, 'grade', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 5, 'option', 1, 'group_new_page', 'no', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 5, 'option', 2, 'allow_multiline', 'no', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 3, 'col', 2, 'title', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 4, 'col', 2, 'school', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 7, 'col', 2, 'teacher', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 7, 'group', 1, 'schooladdr', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 7, 'option', 0, 'type', 'pdf', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 11, 'col', 5, 'grade', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 2, 'col', 1, 'name', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 2, 'option', 1, 'group_new_page', 'no', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 2, 'option', 0, 'type', 'pdf', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 12, 'col', 2, 'tshirt', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 12, 'option', 1, 'group_new_page', 'no', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 7, 'option', 1, 'group_new_page', 'no', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 12, 'option', 2, 'allow_multiline', 'no', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 12, 'option', 0, 'type', 'pdf', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 7, 'col', 1, 'name', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 7, 'col', 0, 'pn', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 7, 'group', 0, 'school', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 15, 'col', 0, 'pn', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 15, 'option', 2, 'allow_multiline', 'no', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 15, 'option', 1, 'group_new_page', 'no', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 15, 'option', 0, 'type', 'pdf', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 13, 'col', 2, 'title', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 13, 'option', 2, 'allow_multiline', 'no', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 13, 'option', 1, 'group_new_page', 'no', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 13, 'option', 0, 'type', 'pdf', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 14, 'col', 1, 'title', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 14, 'option', 2, 'allow_multiline', 'no', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 14, 'option', 1, 'group_new_page', 'no', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 14, 'option', 0, 'type', 'pdf', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 16, 'col', 3, 'req_table', '', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 16, 'col', 2, 'req_elec', '', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 16, 'col', 1, 'title', '', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 16, 'group', 0, 'category', '', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 16, 'sort', 0, 'pn', '', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 16, 'distinct', 0, 'pn', '', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 16, 'option', 1, 'group_new_page', 'no', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 16, 'col', 0, 'pn', '', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 16, 'option', 0, 'type', 'pdf', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 17, 'col', 4, 'emerg_phone', '', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 17, 'col', 3, 'emerg_relation', '', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 17, 'col', 2, 'emerg_name', '', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 17, 'sort', 0, 'last_name', '', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 7, 'option', 2, 'allow_multiline', 'no', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 14, 'col', 2, 'grade', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 17, 'option', 1, 'group_new_page', 'no', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 6, 'option', 0, 'type', 'pdf', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 6, 'col', 3, 'school_fax', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 17, 'option', 0, 'type', 'pdf', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 17, 'col', 1, 'name', '', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 6, 'option', 1, 'group_new_page', 'no', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 6, 'option', 2, 'allow_multiline', 'no', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 9, 'col', 0, 'paid', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 1, 'col', 1, 'name', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 2, 'option', 2, 'allow_multiline', 'no', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 3, 'option', 0, 'type', 'pdf', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 3, 'col', 0, 'pn', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 4, 'option', 1, 'group_new_page', 'no', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 4, 'option', 0, 'type', 'pdf', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 10, 'col', 3, 'title', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 10, 'option', 0, 'type', 'pdf', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 10, 'option', 1, 'group_new_page', 'no', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 10, 'option', 2, 'allow_multiline', 'no', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 5, 'col', 2, 'title', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 5, 'col', 1, 'name', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 5, 'option', 0, 'type', 'pdf', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 5, 'col', 0, 'pn', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 11, 'col', 2, 'title', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 11, 'col', 1, 'name', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 11, 'col', 0, 'pn', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 18, 'col', 0, 'pn', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 18, 'col', 1, 'name', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 18, 'col', 2, 'school', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 18, 'group', 0, 'grade', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 18, 'group', 1, 'gender', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 18, 'sort', 0, 'pn', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 18, 'option', 0, 'type', 'pdf', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 18, 'option', 1, 'group_new_page', 'no', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 18, 'option', 2, 'allow_multiline', 'no', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 3, 'col', 4, 'grade', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 1, 'col', 0, 'pn', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 2, 'col', 4, 'div', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 2, 'col', 5, 'grade', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 19, 'col', 0, 'pn', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 19, 'col', 1, 'title', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 19, 'col', 2, 'bothnames', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 19, 'group', 0, 'school', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 19, 'sort', 0, 'pn', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 19, 'option', 0, 'type', 'pdf', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 19, 'option', 1, 'group_new_page', 'yes', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 19, 'option', 2, 'allow_multiline', 'no', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 21, 'sort', 1, 'namefl', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 21, 'col', 1, 'team', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 21, 'col', 2, 'captain', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 21, 'col', 3, 'namefl', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 21, 'option', 0, 'type', 'pdf', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 20, 'option', 2, 'allow_multiline', 'no', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 20, 'col', 4, 'complete', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 20, 'col', 0, 'name', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 20, 'option', 1, 'group_new_page', 'no', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 20, 'sort', 0, 'name', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 20, 'col', 1, 'email', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 20, 'col', 2, 'phone_home', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 20, 'col', 3, 'phone_work', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 20, 'option', 0, 'type', 'pdf', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 21, 'sort', 0, 'teamnum', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 21, 'option', 1, 'group_new_page', 'no', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 21, 'col', 0, 'teamnum', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 21, 'option', 2, 'allow_multiline', 'no', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 22, 'col', 1, 'type', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 22, 'option', 2, 'allow_multiline', 'yes', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 22, 'option', 1, 'group_new_page', 'no', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 22, 'option', 0, 'type', 'pdf', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 22, 'group', 0, 'judgeteamnum', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 22, 'col', 0, 'name', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 22, 'group', 1, 'judgeteamname', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 23, 'option', 1, 'group_new_page', 'no', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 23, 'col', 1, 'judgeteamname', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 23, 'group', 0, 'type', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 23, 'sort', 0, 'judgeteamnum', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 23, 'option', 2, 'allow_multiline', 'yes', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 23, 'group', 1, 'name', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 23, 'col', 0, 'judgeteamnum', '', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 23, 'option', 0, 'type', 'pdf', 0, 0, 0, 0, 0, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 16, 'col', 4, 'req_special', '', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 16, 'option', 2, 'allow_multiline', 'yes', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 16, 'option', 3, 'label_box', 'no', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 16, 'option', 4, 'label_fairname', 'no', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 16, 'option', 5, 'label_logo', 'no', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 16, 'option', 6, 'stock', 'letter', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 17, 'col', 0, 'pn', '', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 25, 'option', 6, 'stock', '5964', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 25, 'option', 5, 'label_logo', 'yes', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 24, 'col', 2, 'school_city_prov', '', 5, 50, 95, 8, 1, '', 'left'); +INSERT INTO `reports_items` VALUES ('', 24, 'col', 1, 'school_address', '', 5, 40, 95, 16, 2, '', 'left'); +INSERT INTO `reports_items` VALUES ('', 24, 'col', 0, 'school', '', 5, 5, 95, 16, 2, '', 'left'); +INSERT INTO `reports_items` VALUES ('', 24, 'option', 6, 'stock', '5964', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 24, 'option', 5, 'label_logo', 'no', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 24, 'option', 4, 'label_fairname', 'no', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 24, 'option', 3, 'label_box', 'yes', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 24, 'option', 2, 'allow_multiline', 'no', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 24, 'sort', 0, 'school', '', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 25, 'col', 4, 'school', '', 1, 90, 98, 5, 1, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 24, 'option', 1, 'group_new_page', 'no', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 24, 'option', 0, 'type', 'label', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 25, 'option', 4, 'label_fairname', 'yes', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 25, 'option', 3, 'label_box', 'yes', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 25, 'option', 2, 'allow_multiline', 'no', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 25, 'option', 1, 'group_new_page', 'no', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 25, 'option', 0, 'type', 'label', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 25, 'sort', 0, 'pn', '', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 8, 'col', 7, 'nom_awards', '', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 25, 'col', 3, 'categorydivision', '', 1, 80, 98, 12, 2, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 25, 'col', 2, 'pn', '', 1, 68, 98, 8, 1, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 27, 'sort', 0, 'namefl', '', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 25, 'col', 1, 'title', '', 1, 35, 98, 27, 3, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 25, 'col', 0, 'namefl', '', 5, 5, 90, 28, 2, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 26, 'col', 2, 'categorydivision', '', 1, 70, 98, 14, 2, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 26, 'sort', 0, 'pn', '', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 26, 'option', 6, 'stock', 'nametag', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 26, 'option', 5, 'label_logo', 'yes', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 26, 'option', 4, 'label_fairname', 'yes', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 26, 'option', 3, 'label_box', 'yes', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 26, 'option', 2, 'allow_multiline', 'no', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 26, 'option', 1, 'group_new_page', 'no', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 26, 'col', 1, 'title', '', 1, 35, 98, 27, 3, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 26, 'option', 0, 'type', 'label', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 26, 'col', 0, 'namefl', '', 5, 5, 90, 28, 2, 'bold', 'center'); +INSERT INTO `reports_items` VALUES ('', 27, 'col', 1, 'static_text', 'Judge', 1, 40, 98, 10, 1, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 27, 'col', 0, 'namefl', '', 1, 15, 98, 24, 2, 'bold', 'center'); +INSERT INTO `reports_items` VALUES ('', 27, 'option', 4, 'label_fairname', 'yes', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 27, 'option', 3, 'label_box', 'yes', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 27, 'option', 2, 'allow_multiline', 'no', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 27, 'option', 1, 'group_new_page', 'no', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 27, 'option', 0, 'type', 'label', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 28, 'col', 1, 'static_text', 'Committee', 1, 40, 98, 10, 1, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 28, 'col', 0, 'name', '', 1, 15, 98, 24, 2, 'bold', 'center'); +INSERT INTO `reports_items` VALUES ('', 28, 'sort', 0, 'name', '', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 28, 'option', 4, 'label_fairname', 'yes', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 28, 'option', 3, 'label_box', 'yes', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 28, 'option', 2, 'allow_multiline', 'no', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 28, 'option', 1, 'group_new_page', 'no', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 28, 'option', 0, 'type', 'label', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 30, 'option', 6, 'stock', 'fullpage_landscape', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 29, 'option', 5, 'label_logo', 'no', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 29, 'col', 1, 'categorydivision', '', 1, 30, 98, 18, 1, '', 'left'); +INSERT INTO `reports_items` VALUES ('', 8, 'col', 6, 'school_city', '', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 29, 'col', 0, 'pn', '', 1, 5, 98, 20, 1, '', 'left'); +INSERT INTO `reports_items` VALUES ('', 29, 'sort', 0, 'pn', '', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 29, 'option', 4, 'label_fairname', 'no', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 29, 'option', 3, 'label_box', 'yes', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 29, 'option', 2, 'allow_multiline', 'no', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 29, 'option', 1, 'group_new_page', 'no', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 29, 'option', 0, 'type', 'label', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 30, 'col', 3, 'categorydivision', '', 1, 85, 98, 5, 1, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 30, 'col', 2, 'pn', '', 1, 20, 98, 35, 1, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 30, 'sort', 0, 'pn', '', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 30, 'option', 4, 'label_fairname', 'yes', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 30, 'option', 3, 'label_box', 'yes', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 30, 'option', 1, 'group_new_page', 'no', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 30, 'col', 1, 'title', '', 1, 5, 98, 15, 3, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 30, 'option', 2, 'allow_multiline', 'no', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 31, 'option', 6, 'stock', 'fullpage', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 8, 'col', 5, 'birthdate', '', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 8, 'col', 4, 'gender', '', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 31, 'option', 5, 'label_logo', 'no', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 31, 'option', 4, 'label_fairname', 'no', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 31, 'option', 3, 'label_box', 'no', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 31, 'option', 2, 'allow_multiline', 'no', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 31, 'col', 5, 'age', '', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 31, 'sort', 0, 'pn', '', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 17, 'option', 2, 'allow_multiline', 'yes', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 31, 'option', 1, 'group_new_page', 'yes', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 31, 'col', 4, 'gender', '', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 31, 'option', 0, 'type', 'pdf', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 31, 'col', 3, 'grade', '', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 31, 'group', 0, 'nom_awards', '', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 32, 'option', 6, 'stock', 'fullpage', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 32, 'col', 4, 'school', '', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 32, 'col', 3, 'grade', '', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 32, 'col', 2, 'title', '', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 32, 'group', 0, 'school_board', '', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 32, 'sort', 0, 'pn', '', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 32, 'option', 2, 'allow_multiline', 'no', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 32, 'option', 5, 'label_logo', 'no', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 32, 'option', 4, 'label_fairname', 'no', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 32, 'option', 1, 'group_new_page', 'yes', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 32, 'col', 1, 'name', '', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 32, 'col', 0, 'pn', '', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 32, 'option', 3, 'label_box', 'no', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 32, 'option', 0, 'type', 'pdf', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 17, 'option', 3, 'label_box', 'no', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 17, 'option', 4, 'label_fairname', 'no', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 17, 'option', 5, 'label_logo', 'no', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 17, 'option', 6, 'stock', 'fullpage', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 31, 'col', 2, 'namefl', '', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 31, 'col', 1, 'title', '', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 31, 'col', 0, 'pn', '', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 33, 'col', 5, 'static_text', 'Chair', 5, 85, 30, 2, 1, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 33, 'sort', 0, 'pn', '', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 8, 'col', 2, 'namefl', '', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 8, 'option', 6, 'stock', 'fullpage', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 33, 'col', 6, 'static_text', 'Chief Judge', 60, 85, 30, 2, 1, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 33, 'col', 4, 'fair_year', '', 5, 25, 30, 6, 1, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 33, 'option', 5, 'label_logo', 'no', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 33, 'option', 6, 'stock', 'fullpage', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 33, 'option', 4, 'label_fairname', 'no', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 33, 'option', 3, 'label_box', 'yes', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 33, 'option', 2, 'allow_multiline', 'no', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 33, 'option', 1, 'group_new_page', 'no', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 33, 'option', 0, 'type', 'label', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 33, 'col', 3, 'pn', '', 3, 97, 94, 1, 1, '', 'right'); +INSERT INTO `reports_items` VALUES ('', 33, 'col', 0, 'fair_name', '', 1, 36, 98, 4, 1, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 33, 'col', 1, 'namefl', '', 1, 56, 98, 8, 2, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 33, 'col', 2, 'title', '', 1, 65, 98, 12, 3, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 24, 'col', 3, 'school_postal', '', 5, 60, 95, 8, 1, '', 'left'); +INSERT INTO `reports_items` VALUES ('', 30, 'col', 0, 'bothnames', '', 1, 70, 98, 10, 2, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 30, 'option', 0, 'type', 'label', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 26, 'col', 3, 'pn', '', 1, 85, 98, 8, 1, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 27, 'col', 2, 'organization', '', 1, 70, 98, 16, 2, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 27, 'option', 5, 'label_logo', 'yes', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 27, 'option', 6, 'stock', 'nametag', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 28, 'col', 2, 'organization', '', 1, 70, 98, 16, 2, '', 'center'); +INSERT INTO `reports_items` VALUES ('', 28, 'option', 5, 'label_logo', 'yes', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 28, 'option', 6, 'stock', 'nametag', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 29, 'col', 2, 'title', '', 1, 55, 98, 40, 2, '', 'left'); +INSERT INTO `reports_items` VALUES ('', 29, 'option', 6, 'stock', '5961', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 30, 'option', 5, 'label_logo', 'yes', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 30, 'distinct', 0, 'pn', '', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 8, 'option', 5, 'label_logo', 'no', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 8, 'option', 4, 'label_fairname', 'no', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 8, 'option', 2, 'allow_multiline', 'no', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 8, 'option', 1, 'group_new_page', 'no', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 8, 'col', 3, 'grade', '', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 8, 'col', 1, 'title', '', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 8, 'col', 0, 'pn', '', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 8, 'option', 3, 'label_box', 'no', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 8, 'option', 0, 'type', 'csv', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 8, 'sort', 0, 'nom_awards', '', 0, 0, 0, 0, 0, '', ''); +INSERT INTO `reports_items` VALUES ('', 8, 'sort', 1, 'pn', '', 0, 0, 0, 0, 0, '', ''); + + + diff --git a/db/db.update.48.sql b/db/db.update.48.sql new file mode 100644 index 00000000..d512fdb9 --- /dev/null +++ b/db/db.update.48.sql @@ -0,0 +1,22 @@ +-- Example how to add a new report to the system, without knowing the +-- report ID. This adds report #34 to the system, if applied directly +-- after the last SQL update + +INSERT INTO `reports` (`id`, `name`, `desc`, `creator`, `type`) VALUES +('', 'Labels -- Table Labels (small)', 'Labels to go on each table', 'The Grant Brothers', 'student'); + +INSERT INTO `reports_items` (`id`, `reports_id`, `type`, `ord`, `field`, `value`, `x`, `y`, `w`, `h`, `lines`, `face`, `align`) VALUES +('', LAST_INSERT_ID(), 'col', 3, 'categorydivision', '', 1, 85, 98, 7, 1, '', 'center'), +('', LAST_INSERT_ID(), 'col', 2, 'pn', '', 1, 20, 98, 35, 1, '', 'center'), +('', LAST_INSERT_ID(), 'col', 1, 'title', '', 1, 5, 98, 24, 3, '', 'center'), +('', LAST_INSERT_ID(), 'sort', 0, 'pn', '', 0, 0, 0, 0, 0, '', ''), +('', LAST_INSERT_ID(), 'option', 4, 'label_fairname', 'yes', 0, 0, 0, 0, 0, '', ''), +('', LAST_INSERT_ID(), 'option', 3, 'label_box', 'yes', 0, 0, 0, 0, 0, '', ''), +('', LAST_INSERT_ID(), 'option', 2, 'allow_multiline', 'no', 0, 0, 0, 0, 0, '', ''), +('', LAST_INSERT_ID(), 'col', 0, 'bothnames', '', 1, 70, 98, 14, 2, '', 'center'), +('', LAST_INSERT_ID(), 'distinct', 0, 'pn', '', 0, 0, 0, 0, 0, '', ''), +('', LAST_INSERT_ID(), 'option', 5, 'label_logo', 'yes', 0, 0, 0, 0, 0, '', ''), +('', LAST_INSERT_ID(), 'option', 1, 'group_new_page', 'no', 0, 0, 0, 0, 0, '', ''), +('', LAST_INSERT_ID(), 'option', 0, 'type', 'label', 0, 0, 0, 0, 0, '', ''), +('', LAST_INSERT_ID(), 'option', 6, 'stock', '5964', 0, 0, 0, 0, 0, '', ''); +