PageRenderTime 34ms CodeModel.GetById 22ms RepoModel.GetById 1ms app.codeStats 0ms

/User/admin/contens/charts/danhSach.php

https://gitlab.com/nmhieucoder/php_bandienthoai
PHP | 131 lines | 125 code | 6 blank | 0 comment | 7 complexity | 4b459ca1a0e792ffd27c9b251473d5ab MD5 | raw file
  1. <?php require_once($level.compPart."Chart_Search.php"); ?>
  2. <!-- ============================================================== -->
  3. <!-- Charts pages -->
  4. <!-- ============================================================== -->
  5. <style>
  6. .activePage{
  7. background-color:#27a9e3;
  8. color:white;
  9. }
  10. </style>
  11. <div class="card" id="lstChart">
  12. <div class="card-body">
  13. <div class="table-responsive">
  14. <div id="zero_config_wrapper" class="dataTables_wrapper container-fluid dt-bootstrap4">
  15. <div class="row mb-2">
  16. <div class="col-12 d-flex no-block align-items-center">
  17. <div id="zero_config_filter" class="dataTables_filter" style="margin: auto;">
  18. <form style="display: flex;">
  19. <select name="chart_mou" class="select2 form-control custom-select" style="border-color:blueviolet;width: 15vw; height:36px;">
  20. <?php for($i = 1; $i<=12;$i++){
  21. ?>
  22. <option value="<?php echo $i ?>">Tháng <?php echo $i ?> </option>
  23. <?php } ?>
  24. </select>
  25. <input name="chart_Yea" type="number" style="width: 30%; font-size: medium;border-color: blueviolet;"
  26. class="form-control form-control-sm" placeholder="Năm">
  27. <button type="submit" class="btn btn-cyan btn-sm">Tìm kiếm</button>
  28. </form>
  29. </div>
  30. <div id="zero_config_filter" class="dataTables_filter" style=" margin-left: 30px;">
  31. <form style="display: flex;">
  32. <select name="chart_Quy" class="select2 form-control custom-select" style="border-color:blueviolet;width: 15vw; height:36px;">
  33. <?php for($i = 1; $i<=4;$i++){
  34. ?>
  35. <option value="<?php echo $i ?>">Quý <?php echo $i ?> </option>
  36. <?php } ?>
  37. <input name="chart_Yea" type="number" style="width: 30%; font-size: medium;border-color: blueviolet;"
  38. class="form-control form-control-sm" placeholder="Năm">
  39. </select>
  40. <button type="submit" class="btn btn-cyan btn-sm">Tìm kiếm</button>
  41. </form>
  42. </div>
  43. <div id="zero_config_filter" class="dataTables_filter" style=" margin-left: 30px;">
  44. <form style="display: flex;">
  45. <input name="chart_Year" type="number" style="width: 100%; margin-left: 10px; font-size: medium;border-color: blueviolet;"
  46. class="form-control form-control-sm" placeholder="Năm">
  47. <button type="submit" class="btn btn-cyan btn-sm">Tìm kiếm</button>
  48. </form>
  49. </div>
  50. <!-- <div id="zero_config_filter" class="dataTables_filter" style="margin: auto;">
  51. <form style="display: flex;">
  52. <button style="height:36px;" type="submit" class="btn btn-cyan btn-sm">Xem tất cả</button>
  53. </form>
  54. </div> -->
  55. </div>
  56. </div>
  57. <div class="row">
  58. <div class="col-sm-12">
  59. <table id="zero_config" class="table table-striped table-bordered dataTable" role="grid"
  60. aria-describedby="zero_config_info">
  61. <thead>
  62. <tr role="row">
  63. <th class="sorting_asc" rowspan="1"colspan="1" style="width: 50.333px;"> ID</th>
  64. <th class="sorting_asc" rowspan="1" colspan="1" style="width: 200.333px;">Tên</th>
  65. <th class="sorting" rowspan="1" colspan="1" style="width: 100.667px;">Giá</th>
  66. <th class="sorting" rowspan="1" colspan="1" style="width: 90.3333px;">Số lượng</th>
  67. <th class="sorting" rowspan="1" colspan="1" style="width: 100px;">Ngày bán</th>
  68. <th class="sorting" rowspan="1" colspan="1" style="width: 37px;">Thành tiền</th>
  69. </tr>
  70. </thead>
  71. <tbody >
  72. <?php
  73. foreach( $lstCharts as $value){
  74. ?>
  75. <tr role="row" class="even">
  76. <td><?php echo $value["prodID"] ?></td>
  77. <td><?php echo $value["prodName"] ?></td>
  78. <td><?php echo number_format($value["InfoOrderPrice"])."đ"; ?></td>
  79. <td><?php echo $value["InfoOrderSL"] ?></td>
  80. <td><?php echo $value["ordDate"] ?></td>
  81. <td><?php echo number_format($value["InfoOrderSL"]*$value["InfoOrderPrice"])." đ"; ?></td>
  82. </tr>
  83. <?php } ?>
  84. </tbody>
  85. <tfoot>
  86. <tr role="row">
  87. <th class="sorting_asc"rowspan="1"colspan="1" style="width: 50.333px;"> ID</th>
  88. <th class="sorting_asc" rowspan="1" colspan="1" style="width: 200.333px;">Tên</th>
  89. <th class="sorting" rowspan="1" colspan="1" style="width: 100.667px;">Giá</th>
  90. <th class="sorting" rowspan="1" colspan="1" style="width: 90.3333px;">Số lượng</th>
  91. <th class="sorting" rowspan="1" colspan="1" style="width: 100px;">Ngày bán</th>
  92. <th class="sorting" rowspan="1" colspan="1" style="width: 37px;">Thành tiền</th>
  93. </tr>
  94. </tfoot>
  95. </table>
  96. </div>
  97. </div>
  98. </div>
  99. </div>
  100. </div>
  101. <div class="row mb-3">
  102. <div class="col-12 d-flex">
  103. <ul class="pagination " style="margin:auto;">
  104. <?php for( $i=0 ; $i< ceil(count($countlst)/5) ;$i++){
  105. ?>
  106. <li onclick="page('<?php echo $i*5; ?>','<?php echo ceil(count($countlst)/5); ?>', '<?php echo $i?>');"class="page-item page-link"><?php echo $i+1; ?></li>
  107. <?php } ?>
  108. </ul>
  109. </div>
  110. </div>
  111. </div>
  112. <script>
  113. function page(page, sumRow, check){
  114. const xhttp = new XMLHttpRequest();
  115. xhttp.onreadystatechange = function() {
  116. if (this.readyState == 4 && this.status == 200) {
  117. document.getElementById("lstChart").innerHTML =
  118. this.responseText;
  119. }
  120. };
  121. var url = "../api/Chart_chiatrang.php?sta=" + page +"&sumRow="+ sumRow +"&check="+check;
  122. xhttp.open("GET", url);
  123. xhttp.send();
  124. }
  125. </script>