blockcondition.html.php 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <div class='panel'>
  2. <div class='panel-heading'>
  3. <div class='panel-title'><?php echo $lang->crystal->condition?></div>
  4. </div>
  5. <form action='<?php echo inlink('custom', "step=2&reportID=$reportID&from=$type")?>' target='hiddenwin' method='post' class='main-form'>
  6. <table class='table table-form'>
  7. <tr>
  8. <th class='thWidth'><?php echo $lang->crystal->group?></th>
  9. <td style='overflow: visible'>
  10. <div class='input-group'>
  11. <span class='input-group-addon'><?php echo $lang->crystal->group1?></span>
  12. <?php echo html::select('group1', $fields, empty($condition['group1']) ? '' : $condition['group1'], "class='form-control chosen'")?>
  13. <span class='input-group-addon'>
  14. <div class='checkbox-primary'>
  15. <?php echo html::checkbox('isUser[group1]', array('1' => $lang->crystal->isUser), empty($condition['isUser']['group1']) ? '' : 1)?>
  16. </div>
  17. </span>
  18. </div>
  19. </td>
  20. <td style='overflow: visible'>
  21. <div class='input-group'>
  22. <span class='input-group-addon'><?php echo $lang->crystal->group2?></span>
  23. <?php echo html::select('group2', array('' => '') + $fields, empty($condition['group2']) ? '' : $condition['group2'], "class='form-control chosen'")?>
  24. <span class='input-group-addon'>
  25. <div class='checkbox-primary'>
  26. <?php echo html::checkbox('isUser[group2]', array('1' => $lang->crystal->isUser), empty($condition['isUser']['group2']) ? '' : 1)?>
  27. </div>
  28. </span>
  29. </div>
  30. </td>
  31. </tr>
  32. <tr>
  33. <th class='text-top'><?php echo $lang->crystal->statistics?></th>
  34. <td colspan='2' style='overflow:visible'>
  35. <table class='table table-fixed table-form table-condensed'>
  36. <thead class='text-center'>
  37. <tr>
  38. <th><?php echo $lang->crystal->reportField?></th>
  39. <th class='w-250px'><?php echo $lang->crystal->reportType?></th>
  40. <th class='w-70px'><?php echo $lang->crystal->reportTotal?></th>
  41. <th><?php echo $lang->crystal->percent?></th>
  42. <th class='w-100px'></th>
  43. </tr>
  44. </thead>
  45. <tbody>
  46. <tr>
  47. <td style='overflow: visible'>
  48. <div class='input-group'>
  49. <?php echo html::select('reportField[]', $fields, empty($condition['reportField'][0]) ? '' : $condition['reportField'][0], "class='form-control chosen'")?>
  50. <span class='input-group-addon'>
  51. <div class='checkbox-primary'>
  52. <?php echo html::checkbox('isUser[reportField][0]', array('1' => $lang->crystal->isUser), empty($condition['isUser']['reportField'][0]) ? '' : 1)?>
  53. </div>
  54. </span>
  55. </div>
  56. </td>
  57. <td style='overflow: visible'>
  58. <div class='input-group'>
  59. <?php echo html::select('reportType[]', $lang->crystal->reportTypeList, empty($condition['reportType'][0]) ? '' : $condition['reportType'][0], "class='form-control' onchange='toggleSumAppend(this)'")?>
  60. <span class="input-group-addon fix-border fix-padding"></span>
  61. <?php echo html::select('sumAppend[]', array('' => $lang->crystal->sumPlaceholder) + $fields, empty($condition['sumAppend'][0]) ? '' : $condition['sumAppend'][0], "class='form-control " . (empty($condition['reportType'][0]) ? 'hidden' : ($condition['reportType'][0] == 'count' ? 'hidden' : '')) . "'")?>
  62. </div>
  63. </td>
  64. <td class='text-center'>
  65. <div class='checkbox-primary' style='margin-left:20px'>
  66. <input type='checkbox' name='reportTotal[0]' value=1 <?php echo empty($condition['reportTotal'][0]) ? '' : 'checked'?> />
  67. <label></label>
  68. </div>
  69. </td>
  70. <td class='text-center' style='overflow: visible'>
  71. <div class='input-group'>
  72. <span class='input-group-addon'>
  73. <div class='checkbox-primary'>
  74. <input type='checkbox' name='percent[0]' value=1 <?php echo empty($condition['percent'][0]) ? '' : 'checked'?> onchange='toggleContrast(this)'/>
  75. <label><?php echo $lang->crystal->contrast?></label>
  76. </div>
  77. </span>
  78. <?php $class = empty($condition['percent'][0]) ? 'disabled' : '';?>
  79. <?php echo html::select('contrast[0]', array('' => '') + $fields + array('crystalTotal' => $lang->report->total), empty($condition['contrast'][0]) ? '' : $condition['contrast'][0], "class='form-control contrastField' $class");?>
  80. <span class='input-group-addon'>
  81. <div class='checkbox-primary'>
  82. <input type='checkbox' name='showAlone[0]' value=1 class='contrastField' <?php echo $class?> <?php echo empty($condition['showAlone'][0]) ? '' : 'checked'?> />
  83. <label><?php echo $lang->crystal->showAlone;?></label>
  84. </div>
  85. </span>
  86. </div>
  87. </td>
  88. <td>
  89. <div class='btn-group'>
  90. <?php echo html::a('javascript:;', '<i class="icon-plus"></i>', '', "onclick='addField(this)' class='btn'")?></a>
  91. <?php echo html::a('javascript:;', '<i class="icon-close"></i>', '', "onclick='deleteField(this)' class='btn'")?></a>
  92. </div>
  93. </td>
  94. </tr>
  95. <?php if(!empty($condition['reportField']) and count($condition['reportField']) >= 2):?>
  96. <?php for($i = 1; $i < count($condition['reportField']); $i++):?>
  97. <tr>
  98. <td style='overflow: visible'>
  99. <div class='input-group'>
  100. <?php echo html::select("reportField[]", $fields, empty($condition['reportField'][$i]) ? '' : $condition['reportField'][$i], "class='form-control chosen'")?>
  101. <span class='input-group-addon'>
  102. <div class='checkbox-primary'>
  103. <?php echo html::checkbox("isUser[reportField][$i]", array('1' => $lang->crystal->isUser), empty($condition['isUser']['reportField'][$i]) ? '' : 1)?>
  104. </div>
  105. </span>
  106. </div>
  107. </td>
  108. <td style='overflow: visible'>
  109. <div class='input-group'>
  110. <?php echo html::select("reportType[]", $lang->crystal->reportTypeList, empty($condition['reportType'][$i]) ? '' : $condition['reportType'][$i], "class='form-control' onchange='toggleSumAppend(this)'")?>
  111. <span class="input-group-addon fix-border fix-padding"></span>
  112. <?php echo html::select("sumAppend[]", $fields, empty($condition['sumAppend'][$i]) ? '' : $condition['sumAppend'][$i], "class='form-control " . (empty($condition['reportType'][$i]) ? 'hidden' : ($condition['reportType'][$i] == 'count' ? 'hidden' : '')) . "'")?>
  113. </div>
  114. </td>
  115. <td class='text-center'>
  116. <div class='checkbox-primary' style='margin-left:20px'>
  117. <input type='checkbox' name='reportTotal[<?php echo $i?>]' value=1 <?php echo empty($condition['reportTotal'][$i]) ? '' : 'checked'?> />
  118. <label></label>
  119. </div>
  120. </td>
  121. <td class='text-center' style='overflow: visible'>
  122. <div class='input-group'>
  123. <span class='input-group-addon'>
  124. <div class='checkbox-primary'>
  125. <input type='checkbox' name='percent[<?php echo $i?>]' value=1 <?php echo empty($condition['percent'][$i]) ? '' : 'checked'?> onchange='toggleContrast(this)'/>
  126. <label><?php echo $lang->crystal->contrast?></label>
  127. </div>
  128. </span>
  129. <?php $class = empty($condition['percent'][$i]) ? 'disabled' : '';?>
  130. <?php echo html::select("contrast[$i]", array('' => '') + $fields + array('crystalTotal' => $lang->report->total), empty($condition['contrast'][$i]) ? '' : $condition['contrast'][$i], "class='form-control contrastField' $class");?>
  131. <span class='input-group-addon'>
  132. <div class='checkbox-primary'>
  133. <input type='checkbox' name='showAlone[<?php echo $i?>]' class='contrastField' <?php echo $class?> value=1 <?php echo empty($condition['showAlone'][$i]) ? '' : 'checked'?> />
  134. <label><?php echo $lang->crystal->showAlone?></label>
  135. </div>
  136. </span>
  137. </div>
  138. </td>
  139. <td>
  140. <div class='btn-group'>
  141. <?php echo html::a('javascript:;', '<i class="icon-plus"></i>', '', "onclick='addField(this)' class='btn'")?></a>
  142. <?php echo html::a('javascript:;', '<i class="icon-close"></i>', '', "onclick='deleteField(this)' class='btn'")?></a>
  143. </div>
  144. </td>
  145. </tr>
  146. <?php endfor;?>
  147. <?php endif;?>
  148. </tbody>
  149. </table>
  150. </td>
  151. </tr>
  152. <tr><td colspan='3' class='text-center'><?php echo html::submitButton($lang->confirm);?></td></tr>
  153. </table>
  154. </form>
  155. </div>