/[theodore]/openticket/requestwindow.cgi


UCC Code Repository

Contents of /openticket/requestwindow.cgi

Parent Directory Parent Directory | Revision Log Revision Log


Revision 18 - (show annotations) (download)
Fri Feb 1 04:56:07 2008 UTC (13 years, 5 months ago) by theodore
File size: 1194 byte(s)
Adding openticket base


1 #!/usr/bin/python
2 import cgi
3 import cgitb; cgitb.enable()
4 import time
5
6
7 def makesessionID(areaid):
8 id = str(areaid)[:2]
9 id += str(time.time())[-7:-3]
10 return id
11
12 form = cgi.FieldStorage()
13 httpheader = "Status: 200\nContent-Type: text/html\r\n\n" # HTML is following
14
15 if form.has_key('name'):
16 name = form['name'].value
17 else:
18 name = "Nameless Worker Drone"
19 if form.has_key('area'):
20 area = form['area'].value
21 else:
22 area = '00'
23 sessionID = makesessionID(area)
24
25 pagetoreturn = """
26 <html>
27 <head>
28 <title>Senior Request for name</title>
29 <script type="text/javascript" src="prototype.js" charset="utf-8"></script>
30 <script type="text/javascript" src="ticketwindow.js" charset="utf-8"></script>
31 </head>
32 <body onunload="deleteticket('sessID')">
33 <b>Senior Request Tool for name</b><hr>
34 <div id="infobar">Information about your tickets will appear here</div>
35 <form>
36 <input type="reset" value="Request a senior" onClick="requestticket('sessID','name')"/>
37 <input type="reset" value="Delete request" onClick="deleteticket('sessID')"/>
38
39 </form>
40 </body>
41
42 """
43 pagetoreturn = pagetoreturn.replace('name',name)
44 pagetoreturn = pagetoreturn.replace('sessID', sessionID)
45
46 print httpheader + pagetoreturn
47

Properties

Name Value
svn:executable *

Managed by UCC Webmasters ViewVC Help
Powered by ViewVC 1.1.26