TR-Tiimi Oy
eScript-HTML-esimerkkikoodia

Tämä HTML-teksti talletetetaan tietokannassa. Vastaavaa web-objektia kutsuttaessa teksti prosessoidaan, jolloin mm. <%include%> tagit tuovat kohdalleen oikeankielisen, ko. ajankohdan mukaisen ja muut kriteerit täyttävän tekstin.

Funktiot suoritetaan web-objektissa ja ne joko määräävät prosessointia kuten toistoa tai ehdollista käsittelyä tai palauttavat dataa HTML-tulosteeseen.


<%include:DefaultDocType%>                                                                                                                                                                          
<html>                                                                                                                                                                                              
<head>                                                                                                                                                                                              
<title><%include:SportsTitle%></title>                                                                                                                                                  
<%include:SportsStyleSheet%>                                                                                                                                                                        
<%include:SportsStdJS%>                                                                                                                                                                             
</head>                                                                                                                                                                                             
                                                                                                                                                                                                          
<body>                                                                                                                                                                                              
<%include:SportsBanner%>                                                                                                                                                                            
<%include:SportsMainMenu%>                                                                                                                                                                          
                                                                                                                                                                                                          
<div class="FunctionTitleArea">                                                                                                                                                                     
  <span class="FunctionTitle"><%include:CustomerSearchTitle%></span>                                                                                                                    
  <div class="FunctionOptionArea">                                                                                                                                                                  
  <%call:buildLink()%><a title="<%include:AddCustomerTT%>" class="FunctionOption" href="sports/custdetail.p?id=new"><%include:AddCustomer%></a><%end:buildLink%>      
  </div>                                                                                                                                                                                            
</div>                                                                                                                                                                                              
                                                                                                                                                                                                          
<div class="FunctionArea">                                                                                                                                                                          
                                                                                                                                                                                                          
  <div style="text-align: center; margin-top: 5px;">                                                                                                                                                
  <%call:buildLink()%><form method="post" action="sports/custsearch.p"><%end:buildLink%>                                                                                                
                                                                                                                                                                                                          
    <span class="FieldLabel"><%include:NameLabel%>:</span>                                                                                                                              
    <input class="InputField" type="text" title="<%include:SearchValueTT%>" name="fiSearch" value="<%=getData(fiSearch)%>" />                                                           
    <input class="FormButton" type="submit" title="<%include:SearchTT%>" name="btSearch" value="<%include:SearchLabel%>" />                                                             
                                                                                                                                                                                                          
    <%include:NavBar.html $searchId=Customers $objectName=custsearch.p%>                                                                                                                            
                                                                                                                                                                                                          
  </form>                                                                                                                                                                                           
  </div>                                                                                                                                                                                            
                                                                                                                                                                                                          
  <table width="100%" cellspacing="0">                                                                                                                                                              
  <tr align="left">                                                                                                                                                                                 
  <th class="ColumnLabel"><%include:NameLabel%></th>                                                                                                                                    
  <th class="ColumnLabel"><%include:AddressLabel%></th>                                                                                                                                 
  <th class="ColumnLabel"><%include:RepNameLabel%></th>                                                                                                                                 
  <th class="ColumnLabel" align="right"><%include:BalanceLabel%></th>                                                                                                                   
  </tr>                                                                                                                                                                                             
  <%while:listCustomers(22)%>                                                                                                                                                                       
                                                                                                                                                                                                          
    <tr title="<%include:Click4DetailsTT%>" onmouseover="this.className='ListRowOn'" onmouseout="this.className='ListRowOff'">                                                                
      <td> <%call:buildLink()%><a href="custdetail.p?id=<%=getData(Customer.ResultNum)%>"><%=getData(Customer.Name)%></a><%end:buildLink%></td>           
      <td> <%call:buildLink()%><a href="custdetail.p?id=<%=getData(Customer.ResultNum)%>"><%=getData(FullAddress)%></a><%end:buildLink%></td>             
      <td> <%call:buildLink()%><a href="custdetail.p?id=<%=getData(Customer.ResultNum)%>"><%=getData(Customer.RepName)%></a><%end:buildLink%></td>        
     <td> <%call:buildLink()%><a href="custdetail.p?id=<%=getData(Customer.ResultNum)%>"><%=getData(Customer.CreditLimit)%></a><%end:buildLink%></td>     
                                                                                                                                                                                                          
    </tr>                                                                                                                                                                                           
                                                                                                                                                                                                          
    <%if:rowStyle(3)%>                                                                                                                                                                              
    <tr> <td colspan="5"><hr/></td> </tr>                                                                                                                                   
    <%end:rowStyle%>                                                                                                                                                                                
                                                                                                                                                                                                          
  <%end:listCustomers%>                                                                                                                                                                             
  </table>                                                                                                                                                                                          
</div>                                                                                                                                                                                              
                                                                                                                                                                                                          
<%include:SportsDefaultFocus%>                                                                                                                                                                      
</body>                                                                                                                                                                                             
</html>