Exemplo n.º 1
0
def Main():
	form = cgi.FormContent()
	style.header("Edit Hourly Reports","white")
	style.std_top("Edit Hourly Reports")


	print '<B>Information:</B> <dd>This is the date and time selection page for the Severe Forecasting Excercise.</dd><BR>'
	print '<B>Instruction:</B> <dd>Select the desired day and time and then click on "submit."</dd><BR>'
	print '<B>Scope of this program:</B> <dd>This set of programs modifies ALL of the hourly annotations available to ALL excercises.</dd><BR>'
	print '<B>NOTE:</b><dd>If you are wanting to edit the preview for a case, you will want to edit the first hour that the exercise runs for.</dd>'
	print '<HR>'

	if form.has_key("caseNum"):
		print """
		<HR>
		<a href="hourly.py">Select a different Case</a><BR><HR>"""

		print '<form method="post" action="editHourly.py">'
		print '<input type="hidden" value="'+form["caseNum"][0]+'" name="caseNum">'
		listHours( form["caseNum"][0] )
	else:
		print '<form method="post" action="hourly.py">'
		listCases()

	print '<input type="submit" value="submit">'

	print '<HR>Links outta here:<HR>'
	print '<BR><a href="/admin">Admin Page</a>'	
Exemplo n.º 2
0
Arquivo: prev.py Projeto: akrherz/pals
def Main(): 
	form = FormContent()
 	if not form.has_key("url"): style.SendError("CGI ERROR")
	url = form["url"][0]


	style.header("Save Location","white")
	style.std_top("Save the file location")
        print '<a href="http://www.pals.iastate.edu/c2w/adm/search.html">New Search</a>--'
        print '<a href="http://www.pals.iastate.edu/c2w/adm/access.html">Enter a different username</a>'
        print '<HR>'

        mytime = os.popen('date', 'r').read()

	print '<form method=POST action="http://www.pals.iastate.edu/cgi-bin/C2W/prevsub.py">'
        print '<input type="hidden" name="url" value="'+url+'">'
	print '<table>'
	print '<tr>'
        print '<th align="right">Enter your username'
        print '<td><input type="text" name="user">'
	print '<tr>'
	print '<th align="right">Name the file for future reference:'
	print '<td><input type="text" name="title">'
	print '<tr>'
        print '<th align="right">'
        print '<td><input type="hidden" value="'+mytime+'" name="mytime">'
	print '<tr>'
	print '<th colspan=2 align="center">'
	print '<input type="submit" value="Submit">'
	print '</form>'	

        print '</table>\n'
	style.std_bot()
Exemplo n.º 3
0
def Main():
	checker()
	style.header("Your Score","/images/ISU_bkgrnd.gif")
	style.std_top("Your Sample Forecast Score")
	score = get_score()
	body(score)	
	style.std_bot()
Exemplo n.º 4
0
Arquivo: edit.py Projeto: akrherz/pals
def Main():
	style.header("Edit Annotation","white")

	form = cgi.FormContent()
	try:
		caseNum = form["caseNum"][0]
		className = form["className"][0]
	except:
		style.SendError("CGI Parse Error")

	entry = get_entry(caseNum, className)

	try:
		comment = entry[0][0]
	except IndexError:
		comment = "Write Something here"

	style.std_top('Edit entry for '+caseNum)
	print '<HR>'
	print '<a href="index.py?className='+className+'">Select a different Case</a><BR>'

        print '<form method="post" action="change.py">'
        print '<input type="hidden" name="className" value="'+className+'">'
	print '<input type="hidden" name="caseNum" value="'+str(caseNum)+'">'
	adds(comment)
	print '<input type="submit" value="Click to Save this Entry">'
	print '</form>'

	
	style.std_bot()
Exemplo n.º 5
0
def SendError(str):
	errmsg = escape(str)
	style.header("CGI ERROR","white")
	style.std_top("CGI ERROR")
	print "<H3><STRONG>" + errmsg + "</STRONG></H3>\n"
	style.std_bot()
	sys.exit(0)
