7 * @link http://www.open-emr.org
8 * @author Brady Miller <brady.g.miller@gmail.com>
9 * @copyright Copyright (c) 2019 Brady Miller <brady.g.miller@gmail.com>
10 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
13 require_once(__DIR__
. "/../../globals.php");
14 require_once("$srcdir/api.inc.php");
15 require_once("$srcdir/forms.inc.php");
17 use OpenEMR\Common\Csrf\CsrfUtils
;
19 if (!CsrfUtils
::verifyCsrfToken($_POST["csrf_token_form"])) {
20 CsrfUtils
::csrfNotVerified();
23 if ($encounter == "") {
24 $encounter = date("Ymd");
27 if ($_GET["mode"] == "new") {
28 $newid = formSubmit("form_dictation", $_POST, ($_GET["id"] ??
null), $userauthorized);
29 addForm($encounter, "Speech Dictation", $newid, "dictation", $pid, $userauthorized);
30 } elseif ($_GET["mode"] == "update") {
31 sqlStatement("update form_dictation set pid = ?,groupname=?,user=?,authorized=?,activity=1, date = NOW(), dictation=?, additional_notes=? where id=?", array($_SESSION["pid"],$_SESSION["authProvider"],$_SESSION["authUser"],$userauthorized,$_POST["dictation"],$_POST["additional_notes"],$_GET["id"]));
34 formHeader("Redirecting....");