function pretty_type($type) { return select_type($type["id"], array("name"))["name"]; }
function exists_type($type) { return select_type($type) ? true : false; }
$page = null; $page = isset($_GET['page']) ? $_GET['page'] : "list"; $title = ucfirst("user"); $_SESSION['menu_active'] = 11; switch ($page) { case 'list': get_header($title); $query = select(); $add_button = "user.php?page=form"; include '../views/user/list.php'; get_footer(); break; case 'form': get_header(); $close_button = "user.php?page=list"; $query_type = select_type(); $query_branch = select_branch(); $id = isset($_GET['id']) ? $_GET['id'] : null; if ($id) { $row = read_id($id); $row->user_confirm_password = $row->user_password; $action = "user.php?page=edit&id={$id}"; } else { //inisialisasi $row = new stdClass(); //$get_code = get_user_code(); $row->user_code = false; $row->user_type_id = false; $row->user_name = false; $row->user_phone = false; $row->user_password = false;