Fixed php short tags
[openemr.git] / contrib / forms / lab_results / save.php
blob3995f2422eef1803b6977fdccf6437ee992b090d
1 <?php
3 # file save.php.
5 include_once("../../globals.php");
6 include_once("$srcdir/api.inc");
7 include_once("$srcdir/forms.inc");
8 formHeader('Lab Results');
10 //main check to be sure it was finely called.
11 if ($_POST["action"]!="submit" ) {
12 die ("You should send the info from the form.");
13 }//eof main check
15 //echo ("debug passed if<br>");
17 # we are not using the standard function
18 # because of the file being uploaded.
19 // if succesfull we keep going with the form input to the table
21 $notes=addslashes (trim ($_POST['notes']) );
23 $now=date ("Y-m-d H:h:s");
25 $sql = "INSERT INTO `form_lab_results` SET
26 pid = {$_SESSION['pid']},
27 groupname='".$_SESSION['authProvider']."',
28 user='".$_SESSION['authUser']."',
29 authorized=$userauthorized,
30 activity=1,
31 date ='$now',
32 notes='$notes'
35 $result= sqlQuery ($sql); //query passed to db
38 //this function adds the form to a table wich creates a registry
39 // then it may be retrievable by the report menu
40 if ($encounter == "")
41 $encounter = date("Ymd");
42 //$newid=mysql_insert_id($GLOBALS['dbh']); // last id
43 if($GLOBALS['lastidado'] >0)
44 $newid = $GLOBALS['lastidado'];
45 else
46 $newid=mysql_insert_id($GLOBALS['dbh']); // last id
48 addForm($encounter, "Lab Results", $newid, "lab_results", $pid, $userauthorized);
51 // i don't get where this id cames from
52 // formJump("./print.php?id=$id");
53 formJump("./print.php?id=$newid");
55 formFooter();