Ejemplo n.º 1
0
         $_POST['contract_start'] = @formatDate2STD($_POST['contract_start'], $date_format);
     }
     if ($_POST['contract_end']) {
         $_POST['contract_end'] = @formatDate2STD($_POST['contract_end'], $date_format);
     } else {
         $_POST['contract_end'] = DBF_NODATE;
     }
     $_POST['modify_id'] = $encoder;
     $_POST['modify_time'] = date('YmdHis');
     $_POST['history'] = $personell_obj->ConcatHistory("Update: " . date('Y-m-d H:i:s') . " = " . $encoder . "\n");
     # Disable the pid variable
     if (isset($_POST['pid'])) {
         unset($_POST['pid']);
     }
     $personell_obj->setDataArray($_POST);
     if ($personell_obj->updateDataFromInternalArray($personell_nr)) {
         header("location: personell_register_show.php" . URL_REDIRECT_APPEND . "&personell_nr={$personell_nr}&origin=admit&target=personell_reg&newdata={$newdata}");
         exit;
     } else {
         $error = TRUE;
     }
 } else {
     $newdata = 1;
     if (!$personell_obj->InitPersonellNrExists($GLOBAL_CONFIG['personell_nr_init'])) {
         $_POST['nr'] = $GLOBAL_CONFIG['personell_nr_init'];
     }
     if ($_POST['date_join']) {
         $_POST['date_join'] = @formatDate2STD($_POST['date_join'], $date_format);
     }
     if ($_POST['date_exit']) {
         $_POST['date_exit'] = @formatDate2STD($_POST['date_exit'], $date_format);
Ejemplo n.º 2
0
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');
        $data['history'] = $pers_obj->ConcatHistory("Deleted: " . date('Y-m-d H:i:s') . " = " . $_SESSION['sess_user_name'] . "\n");
        $data['modfiy_id'] = $_SESSION['sess_user_name'];
        $data['modify_time'] = date('YmdHis');
        $pers_obj->setDataArray($data);
        if (!$pers_obj->updateDataFromInternalArray($item_nr)) {
            echo "{$obj->sql}<br>{$LDDbNoUpdate}";
        }
}
header("location:nursing-or-dienst-personalliste.php" . URL_REDIRECT_APPEND . "&saved=1&retpath={$retpath}&ipath={$ipath}&dept_nr={$dept_nr}&nr={$nr}");
 $ref_buffer['duty_2_txt'] = serialize($arr_2_txt);
 $ref_buffer['duty_3_txt'] = serialize($arr_3_txt);
 $ref_buffer['duty_1_pnr'] = serialize($arr_1_pnr);
 $ref_buffer['duty_2_pnr'] = serialize($arr_2_pnr);
 $ref_buffer['duty_3_pnr'] = serialize($arr_3_pnr);
 $ref_buffer['dept_nr'] = $dept_nr;
 $ref_buffer['role_nr'] = 15;
 $ref_buffer['year'] = $pyear;
 $ref_buffer['month'] = $pmonth;
 $ref_buffer['modify_id'] = $_SESSION['sess_user_name'];
 if ($dpoc_nr = $pers_obj->DOCDutyplanExists($dept_nr, $pyear, $pmonth)) {
     $ref_buffer['history'] = $pers_obj->ConcatHistory("Update: " . date('Y-m-d H:i:s') . " = " . $_SESSION['sess_user_name'] . "\n");
     $ref_buffer['modify_time'] = date('YmdHis');
     // Point to the internal data array
     $pers_obj->setDataArray($ref_buffer);
     if ($pers_obj->updateDataFromInternalArray($dpoc_nr)) {
         # Remove the cache plan
         if (date('Yn') == "{$pyear}{$pmonth}") {
             $pers_obj->deleteDBCache('DOCS_' . date('Y-m-d'));
         }
         header("location:{$thisfile}?sid={$sid}&lang={$lang}&saved=1&dept_nr={$dept_nr}&pyear={$pyear}&pmonth={$pmonth}&retpath={$retpath}");
         exit;
     } else {
         echo "<p>" . $pers_obj->getLastQuery . "<p>{$LDDbNoSave}";
     }
 } else {
     $ref_buffer['history'] = "Create: " . date('Y-m-d H:i:s') . " = " . $_SESSION['sess_user_name'] . "\n";
     $ref_buffer['create_id'] = $_SESSION['sess_user_name'];
     $ref_buffer['create_time'] = date('YmdHis');
     // Point to the internal data array
     $pers_obj->setDataArray($ref_buffer);