Exemplo n.º 6
0
def Main():
    style.header("7/18/98 Answers", "/images/ISU_bkgrnd.gif")
    style.std_top("June 18, 1998 Answers")
    style.table_setter("400", "State", "Severe Weather type", "During time period")
    table()
    body()
    sys.exit(0)
Exemplo n.º 7
0
def Main():
	form = FormContent()
	
	if not form.has_key("user"): style.SendError("You did not input a user name")
        if not form.has_key("title"): style.SendError("no search title")
	
	user = form["user"][0]  
        title = form["title"][0]
        url = form["url"][0]
        mytime = form["mytime"][0]

	style.header("Saved Search","/images/ISU_bkgrnd.gif")

	insert = mydbase.query("INSERT INTO saved VALUES ('" + user + "', '" + url + "','" + title + "', '" + mytime + "')")

        style.std_top('Your title: '+title+' has been saved')
	print '<P>\nYour title can now be accessed by going to <a href="http://www.pals.iastate.edu/cgi-bin/C2W/places.py?user='******'">'
	print "Here</a>\n<BR>"
	print '<BR>\n<BR>\n<HR>\n'
	print 'Write down your username and title of your search for future reference.<BR>'
	print '<B>Username =></B>'
	print user 
	print "<BR>"
	print '<B>File Title =></B>'
	print title
	print "<BR><BR>"
	style.std_bot()
Exemplo n.º 8
0
def Main():
	form = FormContent()
	year = form["year"][0]
	month = form["month"][0]
	str_month = convert_month("0"+month)
	day = form["day"][0]
	city = form["city"][0]
	station = convert_station(city)
	style.header("IOWAWX Query results","white")
	style.std_top("Data for "+station+" on "+str_month+" "+day+" "+year+".")

	date = str_month+" "+day+", "+year

	high, low, rain, snow = query_db(city, year, month, day)
	sun_type = sun(int(high), int(low))
	high, low, rain, snow  = chk_data(high, low, rain, snow)


	table_header()

	result_table(date, sun_type, str(high), str(low), str(rain), str(snow))

	print '</TABLE>'

	print high, low, rain, snow, sun_type
Exemplo n.º 9
0
def Main(): 
        presults = ""

        form = FormContent()  
	if not form.has_key("user"): style.SendError("Enter an Username")
        user = form["user"][0]
	
	style.header("Your saved file locations","white")
	style.std_top("Titles of saved files")
	print '<a href="http://www.pals.iastate.edu/c2w/adm/search.html">New Search</a>--'
        print '<a href="http://www.pals.iastate.edu/c2w/adm/saves.html">Enter a different username</a>'
        print '<HR>'
        style.table_setter("650","Username:"******"Title:","Date:","Click to view file:")

        lresults = mydbase.query("select * from saved where user = '******'").getresult() 

        if len(lresults) > 0: 
                for i in range(len(lresults)): 
			url = lresults[i][1]
                        mytime = lresults[i][3]
                        title = lresults[i][2]
                        dresults = mydbase.query("select * from movies where url = '" + url + "'") 
                        dresults = dresults.getresult() 
                        filename = dresults[0][1]
			print '<tr>'
                        print '<TD ALIGN="LEFT" VALIGN="CENTER">'+user+'</TD>'
                        print '<TD ALIGN="LEFT" VALIGN="CENTER">'+title+'</TD>'
                        print '<TD ALIGN="LEFT" VALIGN="CENTER">'+mytime[4:10]+mytime[22:27]+'</TD>'
			print '<TD ALIGN="LEFT" VALIGN="CENTER"><a href="http://www.pals.iastate.edu/cgi-bin/C2W/file.py?url='+url+'">'+filename+'</a></TD>'
        else: 
                print "Your username not found" 
        print '</table>\n'
	style.std_bot()
