Source code of tbs_us_examples_prmfrm.htm

  1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
 
<!DOCTYPE HTML>
<html lang="en">
<head>
<title>TinyButStrong - Example of parameter frm</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="./tbs_us_examples_styles.css" rel="stylesheet" type="text/css" />
<style type="text/css">
.note1 {
    font-style: italic;
    color: #996600;
}
.format1 {
    color: #F00;
}
.table-example {
    margin-left:auto;
    margin-right:auto;
    width:500px;
    border:none;
    border-width:0;
    border-spacing:0;
}
.table-example td, th {
    padding:3px;
    text-align:left;
}
</style>
</head>
<body>
<div id="main-body">
  <h1>Example of parameter <samp>frm</samp></h1>
  <div class="w3cinfo"> this TBS template is W3C compliant <a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml11" alt="Valid XHTML 1.1" height="31" width="88" style="border:none;" /></a> </div>
  <div id="example">
    <p>The <samp>frm</samp> parameter enables you to display a date-time value or numeric value using a format string.</p>
    <h2>Date formats</h2>
    <p>Using the current date time</p>
    <table class="table-example">
      <tr class="back-special2 title-section2">
        <th style="width:50%">Format</th>
        <th>Display</th>
      </tr>
      <tr class="back-special2">
        <td>yyyy-mm-dd</td>
        <td>[onshow..now;frm='yyyy-mm-dd']</td>
      </tr>
      <tr class="back-special2">
        <td>dd/mm/yyyy</td>
        <td>[onshow..now;frm='dd/mm/yyyy']</td>
      </tr>
      <tr class="back-special2">
        <td>hh:nn:ss</td>
        <td>[onshow..now;frm='hh:nn:ss']</td>
      </tr>
      <tr class="back-special2">
        <td>dddd dd mmmm</td>
        <td>[onshow..now;frm='dddd dd mmmm']</td>
      </tr>
      <tr class="back-special2">
        <td>ddd dd mmm</td>
        <td>[onshow..now;frm='ddd dd mmm']</td>
      </tr>
      <tr class="back-special2">
        <td>mm-dd-yyyy hh:nn</td>
        <td>[onshow..now;frm='mm-dd-yyyy hh:nn']</td>
      </tr>
    </table>
    <h2>Numeric formats</h2>
    <p>Using the Php variable <samp>$amount = 1023.2568</samp></p>
    <table class="table-example">
      <tr class="back-special2 title-section2">
        <th style="width:50%">Format</th>
        <th>Display</th>
      </tr>
      <tr class="back-special2">
        <td>$ 0,000.00</td>
        <td>[onshow.amount;frm='$ 0,000.00']</td>
      </tr>
      <tr class="back-special2">
        <td>$ 0,000. <span class="note1">(1)</span></td>
        <td>[onshow.amount;frm='$ 0,000.']</td>
      </tr>
      <tr class="text-mini">
        <td colspan="2" class="note1">(1) The dot (.) at the bottom means there is no decimal.</td>
      </tr>
    </table>
    <p>Using the Php variable <samp>$rate = 0.751897</samp></p>
    <table class="table-example">
      <tr class="back-special2">
        <td style="width:50%">0.000 %</td>
        <td>[onshow.rate;frm='0.000 %']</td>
      </tr>
    </table>
    <h2>Conditional formats</h2>
    <p>Using the Php variable <samp>$amount2 = -255.4893</samp></p>
    <table class="table-example">
      <tr class="back-special2 title-section2">
        <th style="width:50%">Format</th>
        <th>Display</th>
      </tr>
      <tr class="back-special2">
        <td>+0,000.00|<span class="format1">-0,000.00</span>|0|-</td>
        <td>[onshow.amount2;frm='+0,000.00|<span class="format1">-0,000.00</span>|0|-']</td>
      </tr>
    </table>
    <h2>Reusable formats</h2>
    <p>Formats curr1 and rate1 are defined using parameter <samp>tplfrms</samp>. [onload;tplfrms;curr1='$ 0,000.00';rate1='0.000 %']</p>
    <table class="table-example">
      <tr class="back-special2 title-section2">
        <th style="width:50%">Format</th>
        <th>Display</th>
      </tr>
      <tr class="back-special2">
        <td>curr1=$ 0,000.00<br /></td>
        <td>[onshow.amount;frm=curr1]</td>
      </tr>
      <tr class="back-special2">
        <td>rate1=0.000 %<br /></td>
        <td>[onshow.rate;frm=rate1]</td>
      </tr>
    </table>
  </div>
</div>
</body>
</html>