$list = false; $catalog = new catalog(); $catalog->action = $a; switch ($a) { case 'delete': $catalog->delete($id); break; case 'create': $ret = $catalog->create($_POST); break; case 'update': $ret = $catalog->update($id, $_POST); break; default: $list = true; $ret = $catalog->browse(); } echo sprintf('<a href="?a=%1$s">%2$s</a>', $list ? 'create' : 'browse', $list ? 'Baru' : 'Daftar'); echo $ret; /** * Perform catalog operation */ class catalog { var $path_name; // real path name without ending (back)slash var $file_name; // file name with extension var $file_path; // full file name with path var $entries;