settips.html.php 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <?php
  2. $lang->custom->object = array();
  3. $lang->custom->system = array();
  4. include $app->getModuleRoot() . 'common/view/header.html.php';
  5. js::set('object', $object);
  6. ?>
  7. <?php $isEn = $app->getClientLang() == 'en';?>
  8. <div id='mainMenu' class='clearfix menu-secondary'>
  9. <div class="btn-toolbar pull-left">
  10. <?php include './menu.html.php';?>
  11. </div>
  12. </div>
  13. <div id='mainContent' class='main-row'>
  14. <div class='side-col' id='sidebar' <?php echo $isEn ? 'style="width: 246px;"' : ''; ?>>
  15. <div class='cell' <?php echo $isEn ? 'style="width: 100%;"' : ''; ?>>
  16. <div class='list-group'>
  17. <?php
  18. foreach($lang->custom->tipProgressList as $key => $value)
  19. {
  20. echo html::a(inlink('setTips', "type=progress&object=$key"), $value, '', " id='{$key}Tab'");
  21. }
  22. foreach($lang->custom->tipCostList as $key => $value)
  23. {
  24. echo html::a(inlink('setTips', "type=cost&object=$key"), $value, '', " id='{$key}Tab'");
  25. }
  26. ?>
  27. </div>
  28. </div>
  29. </div>
  30. <div class='main-col main-content'>
  31. <form class="load-indicator main-form form-ajax" method='post'>
  32. <table class='table table-form mw-900px'>
  33. <thead>
  34. <tr class='text-center'>
  35. <th class='w-200px'><?php echo $lang->custom->region;?></th>
  36. <th class='w-150px'><?php echo $lang->custom->isRange;?></th>
  37. <th><?php echo $lang->custom->tips;?></th>
  38. <th class="w-90px"> <?php echo $lang->actions;?></th>
  39. </tr>
  40. </thead>
  41. <tbody>
  42. <?php $i = 0;?>
  43. <?php if(!empty($tipsConfig)):?>
  44. <?php foreach($tipsConfig as $key => $tipConfig):?>
  45. <?php if($tipConfig->type != $object) continue;?>
  46. <tr class='addedItem'>
  47. <td>
  48. <div class='input-group'>
  49. <input type='text' name='mins[]' id='maxs<?php echo $i;?>' value='<?php echo $tipConfig->min?>' class='form-control' />
  50. <span class='input-group-addon'><?php echo $lang->dash;?></span>
  51. <input type='text' name='maxs[]' id='maxs<?php echo $i;?>' value='<?php echo $tipConfig->max?>' class='form-control' />
  52. </div>
  53. </td>
  54. <td class='text-center'><?php echo html::radio("ranges[$i]", $lang->custom->tipRangeList, $tipConfig->range ? $tipConfig->range : 0);?></td>
  55. <td><input type='text' name='tips[]' id='tips<?php echo $i;?>' value='<?php echo $tipConfig->tip?>' class='form-control' /></td>
  56. <td class='c-actions text-center'>
  57. <a href='javascript:;' onclick='addItem(this)' class='btn btn-link'><i class='icon-plus'></i></a>
  58. <a href='javascript:;' onclick='deleteItem(this)' class='btn btn-link'><i class='icon icon-close'></i></a>
  59. </td>
  60. </tr>
  61. <?php $i ++;?>
  62. <?php endforeach;?>
  63. <?php endif;?>
  64. <?php for($j = 0; $j < 2; $j ++):?>
  65. <tr class='addedItem'>
  66. <td>
  67. <div class='input-group'>
  68. <input type='text' name='mins[]' id='maxs<?php echo $i;?>' value='' class='form-control' />
  69. <span class='input-group-addon'><?php echo $lang->dash;?></span>
  70. <input type='text' name='maxs[]' id='maxs<?php echo $i;?>' value='' class='form-control' />
  71. </div>
  72. </td>
  73. <td class='text-center'><?php echo html::radio("ranges[$i]", $lang->custom->tipRangeList, 0);?></td>
  74. <td><input type='text' name='tips[]' id='tips<?php echo $i;?>' value='' class='form-control' /></td>
  75. <td class='c-actions text-center'>
  76. <a href='javascript:;' onclick='addItem(this)' class='btn btn-link'><i class='icon-plus'></i></a>
  77. <a href='javascript:;' onclick='deleteItem(this)' class='btn btn-link'><i class='icon icon-close'></i></a>
  78. </td>
  79. </tr>
  80. <?php $i ++;?>
  81. <?php endfor;?>
  82. </tbody>
  83. <tfoot>
  84. <tr>
  85. <td colspan='3' class='text-center'><?php echo html::submitButton();?></td>
  86. </tr>
  87. </tfoot>
  88. </table>
  89. <?php js::set('i', $i);?>
  90. </form>
  91. <?php $i = '%i%';?>
  92. <table class='hidden'>
  93. <tr id='addItem' class='hidden'>
  94. <td>
  95. <div class='input-group'>
  96. <input type='text' name='mins[]' id='mins<?php echo $i;?>' class='form-control' />
  97. <span class='input-group-addon'><?php echo $lang->dash;?></span>
  98. <input type='text' name='maxs[]' id='maxs<?php echo $i;?>' class='form-control' />
  99. </div>
  100. </td>
  101. <td class='text-center'><?php echo html::radio("ranges[$i]", $lang->custom->tipRangeList, 0);?></td>
  102. <td><input type='text' name='tips[]' id='tips<?php echo $i;?>' class='form-control' /></td>
  103. <td class='c-actions text-center'>
  104. <a href='javascript:;' onclick='addItem(this)' class='btn btn-link'><i class='icon-plus'></i></a>
  105. <a href='javascript:;' onclick='deleteItem(this)' class='btn btn-link'><i class='icon icon-close'></i></a>
  106. </td>
  107. </tr>
  108. </table>
  109. </div>
  110. </div>
  111. <script>
  112. $('#' + object + 'Tab').addClass('active');
  113. function addItem(obj)
  114. {
  115. var item = $('#addItem').html().replace(/%i%/g, i);
  116. $(obj).closest('tr').after('<tr class="addedItem">' + item + '</tr>');
  117. i ++;
  118. }
  119. function deleteItem(obj)
  120. {
  121. $(obj).closest('tr').remove();
  122. }
  123. </script>
  124. <?php include $app->getModuleRoot() . 'common/view/footer.html.php';?>