1:- ensure_loaded(library(pillow)).
2
3main :-
4    get_form_input(Input),
5    get_form_value(Input,person_name,Name),
6    response(Name,Response),
7    output_html([
8        cgi_reply,
9        start,
10        title('Telephone database'),
11        heading(2,'Telephone database'),
12        --,
13        Response,
14        start_form,
15        'Click here, enter name of clip member, and press Return:',
16        \\,
17        input(text,[name=person_name,size=20]),
18        end_form,
19        end]).
20
21response(Name, Response) :-
22    form_empty_value(Name) ->
23       Response = []
24  ; phone(Name, Phone) ->
25       Response = ['Telephone number of ',b(Name),': ',Phone,$]
26  ; Response = ['No telephone number available for ',b(Name),'.',$].
27
28phone(daniel, '336-7448').
29phone(manuel, '336-7435').
30phone(sacha,  '543-5316').
31
32