You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
73 lines
2.0 KiB
73 lines
2.0 KiB
<?php |
|
|
|
// Copyright (C) 2009 Aron Racho <aron@mi-squared.com> |
|
// |
|
// 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 |
|
|
|
require_once($GLOBALS['fileroot'] . "/library/forms.inc"); |
|
require_once("FormSnellen.class.php"); |
|
|
|
class C_FormSnellen extends Controller |
|
{ |
|
var $template_dir; |
|
|
|
function __construct($template_mod = "general") |
|
{ |
|
parent::__construct(); |
|
$this->template_mod = $template_mod; |
|
$this->template_dir = dirname(__FILE__) . "/templates/"; |
|
$this->assign("FORM_ACTION", $GLOBALS['web_root']); |
|
$this->assign("DONT_SAVE_LINK", $GLOBALS['form_exit_url']); |
|
$this->assign("STYLE", $GLOBALS['style']); |
|
} |
|
|
|
function default_action() |
|
{ |
|
$form = new FormSnellen(); |
|
$this->assign("data", $form); |
|
return $this->fetch($this->template_dir . $this->template_mod . "_new.html"); |
|
} |
|
|
|
function view_action($form_id) |
|
{ |
|
if (is_numeric($form_id)) { |
|
$form = new FormSnellen($form_id); |
|
} else { |
|
$form = new FormSnellen(); |
|
} |
|
|
|
$dbconn = $GLOBALS['adodb']['db']; |
|
$this->assign("data", $form); |
|
return $this->fetch($this->template_dir . $this->template_mod . "_new.html"); |
|
} |
|
|
|
function default_action_process() |
|
{ |
|
if ($_POST['process'] != "true") { |
|
return; |
|
} |
|
|
|
$this->form = new FormSnellen($_POST['id']); |
|
parent::populate_object($this->form); |
|
$this->form->persist(); |
|
if ($GLOBALS['encounter'] == "") { |
|
$GLOBALS['encounter'] = date("Ymd"); |
|
} |
|
|
|
if (empty($_POST['id'])) { |
|
addForm( |
|
$GLOBALS['encounter'], |
|
"Snellen Eye Exam", |
|
$this->form->id, |
|
"snellen", |
|
$GLOBALS['pid'], |
|
$_SESSION['userauthorized'] |
|
); |
|
$_POST['process'] = ""; |
|
} |
|
|
|
return; |
|
} |
|
}
|
|
|