Exemplo n.º 10
0
def Main():
	form = FormContent()
	if not form.has_key("string"): style.SendError("search string not found")
	if not form.has_key("field"): style.SendError("field not found")
	if not form.has_key("filename"): style.SendError("CGI ERROR")
	if not form.has_key("total"): style.SendError("CGI ERROR")

	string = form["string"][0]
	field = form["field"][0]
	filename = form["filename"][0]
	total = form["total"][0]

	style.header("Save your search results","/images/ISU_bkgrnd.gif")
	style.std_top("Save your search for "+string)

	print '<P><H3>Enter a username and title for your search</H3>' 
	print '<BR CLEAR="all">\n'
	
	print '<FORM METHOD=POST action="http://www.pals.iastate.edu/cgi-bin/C2W/submit.py">\n'
	print '<table>\n<tr>\n'
	print '<th align=right>Enter a Username:'******'<td>\n'
	print '<INPUT TYPE=text name="user">\n'
	print '<tr>\n<th align=right>Title of your search:'
	print '<td>\n'
	print '<INPUT TYPE=text name="title">\n'
	print '<INPUT TYPE=hidden name="string" value="'+string+'">\n'
	print '<input type=hidden name="field" value="'+field+'">\n'
	print '<input type=hidden name="filename" value="'+filename+'">\n'
	print '<input type=hidden name="total" value="'+total+'">'
	print '<tr>\n<th colspan="2" align=center>\n'
	print '<INPUT TYPE=submit value="Submit">\n'
	print '</FORM>\n'
	print '</table><BR><BR>'
	style.std_bot()
Exemplo n.º 11
0
def Main():
	style.header("Edit Severe Forecast results","white")
	style.std_top("Edit answer key for what case??")
	print '<form method="post" action="edit.py">'
	print '<BR>'
	which_days()
	closing()
	style.std_bot()
Exemplo n.º 12
0
def Main():
	style.header("Edit Annotation","white")
	descrip = get_entry()
	style.std_top('Edit entry for '+day)

	adds(descrip)

	sys.exit(0)
Exemplo n.º 13
0
def Main():
	style.header("Annotation Editor","white")
	style.std_top("Edit Entries")

	options()	
	selections()
	
	style.std_bot()
Exemplo n.º 14
0
def Main():
    form = FormContent()
    ztime = form["ztime"][0]
    events = form["events"][0]
    updates = form["updates"][0]

    update = mydb.query("INSERT into jun181998 VALUES('" + ztime + "','" + events + "','" + updates + "')")
    style.header("Worked", "/images/ISU_bkgrnd.gif")
    style.std_top("Hello")
Exemplo n.º 15
0
def Main():
	style.header("Edit Entries","white")
	entries = get_entry()
	style.std_top('Edit Results for '+day)
	current(entries)
	print '<HR>'
	new_ones()
	style.std_bot()

	sys.exit(0)
Exemplo n.º 16
0
def Main():
	style.header("Edit Hourly Reports","white")
	style.std_top("Which Day and Hour??")
	print '<form method="post" action="edit_hourly.py">'
	which_hours()
	print '<BR>'
	which_days()
	closing()
	style.std_bot()
	sys.exit()
Exemplo n.º 17
0
def Main():
	style.header("New Annotation","white")
	style.std_top("New One")
	print '<form method="post" action="add_annote.py">'
        print '<H3>Enter a day in the form mo.da.year (ex 06.09.1998)</H3>'
        print '<input type="text" name="day">'
        print '<H3>Enter description</H3>'
        print '<textarea name="descrip" cols="90" rows="20"></textarea>'
        print '<input type="submit" value="New Entry">'
	print '</form></body></html>'
	sys.exit(0)
Exemplo n.º 18
0
def Main():
	form = FormContent()  
        date = form["date"][0]
	if not form.has_key("date"): style.SendError("CGI ERROR")
	style.header(date+' Weather','/images/ISU_bkgrnd.gif')
	style.std_top("U. S. Weather Observations on "+date)
	intro(date)
	lister(date)
	ready(date)

	style.std_bot()
