Exemple #1
0
function desplayDepartment($user, $tpl)
{
    $departDAO = new DepartmentDAO();
    $departs = $departDAO->getAllDepartments();
    if ($departs === null) {
        $tpl->assign("SETTINGS_DEPARTMENT_OPTION", "");
    } else {
        foreach ($departs as $depart) {
            if ($depart->getDepartmentID() === "1") {
                continue;
            }
            $tpl->assign("SETTINGS_DEPARTMENT_DEPARTID", $depart->getDepartmentID());
            $tpl->assign("SETTINGS_DEPARTMENT_DEPARTNAME", $depart->getDepartmentName());
            $tpl->parse("SETTINGS_DEPARTMENT_OPTION", ".department_option");
        }
    }
    $tpl->parse("SETTINGS_DEPARTMENT", "department");
}