res=run_sql("SELECT sbmSUBMISSIONS.* FROM sbmSUBMISSIONS,sbmACTION WHERE sactname=action and email=%s and id!='' "+docselect+" ORDER BY doctype,"+reqorder,(u_email,))
currentdoctype=""
currentaction=""
currentstatus=""
submissions=[]
forrowinres:
ifcurrentdoctype!=row[1]:
currentdoctype=row[1]
currentaction=""
currentstatus=""
res2=run_sql("SELECT ldocname FROM sbmDOCTYPE WHERE sdocname=%s",(currentdoctype,))
ifres2:
ldocname=res2[0][0]
else:
ldocname="""***Unknown Document Type - (%s)"""%(currentdoctype,)
ifcurrentaction!=row[2]:
currentaction=row[2]
res2=run_sql("SELECT lactname FROM sbmACTION WHERE sactname=%s",(currentaction,))