another thing related to development version incrementation
[openemr.git] / interface / forms / CAMOS / save.php
blobf9b4a824a6caaa50fff65d171e300310ff141a66
1 <?php
2 //------------This file inserts your field data into the MySQL database
3 include_once("../../globals.php");
4 include_once("../../../library/api.inc");
5 include_once("../../../library/forms.inc");
6 include_once("../../../library/sql.inc");
7 include_once("./content_parser.php");
8 include_once("../../../library/formdata.inc.php");
10 if ($_GET["mode"] == "delete") {
11 foreach($_POST as $key => $val) {
12 if (substr($key,0,3) == 'ch_' and $val='on') {
13 $id = substr($key,3);
14 if ($_POST['delete']) {
15 sqlInsert("delete from form_CAMOS where id=$id");
16 sqlInsert("delete from forms where form_name like 'CAMOS%' and form_id=$id");
18 if ($_POST['update']) {
19 // Replace the placeholders before saving the form. This was changed in version 4.0. Previous to this, placeholders
20 // were submitted into the database and converted when viewing. All new notes will now have placeholders converted
21 // before being submitted to the database. Will also continue to support placeholder conversion on report
22 // views to support notes within database that still contain placeholders (ie. notes that were created previous to
23 // version 4.0).
24 $content = strip_escape_custom( $_POST['textarea_'.${id}] );
25 $content = add_escape_custom( replace($pid,$encounter,$content) );
26 sqlInsert("update form_CAMOS set content='$content' where id=$id");
32 $_SESSION["encounter"] = $encounter;
33 formHeader("Redirecting....");
34 formJump();
35 formFooter();