vaccine_setting_table.blade.php 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <form id="commentForm">
  2. <div class="row">
  3. <input name="id" type="hidden" value="{{$req['id']}}">
  4. <div class="col-lg-12" style="margin-bottom: 10px;margin-left: 10px;">
  5. <input class="week_time_point_all" name="week_time_point_all" <?php if (empty($data)) { echo 'checked'; } ?> type="checkbox" value="1"><span style="margin-left: 6px;">不限</span>
  6. </div>
  7. <div class="col-lg-12">
  8. <div class="box-body table-responsive no-padding">
  9. <table class="table table-bordered table-hover table-striped" style="text-align: center;">
  10. <tbody>
  11. <tr style="color: #ecf0f4;background-color: #3c8dbc;">
  12. <th></th>
  13. <th style="text-align: center">周一</th>
  14. <th style="text-align: center">周二</th>
  15. <th style="text-align: center">周三</th>
  16. <th style="text-align: center">周四</th>
  17. <th style="text-align: center">周五</th>
  18. <th style="text-align: center">周六</th>
  19. <th style="text-align: center">周日</th>
  20. </tr>
  21. <tr>
  22. <td>上午</td>
  23. <?php for ($i = 11; $i <= 17; $i++) { ?>
  24. <td><input class="week_time_point" <?php if (in_array($i, $data)) { echo 'checked'; } ?> name="week_time_point[]" type="checkbox" value="{{$i}}"></td>
  25. <?php } ?>
  26. </tr>
  27. <tr>
  28. <td>下午</td>
  29. <?php for ($i = 21; $i <= 27; $i++) { ?>
  30. <td><input class="week_time_point" <?php if (in_array($i, $data)) { echo 'checked'; } ?> name="week_time_point[]" type="checkbox" value="{{$i}}"></td>
  31. <?php } ?>
  32. </tr>
  33. </tbody>
  34. </table>
  35. </div>
  36. </div>
  37. <div class="col-lg-12" style="text-align: center;margin-top: 10px;">
  38. <button type="button" class="btn btn-primary" onclick="sub()">提 交</button>
  39. </div>
  40. </div>
  41. </form>
  42. <script src="/layui/layer/layer.js"></script>
  43. <script>
  44. $(function () {
  45. $('.week_time_point').click(function () {
  46. $('.week_time_point_all').removeAttr('checked');
  47. });
  48. $('.week_time_point_all').click(function () {
  49. $('.week_time_point').removeAttr('checked');
  50. });
  51. })
  52. function sub()
  53. {
  54. $.post('{{url("/cdms/community/vaccineSetting/sumbit")}}', $('#commentForm').serialize(), function (res) {
  55. if (res.status == 0){
  56. window.location.href = document.referrer;
  57. }
  58. else {
  59. layer.msg(res.message, {icon: 5, time: 3000});
  60. }
  61. });
  62. }
  63. </script>