From fcd6eedc1dc19d1ae1ee2d9a77e1a1fff4b9cd61 Mon Sep 17 00:00:00 2001 From: dave Date: Sun, 30 Dec 2007 21:45:04 +0000 Subject: [PATCH] - Add a new data field for counting the number of tshirts of each size - Add a system report that lists the number of tshirts of each size --- admin/reports_students.inc.php | 23 +++++++++++++++-------- db/db.code.version.txt | 2 +- db/db.update.95.sql | 14 ++++++++++++++ 3 files changed, 30 insertions(+), 9 deletions(-) create mode 100644 db/db.update.95.sql diff --git a/admin/reports_students.inc.php b/admin/reports_students.inc.php index cbc02234..34ca5c2d 100644 --- a/admin/reports_students.inc.php +++ b/admin/reports_students.inc.php @@ -143,6 +143,14 @@ $report_students_fields = array( 'table' => "DATE_FORMAT(FROM_DAYS(TO_DAYS(NOW())-TO_DAYS(students.dateofbirth)), '%Y')+0", 'table_sort' => 'students.dateofbirth'), + 'tshirt' => array( + 'name' => 'Student -- T-Shirt Size', + 'header' => 'T-Shirt', + 'width' => 0.55, + 'table' => 'students.tshirt', + 'value_map' => array ('none' => '', 'small' => 'Small', 'medium' => 'Medium', + 'large' => 'Large', 'xlarge' => 'X-Large')), + 'title' => array( 'name' => 'Project -- Title', 'header' => 'Project Title', @@ -313,14 +321,6 @@ $report_students_fields = array( 'table' => 'registrations.status', 'value_map' => array ('complete' => '', 'paymentpending' => 'No')), - 'tshirt' => array( - 'name' => 'T-Shirt Size', - 'header' => 'T-Shirt', - 'width' => 0.55, - 'table' => 'students.tshirt', - 'value_map' => array ('none' => '', 'small' => 'Small', 'medium' => 'Medium', - 'large' => 'Large', 'xlarge' => 'X-Large')), - 'awards' => array( 'name' => 'Award -- Type + Name (warning: duplicates student for multiple awards!)', 'header' => 'Award Name', @@ -513,6 +513,13 @@ $report_students_fields = array( 'table' => "GROUP_CONCAT(students.lastname, ',', students.firstname ORDER BY students.lastname SEPARATOR ':')", 'group_by' => array('students.registrations_id')), + 'special_tshirt_count' => array( + 'name' => 'Special -- T-Shirt Size Count', + 'header' => 'Count', + 'width' => 0.5, + 'table' => 'COUNT(*)', + 'group_by' => array('students.tshirt')), + ); diff --git a/db/db.code.version.txt b/db/db.code.version.txt index 49541f72..5595fa46 100644 --- a/db/db.code.version.txt +++ b/db/db.code.version.txt @@ -1 +1 @@ -94 +95 diff --git a/db/db.update.95.sql b/db/db.update.95.sql new file mode 100644 index 00000000..540ebdeb --- /dev/null +++ b/db/db.update.95.sql @@ -0,0 +1,14 @@ +INSERT INTO `reports` (`id`, `system_report_id`, `name`, `desc`, `creator`, `type`) VALUES + ('', '43', 'T-Shirt Size Count', 'A list of tshirt sizes (the blank entry is those students who have selected \"none\"), and the number of tshirts of each size.', '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(), 'option', 0, 'type', 'pdf', 0, 0, 0, 0, 0, '', ''), + ('', LAST_INSERT_ID(), 'option', 1, 'group_new_page', 'no', 0, 0, 0, 0, 0, '', ''), + ('', LAST_INSERT_ID(), 'option', 2, 'allow_multiline', 'no', 0, 0, 0, 0, 0, '', ''), + ('', LAST_INSERT_ID(), 'option', 3, 'label_box', 'no', 0, 0, 0, 0, 0, '', ''), + ('', LAST_INSERT_ID(), 'option', 4, 'label_fairname', 'no', 0, 0, 0, 0, 0, '', ''), + ('', LAST_INSERT_ID(), 'option', 5, 'label_logo', 'no', 0, 0, 0, 0, 0, '', ''), + ('', LAST_INSERT_ID(), 'option', 6, 'stock', 'fullpage', 0, 0, 0, 0, 0, '', ''), + ('', LAST_INSERT_ID(), 'col', 0, 'tshirt', '', 0, 0, 0, 0, 1, '', ' '), + ('', LAST_INSERT_ID(), 'col', 1, 'special_tshirt_count', '', 0, 0, 0, 0, 1, '', ' '), + ('', LAST_INSERT_ID(), 'sort', 0, 'tshirt', '', 0, 0, 0, 0, 1, '', ' ');