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') {
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
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....");