PageRenderTime 30ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 0ms

/modules/latihan/latihan.tpl

https://github.com/emmank/cardiac
Smarty Template | 187 lines | 187 code | 0 blank | 0 comment | 73 complexity | 3d968036585c4209c884fad19c12b340 MD5 | raw file
  1. <?php
  2. /*
  3. * Copyright (c) 2009 Denic Wibowo<denicwibowo@gmail.com>.
  4. * All rights reserved.
  5. *
  6. * This program is free software; you can redistribute it and/or modify it
  7. * under the terms of the GNU General Public License as published by the
  8. * Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful, but
  12. * WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
  14. * Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License along
  17. * with this program; if not, write to the Free Software Foundation, Inc.,
  18. * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  19. *
  20. * presentStatus.php
  21. *
  22. * Created on Oct 28, 2009, 9:51:59 AM
  23. */
  24. $result .= '<div id="fisis' . $ke . '" class="tabcontent">' . "\n";
  25. //$result .= $vl['datafields']['Fase Latihan']['title'];
  26. //echo '<pre>'; print_r($vl); echo '</pre>';
  27. $result .= '<table width=100% class="table" border="0">' . "\n";
  28. foreach($vl['datafields'] as $yk => $lv){
  29. $result .= '<tr valign="top">' . "\n";
  30. $result .= '<td style="font-weight:bold" align="left" width="4%">' . strtoupper($yk) . '</td>' . "\n";
  31. $result .= '<td align="left">' . "\n";
  32. foreach($lv as $kk => $vv){
  33. $result .= '<div>' . __t($kk) .'</div>' . "\n";
  34. if(!isset($vv['type'])){
  35. $htg = 1;
  36. $result .= '<div>' . "\n";
  37. $result .= '<table width="100%" align="left">' . "\n";
  38. foreach($vv as $yy => $ll){
  39. $result .= '<tr valign="top">' . "\n";
  40. $result .= '<td align="right" width="5%">' . $htg . '. </td>' . "\n";
  41. $result .= '<td align="left" width="25%">' . __t($yy) . '</td>' . "\n";
  42. $result .= '<td align="' . (eregi('st', $yy) ? 'left' : 'left') . '">' . "\n";
  43. if(!isset($ll['type'])){
  44. foreach($ll as $ee => $uu){
  45. $result .= '<div>' . "\n";
  46. if($ee != $yy) {
  47. $result .= __t($uu['title']) . ' : ';
  48. }
  49. if(isset($uu['value'])){
  50. $uu['value'] = explode('|', $uu['value']);
  51. }
  52. if($uu['type'] == 'select'){
  53. if(isset($uu['readonly']) && $uu['readonly'] !== FALSE){
  54. $result .= $uu['theref'][$uu['value'][0]] . "\n";
  55. } else {
  56. // echo '<pre>'; print_r($ee); echo '</pre>';
  57. $result .= '<select name="' . $ky . '_' . $ee . '[0]" size="1">' . "\n";
  58. $result .= '<option value=""> --- ' . __t('Silahkan pilih') . ' --- </option>' . "\n";
  59. foreach($uu['theref'] as $ey => $al){
  60. $result .= '<option name="' . $ey . '"' . (isset($uu['value'][0]) && $uu['value'][0] == $ey ? ' selected' : '') . '>' . __t($al) . '</option>' . "\n";
  61. }
  62. $result .= '</select>' . "\n";
  63. }
  64. } elseif($uu['type'] == 'radio'){
  65. if(isset($uu['readonly']) && $uu['readonly'] !== FALSE){
  66. $result .= $uu['theref'][$uu['value'][0]];
  67. if(isset($uu['value'][1])){
  68. $result .= ' ' . __t('sistolik') . ' ' . $uu['value'][1] . 'mmHg';
  69. if(isset($uu['value'][2])){
  70. $result .= ' ' . __t('diastolik') . ' ' . $uu['value'][2] . 'mmHg';
  71. }
  72. }
  73. $result .= "\n";
  74. } else {
  75. $result .= '<div>' . "\n";
  76. $gth = 1;
  77. foreach($uu['theref'] as $ey => $al){
  78. $result .= '<input type="radio" name="' . $ky . '_' . $ee . '[0]" value="' . $ey . '"' . (isset($uu['value'][0]) && $uu['value'][0] == $ey ? ' checked="true"' : '') . '>' . __t($al);
  79. if(eregi('hipert', $al)){
  80. $result .= ' ' . __t('sistolik') . ' <input type="text" name="' . $ky . '_' . $ee . '[' . $gth . ']"' . (isset($uu['value'][1]) && $uu['value'][0] == $ey ? ' value="' . $uu['value'][1] . '"' : '') . ' size="5"> mmHg' . "\n";
  81. $gth++;
  82. $result .= ', ' . __t('diastolik') . ' <input type="text" name="' . $ky . '_' . $ee . '[' . $gth . ']"' . (isset($uu['value'][2]) && $uu['value'][0] == $ey ? ' value="' . $uu['value'][2] . '"' : '') . ' size="5"> mmHg' . "\n";
  83. $gth++;
  84. }
  85. $result .= "<br />\n";
  86. } unset($gth);
  87. $result .= '</div>' . "\n";
  88. }
  89. } else {
  90. if(isset($uu['readonly']) && $uu['readonly'] !== FALSE){
  91. $result .= $uu['value'][0];
  92. } else {
  93. $result .= '<input type="text" name="' . $ky . '_' . $ee . '[0]" size="' . (isset($uu['size']) ? $uu['size'] : '') . '"' . (isset($uu['value'][0]) ? ' value="' . $uu['value'][0] . '"' : '') . '>' . "\n";
  94. }
  95. }
  96. if(!eregi('konfigurasi', $ee) && eregi('ekg', $kk)){
  97. $result .= ' ' . __t('pada menit ke') . ' : ';
  98. if(isset($uu['readonly']) && $uu['readonly'] !== FALSE){
  99. $result .= $uu['value'][1];
  100. } else {
  101. $result .= '<input type="text" name="' . $ky . '_' . $ee . '[1]" size="' . (isset($uu['size']) ? $uu['size'] : '') . '"' . (isset($uu['value'][1]) ? ' value="' . $uu['value'][1] . '"' : '') . '>' . "\n";
  102. }
  103. }
  104. $result .= '</div>' . "\n";
  105. }
  106. } else {
  107. if(isset($ll['value'])){
  108. $ll['value'] = explode('|', $ll['value']);
  109. }
  110. if(isset($ll['readonly']) && $ll['readonly'] != FALSE){
  111. if(isset($ll['theref'])){
  112. $result .= $ll['theref'][$ll['value'][0]];
  113. } else {
  114. $result .= $ll['value'][0];
  115. }
  116. $result .= "\n";
  117. } else {
  118. if($ll['type'] == 'select'){
  119. // echo '<pre>'; print_r($yy); echo '</pre>';
  120. $result .= '<select name="' . $ky . '_' . $yy . '[0]" size="1">' . "\n";
  121. $result .= '<option value=""> --- ' . __t('Silahkan pilih') . ' --- </option>' . "\n";
  122. foreach($ll['theref'] as $ee => $uu){
  123. $result .= '<option value="' . $ee . '"' . (isset($ll['value'][0]) && $ll['value'][0] == $ee ? ' selected' : '') . '>' . __t($uu) . '</option>' . "\n";
  124. }
  125. $result .= '</select>' . "\n";
  126. } elseif($ll['type'] == 'radio'){
  127. foreach($ll['theref'] as $ee => $uu){
  128. $result .= '<input type="radio" name="' . $ky . '_' . $ee . '[0]" value="' . $ee . '"' . (isset($ll['value'][0]) && $ll['value'][0] == $ee ? ' checked="true"' : '') . '> ' . __t($uu) . "<br />\n";
  129. }
  130. } else {
  131. $result .= '<input type="text" name="' . $ky . '_' . $yy . '[0]" size="' . (isset($ll['value'][0]) ? $ll['value'][0] : '') . '">' . "\n";
  132. }
  133. }
  134. if(eregi('irama', $yy)){
  135. if(isset($ll['readonly']) && $ll['readonly'] !== FALSE){
  136. $result .= ' ' . __t('pada menit ke') . ' ' . $ll['value'][1] . "\n";
  137. } else {
  138. $result .= ' ' . __t('pada menit ke') . ' <input type="text" name="' . $ky. '_' . $yy . '[1]" size="10"' . (isset($ll['value'][1]) ? ' value="' . $ll['value'][1] . '"' : '') . '>' . "\n";
  139. }
  140. }
  141. }
  142. $result .= '</td>' . "\n";
  143. $result .= '</tr>' . "\n";
  144. $htg++;
  145. } unset($htg);
  146. $result .= '</table>' . "\n";
  147. $result .= '</div>' . "\n";
  148. } else {
  149. if(isset($vv['value'])){
  150. $vv['value'] = explode('|', $vv['value']);
  151. }
  152. if(isset($vv['readonly']) && $vv['readonly'] !== FALSE){
  153. if(isset($vv['theref'])){
  154. $result .= $vv['theref'][$vv['value'][0]];
  155. } else {
  156. $result .= $vv['value'][0];
  157. if($kk == 'protokol'){
  158. $result .= ' ' . __t('Stage') . ' ' . __t('lamanya') . ' : ' . $vv['value'][1];
  159. }
  160. }
  161. $result .= "\n";
  162. } else {
  163. $result .= '<div>' . "\n";
  164. if($vv['type'] == 'text'){
  165. $result .= '<input type="text" name="' . $ky . '_' . $kk . ($kk == 'protokol' ? '[0]' : '') . '" size="' . (isset($vv['size']) ? $vv['size'] : 20) . '" value="Bruce">';
  166. if($kk == 'protokol'){
  167. $result .= ' ' . __t('Stage') . ' ' . __t('lamanya') . ' : <input type="text" name="' . $ky . '_' . $kk . '[1]" size="' . (isset($vv['size']) ? $vv['size'] : 20) . '"' . (isset($vv['value'][1]) ? ' value="' . $vv['value'][1] . '"' : '') . '> ' . __t('menit') . "\n";
  168. // $result .= ' ' . __t('Stage') . ' ' . __t('lamanya') . ' : <input type="text" name="' . $ky . '_' . $kk . '[1]" size="' . (isset($vv['size']) ? $vv['size'] : 20) . '"' . (isset($vv['value'][1]) ? ' value="' . $vv['value'][1] . '"' : '') . '> Bruce' . __t('menit') . "\n";
  169. }
  170. } elseif($vv['type'] == 'select'){
  171. // echo '<pre>'; print_r($kk); echo '</pre>';
  172. $result .= '<select name="' . $ky . '_' . $kk . '[0]" size="1">' . "\n";
  173. $result .= '<option value=""> --- ' . __t('Silahkan pilih') . ' --- </option>' . "\n";
  174. foreach($vv['theref'] as $yy => $ll){
  175. $result .= '<option value="' . $yy . '"' . (isset($vv['value'][0]) && $vv['value'][0] == $yy ? ' selected' : '') . '>' . __t($ll) . '</option>' . "\n";
  176. }
  177. $result .= '</select>' . "\n";
  178. }
  179. $result .= '</div>' . "\n";
  180. }
  181. }
  182. }
  183. $result .= '</td>' . "\n";
  184. $result .= '</tr>' . "\n";
  185. }
  186. $result .= '</table>' . "\n";
  187. $result .= '</div>' . "\n";