productinvest.html.php 4.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <style>
  2. #mainContent > .side-col.col-lg{width: 235px}
  3. .hide-sidebar #sidebar{width: 0 !important}
  4. .c-count {width: 150px;}
  5. .c-name {width: 100px;}
  6. #conditions {display: flex;}
  7. #conditions .condition-options {margin-left: 16px;}
  8. .pl-4 {padding-left: 1rem;}
  9. </style>
  10. <div class='flex bg-canvas p-2' id='conditions'>
  11. <div class='input-group w-1/4 pl-4'>
  12. <span class='input-group-addon'><?php echo $lang->pivot->otherLang->product;?></span>
  13. <?php echo html::select('product', array('' => '') + $products, $productID, "class='form-control chosen' onchange='loadProductInvest()'");?>
  14. </div>
  15. <div class='input-group w-1/4 pl-4'>
  16. <span class='input-group-addon'><?php echo $lang->pivot->otherLang->productStatus;?></span>
  17. <?php echo html::select('productStatus', $statusList, $productStatus, "class='form-control chosen' onchange='loadProductInvest()'");?>
  18. </div>
  19. <div class='input-group w-1/4 pl-4'>
  20. <span class='input-group-addon'><?php echo $lang->pivot->otherLang->productType;?></span>
  21. <?php echo html::select('productType', $typeList, $productType, "class='form-control chosen' onchange='loadProductInvest()'");?>
  22. </div>
  23. </div>
  24. <?php if(empty($investData)):?>
  25. <div class="cell bg-canvas">
  26. <div class="dtable-empty-tip">
  27. <p><span class="text-muted"><?php echo $lang->error->noData;?></span></p>
  28. </div>
  29. </div>
  30. <?php else:?>
  31. <div class='cell'>
  32. <div class='panel rounded ring-0 bg-canvas'>
  33. <div class='panel-heading'>
  34. <div class='panel-title'><?php echo $title;?></div>
  35. </div>
  36. <div class='panel-body pt-0'>
  37. <div data-ride='table'>
  38. <table class='table table-condensed table-striped table-bordered table-fixed no-margin' id='productList'>
  39. <thead>
  40. <tr class='text-center text-left bg-canvas'>
  41. <th class='c-name text-left border'><?php echo $lang->product->name;?></th>
  42. <th class='c-count border'><?php echo $lang->pivot->projects;?></th>
  43. <th class="c-count border"><?php echo $lang->pivot->storyConsumed;?></th>
  44. <th class="c-count border"><?php echo $lang->pivot->taskConsumed;?></th>
  45. <th class="c-count border"><?php echo $lang->pivot->bugConsumed;?></th>
  46. <th class="c-count border"><?php echo $lang->pivot->caseConsumed;?></th>
  47. <th class="c-count border"><?php echo $lang->pivot->totalConsumed;?></th>
  48. </tr>
  49. </thead>
  50. <tbody>
  51. <?php foreach($investData as $invest):?>
  52. <tr class="text-center">
  53. <td class='border'><div class='text-ellipsis text-left' title='<?php echo $invest->name;?>'><?php echo $invest->name?></div></td>
  54. <td class='border'><?php echo $invest->projectCount;?></td>
  55. <td class='border'><?php echo $invest->storyConsumed;?></td>
  56. <td class='border'><?php echo $invest->taskConsumed;?></td>
  57. <td class='border'><?php echo $invest->bugConsumed;?></td>
  58. <td class='border'><?php echo $invest->caseConsumed;?></td>
  59. <td class='border'><?php echo $invest->totalConsumed;?></td>
  60. </tr>
  61. <?php endforeach;?>
  62. </tbody>
  63. </table>
  64. </div>
  65. </div>
  66. </div>
  67. </div>
  68. <?php endif;?>
  69. <script>
  70. function loadProductInvest()
  71. {
  72. var conditions = '';
  73. /*
  74. $('#conditions input[type=checkbox]').each(function(i)
  75. {
  76. if($(this).prop('checked')) conditions += $(this).val() + ',';
  77. })
  78. conditions = conditions.substring(0, conditions.length - 1);
  79. */
  80. var productID = $('#product').val();
  81. var productStatus = $('#productStatus').val();
  82. var productType = $('#productType').val();
  83. var params = window.btoa('conditions=' + conditions + '&productID=' + productID + '&productStatus=' + productStatus + '&productType=' + productType);
  84. var link = $.createLink('pivot', 'preview', 'dimension=' + <?php echo $dimensionID;?> + '&group=' + <?php echo $groupID;?> + '&method=productinvest&params=' + params);
  85. loadPage(link, '#pivotContent');
  86. }
  87. </script>