#### End of routine to fetch doctors on duty
    } else {
        $ward_ok = false;
    }
} elseif ($mode == 'newdata') {
    if ($pn == 'lock' || $pn == 'unlock') {
        //$db->debug=true;
        if ($pn == 'lock') {
            $ward_obj->closeBed($ward_nr, $rm, $bd);
        } else {
            $ward_obj->openBed($ward_nr, $rm, $bd);
        }
        //header("location:nursing-station.php".URL_REDIRECT_APPEND."&edit=1&mode=&pday=$pday&pmonth=$pmonth&pyear=$pyear&station=$station&ward_nr=$ward_nr");
        //exit;
    } else {
        if ($ward_obj->AdmitInWard($pn, $ward_nr, $rm, $bd)) {
            //echo "ok";
            $ward_obj->setAdmittedInWard($pn, $ward_nr, $rm, $bd);
        }
        //header("location:nursing-station.php".URL_REDIRECT_APPEND."&edit=1&mode=&pday=$pday&pmonth=$pmonth&pyear=$pyear&station=$station&ward_nr=$ward_nr");
        //exit;
    }
    header("location:nursing-station.php" . URL_REDIRECT_APPEND . "&edit=1&mode=&pday={$pday}&pmonth={$pmonth}&pyear={$pyear}&station={$station}&ward_nr={$ward_nr}");
    exit;
}
# Start Smarty templating here
/**
 * LOAD Smarty
 */
# Note: it is advisable to load this after the inc_front_chain_lang.php so
# that the smarty script can use the user configured template theme