$_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; } } else { $person_obj->setPID($pid);