ios_device.php 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <?php
  2. namespace app\admin;
  3. class ios_device extends Base
  4. {
  5. public function initialize()
  6. {
  7. parent::initialize();
  8. $this->Administrator(6);
  9. $this->header();
  10. }
  11. public function __destruct()
  12. {
  13. ?> <script>
  14. $('input[name=sort]').on('input', function () {
  15. var sort = $(this).val();
  16. if (sort != $(this).attr('data-sort'))
  17. $.ajax({
  18. url: '?c=ajax&a=ios_device_sort',
  19. data: {id: $(this).attr('data-id'), sort: sort},
  20. type: 'post',
  21. success: function (ret) {
  22. console.log(ret)
  23. }
  24. });
  25. });
  26. </script>
  27. <?php
  28. $this->footer();
  29. }
  30. function index($map = [])
  31. {
  32. $_var_0 = SafeRequest("udid", "get");
  33. if ($_var_0) {
  34. $map[] = ["udid", "=", $_var_0];
  35. }
  36. $_var_1 = SafeRequest("iss", "get");
  37. if ($_var_1) {
  38. $map[] = ["cert_iss", "=", $_var_1];
  39. }
  40. $_var_2 = SafeRequest("page", "get");
  41. $_var_3 = db("ios_device")->where($map)->group("udid")->order("version desc")->paginate(["page" => $_var_2]);
  42. $_var_4 = $_var_3->items();
  43. $_var_5 = getRender($_var_3, $_var_2);
  44. $_var_6 = $_var_3->total();
  45. ?><div class="container"><?php
  46. $this->nav3();
  47. ?><table class="tb tb2">
  48. <tr><th class="partition">设备列表</th></tr>
  49. </table>
  50. <table class="tb tb2">
  51. <tr class="header">
  52. <th>ID</th>
  53. <th>设备UDID</th>
  54. <th>设备型号</th>
  55. <th>设备版本</th>
  56. <th>操作</th>
  57. </tr>
  58. <?php
  59. if ($_var_6 == 0) {
  60. ?><tr><td colspan="2" class="td27">没有设备管理</td></tr>
  61. <?php
  62. }
  63. function eachrow($_var_7, $_var_8 = '<b></b>')
  64. {
  65. $_var_9 = db("super_sign")->where("udid", $_var_7["udid"])->count();
  66. ?><tr class="hover">
  67. <td class="td25"><?php echo $_var_7["id"];?></td>
  68. <td><a href="?c=super_sign&a=index&udid=<?php echo $_var_7["udid"];?>"><?php echo $_var_7["udid"];?></a></td>
  69. <td><?php echo $_var_7["product"];?></td>
  70. <td><?php echo $_var_7["version"];?></td>
  71. <td><?php echo $_var_9 ? "<a href=\"?c=super_sign&a=index&udid=" . $_var_7["udid"] . "\">签名记录(" . $_var_9 . ")</a>" : "";?></td></tr><?php
  72. }
  73. if ($_var_4) {
  74. foreach ($_var_4 as $_var_10) {
  75. eachrow($_var_10);
  76. }
  77. }
  78. ?></table></div><?php echo $_var_5;?><?php
  79. }
  80. }