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