Fixed php short tags
[openemr.git] / contrib / forms / habits / save.php
blobe4ee7334ba47ad25f538ffdbd7cda0d88121c58f
1 <?php
3 # file habits/save.php
4 # saves what cames from habits/new.php
6 include_once("../../globals.php");
7 include_once("$srcdir/api.inc");
8 include_once("$srcdir/forms.inc");
9 formHeader('Habits form submitted');
11 $_POST["smoke_quit"]=dateToDB ($_POST["smoke_quit"]);
13 $id = formSubmit('form_habits', $_POST);
15 //this function adds the form to a table wich creates a registry
16 //don't forget to add it in your save.php file.
17 // then it may be retrievable by the report menu
18 if ($encounter == "")
19 $encounter = date("Ymd");
20 //$newid=mysql_insert_id($GLOBALS['dbh']); // last id
21 if($GLOBALS['lastidado'] >0)
22 $newid = $GLOBALS['lastidado'];
23 else
24 $newid=mysql_insert_id($GLOBALS['dbh']); // last id
26 addForm($encounter, "Habits", $newid, "habits", $pid, $userauthorized);
30 formJump("./print.php?id=$id");
32 formFooter();