Compiled Template sandwich-grid.adp

set __adp_output {}; set __ad_conn_locale [ad_conn locale]
append __adp_output "<html>
  <head>
  <title>[ns_quotehtml [lang::util::localize ${title}]]</title>
  <style>
    h1 \{ font-family: Arial, Helvetica \}
    th \{ font-family: Arial, Helvetica \}
    td \{ font-family: Arial, Helvetica \}
  </style>
</head>
<body bgcolor=\"#FFFFCC\">
<h1>Customize a Sandwich</h1>
<hr>

  "
set form:id sandwich
upvar 0 sandwich:properties form_properties
set form_properties(headers) {}
set form_properties(title) {}
set form_properties(cols) {}
append __adp_output "[template::form render sandwich {  } ]"
append __adp_output "[template::element render ${form:id} grid {  } ]"
append __adp_output "

    <table border=\"0\" >
      <tr><td>
        <table bgcolor=\"#99CCFF\" cellpadding=\"4\" cellspacing=\"0\" border=\"1\" >
          <tr>
            <td><strong>Sandwich Name</strong>&nbsp;&nbsp;</td>
	    <td>"
append __adp_output "[template::element render ${form:id} nickname {  } ]"
if {([info exists formerror(nickname)] && ${formerror(nickname)} ne {})} {
append __adp_output "<br><font color=\"red\"><strong>[ns_quotehtml [lang::util::localize $formerror(nickname)]]<strong></font>"
}
append __adp_output "
            </td>

          </tr>
          <tr>
	    <td><strong>Protein</strong>&nbsp;&nbsp;</td>
	    <td>
	      <table cellpadding=\"4\" cellspacing=\"0\" border=\"0\">
                "
template::element options ${form:id} protein { cols 2 }

  set rows [expr {ceil(${formgroup:rowcount} / 2.0)}]
  for { set __r 1 } { $__r <= $rows } { incr __r } {
    for { set __c 1 } { $__c <= 2 } { incr __c } {


      set rownum [expr {1 + int(($__r - 1) + (($__c - 1) * $rows))}]


      upvar 0 formgroup:$rownum formgroup
      set formgroup(rownum) $rownum
      set formgroup(row) $__r
      set formgroup(col) $__c
  
if {"[ns_quotehtml [lang::util::localize $formgroup(col)]]" eq "1"} {
append __adp_output "
                    <tr>
                  "
}
append __adp_output "
                  <td>
                    "
if {"[ns_quotehtml [lang::util::localize $formgroup(rownum)]]" <= "[ns_quotehtml [lang::util::localize ${formgroup:rowcount}]]"} {
append __adp_output "
                      $formgroup(widget) [template::adp_parse_tags_and_localize $formgroup(label)]
                    "
} else {
append __adp_output "
                      &nbsp;
                    "
}
append __adp_output "
                  </td>
                  "
if {"[ns_quotehtml [lang::util::localize $formgroup(col)]]" eq "2"} {
append __adp_output "
                    </tr>
                  "
}

    }
  }
append __adp_output " 
	      </table>
              "
if {([info exists formerror(protein)] && ${formerror(protein)} ne {})} {
append __adp_output "<br><font color=\"red\"><strong>[ns_quotehtml [lang::util::localize $formerror(protein)]]<strong></font>"
}
append __adp_output "
	    </td>
	  </tr>
	  <tr>
	    <td><strong>Vitamins</strong>&nbsp;&nbsp;</td>
	    <td> 
	      <table cellpadding=\"4\" cellspacing=\"0\" border=\"0\">
               "
template::element options ${form:id} vitamins { cols 2 }

  set rows [expr {ceil(${formgroup:rowcount} / 2.0)}]
  for { set __r 1 } { $__r <= $rows } { incr __r } {
    for { set __c 1 } { $__c <= 2 } { incr __c } {


      set rownum [expr {1 + int(($__r - 1) + (($__c - 1) * $rows))}]


      upvar 0 formgroup:$rownum formgroup
      set formgroup(rownum) $rownum
      set formgroup(row) $__r
      set formgroup(col) $__c
  
if {"[ns_quotehtml [lang::util::localize $formgroup(col)]]" eq "1"} {
append __adp_output "
                    <tr>
                  "
}
append __adp_output "
                  <td>
                    "
if {"[ns_quotehtml [lang::util::localize $formgroup(rownum)]]" <= "[ns_quotehtml [lang::util::localize ${formgroup:rowcount}]]"} {
append __adp_output "
                      $formgroup(widget) [template::adp_parse_tags_and_localize $formgroup(label)]
                    "
} else {
append __adp_output "
                      &nbsp;
                    "
}
append __adp_output "
                  </td>
                  "
if {"[ns_quotehtml [lang::util::localize $formgroup(col)]]" eq "2"} {
append __adp_output "
                   </tr>
                  "
}

    }
  }
append __adp_output " 
	      </table>
              "
if {([info exists formerror(vitamins)] && ${formerror(vitamins)} ne {})} {
append __adp_output "<br><font color=\"red\"><strong>[ns_quotehtml [lang::util::localize $formerror(vitamins)]]<strong></font>"
}
append __adp_output "
            </td>
          </tr>
        </table>
      </td></tr>
         <tr>
  	   <td align=\"center\">"
append __adp_output "[template::element render ${form:id} ok {  } ]"
append __adp_output "</td>
         </tr>
    </table>

  "
append __adp_output "[template::form check_elements sandwich]"
append __adp_output "</form>"
append __adp_output "
<hr>
</body>
</html>
"
set __adp_output