2 // Copyright (C) 2009 Aron Racho <aron@mi-squared.com>
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License
6 // as published by the Free Software Foundation; either version 2
8 require_once($GLOBALS['fileroot'] . "/library/forms.inc");
9 require_once("FormLegLength.class.php");
11 class C_FormLegLength
extends Controller
16 function __construct($template_mod = "general")
18 parent
::__construct();
19 $this->template_mod
= $template_mod;
20 $this->template_dir
= dirname(__FILE__
) . "/templates/";
21 $this->assign("FORM_ACTION", $GLOBALS['web_root']);
22 $this->assign("DONT_SAVE_LINK", $GLOBALS['form_exit_url']);
23 $this->assign("STYLE", $GLOBALS['style']);
26 function default_action()
28 $form = new FormLegLength();
29 $this->assign("data", $form);
30 return $this->fetch($this->template_dir
. $this->template_mod
. "_new.html");
33 function view_action($form_id)
35 if (is_numeric($form_id)) {
36 $form = new FormLegLength($form_id);
38 $form = new FormLegLength();
41 $dbconn = $GLOBALS['adodb']['db'];
42 $this->assign("data", $form);
43 return $this->fetch($this->template_dir
. $this->template_mod
. "_new.html");
46 function default_action_process()
48 if ($_POST['process'] != "true") {
52 $this->form
= new FormLegLength($_POST['id']);
53 parent
::populate_object($this->form
);
54 $this->form
->persist();
55 if ($GLOBALS['encounter'] == "") {
56 $GLOBALS['encounter'] = date("Ymd");
59 if (empty($_POST['id'])) {
61 $GLOBALS['encounter'],
62 "Extremities measurements",
66 $_SESSION['userauthorized']
68 $_POST['process'] = "";