//setcookie(op_pflegelogbuch_user,$user);
$thisfile = basename($_SERVER['PHP_SELF']);
$breakfile = 'javascript:window.close()';
if (!isset($saal) || !$saal) {
    $saal = 1;
}
//default or room
$pdata = array();
$filetitles = array();
$template = array();
$datafound = false;
require_once $root_path . 'include/care_api_classes/class_department.php';
$dept_obj = new Department();
$dept_obj->preloadDept($dept_nr);
/* Load all operative departments */
$surgery_arr =& $dept_obj->getAllActiveWithSurgery();
/* Get list of all active OR numbers */
$ORNrs =& $dept_obj->getAllActiveORNrs();
function yesterday(&$fd, &$fm, &$fy, $minyr)
{
    if ($fd < 2) {
        if ($fm < 2) {
            if ($fy < $minyr) {
                return false;
            } else {
                $fy = $fy - 1;
                $fm = 12;
                $fd = 31;
            }
        } else {
            $fm = $fm - 1;
switch($retpath)
{
	case "docs": $breakfile='doctors.php'.URL_APPEND; break;
	case "op": $breakfile='op-doku.php'.URL_APPEND; break;
}
*/
/* default startpage */
$breakfile = $root_path . 'main/op-doku.php' . URL_APPEND;
$pday = date(j);
$pmonth = date(n);
$pyear = date(Y);
$abtarr = array();
$abtname = array();
$datum = date("d.m.Y");
/* Load the department list with oncall doctors */
$dept_DOC =& $dept_obj->getAllActiveWithSurgery();
if (is_array($dept_DOC)) {
    $dlen = sizeof($dept_DOC);
} else {
    $dlen = 0;
}
$ORNrs =& $dept_obj->getAllActiveORNrs();
if (is_object($ORNrs)) {
    $slen = $ORNrs->RecordCount();
} else {
    $slen = 0;
}
# Start Smarty templating here
/**
 * LOAD Smarty
 */