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
19 $encounter = date("Ymd");
20 //$newid=mysql_insert_id($GLOBALS['dbh']); // last id
21 if($GLOBALS['lastidado'] >0)
22 $newid = $GLOBALS['lastidado'];
24 $newid=mysql_insert_id($GLOBALS['dbh']); // last id
26 addForm($encounter, "Habits", $newid, "habits", $pid, $userauthorized);
30 formJump("./print.php?id=$id");