home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 8 / CDACTUAL8.iso / progs / ite / ite10d1.exe / DATA.Z / GUEST.JFM < prev    next >
Encoding:
Text File  |  1996-09-07  |  8.4 KB  |  315 lines

  1. /****************************************************************************\
  2. *                                                                            *
  3. * Guest.jfm  --  Guest Book Entry Form                                       *
  4. *                                                                            *
  5. * Guest.jfm is part of the Guest Book solution application. It is the first  *
  6. * form that the user encounters. They can enter their name, email address,   *
  7. * comment, etc. and then submit a guest book entry. They can skip that and   *
  8. * just view the existing entries by selecting the appropriate link. After    *
  9. * the submission, the thanks form is displayed (see the                      *
  10. * submitButton_OnServerClick() method to see how this is done).              *
  11. *                                                                            *
  12. * Dependencies:  gestbk31.gif                                                *
  13. *                homepg31.gif                                                *
  14. *                apps/shared/controls.cc                                     *
  15. *                                                                            *
  16. * Links to:      ibapps/index.htm                                            *
  17. *                svr/intrasrv.isv?apps/guestbk/entries.jrp(1,1)              *
  18. *                                                                            *
  19. * Updated 8/27/96 by IntraBuilder Samples Group                              *
  20. * $Revision:   1.12  $                                                        *
  21. *                                                                            *
  22. * Copyright (c) 1996, Borland International, Inc. All rights reserved.       *
  23. *                                                                            *
  24. \****************************************************************************/
  25.  
  26. // {End Header} Do not remove this comment//
  27. // Generated on 08/27/1996
  28. //
  29. var f = new guestForm();
  30. f.open();
  31. class guestForm extends Form {
  32.    _sys.scripts.load(_sys.env.home() + "APPS\\SHARED\\CONTROLS.CC");
  33.    with (this) {
  34.       color = "a4d5ff";
  35.       height = 27.4706;
  36.       left = 6.6667;
  37.       top = 0;
  38.       width = 67.8333;
  39.       title = "Guest Book";
  40.       onServerLoad = class::Form_onServerLoad;
  41.    }
  42.  
  43.  
  44.    with (this.ibapps1 = new Database()){
  45.       left = 22.1667;
  46.       top = 3;
  47.       databaseName = "IBAPPS";
  48.       active = true;
  49.    }
  50.  
  51.  
  52.    with (this.guest1 = new Query()){
  53.       left = 30.1667;
  54.       top = 3;
  55.       database = parent.ibapps1;
  56.       sql = "select * from guest";
  57.    }
  58.  
  59.  
  60.    with (this.guest1.rowset) {
  61.  
  62.    }
  63.  
  64.  
  65.    with (this.rule1 = new Rule(this)){
  66.       left = 2;
  67.       top = 6;
  68.       size = 2;
  69.       right = 62;
  70.    }
  71.  
  72.  
  73.    with (this.rule2 = new Rule(this)){
  74.       left = 2;
  75.       top = 24;
  76.       size = 2;
  77.       right = 62;
  78.    }
  79.  
  80.  
  81.    with (this.rule3 = new Rule(this)){
  82.       left = 2;
  83.       top = 36;
  84.       size = 2;
  85.       right = 62;
  86.    }
  87.  
  88.  
  89.    with (this.guestBookLogo = new Image(this)){
  90.       height = 4.8235;
  91.       left = 2;
  92.       top = 0.4706;
  93.       width = 13.6667;
  94.       dataSource = "filename GESTBK31.GIF";
  95.       alignment = 4;
  96.    }
  97.  
  98.  
  99.    with (this.titleHTML = new HTML(this)){
  100.       height = 2;
  101.       left = 18;
  102.       top = 0.4706;
  103.       width = 44;
  104.       color = "steelblue";
  105.       text = '<H1><FONT SIZE="+4"><FONT COLOR="mediumvioletred">G</FONT></FONT>uest <FONT SIZE="+4"><FONT COLOR="mediumvioletred">B</FONT></FONT>ook</H1>';
  106.    }
  107.  
  108.  
  109.    with (this.invitationHTML = new HTML(this)){
  110.       height = 3;
  111.       left = 2;
  112.       top = 7;
  113.       width = 60;
  114.       color = "black";
  115.       fontBold = false;
  116.       text = "We're glad you visited our site today. Please be kind enough to leave a record of your visit. Comments and suggestions are always welcome.";
  117.    }
  118.  
  119.  
  120.    with (this.fullnameHTML = new HTML(this)){
  121.       height = 1;
  122.       left = 2;
  123.       top = 10;
  124.       width = 26;
  125.       color = "black";
  126.       fontBold = false;
  127.       text = "Your full name";
  128.    }
  129.  
  130.  
  131.    with (this.fullnameText = new Text(this)){
  132.       left = 28;
  133.       top = 10;
  134.       width = 34;
  135.       value = "";
  136.    }
  137.  
  138.  
  139.    with (this.emailHTML = new HTML(this)){
  140.       height = 1;
  141.       left = 2;
  142.       top = 11;
  143.       width = 26;
  144.       color = "black";
  145.       fontBold = false;
  146.       text = "Email address";
  147.    }
  148.  
  149.  
  150.    with (this.emailText = new Text(this)){
  151.       left = 28;
  152.       top = 11;
  153.       width = 34;
  154.       value = "";
  155.    }
  156.  
  157.  
  158.    with (this.wherefromHTML = new HTML(this)){
  159.       height = 1;
  160.       left = 2;
  161.       top = 12;
  162.       width = 26;
  163.       color = "black";
  164.       fontBold = false;
  165.       text = "Where are you from?";
  166.    }
  167.  
  168.  
  169.    with (this.wherefromText = new Text(this)){
  170.       left = 28;
  171.       top = 12;
  172.       width = 34;
  173.       value = "";
  174.    }
  175.  
  176.  
  177.    with (this.firstVisitCheck = new CheckBox(this)){
  178.       height = 1;
  179.       left = 2;
  180.       top = 13;
  181.       width = 26;
  182.       text = "Is this your first visit?";
  183.       color = "black/a4d5ff";
  184.       fontBold = false;
  185.       checked = false;
  186.    }
  187.  
  188.  
  189.    with (this.commentsHTML = new HTML(this)){
  190.       height = 1;
  191.       left = 2;
  192.       top = 14;
  193.       width = 15;
  194.       color = "black";
  195.       fontBold = false;
  196.       text = "Comments";
  197.    }
  198.  
  199.  
  200.    with (this.commentsTextArea = new TextArea(this)){
  201.       height = 6;
  202.       left = 2;
  203.       top = 15;
  204.       width = 60;
  205.       value = "";
  206.       readOnly = false;
  207.    }
  208.  
  209.  
  210.    with (this.submitButton = new Button(this)){
  211.       left = 2;
  212.       top = 22;
  213.       width = 10.5;
  214.       text = "Submit";
  215.       onServerClick = class::SubmitButton_onServerClick;
  216.    }
  217.  
  218.  
  219.    with (this.resetButton = new Reset(this)){
  220.       left = 18;
  221.       top = 22;
  222.       width = 9;
  223.       text = "Clear";
  224.    }
  225.  
  226.  
  227.    with (this.guestBookLinkImage = new Image(this)){
  228.       height = 4.8235;
  229.       left = 2;
  230.       top = 25;
  231.       width = 13.6667;
  232.       dataSource = "filename GESTBK31.GIF";
  233.       alignment = 4;
  234.       onImageClick = class::link_to_entries_page;
  235.    }
  236.  
  237.  
  238.    with (this.guestBookLinkHTML = new HTML(this)){
  239.       height = 1;
  240.       left = 18;
  241.       top = 25;
  242.       width = 34;
  243.       color = "black";
  244.       fontBold = false;
  245.       text = "<A HREF='/svr/intrasrv.isv?apps/guestbk/entries.jrp(1,1)'>View Current Guest Book Entries</A>";
  246.    }
  247.  
  248.  
  249.    with (this.homePageLinkImage = new Image(this)){
  250.       height = 4.8235;
  251.       left = 2;
  252.       top = 30;
  253.       width = 13.6667;
  254.       dataSource = "filename HOMEPG31.GIF";
  255.       alignment = 4;
  256.       onImageClick = class::link_to_home_page;
  257.    }
  258.  
  259.  
  260.    with (this.homePageLinkHTML = new HTML(this)){
  261.       height = 1;
  262.       left = 18;
  263.       top = 30;
  264.       width = 28;
  265.       color = "black";
  266.       fontBold = false;
  267.       text = "<A HREF='/ibapps/index.htm'>Return to Home Page</A>";
  268.    }
  269.  
  270.  
  271.    with (this.generatedHTML1 = new GeneratedHTML(this)){
  272.       height = 1;
  273.       left = 2;
  274.       top = 37;
  275.       width = 58;
  276.    }
  277.  
  278.    this.rowset = this.guest1.rowset
  279.  
  280.    function Form_onServerLoad() {
  281.       // set default value of fields to something large
  282.       this.fullnameText.value  = new StringEx().replicate(' ',100);
  283.       this.emailText.value     = new StringEx().replicate(' ',100);
  284.       this.wherefromText.value = new StringEx().replicate(' ',100);
  285.    }
  286.  
  287.    function SubmitButton_onServerClick()
  288.    {
  289.       // make the guest query active
  290.       this.form.guest1.active = true;
  291.       // store the form's values to the table
  292.       this.form.guest1.rowset.beginAppend();
  293.       this.form.guest1.rowset.fields["VisitTime"].value  = new Date();
  294.       this.form.guest1.rowset.fields["Fullname"].value   = this.form.fullnameText.value;
  295.       this.form.guest1.rowset.fields["Email"].value      = this.form.emailText.value;
  296.       this.form.guest1.rowset.fields["WhereFrom"].value  = this.form.wherefromText.value;
  297.       this.form.guest1.rowset.fields["FirstVisit"].value = this.form.firstVisitCheck.checked;
  298.       this.form.guest1.rowset.fields["Comment"].value    = this.form.commentsTextArea.value;
  299.       // save the new row
  300.       this.form.guest1.rowset.save();
  301.       // end with the thank you form
  302.       _sys.forms.run("thanks.jfm");
  303.    }
  304.  
  305.    function link_to_home_page()
  306.    {
  307.       location.href="/ibapps/index.htm";
  308.    }
  309.  
  310.    function link_to_entries_page()
  311.    {
  312.       location.href="/svr/intrasrv.isv?apps/guestbk/entries.jrp(1,1)";
  313.    }
  314. }
  315.