Exemplo n.º 19
0
Arquivo: day.py Projeto: akrherz/pals
def Main():
	day = determine_day()
	style.header('Access for '+day+' weather data','white')	
	style.std_top('Access '+day )
	print '<BR><TABLE><TR><TH align="right">'
	print 'Enter the password</TH>'
	print '<form method="post" action="adm/display.py">'
	print '<TD><input type="password" name="pass"></TD>'
	print '<input type="hidden" name="day" value="'+day+'">'
	print '</tr><tr><th colspan="2">'
	print '<input type="submit" value="Submit Request">'
	print '</form></td></tr></table>'
	style.std_bot()
Exemplo n.º 20
0
def Main():
	style.header("Keywords for Database","white")
	style.std_top("COMET Keyword Searches")
	print '<form method="post" action="http://www.pals.iastate.edu/cgi-bin/C2W/search.py">'
	words()
	print '<HR>'
	dirs()
	print '<HR>'
	fields()
	print '<HR>'
	print '<center><input type="submit" value="Search for keyword">'
	print '</form>'
	style.std_bot()
Exemplo n.º 21
0
def Main():
	form = FormContent()
	day = form["day"][0]
	passwd = form["pass"][0]
	checker(passwd)
	style.header('Data for '+day, 'white')
	style.std_top('Data for '+day)
	files = posix.listdir(data_src+day+'/data/')
	print '<multicol cols="3">'
	for file in files:
		print '<a href="'+url_ref+day+'/data/'+file+'">'
		print file+'</a><BR>'
	print '</multicol>'
	style.std_bot()
Exemplo n.º 22
0
def Main():
	form = cgi.FormContent()
	className = form["className"][0]
	style.header("Edit Introduction","white")
	style.std_top("Edit Case Introduction:")

	print '<form method="post" action="edit.py">'
	print '<input type="hidden" name="className" value="'+className+'">'
	listCases()

	print '<input type="submit" value="submit">'

	print '<HR>Links outta here:<HR>'
	print '<BR><a href="/admin">Admin Page</a>'	
Exemplo n.º 23
0
def Main():
	form = FormContent()
	if not form.has_key("string"): style.SendError("You did not input a search string")
	if not form.has_key("field"): style.SendError("no search field found")
	mystring = form["string"][0]
	field = form["field"][0]
	filename = form["filename"][0]

	style.header("C2W Search Results","white")
	style.std_top('Results of your search for "'+mystring+'"')
        print '<a href="http://www.pals.iastate.edu/c2w/adm/search.html">New Search</a>--'
	print '<a href="http://www.pals.iastate.edu/c2w/adm/access.html">Access Saved Search</a>'

	c2w.old_search(mystring,field,filename)	
	style.std_bot()	
