2 /*------begin------ This protection code was suggested by Luki R. luki@karet.org ---- */
3 if (eregi('save_immunization.inc.php',$PHP_SELF))
4 die('<meta http-equiv="refresh" content="0; url=../">');
6 require_once($root_path.'include/care_api_classes/class_immunization.php');
7 if(!isset($imm_obj)) $imm_obj=new Immunization
;
9 require_once($root_path.'include/inc_date_format_functions.php');
10 # Check date, default is today
11 if($HTTP_POST_VARS['date']) $HTTP_POST_VARS['date']=@formatDate2STD
($HTTP_POST_VARS['date'],$date_format);
12 else $HTTP_POST_VARS['date']=date('Y-m-d');
13 if($HTTP_POST_VARS['refresh_date']) $HTTP_POST_VARS['refresh_date']=@formatDate2STD
($HTTP_POST_VARS['refresh_date'],$date_format);
15 $imm_obj->setDataArray($HTTP_POST_VARS);
17 if($type&&$medicine&&$dosage&&$application_type_nr&&$application_by){
21 //if($HTTP_POST_VARS['date') $HTTP_POST_VARS['date']=@formatDate2STD($HTTP_POST_VARS['date'],$date_format);
22 //if($HTTP_POST_VARS['refresh_date') $HTTP_POST_VARS['date']=@formatDate2STD($HTTP_POST_VARS['refresh_date'],$date_format);
24 if($imm_obj->insertDataFromInternalArray())
26 header("location:".$thisfile.URL_REDIRECT_APPEND
."&mode=show&target=$target&pid=".$HTTP_SESSION_VARS['sess_pid']);
29 else echo "<br>$LDDbNoSave";
32 //$HTTP_POST_VARS['date']=@formatDate2STD($HTTP_POST_VARS['date'],$date_format);
33 //$imm_obj->setDataArray($HTTP_POST_VARS);
34 $imm_obj->setWhereCond("nr=$imm_nr");
35 if($imm_obj->updateDataFromInternalArray($dept_nr))
37 header("location:".$thisfile.URL_REDIRECT_APPEND
."&target=$target&pid=".$HTTP_SESSION_VARS['sess_pid']);
40 else echo "$sql<br>$LDDbNoUpdate";