2 * Written by Richard W.M. Jones <rich@merjis.com>.
3 * Copyright (C) 2004 Merjis Ltd.
4 * $Id: undelete_file_form.ml,v 1.2 2004/09/07 13:40:10 rich Exp $
15 open Cocanwiki_template
17 let template = get_template "undelete_file_form.html"
19 let run r (q : cgi) (dbh : Dbi.connection) (hostid, _, _) _ =
20 let id = int_of_string (q#param "id") in
22 let sth = dbh#prepare_cached "select name, name_deleted
24 where hostid = ? and id = ?" in
25 sth#execute [`Int hostid; `Int id];
28 match sth#fetch1 () with
29 [ `String name; `Null]
30 | [ `Null; `String name] -> name
31 | _ -> assert false in
33 template#set "id" (string_of_int id);
34 template#set "name" name;