Пример #1
0
    } elseif ($request->GetVar('frm_action', 'post') == 'del') {
        $timetracker->del($request->GetVar('frm_timetrackerid', 'post'));
        $smarty->assign('tpl_editid', -1);
    } elseif ($request->GetVar('frm_timetrackerid', 'post') !== "") {
        $check = $timetracker->saveupdate();
        $smarty->assign('tpl_editid', -1);
    } else {
        $smarty->assign('tpl_editid', -1);
    }
}
if ($employeeid !== -1) {
    if ($request->GetVar('frm_action', 'post') == 'clear') {
        $ids = $request->GetVar('frm_cleared', 'post');
        for ($i = 0; $i < count($ids); $i++) {
            $timetracker->clear($ids[$i]);
        }
    }
    list($month, $year) = split('[/]', $theend);
    $theend = mktime(0, 0, 0, $month, 1, $year);
    list($month, $year) = split('[/]', $thestart);
    $thestart = mktime(0, 0, 0, $month, 1, $year);
    $times = $timetracker->gettimes($employeeid, $thestart, $theend, true, $thetype);
    if (count($times) > 1) {
        $smarty->assign('tpl_list', $times);
    } else {
        $smarty->assign('tpl_noresult', true);
    }
}
$smarty->assign('tpl_employee', $employee->getall());
$smarty->assign('tpl_dates', $timetracker->getdates());
$smarty->display('list_employeetime.tpl');
Пример #2
0
    }
    $theend = $month . '/' . $year;
}
if ($request->GetVar('frm_newstart', 'post') == "true") {
    list($month, $year) = split('[/]', $thestart);
    $month = number_format($month, 0, '', '');
    $year = number_format($year, 0, '', '');
    if ($month == 12) {
        $year = $year + 1;
        $month = 1;
    } else {
        $month = $month + 1;
    }
    $theend = $month . '/' . $year;
}
$employeeid = $request->GetVar('uid', 'session');
$smarty->assign('tpl_theemployeeid', $employeeid);
$smarty->assign('tpl_theend', $theend);
$smarty->assign('tpl_thestart', $thestart);
$smarty->assign("tpl_title", "Zeiten");
$smarty->assign('tpl_nav', 'list');
if ($employeeid !== -1) {
    list($month, $year) = split('[/]', $theend);
    $theend = mktime(0, 0, 0, $month, 1, $year);
    list($month, $year) = split('[/]', $thestart);
    $thestart = mktime(0, 0, 0, $month, 1, $year);
    $smarty->assign('tpl_list', $timetracker->gettimes($employeeid, $thestart, $theend, false));
}
$smarty->assign('tpl_employee', $employee->getall());
$smarty->assign('tpl_dates', $timetracker->getdates());
$smarty->display('list_employeetime.tpl');