######################################################################## # #This is Aubit 4gl demo for CGI/HTML functionality # # $Id: simple_html.4gl,v 1.5 2007/06/05 18:06:21 fortiz Exp $ # ######################################################################## globals "libahtmllib.4gl" ################################### main ################################### let do_debug = false # let do_debug = true # let g_css="none" let g_css="gray-blue" call html_init(g_css) call select_page() end main #this should produce highlited background on only this line: #
From: Steve Mathis #
################################### function select_page() ################################### define dummy smallint case upshift(item) when "FORM" call html_head("Form Test") call show_formpage() when "SUBMIT SUBSCRIPTION" call html_head("Form Results") call process_form() when "DEBUG" call html_head("Debug") call show_webserver_vars_page() when "EXIT" call html_redirect("http://aubit4gl.sourceforge.net") otherwise #"INTRO" call html_head("Intro") call show_intropage() end case display "" end function ############################ function page_menu() ############################ define # passvar # char (40) #use this to pass variables from form to form tmp_char char(40) call html_start_center() display "" display " " display " " display " " display "
" # " display '
' display " " display " " display " " display " " display " " display " " display " " display " " display " " display " " # display " " display " " if do_debug then let tmp_char = "on" else let tmp_char = "off" end if display " " display "
" display "
" call html_end_center() # call html_hline() end function #################### function ccs_demo_fjs() #################### # display "" # display " " # display " CSS Example" # display " " # display "
" # display "
" # display " " # display " " # display " " # display " " # display "
" # display "
" # display " " # display " " # display "
Hello, world !
" # display "
" # display " " # display "" end function ################################### function show_intropage() ################################### define s1, s2, s3, s4, s5 char (300) call html_start_body() call page_menu() call html_heading("Overview",1) call html_display_para("This is demonstration of 4gl program compiled with Aubit 4gl compiler running as CGI program.") let s1 = "This is output of 4gl program compiled with Aubit compiler, running as CGI under Apache web server" let s2 = "You can input data in the form, watch client-side validation in action, and see results" let s3 = "This program will not perform any actions, and data you enter will not be recorded" let s4 = "All Aubit 4GL functionality is available: ODBC database connection, PDF generation, RPC, IM, etc..." call html_list(s4,s3,s2,s1) call html_display_para("Click on 'Form' button to start...") call standard_footer() call html_end_body() end function ############################### function show_formpage() ############################### define page_title char (300), tmp_char char(3) call JS_windowname() call JS_launchHelpWin() call JS_launchNewWin() call JS_startcode() call JS_ValidateEmail() call JS_ValidateForm() call JS_PageLoad() call JS_endcode() call html_start_body() call page_menu() call maximise_logo() call HTMLF_form_header() call HTMLF_transferValue() call HTMLF_tableFrameStart() display " " call HTMLF_email() # display " " display " " display " " call HTMLF_email_confirm() # display " " display " " display " " call HTMLF_countrylist() # display " " display " " display " " call HTMLF_firstName() # display " " display " " display " " call HTMLF_lastname() # display " " display " " display " " call HTMLF_loginname() # display " " display " " display " " call HTMLF_checkASPnews() # display " " display " " display " " call HTMLF_checkSiteNews() # display " " display " " display " " call HTMLF_TitleLine() display " " call HTMLF_radioItems() display " " call HTMLF_SubmitButton() display " " call HTMLF_TableFrameEnd() display " " if do_debug then let tmp_char = "on" else let tmp_char = "off" end if display " " call HTMLF_form_footer() call standard_footer() call html_end_body() end function ############################### function process_form() ############################### call html_start_body() call page_menu() call html_heading("Form entry results",1) display "You entered:

" display " Email address :", vread("email"), " (confirmed)
" display " Country :", vread("country"), "
" display " Your name is :", vread("first_name"), vread("last_name"), "
" display " Login name to be created :", vread("alias"), "
" if vread("ASPnews_notification") = "on" then display " You want to receive ASP newsletter
" else display " You don't want to receive ASP newsletter
" end if display " Subscription type will be :", vread("subscription_type"), "
" display "

Thank you for tesitng Aubit 4gl HTML functionality.
" call standard_footer() call html_end_body() end function ############################## function standard_footer() ############################## { call html_hline() call html_start_center() call html_link("http://aubit4gl.sourceforge.net","_blank","Aubit home page") call html_end_center() } display " " display " " display " " display " " display "
" display "
" display " " call html_link("http://aubit4gl.sourceforge.net","_blank","Aubit home page") display " " display "
" display "
" end function ############################# function maximise_logo() ############################# # call html_image("/images/maximiseorb.gif",54,51) # call html_image("/images/maximiselogo.gif",186,50) call html_start_center() # call html_image("http://aubit4gl.sourceforge.net/images/AubitLogoOnWhite.jpg",186,100) call html_image("http://aubit4gl.sourceforge.net/images/AubitLogoTPLight.gif",186,100) call html_end_center() end function #-------------------------------- EOF ---------------------------