Exemplo n.º 24
0
def Main():
	lresults = ""
	
	style.header("Previous Searches","white")
	style.std_top("Titles of Saved Searches")
	print '<a href="http://www.pals.iastate.edu/c2w/adm/search.html">New Search</a>--'
	print '<a href="http://www.pals.iastate.edu/c2w/adm/access.html">Enter a different username</a>'
	print '<HR>'
	print '<TABLE BORDER="1" WIDTH="650">\n<TR>\n'
	print '<TH ALIGN="LEFT" VALIGN="TOP" WIDTH="125">Username:</TH>' 
	print '<th ALIGN="LEFT" VALIGN="TOP" WIDTH="125">You Searched For:</TH>'
	print '<th ALIGN="LEFT" VALIGN="TOP" WIDTH="125">In directories:</TH>'
	print '<th ALIGN="LEFT" VALIGN="TOP" WIDTH="50">Entries Returned:</TH>'
	print '<TH align="left" VALIGN="top" WIDTH="225">Click title to view search:</th></TR>'


	form = FormContent()
	user = form["user"][0]

	if not form.has_key("user"): SendError("You did not input a username")

	lresults = mydbase.query("select * from users where user = '******'")
	lresults = lresults.getresult()
	if len(lresults) > 0:
		for i in range(len(lresults)):
			string = lresults[i][2]
			field = lresults[i][3]
			title = lresults[i][1]
			filename = lresults[i][4]
			total = lresults[i][5]
			print '<tr>'
			print '<form method=POST action="http://www.pals.iastate.edu/cgi-bin/search2.py">'
			print '<INPUT TYPE=hidden NAME="string" VALUE="'+string+'">\n'
			print '<input type=hidden name="field" value="'+field+'">\n'
			print '<input type=hidden name="filename" value="'+filename+'">\n'
			print '<TD ALIGN="LEFT" VALIGN="CENTER">'+user+'</TD>'
			print '<TD ALIGN="LEFT" VALIGN="CENTER">'+string+'</TD>'
			if filename == "%": filename = "All Directories"
			print '<TD ALIGN="LEFT" VALIGN="CENTER">'+filename+'</TD>'
			print '<TD ALIGN="CENTER" VALIGN="CENTER">',total,'</TD>'
			print '<TD ALIGN="LEFT" VALIGN="CENTER"><input type=submit value="'+title+'"></TD>'
			print '</form>\n</TR>'
	else:
		print "Your username not found"
	print '</table>\n'
	print '<BR><BR><BR>'
	style.std_bot()
Exemplo n.º 25
0
Arquivo: edit.py Projeto: akrherz/pals
def Main():
	style.header("Add a case to the system", "white")

	form = cgi.FormContent()
	caseType = form["caseType"][0]

	style.std_top("Add a case to the system")

	print '<form method="POST" action="addDay.py">'
	print '<input type="hidden" name="caseType" value="'+caseType+'">'
	print '<H3>Fill out the Form to add a case to the system:</H3>'

	print '<TABLE width="500">'
	print '<TR><TH></TH><TH>Year (4 digits):</TH><TH>Month:</TH><TH>Day:</TH><TH>Ztime:</TH></TR>'

	print '<TR><TH>Start At:</TH>'
	print '<TH><input type="text" MAXLENGTH="4" SIZE="5" name="start_yeer" value="20"></TH>'
	print '<TH>'
	months("start_month")
	print '</TH>'
	print '<TH><input type="text" name="start_day" maxlength="2" size="2"></TH>'
	print '<TH>'
	if caseType == "w":
		win_times("start_ztime")
	else:
		sum_times("start_ztime")
	print '</TH></TR>'

	print '<TR><TH>End At:</TH>'
	print '<TH><input type="text" MAXLENGTH="4" SIZE="5" name="end_yeer" value="20"></TH>'
	print '<TH>'
	months("end_month")
	print '</TH>'
	print '<TH><input type="text" name="end_day" maxlength="2" size="2"></TH>'
	print '<TH>'
	if caseType == "w":
		win_times("end_ztime")
	else:
		sum_times("end_ztime")
	print '</TH></TR></TABLE>'

	print '<input type="SUBMIT">'
	print '<input type="RESET">'

	print '</form>'

	style.std_bot()	
Exemplo n.º 26
0
def Main():
	form = cgi.FormContent()
	style.header("Edit Introduction","white")
	style.std_top("Edit Case Introduction")

	print """
	<B>Instructions:</B><BR>This page edits the case introduction that appears immediately on the
	forecasting exercise.  This introduction is the basis for all of the versions of the exercise."""


	print '<form method="post" action="edit.py">'
	listCases()

	print '<BR><input type="submit" value="submit">'

	print '<HR>Links outta here:<HR>'
	print '<BR><a href="/admin">Admin Page</a>'	
Exemplo n.º 27
0
def Main():
	style.header("Edit Hourly Reports","white")
	style.std_top("Edit Hourly Reports")

	print '<B>Information:</B> <dd>This is the date and time selection page for the Severe Forecasting Excercise.</dd><BR>'
	print '<B>Instruction:</B> <dd>Select the desired day and time and then click on "submit."</dd><BR>'
	print '<B>Scope of this program:</B> <dd>This edits the annotations for case days.</dd><BR>'
	print '<HR>'

	print '<form method="post" action="list.py">'

	print '<form method="POST" action="list_case.py">'
	load_days()
	print '<input type="submit" value="submit">'
	print '</form>'
	
	style.std_bot()
