$data['personell_nr'] = $nr; $data['role_nr'] = 16; // 16 = nurse (role person) $data['location_type_nr'] = 1; // 1 = dept (location type) $data['location_nr'] = $dept_nr; $data['date_start'] = date('Y-m-d'); } $data['modify_id'] = $_SESSION['sess_user_name']; switch ($mode) { case 'save': $data['history'] = "Add: " . date('Y-m-d H:i:s') . " = " . $_SESSION['sess_user_name'] . "\n"; $data['create_id'] = $_SESSION['sess_user_name']; $data['create_time'] = date('YmdHis'); $pers_obj->setDataArray($data); if (!$pers_obj->insertDataFromInternalArray()) { echo "{$obj->sql}<br>{$LDDbNoSave}"; } break; case 'update': $data['history'] = $pers_obj->ConcatHistory("Update: " . date('Y-m-d H:i:s') . " = " . $_SESSION['sess_user_name'] . "\n"); $pers_obj->setDataArray($data); $data['modfiy_id'] = $_SESSION['sess_user_name']; $data['modify_time'] = date('YmdHis'); if (!$pers_obj->updateDataFromInternalArray($item_nr)) { echo "{$obj->sql}<br>{$LDDbNoUpdate}"; } break; case 'delete': $data['status'] = 'deleted'; $data['date_end'] = date('Y-m-d');
$_POST['date_join'] = @formatDate2STD($_POST['date_join'], $date_format); } if ($_POST['date_exit']) { $_POST['date_exit'] = @formatDate2STD($_POST['date_exit'], $date_format); } if ($_POST['contract_start']) { $_POST['contract_start'] = @formatDate2STD($_POST['contract_start'], $date_format); } if ($_POST['contract_end']) { $_POST['contract_end'] = @formatDate2STD($_POST['contract_end'], $date_format); } $_POST['create_id'] = $encoder; $_POST['create_time'] = date('YmdHis'); $_POST['history'] = "Create: " . date('Y-m-d H:i:s') . " = " . $encoder . "\n"; $personell_obj->setDataArray($_POST); if ($personell_obj->insertDataFromInternalArray()) { # Get the PID $oid = $db->Insert_ID(); $personell_nr = $personell_obj->LastInsertPK('nr', $oid); header("location: personell_register_show.php" . URL_REDIRECT_APPEND . "&personell_nr={$personell_nr}&origin=admit&target=personell_reg&newdata={$newdata}"); exit; } else { $error = TRUE; } } // end of if(update) else() } // end of if($error) if ($error) { header("location: {$thisfile}" . URL_REDIRECT_APPEND . "&personell_nr={$personell_nr}&error=1"); exit;