- modules/fotolab updated imagej to current version & some cod fixes to make it work
[care2x.git] / Care2007 / modules / registration_admission / include / save_admission_data.inc.php
blobe50e928a08232ae9620983f2372a03edd7636155
1 <?php
2 /*------begin------ This protection code was suggested by Luki R. luki@karet.org ---- */
3 if (eregi('save_admission_data.inc.php',$PHP_SELF))
4 die('<meta http-equiv="refresh" content="0; url=../">');
6 $obj->setDataArray($HTTP_POST_VARS);
8 switch($mode){
9 case 'create':
10 if($obj->insertDataFromInternalArray()) {
11 if(!$no_redirect){
12 header("location:".$thisfile.URL_REDIRECT_APPEND."&target=$target&type_nr=$type_nr&allow_update=1&pid=".$HTTP_SESSION_VARS['sess_pid']);
13 //echo "$obj->getLastQuery<br>$LDDbNoSave";
14 exit;
16 } else{
17 echo "$obj->getLastQuery<br>$LDDbNoSave";
18 $error=TRUE;
20 break;
21 case 'update':
22 $obj->where=' nr='.$nr;
23 if($obj->updateDataFromInternalArray($nr)) {
24 if(!$no_redirect){
25 header("location:".$thisfile.URL_REDIRECT_APPEND."&target=$target&type_nr=$type_nr&allow_update=1&pid=".$HTTP_SESSION_VARS['sess_pid']);
26 //echo "$obj->sql<br>$LDDbNoUpdate";
27 exit;
29 } else{
30 echo "$obj->getLastQuery<br>$LDDbNoUpdate";
31 $error=TRUE;
33 break;
34 }// end of switch