package dynamic.people;

import dynamic.people.dblist.StaffList;

import java.io.BufferedWriter;
import java.io.IOException;
import java.util.HashMap;

public class PeopleHtmlFormatter {


    public static String webstub = "";

    static BufferedWriter f;

    protected static void tdclose(BufferedWriter f) throws IOException {f.write("</td>");}
    protected static void tr(BufferedWriter f) throws IOException {f.write("<tr>");}
    protected static void th(BufferedWriter f) throws IOException {f.write("<th>");}
    protected static void thclose(BufferedWriter f) throws IOException {f.write("</th>");}
    protected static void trclose(BufferedWriter f) throws IOException {f.write("</tr>");}

    public static void FormatOutput(StaffList sl, HashMap<String, String> image_lookup, String title, String fname, String type) {

        if (type.equals("list"))
            PeopleHtmlFormatterList.FormatOutput(sl, title, fname);
        else if (type.equals("pictures"))
            PeopleHtmlFormatterPictures.FormatOutput(sl, image_lookup, title, fname);
        else if (type.equals("pictures_short"))
            PeopleHtmlFormatterPicturesShort.FormatOutput(sl, image_lookup, title, fname);
        else
            System.out.println("title - " + title + " - unknown type - " + type);

    }


}