Exemplo n.º 28
0
Arquivo: file.py Projeto: akrherz/pals
def Main():
	form = FormContent() 
	if not form.has_key("url"): style.SendError("CGI ERROR")	
	url = form["url"][0]
	
	if form.has_key("comment"):
		comment = form["comment"][0]
		comment = regsub.gsub("'","&#180;",comment)
		update = mydbase.query("update comments set comments = '"+comment+"' where url = '"+url+"'")

	cresults = mydbase.query(" select * from comments where url = '" + url + "'").getresult()
	if len(cresults) == 0: style.SendError("CGI ERROR")
	src = cresults[0][0]
	comments = cresults[0][1]

	lookup = mydbase.query("select * from movies where url = '" + url + "'").getresult()
	if len(lookup) == 0: style.SendError("CGI ERROR")
	filename = lookup[0][1]
	

 	style.header('c2w=>'+filename,'/images/ISU_bkgrnd.gif') 
        style.std_top("Viewing COMET® Video Files")
	print '<U><center><H1>'+filename+'</H1></center></U>'
	print '<BR><B>1) You can view this file:</B>' 
	print '<center><a href="'+src+'">View '+filename+'</a></center>'
	
	print """
	<blockquote>
	You can also download this file by either holding down the shift key and then clicking
on the link, or on some systems, you need to hold the option key down.

	</blockquote>
	"""

	print "<BR><BR><B>2) You can look at / edit this file's comments:</B><BR>"
	print "<center>You can add your comments about this file to the end of this section."
	print '<form name="form2" method="POST" action="http://www.pals.iastate.edu/cgi-bin/C2W/file.py">'
	print '<textarea name="comment" cols="40" rows="10">'+comments+'</textarea>'
	print '<P>'
	print '<input type="hidden" name="url" value="'+url+'">'
	print '<input type="submit" value="Add my comment">'
	print '</form></center>'
	
	style.std_bot()
Exemplo n.º 29
0
def Main():
	style.header("Edit Annotation","white")
	entry = get_entry()
	try:
		comment = entry[0][1]
	except IndexError:
		comment = "Write Something here"
	try:
		analysis = entry[0][2]
	except IndexError: 
                analysis = "Write Something here"
	real = str(int(hour)-(17))
	style.std_top('Edit entry for '+day+' at '+real+' PM')

	adds(comment, analysis)
	
	style.std_bot()

	sys.exit(0)
Exemplo n.º 30
0
def Main():
	style.header("Edit Annotation","white")

	form = cgi.FormContent()
	try:
		secs = int(float(form["secs"][0]))
	except:
		style.SendError("CGI Parse Error")

	this_tuple = time.localtime(secs)
	yeer = str( time.strftime("%Y", this_tuple) )
	day = str( time.strftime("%d", this_tuple) )
	month = str( time.strftime("%m", this_tuple) )

	std_day = yeer+"_"+month+"_"+day

	table_name = "t"+str(yeer)

	entry = get_entry(str(secs), table_name)
	try:
		comment = entry[0][1]
	except IndexError:
		comment = "Write Something here"
	try:
		analysis = entry[0][2]
	except IndexError: 
                analysis = "Write Something here"

	real = time.strftime("%I %p", this_tuple)

	style.std_top('Edit entry for '+std_day+' at '+real)

	avail(std_day)

        print '<form method="post" action="add_hourly.py">'
	print '<input type="hidden" name="ticks" value="'+str(secs)+'">'
	print '<input type="hidden" name="table_name" value="'+table_name+'">'
	adds(comment, analysis)
	print '<input type="submit" value="Click to Save this Entry">'
	print '</form>'

	
	style.std_bot()