def Main(): cityFX.setupPage() form = cgi.FormContent() try: userKey = form["userKey"][0] cityID = form["city"][0] day = form["day"][0] mydb.query("DELETE from users WHERE userID = "+userKey+" ") mydb.query("INSERT into users VALUES("+userKey+", "+day+", '"+cityID+"')") except: style.SendError("oops") print """<P>You are now ready to begin the Archived Forecasting Activity. You will be presented with hourly data and asked to make some forecasts valid for your city. Good luck. """ print '<P>Lets go: <a href="hour.py">Start Exercise</a>' cityFX.finishPage()
def Main(): cityFX.setupPage() form = cgi.FormContent() mode = "b" if form.has_key("mode"): mode = form["mode"][0] if form.has_key("starttime"): # We must be posting a new case startTime = form["starttime"][0] endTime = form["endtime"][0] insertCase(startTime, endTime) elif mode == "r": # We need to release a case caseID = form["caseID"][0] releaseCase( caseID ) elif mode == "v": caseID = form["caseID"][0] revokeCase( caseID ) print """ <TABLE width="100%"> <TR> <TH>Release Cases:</TH> <TH>Revoked Cases:</TH> </TR> <TR> <TD>""" releasedCases() print "</TD><TD>" revokedCases() print "</TD></TR></TABLE>" print '<BR><BR>' createCaseDialog() print '<P><a href="/admin">Back to Admin Page</a>' cityFX.finishPage()
def Main(): form = cgi.FormContent() cityFX.setupPage() print """<P><B>Welcome</b> to the Archived City Forecasting Activity. This activity presents weather data in an hourly format and you are asked to forecast the weather for a city of your choice. In order to start the exercise, you need to select a case date to work and a city to forecast for.""" if form.has_key("day"): day = form["day"][0] userKey = form["userKey"][0] cityDialog(day, userKey) else: userKey = initUser() dayDialog(userKey) cityFX.finishPage()