<script type="text/javascript">

$(document).ready(function(){


$('#button_poweron').click(function(){
	$('#button_poweron').attr('disabled','disabled');
	//发送开机命令
	var ip=$('#computer_ip').val();
	var mac=$('#computer_mac').val();
	 $.get("<?php echo site_url('onlineoffice/wakeonlan/'); ?>"+'/'+ip+'/'+mac,function(data,status){
		//alert("Data: " + data + "\nStatus: " + status);
		$('#ping_status').append('<li>开机命令发送成功，准备启动...'+'</li>');
	  });
	  
	  window.setInterval(function(){
		$.get("<?php echo site_url('onlineoffice/ping/'); ?>"+'/'+ip,function(data,status){
			$('#ping_status').append('<li>'+data+'</li>');
	  });
		
	  },10000); 
});

});
</script>

<div class="container-fluid">
<h3>在线开机</h3>
<div class="row">
<div class="col-md-2"></div>
<div class="col-md-6">
<form name="form_wakeup" action="<?php echo site_url('onlineoffice'); ?>" method="post">
<div class="form-group">
    <label for="computer_ip">电脑IP</label>
    <input type="text" class="form-control" id="computer_ip" name="computer_ip" placeholder="202.103.68.xxx" value="<?php echo $whu_ip; ?>">
  </div>
  <div class="form-group">
    <label for="computer_mac">电脑MAC地址</label>
    <input type="text" class="form-control" id="computer_mac" name="computer_mac" placeholder="xx:xx:xx:xx:xx" value="<?php echo $whu_mac; ?>">
  </div>
  <label class="text-success">ip不正确或开机不成功请联系ycc调试</label>
   <button type="button" id="button_poweron" class="btn btn-primary pull-right">发送启动命令</button>
</form>
</div>
<div class="col-md-8">
<ul id="ping_status">

</ul>
</div>
<div class="col-md-2"></div>


</div>


</div>