Example #1
0
def modifyPlan():
	output="""<style>
	table {border-collapse: collapse;width: 100%;}
	th, td {text-align: left;padding: 8px;}
	tr:nth-child(even){background-color: #f2f2f2}
	</style>
	<table id="list" border=1>
	<h1>To Do List</h1>
	<tr><th>ID</th><th>CreateDate</th><th>ModifiedDate</th><th>TargetDate</th><th>Plan</th>
	</tr>"""
	tablerow="""
	<tr>
	<td>{}</td>
	<td>{}</td>
	<td>{}</td>
	<td contenteditable='true'>{}</td>
	<td contenteditable='true'>{}</td>
	<td><a href="http://localhost:9999/deletePlan/{}">delete</a></td>
	<td><a href="http://localhost:9999/updatePlan/{},{},{}/">Update</a></td>
	</tr>"""
	# find a way to read the the data from the updated row. functionality still missing.
	for id,createDate,modifiedDate,targetDate,plan in trackerDBoperations.TrackerDbOperations().listPlan():
		output += tablerow.format(id,createDate,modifiedDate,targetDate,plan,id,targetDate.replace('/','-'),plan,id)
	output+="""</table>
	"""
	return output + """
Example #2
0
def deletePlan(id):
	trackerDBoperations.TrackerDbOperations().deletePlan(id)
	goBack = """
	<caption><br>plan {} deleted</br></caption>
	<br><a href="http://localhost:9999/modifyPlan">go Back</a></br>
	<br><a href="http://localhost:9999/">Home Page</a></br>
	""".format(id)
	return goBack
Example #3
0
def updatePlan(targetDate,plan,id):
	trackerDBoperations.TrackerDbOperations().updatePlan(targetDate,plan,id)
	goBack = """
	<caption><br>plan {} update</br></caption>
	<br><a href="http://localhost:9999/modifyPlan">go Back</a></br>
	<br><a href="http://localhost:9999/">Home Page</a></br>
	""".format(id)
	return goBack
Example #4
0
def listPlan():
    output="""<style>
	table {border-collapse: collapse;width: 100%;}
	th, td {text-align: left;padding: 8px;}
	tr:nth-child(even){background-color: #f2f2f2}
	</style>
	<table border=1>
	<h1>To Do List</h1>
	<tr><th>ID</th><th>CreateDate</th><th>ModifiedDate</th><th>TargetDate</th><th>Plan</th>
	</tr>"""
    tablerow="""<tr>
	<td>{}</td>
	<td>{}</td>
	<td>{}</td>
	<td>{}</td>
	<td>{}</td>
	</tr>"""
    for id,createDate,modifiedDate,targetDate,plan in trackerDBoperations.TrackerDbOperations().listPlan():
        output += tablerow.format(id,createDate,modifiedDate,targetDate,plan)
    output+="</table>"
    return output + """
Example #5
0
def addPlan():
	targetTimeStamp = request.forms.get('targetTimeStamp')
	plan = request.forms.get('plan')
	trackerDBoperations.TrackerDbOperations().addPlan(targetTimeStamp,plan)
	return """Plan added  !!
Example #6
0
def deleteExpPlan():
	trackerDBoperations.TrackerDbOperations().deleteExpiredplan()
	return "done !!"