t=t+"<A HREF=\"%s\" onClick=\"return confirm('Are you sure you want to quit this submission?')\">\n"%mainmenu
t=t+"<IMG SRC=\"%s/mainmenu.gif\" border=0 ALT=\"back to main menu\" align=right></A><BR><BR>\n"%images
t=t+"""
<HR>
<small>(1) you should take note of this number at the beginning of the submission, it will allow you to get your information back in case your browser crashes before the end of the submission.</small><BR>"""
# Add the summary window definition if needed
t=t+" <small>(2) mandatory fields appear in red in the 'Summary' window.</small><BR>\n"
returnwarningMsg("<center><font color=red>Sorry, you must log in to perform this action. Please use the top right menu to do so.</font></center>",req,cdsname,ln)
# If we are in the last step of an action, we can update the "journal of submissions"
iflast_step==1:
ifuid_email!=""anduid_email!="guest"andrn!="":
res=run_sql("SELECT * FROM sbmSUBMISSIONS WHERE doctype=%s and action=%s and id=%s and email=%s",(doctype,act,access,uid_email,))
iflen(res)==0:
run_sql("INSERT INTO sbmSUBMISSIONS values(%s,%s,%s,'finished',%s,%s,NOW(),NOW())",(uid_email,doctype,act,access,rn,))
else:
run_sql("UPDATE sbmSUBMISSIONS SET md=NOW(),reference=%s,status='finished' WHERE doctype=%s and action=%s and id=%s and email=%s",(rn,doctype,act,access,uid_email,))
t=t+""" <BR><BR>
</TD>
</TR>
<TR class=submitHeader>
<TD class=submitHeader colspan=5 align=center>"""
iffinished==0:
t=t+"<small>Submission no</small>²:\n"
t=t+"<small>%s</small>\n"%access
else:
t=t+" \n"
t=t+"""
</TD>
</TR>
</TABLE>
</center>
</form>
<br>
<br>"""
# Add the "back to main menu" button
iffinished==0:
t=t+" <A HREF=\"%s\" onClick=\"return confirm('Are you sure you want to quit this submission?')\">\n"%mainmenu
else:
t=t+" <A HREF=\"%s\">\n"%mainmenu
t=t+"<IMG SRC=\"%s/mainmenu.gif\" border=0 ALT=\"back to main menu\" align=\"right\"></A><BR><BR>\n"%images
res2=run_sql("SELECT * FROM sbmIMPLEMENT LEFT JOIN sbmACTION on sbmACTION.sactname=sbmIMPLEMENT.actname WHERE docname=%s and displayed='Y' ORDER BY sbmIMPLEMENT.buttonorder",(docShortDesc,))
forarr2inres2:
res=run_sql("SELECT * FROM sbmACTION WHERE sactname=%s",(arr2[1],))
res=run_sql("SELECT * FROM sbmIMPLEMENT WHERE docname=%s and level!='0' and level=%s and score>%s ORDER BY score",(doctype,currentlevel,action_score,))
iflen(res)>0:
t=t+Request_Print("A","<BR><BR>You now have to<ul>")
first_score=res[0][10]
foriinrange(0,len(res)):
action=res[i]
ifaction[10]==first_score:
ifi>0:
t=t+Request_Print("A"," <b>or</b>");
res2=run_sql("SELECT dir FROM sbmACTION WHERE sactname=%s",(action[1],))
res=run_sql("SELECT * FROM sbmSUBMISSIONS WHERE doctype=%s and action=%s and id=%s and email=%s and status='finished'",(doctype,act,access,uid_email,))