$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);
     //echo "create";
     if ($pers_obj->insertDataFromInternalArray()) {
         # Remove the cache plan