psr12 fixes for new PHP_CodeSniffer (#4795)
[openemr.git] / contrib / forms / snellen / C_FormSnellen.class.php
blobd5a3ac0dda1ff4d2a384d04935e1bae30b998ffc
1 <?php
3 // Copyright (C) 2009 Aron Racho <aron@mi-squared.com>
4 //
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
9 require_once($GLOBALS['fileroot'] . "/library/forms.inc");
10 require_once("FormSnellen.class.php");
12 class C_FormSnellen 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 FormSnellen();
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 FormSnellen($form_id);
37 } else {
38 $form = new FormSnellen();
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 FormSnellen($_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 "Snellen Eye Exam",
63 $this->form->id,
64 "snellen",
65 $GLOBALS['pid'],
66 $_SESSION['userauthorized']
68 $_POST['process'] = "";
71 return;