PageRenderTime 48ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/docs/api/_column_bar_8php_source.html

http://openbiz-cubi.googlecode.com/
HTML | 143 lines | 142 code | 0 blank | 1 comment | 0 complexity | a513ff5db5497f2eeec162f02b1fb7d0 MD5 | raw file
Possible License(s): GPL-2.0, LGPL-3.0
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
  5. <title>openbiz: E:/E/GEAMP/www/openbiz/openbiz/bin/easy/element/ColumnBar.php Source File</title>
  6. <link href="tabs.css" rel="stylesheet" type="text/css"/>
  7. <link href="doxygen.css" rel="stylesheet" type="text/css"/>
  8. </head>
  9. <body>
  10. <!-- Generated by Doxygen 1.7.2 -->
  11. <div class="navigation" id="top">
  12. <div class="tabs">
  13. <ul class="tablist">
  14. <li><a href="main.html"><span>Main&#160;Page</span></a></li>
  15. <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
  16. <li><a href="namespaces.html"><span>Namespaces</span></a></li>
  17. <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
  18. <li class="current"><a href="files.html"><span>Files</span></a></li>
  19. </ul>
  20. </div>
  21. <div class="tabs2">
  22. <ul class="tablist">
  23. <li><a href="files.html"><span>File&#160;List</span></a></li>
  24. </ul>
  25. </div>
  26. <div class="header">
  27. <div class="headertitle">
  28. <h1>E:/E/GEAMP/www/openbiz/openbiz/bin/easy/element/ColumnBar.php</h1> </div>
  29. </div>
  30. <div class="contents">
  31. <div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 &lt;?php
  32. <a name="l00002"></a>00002 include_once(<span class="stringliteral">&quot;ColumnText.php&quot;</span>);
  33. <a name="l00003"></a><a class="code" href="class_column_bar.html">00003</a> <span class="keyword">class </span><a class="code" href="class_column_bar.html">ColumnBar</a> <span class="keyword">extends</span> <a class="code" href="class_column_text.html">ColumnText</a>
  34. <a name="l00004"></a>00004 {
  35. <a name="l00005"></a>00005 <span class="keyword">public</span> $m_Percent;
  36. <a name="l00006"></a>00006 <span class="keyword">public</span> $m_MaxValue;
  37. <a name="l00007"></a>00007 <span class="keyword">public</span> $m_DisplayUnit;
  38. <a name="l00008"></a>00008 <span class="keyword">public</span> $m_Color;
  39. <a name="l00009"></a>00009
  40. <a name="l00010"></a><a class="code" href="class_column_bar.html#a5888f7e5883c7c2d486f7ddc1bd64760">00010</a> <span class="keyword">protected</span> function <a class="code" href="class_column_bar.html#a5888f7e5883c7c2d486f7ddc1bd64760">readMetaData</a>(&amp;$xmlArr)
  41. <a name="l00011"></a>00011 {
  42. <a name="l00012"></a>00012 <a class="code" href="class_column_bar.html#a5888f7e5883c7c2d486f7ddc1bd64760">parent::readMetaData</a>($xmlArr);
  43. <a name="l00013"></a>00013 $this-&gt;m_Percent = isset($xmlArr[<span class="stringliteral">&quot;ATTRIBUTES&quot;</span>][<span class="stringliteral">&quot;PERCENT&quot;</span>]) ? $xmlArr[<span class="stringliteral">&quot;ATTRIBUTES&quot;</span>][<span class="stringliteral">&quot;PERCENT&quot;</span>] : <span class="stringliteral">&quot;N&quot;</span>;
  44. <a name="l00014"></a>00014 $this-&gt;m_MaxValue = isset($xmlArr[<span class="stringliteral">&quot;ATTRIBUTES&quot;</span>][<span class="stringliteral">&quot;MAXVALUE&quot;</span>]) ? $xmlArr[<span class="stringliteral">&quot;ATTRIBUTES&quot;</span>][<span class="stringliteral">&quot;MAXVALUE&quot;</span>] : <span class="stringliteral">&quot;1&quot;</span>;
  45. <a name="l00015"></a>00015 $this-&gt;m_DisplayUnit = isset($xmlArr[<span class="stringliteral">&quot;ATTRIBUTES&quot;</span>][<span class="stringliteral">&quot;DISPLAYUNIT&quot;</span>]) ? $xmlArr[<span class="stringliteral">&quot;ATTRIBUTES&quot;</span>][<span class="stringliteral">&quot;DISPLAYUNIT&quot;</span>] : null;
  46. <a name="l00016"></a>00016 $this-&gt;m_Color = isset($xmlArr[<span class="stringliteral">&quot;ATTRIBUTES&quot;</span>][<span class="stringliteral">&quot;COLOR&quot;</span>]) ? $xmlArr[<span class="stringliteral">&quot;ATTRIBUTES&quot;</span>][<span class="stringliteral">&quot;COLOR&quot;</span>] : null;
  47. <a name="l00017"></a>00017 $this-&gt;m_cssClass = isset($xmlArr[<span class="stringliteral">&quot;ATTRIBUTES&quot;</span>][<span class="stringliteral">&quot;CSSCLASS&quot;</span>]) ? $xmlArr[<span class="stringliteral">&quot;ATTRIBUTES&quot;</span>][<span class="stringliteral">&quot;CSSCLASS&quot;</span>] : <span class="stringliteral">&quot;column_bar&quot;</span>;
  48. <a name="l00018"></a>00018 $this-&gt;m_Height = isset($xmlArr[<span class="stringliteral">&quot;ATTRIBUTES&quot;</span>][<span class="stringliteral">&quot;HEIGHT&quot;</span>]) ? $xmlArr[<span class="stringliteral">&quot;ATTRIBUTES&quot;</span>][<span class="stringliteral">&quot;HEIGHT&quot;</span>] : <span class="stringliteral">&quot;14&quot;</span>;
  49. <a name="l00019"></a>00019 }
  50. <a name="l00020"></a>00020
  51. <a name="l00021"></a><a class="code" href="class_column_bar.html#afde88292c44dc59faf017738dae6dffb">00021</a> <span class="keyword">public</span> function <a class="code" href="class_column_bar.html#afde88292c44dc59faf017738dae6dffb">render</a>(){
  52. <a name="l00022"></a>00022 $value = $this-&gt;m_Text ? $this-&gt;<a class="code" href="class_label_text.html#a8a2999b1d846c0a7bc77187e28facd99">getText</a>() : $this-&gt;m_Value;
  53. <a name="l00023"></a>00023 <span class="keywordflow">if</span>($this-&gt;m_Color)
  54. <a name="l00024"></a>00024 {
  55. <a name="l00025"></a>00025 $formObj = $this-&gt;<a class="code" href="class_element.html#abf87088a2cd6b615e8e8add31567ba5a">getFormObj</a>();
  56. <a name="l00026"></a>00026 $color = <a class="code" href="class_expression.html#a85d5504074029bc1ebe18dd8de91571c">Expression::evaluateExpression</a>($this-&gt;m_Color, $formObj);
  57. <a name="l00027"></a>00027 <span class="keywordflow">if</span>(!$color){
  58. <a name="l00028"></a>00028 $color = <span class="stringliteral">&#39;33b5fb&#39;</span>;
  59. <a name="l00029"></a>00029 }
  60. <a name="l00030"></a>00030 $bgcolor_str = <span class="stringliteral">&quot;background-color: #&quot;</span>.$color.<span class="stringliteral">&quot;;&quot;</span>;
  61. <a name="l00031"></a>00031 }<span class="keywordflow">else</span>{
  62. <a name="l00032"></a>00032 $bgcolor_str = <span class="stringliteral">&quot;background-color: #33b5fb;&quot;</span>;
  63. <a name="l00033"></a>00033 }
  64. <a name="l00034"></a>00034
  65. <a name="l00035"></a>00035 <span class="keywordflow">if</span>($this-&gt;m_DisplayFormat)
  66. <a name="l00036"></a>00036 {
  67. <a name="l00037"></a>00037 $value = sprintf($this-&gt;m_DisplayFormat,$value);
  68. <a name="l00038"></a>00038 }
  69. <a name="l00039"></a>00039 <span class="keywordflow">if</span>($this-&gt;m_Percent==<span class="charliteral">&#39;Y&#39;</span>)
  70. <a name="l00040"></a>00040 {
  71. <a name="l00041"></a>00041 $value = sprintf(<span class="stringliteral">&quot;%.2f&quot;</span>,$value*100).<span class="charliteral">&#39;%&#39;</span>;
  72. <a name="l00042"></a>00042 }
  73. <a name="l00043"></a>00043 $style = $this-&gt;<a class="code" href="class_column_bar.html#a1a9c641ae8a39113009425cbccaee5d5">getStyle</a>();
  74. <a name="l00044"></a>00044 $id = $this-&gt;m_Name;
  75. <a name="l00045"></a>00045 $func = $this-&gt;<a class="code" href="class_element.html#a3cb728ca27acfebd282caecdb8a1f5fc">getFunction</a>();
  76. <a name="l00046"></a>00046 $height = $this-&gt;m_Height;
  77. <a name="l00047"></a>00047 $width = $this-&gt;m_Width;
  78. <a name="l00048"></a>00048 $max_value = <a class="code" href="class_expression.html#a85d5504074029bc1ebe18dd8de91571c">Expression::evaluateExpression</a>($this-&gt;m_MaxValue, $this-&gt;<a class="code" href="class_element.html#abf87088a2cd6b615e8e8add31567ba5a">getFormObj</a>());
  79. <a name="l00049"></a>00049
  80. <a name="l00050"></a>00050 $width_rate = ($value/$max_value);
  81. <a name="l00051"></a>00051
  82. <a name="l00052"></a>00052 <span class="keywordflow">if</span>($width_rate&gt;1){
  83. <a name="l00053"></a>00053 $width_rate=1;
  84. <a name="l00054"></a>00054 }
  85. <a name="l00055"></a>00055 $width_bar = (int)($width * $width_rate);
  86. <a name="l00056"></a>00056 <span class="keywordflow">if</span>($width&gt;0){
  87. <a name="l00057"></a>00057 $width-=2;
  88. <a name="l00058"></a>00058 }
  89. <a name="l00059"></a>00059 <span class="keywordflow">if</span>(!preg_match(<span class="stringliteral">&quot;/MSIE 6/si&quot;</span>,$_SERVER[<span class="stringliteral">&#39;HTTP_USER_AGENT&#39;</span>])){
  90. <a name="l00060"></a>00060 $bar_overlay=<span class="stringliteral">&quot;&lt;span class=\&quot;bar_data_bg\&quot; style=\&quot;&quot;</span>.$bgcolor_str.<span class="stringliteral">&quot;height:&quot;</span>.$height.<span class="stringliteral">&quot;px;width:&quot;</span>.$width_bar.<span class="stringliteral">&quot;px;\&quot;&gt;&lt;/span&gt;&quot;</span>;
  91. <a name="l00061"></a>00061 $bar = <span class="stringliteral">&quot;&lt;span class=\&quot;bar_data\&quot; style=\&quot;&quot;</span>.$bgcolor_str.<span class="stringliteral">&quot;height:&quot;</span>.$height.<span class="stringliteral">&quot;px;width:&quot;</span>.$width_bar.<span class="stringliteral">&quot;px;\&quot;&gt;&lt;/span&gt;&quot;</span>;
  92. <a name="l00062"></a>00062 }<span class="keywordflow">else</span>{
  93. <a name="l00063"></a>00063 $bar = <span class="stringliteral">&quot;&lt;span class=\&quot;bar_data\&quot; style=\&quot;&quot;</span>.$bgcolor_str.<span class="stringliteral">&quot;height:&quot;</span>.$height.<span class="stringliteral">&quot;px;width:&quot;</span>.$width_bar.<span class="stringliteral">&quot;px;opacity: 0.4;filter: alpha(opacity=40);\&quot;&gt;&lt;/span&gt;&quot;</span>;
  94. <a name="l00064"></a>00064 }
  95. <a name="l00065"></a>00065 $sHTML = <span class="stringliteral">&quot;</span>
  96. <a name="l00066"></a>00066 <span class="stringliteral"> &lt;span id=\&quot;$id\&quot; $func $style &gt;</span>
  97. <a name="l00067"></a>00067 <span class="stringliteral"> </span>
  98. <a name="l00068"></a>00068 <span class="stringliteral"> &lt;span class=\&quot;bar_bg\&quot; style=\&quot;height:&quot;</span>.$height.<span class="stringliteral">&quot;px;width:&quot;</span>.$width.<span class="stringliteral">&quot;px;\&quot;&gt;</span>
  99. <a name="l00069"></a>00069 <span class="stringliteral"> </span>
  100. <a name="l00070"></a>00070 <span class="stringliteral"> $bar_overlay</span>
  101. <a name="l00071"></a>00071 <span class="stringliteral"> $bar </span>
  102. <a name="l00072"></a>00072 <span class="stringliteral"> &lt;/span&gt;</span>
  103. <a name="l00073"></a>00073 <span class="stringliteral"> &lt;span class=\&quot;value\&quot;&gt;$value&quot;</span>.$this-&gt;m_DisplayUnit.<span class="stringliteral">&quot;&lt;/span&gt;</span>
  104. <a name="l00074"></a>00074 <span class="stringliteral"> &lt;/span&gt;</span>
  105. <a name="l00075"></a>00075 <span class="stringliteral"> &quot;</span>;
  106. <a name="l00076"></a>00076 <span class="keywordflow">return</span> $sHTML;
  107. <a name="l00077"></a>00077 }
  108. <a name="l00078"></a><a class="code" href="class_column_bar.html#a1a9c641ae8a39113009425cbccaee5d5">00078</a> <span class="keyword">protected</span> function <a class="code" href="class_column_bar.html#a1a9c641ae8a39113009425cbccaee5d5">getStyle</a>()
  109. <a name="l00079"></a>00079 {
  110. <a name="l00080"></a>00080 $formobj = $this-&gt;<a class="code" href="class_element.html#abf87088a2cd6b615e8e8add31567ba5a">getFormObj</a>();
  111. <a name="l00081"></a>00081 $htmlClass = <a class="code" href="class_expression.html#a85d5504074029bc1ebe18dd8de91571c">Expression::evaluateExpression</a>($this-&gt;m_cssClass, $formobj);
  112. <a name="l00082"></a>00082 $htmlClass = <span class="stringliteral">&quot;CLASS=&#39;$htmlClass&#39;&quot;</span>;
  113. <a name="l00083"></a>00083 <span class="keywordflow">if</span>(!$htmlClass){
  114. <a name="l00084"></a>00084 $htmlClass = null;
  115. <a name="l00085"></a>00085 }
  116. <a name="l00086"></a>00086 $style =<span class="stringliteral">&#39;&#39;</span>;
  117. <a name="l00087"></a>00087 <span class="keywordflow">if</span> ($this-&gt;m_Style)
  118. <a name="l00088"></a>00088 $style .= $this-&gt;m_Style;
  119. <a name="l00089"></a>00089 <span class="keywordflow">if</span> (!isset($style) &amp;&amp; !$htmlClass)
  120. <a name="l00090"></a>00090 <span class="keywordflow">return</span> null;
  121. <a name="l00091"></a>00091 <span class="keywordflow">if</span> (isset($style))
  122. <a name="l00092"></a>00092 {
  123. <a name="l00093"></a>00093
  124. <a name="l00094"></a>00094 $style = <a class="code" href="class_expression.html#a85d5504074029bc1ebe18dd8de91571c">Expression::evaluateExpression</a>($style, $formobj);
  125. <a name="l00095"></a>00095 $style = <span class="stringliteral">&quot;STYLE=&#39;$style&#39;&quot;</span>;
  126. <a name="l00096"></a>00096 }
  127. <a name="l00097"></a>00097 <span class="keywordflow">if</span>($formobj-&gt;m_Errors[$this-&gt;m_Name])
  128. <a name="l00098"></a>00098 {
  129. <a name="l00099"></a>00099 $htmlClass = <span class="stringliteral">&quot;CLASS=&#39;&quot;</span>.$this-&gt;m_cssErrorClass.<span class="stringliteral">&quot;&#39;&quot;</span>;
  130. <a name="l00100"></a>00100 }
  131. <a name="l00101"></a>00101 <span class="keywordflow">if</span> ($htmlClass)
  132. <a name="l00102"></a>00102 $style = $htmlClass.<span class="stringliteral">&quot; &quot;</span>.$style;
  133. <a name="l00103"></a>00103 <span class="keywordflow">return</span> $style;
  134. <a name="l00104"></a>00104 }
  135. <a name="l00105"></a>00105 }
  136. <a name="l00106"></a>00106 ?&gt;
  137. </pre></div></div>
  138. </div>
  139. <hr class="footer"/><address class="footer"><small>Generated on Thu Apr 19 2012 17:09:13 for openbiz by&#160;
  140. <a href="http://www.doxygen.org/index.html">
  141. <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.2 </small></address>
  142. </body>
  143. </html>