SynchronousViewController.borg

SynchronousViewController.borg


{
pagetext:"";
DISP(txt)::pagetext := pagetext + text(txt);
cell(bg,fg,txt)::
    {
    DISP(" ");
    DISP(txt);
    DISP("")
    };
tr()::DISP("");
rt()::DISP("");
printmonthtable(persons)::
    {
    DISP("");

    tr();
    cell(0,255,"Naam");
    x:1;
    while(x<=31,
        {
        cell(0,255,x);
        x := x + 1
        });
    rt();

    y:1;
    while(y<=size(persons),
        {
        x : 1;
        tr();
        DISP("");
        while(x<=31,
            {
            available:person[x + 1];
            if (available = 1,
                DISP(""),    
                DISP(""));
            x := x +1
            });
        y := y + 1;
        rt()
        });
    DISP("
); person : persons[y]; DISP(person[1]); DISP(">"); DISP(person[1]); DISP("..
") }; respondto(req,line,formdata):: { pagetext := ""; printmonthtable(july); req.display(pagetext); req.finish(); pagetext := "" }; createpersonhandler(person):: { reqnummer : 1; handleformdata(formdata):: { if (size(formdata) = 4, { fromrow:formdata[1]; torow:formdata[2]; staterow:formdata[3]; if ((fromrow[1] = "FROM") & (torow[1] = "TO") & (staterow[1] = "STATE"), { l : number(fromrow[2]); r : number(torow[2]); if(is_number(l) & is_number(r), { if (l < 1,l := 1,false); if (r > 31, r := 31, false); if (staterow[2] = "AVAIL", s : 1, s : 0); while(l < r + 1, { l := l + 1; person[l] := s }) },false) },false) },false) }; respondto(req,line,formdata):: { if (is_table(formdata), handleformdata(formdata), false); pagetext := "

Hello " + person[1] + "{" + text(reqnummer); reqnummer := reqnummer + 1; pagetext := pagetext + "}


Your current schedule looks like
"
; printmonthtable([person]); pagetext := pagetext + eoln + "

+"/get"+line+'"'+">"; pagetext := pagetext + ""; pagetext := pagetext + ""; pagetext := pagetext + ""; pagetext := pagetext + "
From:
To:
I am:
"; pagetext := pagetext + "

Back to Main Schedule"
; req.display(pagetext); req.finish() }; clone() }; true }