define('LANG_FILE', 'doctors.php');
$local_user = '******';
require_once $root_path . 'include/inc_front_chain_lang.php';
if (!isset($dept_nr) || !$dept_nr) {
    header('Location:doctors-select-dept.php' . URL_REDIRECT_APPEND . '&retpath=' . $retpath);
    exit;
}
//$db->debug=1;
$thisfile = basename($_SERVER['PHP_SELF']);
$breakfile = "doctors-dienstplan.php" . URL_APPEND . "&dept_nr={$dept_nr}&pmonth={$pmonth}&pyear={$pyear}&retpath={$retpath}";
require_once $root_path . 'include/care_api_classes/class_department.php';
$dept_obj = new Department();
$dept_obj->preloadDept($dept_nr);
require_once $root_path . 'include/care_api_classes/class_personell.php';
$pers_obj = new Personell();
$pers_obj->useDutyplanTable();
if ($pmonth == '') {
    $pmonth = date('n');
}
if ($pyear == '') {
    $pyear = date('Y');
}
/* Establish db connection */
if (!isset($db) || !$db) {
    include $root_path . 'include/inc_db_makelink.php';
}
if ($dblink_ok) {
    if ($mode == 'save') {
        $arr_1_txt = array();
        $arr_2_txt = array();
        $arr_3_txt = array();