You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

108 lines
4.4 KiB

7 years ago
7 years ago
  1. <div class="page-header" data-fit-aside>
  2. <h2 class="page-title"><?=$this->site->config('point_name')?> 관리</h2>
  3. </div>
  4. <form data-grid-search onsubmit="grid.refresh(1);return false;" data-fit-aside autocomplete="off">
  5. <div data-ax-tbl>
  6. <div data-ax-tr>
  7. <div data-ax-td>
  8. <div data-ax-td-label><?=$this->site->config('point_name')?> 유형</div>
  9. <div data-ax-td-wrap>
  10. <select class="form-control form-control-inline" name="target_type">
  11. <option value="">전체보기</option>
  12. <?php foreach($point_type as $key=>$val) :?>
  13. <option value="<?=$key?>" <?=$target_type==$key?'selected':''?>><?=$val?></option>
  14. <?php endforeach;?>
  15. </select>
  16. </div>
  17. </div>
  18. <div data-ax-td>
  19. <div data-ax-td-label>기간검색</div>
  20. <div data-ax-td-wrap>
  21. <input class="form-control" data-chained-datepicker="[name='enddate']" name="startdate" data-toggle="datepicker" value="">
  22. </div>
  23. <div data-ax-td-wrap>
  24. <input class="form-control" name="enddate" data-toggle="datepicker" value="">
  25. </div>
  26. </div>
  27. <div data-ax-td class="W100">
  28. <div data-ax-td-wrap>
  29. <button class="btn btn-default btn-sm"><i class="fal fa-search"></i> 필터적용</button>
  30. </div>
  31. </div>
  32. </div>
  33. </div>
  34. </form>
  35. <div class="H10" data-fit-aside></div>
  36. <div class="grid-wrapper" data-fit-content>
  37. <div class="grid-container" id="grid-container"></div>
  38. </div>
  39. <script>
  40. var grid = new GRID('#grid-container', {
  41. paging: {
  42. pageSize: 20
  43. },
  44. columns: [
  45. {caption:'번호', dataField:'nums', alignment:'right', width:60, dataType:'number', format:'fixedPoint'},
  46. {caption:'일시', dataField:'reg_datetime', alignment:'center', width:120},
  47. {caption:'회원명', dataField:'mem_nickname', alignment:'center', width:80},
  48. {caption:'회원ID', dataField:'mem_userid', alignment:'left', width:180},
  49. {caption:'구분', dataField:'target_type', alignment:'center', width:120},
  50. {
  51. caption: '증가', name:'mpo_value_plus', dataField:'mpo_value', alignment:'right', dataType:'number', format:'fixedPoint', width:120,
  52. calculateCellValue: function(cell) {
  53. if(cell.mpo_flag == 1) return cell.mpo_value.numberFormat()
  54. }
  55. },
  56. {
  57. caption: '감소',name:'mpo_value_minus', dataField:'mpo_value', alignment:'right', dataType:'number', format:'fixedPoint', width:120,
  58. calculateCellValue: function(cell) {
  59. if(cell.mpo_flag == -1) return cell.mpo_value.numberFormat()
  60. }
  61. },
  62. {caption:'내용', dataField:'mpo_description', alignment:'left', minWidth:120},
  63. ],
  64. onCellPrepared: function(e) {
  65. if(e.rowType == 'data') {
  66. if(e.column.name == 'mpo_value_plus') {
  67. e.cellElement.css("color", '#3498db');
  68. }
  69. else if (e.column.name == 'mpo_value_minus') {
  70. e.cellElement.css("color", '#e32815');
  71. }
  72. }
  73. },
  74. onContextMenuPreparing: function(e) {
  75. if (e.row.rowType === "data") {
  76. e.items = APP.memberMenuObject(e, <?=$this->site->config('point_use')=='Y'?'"'.$this->site->config('point_name').'"':'false'?>);
  77. }
  78. },
  79. dataSource: new DevExpress.data.DataSource({
  80. key : 'mpo_idx',
  81. load: function(loadOptions) {
  82. var d = $.Deferred();
  83. var params = grid.getSearchParam(loadOptions);
  84. $.ajax({
  85. url : base_url + '/admin/ajax/members/points',
  86. type: 'GET',
  87. async: false,
  88. cache: false,
  89. data: params
  90. }).done(function(res) {
  91. d.resolve(res.lists, {
  92. totalCount : res.totalCount
  93. });
  94. });
  95. return d.promise();
  96. }
  97. }),
  98. });
  99. $(function() {
  100. grid.init();
  101. })
  102. </script>