From 708300ba1d8fc65eb85bcf28f4677163375ea6f1 Mon Sep 17 00:00:00 2001 From: sunsetsystems Date: Fri, 9 May 2008 23:37:19 +0000 Subject: [PATCH] new form for sports teams --- contrib/forms/strength_conditioning/info.txt | 1 + contrib/forms/strength_conditioning/new.php | 25 ++++++++++++++ contrib/forms/strength_conditioning/report.php | 47 ++++++++++++++++++++++++++ contrib/forms/strength_conditioning/table.sql | 18 ++++++++++ contrib/forms/strength_conditioning/view.php | 25 ++++++++++++++ 5 files changed, 116 insertions(+) create mode 100644 contrib/forms/strength_conditioning/info.txt create mode 100644 contrib/forms/strength_conditioning/new.php create mode 100644 contrib/forms/strength_conditioning/report.php create mode 100644 contrib/forms/strength_conditioning/table.sql create mode 100644 contrib/forms/strength_conditioning/view.php diff --git a/contrib/forms/strength_conditioning/info.txt b/contrib/forms/strength_conditioning/info.txt new file mode 100644 index 000000000..a8dadd341 --- /dev/null +++ b/contrib/forms/strength_conditioning/info.txt @@ -0,0 +1 @@ +Strength and Conditioning diff --git a/contrib/forms/strength_conditioning/new.php b/contrib/forms/strength_conditioning/new.php new file mode 100644 index 000000000..fa6bc07f3 --- /dev/null +++ b/contrib/forms/strength_conditioning/new.php @@ -0,0 +1,25 @@ + +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. + +$spreadsheet_form_name = 'strength_conditioning'; +$spreadsheet_title = 'Strength and Conditioning'; +include_once("../../globals.php"); +include_once("$srcdir/spreadsheet.inc.php"); +?> diff --git a/contrib/forms/strength_conditioning/report.php b/contrib/forms/strength_conditioning/report.php new file mode 100644 index 000000000..fc51a9bd4 --- /dev/null +++ b/contrib/forms/strength_conditioning/report.php @@ -0,0 +1,47 @@ + +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. + +include_once("../../globals.php"); +include_once($GLOBALS["srcdir"] . "/api.inc"); + +function strength_conditioning_report($pid, $encounter, $cols, $id) { + /**** + $cols = 1; // force always 1 column + $count = 0; + $data = sqlQuery("SELECT * " . + "FROM form_treatment_protocols WHERE " . + "id = '$id'"); + if ($data) { + print "\n\n"; + foreach($data as $key => $value) { + if ($key == "id" || $key == "pid" || $key == "user" || $key == "groupname" || + $key == "authorized" || $key == "activity" || $key == "date" || + $value == "" || $value == "0" || $value == "0.00") { + continue; + } + + if ($key == 'followup_required') { + switch ($value) { + case '1': $value = 'Yes'; break; + case '2': $value = 'Pending investigation'; break; + } + } + + $key=ucwords(str_replace("_"," ",$key)); + print "\n"; + $count++; + if ($count == $cols) { + $count = 0; + print "\n\n"; + } + } + print "\n
$key: $value  
\n"; + } + ****/ +} +?> diff --git a/contrib/forms/strength_conditioning/table.sql b/contrib/forms/strength_conditioning/table.sql new file mode 100644 index 000000000..975eed395 --- /dev/null +++ b/contrib/forms/strength_conditioning/table.sql @@ -0,0 +1,18 @@ +# id is the form ID. Negative form IDs are used for the templates. +# (rownbr, colnbr) start at (0, 0) for cell data. (-1, -1) is used for the +# template name. +# +# datatype is one of: +# 0 = unused cell +# 1 = static text +# 2 = checkbox +# 3 = text input +# +CREATE TABLE IF NOT EXISTS form_strength_conditioning ( + id int NOT NULL, + rownbr int NOT NULL DEFAULT 0, + colnbr int NOT NULL DEFAULT 0, + datatype tinyint NOT NULL DEFAULT 0, + value varchar(255) DEFAULT NULL, + PRIMARY KEY (id, rownbr, colnbr) +) TYPE=MyISAM; diff --git a/contrib/forms/strength_conditioning/view.php b/contrib/forms/strength_conditioning/view.php new file mode 100644 index 000000000..fa6bc07f3 --- /dev/null +++ b/contrib/forms/strength_conditioning/view.php @@ -0,0 +1,25 @@ + +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. + +$spreadsheet_form_name = 'strength_conditioning'; +$spreadsheet_title = 'Strength and Conditioning'; +include_once("../../globals.php"); +include_once("$srcdir/spreadsheet.inc.php"); +?> -- 2.11.4.GIT