Convert LDAP / Active Directory authentication to use native PHP LDAP… (#2746)
[openemr.git] / contrib / forms / leg_length / C_FormLegLength.class.php
blobb5514227f1d9125b2b3ad31dd888d53b462a77a5
1 <?php
2 // Copyright (C) 2009 Aron Racho <aron@mi-squared.com>
3 //
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
14 var $template_dir;
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);
37 } else {
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") {
49 return;
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'])) {
60 addForm(
61 $GLOBALS['encounter'],
62 "Extremities measurements",
63 $this->form->id,
64 "leg_length",
65 $GLOBALS['pid'],
66 $_SESSION['userauthorized']
68 $_POST['process'] = "";
71 return;