public class Search extends Session {
public void main() {
read registrations.xml;
show loginPage;
String id = receive id;
if (id is not in registrations.xml) exit loginErrorPage;
read cards.xml;
Element p;
if (id is in cards.xml) p = information from cards.xml;
else p = information from registrations.xml;
String filter = "";
while (true) {
show searchPage<[filter=filter,cards = generate cards using filter];
if ((receive action).equals("filter")) filter = filter;
if ((receive action).equals("update")) {
if ((receive pin) matches p) {
show updatePage<[fields = values from p];
update p with received values;
update cards.xml with p;
}
}
}
}
}
|