tool.blade.php
1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="/css/jquery.mobile-1.3.2.min.css">
<script src="/js/jquery-1.8.3.min.js"></script>
<script src="/js/jquery.mobile-1.3.2.min.js"></script>
</head>
<body>
<div data-role="page">
<div data-role="header">
<h1>强制弹出充电宝工具</h1>
</div>
<div data-role=""><h1 id="msg"></h1></div>
<div data-role="content">
<fieldset data-role="fieldcontain">
{{csrf_field()}}
<label for="mac_no">选择机柜</label>
<select name="mac_no" id="mac_no">
@foreach($machines as $machine)
<option value="{{$machine->mac_no}}" style="color:;">
{{$machine->mac_no}}~~{{$machine->life == 1 ? '在线' : '离线'}}
</option>
@endforeach
</select>
</fieldset>
<fieldset data-role="fieldcontain">
<label for="position">选择仓口</label>
<select name="position" id="position">
<?php for ($i = 1;$i <= 55;$i++) {?>
<option value="<?=$i?>"><?=$i?>号仓口</option>
<?php } ?>
</select>
</fieldset>
<button id="subm">发送命令</button>
</div>
</div>
</body>
<script>
$('#subm').click(function(){
var mac_no = $('#mac_no').val();
var position = $('#position').val();
var csrf_token = $('input[name=_token]').val();
$.ajax({
url:'/tool/dotool',
data:{'mac_no':mac_no, 'position':position, '_token':csrf_token},
type:'post',
dataType:'json',
success:function(msg){
alert(msg.msg);
}
})
})
</script>
</html>