$_SESSION['p'] = $p;
} else {
    $p = $_SESSION['p'];
}
if ($pos == "") {
    $pos = $_SESSION['page'];
}
$_SESSION['page'] = $pos;
$a = new CategoryController($conn);
$a->lang = $lang;
$a->UserLevel = $UserLevel;
$a->UserID = $UserID;
$a->lang_str = $lang_str;
switch ($action) {
    case "list":
        $a->browse($p, 20, $pos);
        break;
    case "add":
        $a->add();
        break;
    case "edit":
        $a->edit($id);
        break;
    case "show":
        $a->show($id);
        break;
    case "save":
        $vars = $_POST;
        $vars['photo'] = $_FILES['photo'];
        //print_r($vars);return;
        $a->save($p, $vars);