forked from orvice/ss-panel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
129 lines (117 loc) · 5.41 KB
/
index.php
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<?php
require_once '_main.php';
//获得流量信息
if($oo->get_transfer()<1000000)
{
$transfers=0;}else{ $transfers = $oo->get_transfer();
}
//计算流量并保留2位小数
$all_transfer = $oo->get_transfer_enable()/$togb;
$unused_transfer = $oo->unused_transfer()/$togb;
$used_100 = $oo->get_transfer()/$oo->get_transfer_enable();
$used_100 = round($used_100,2);
$used_100 = $used_100*100;
//计算流量并保留2位小数
$transfers = $transfers/$tomb;
$transfers = round($transfers,2);
$all_transfer = round($all_transfer,2);
$unused_transfer = round($unused_transfer,2);
//最后在线时间
$unix_time = $oo->get_last_unix_time();
?>
<!-- =============================================== -->
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
用户中心
<small>User Center</small>
</h1>
</section>
<!-- Main content -->
<section class="content">
<!-- START PROGRESS BARS -->
<div class="row">
<div class="col-md-6">
<div class="box box-solid">
<div class="box-header">
<h3 class="box-title">公告&FAQ</h3>
</div><!-- /.box-header -->
<div class="box-body">
<p>流量不会重置,可以通过签到获取流量。</p>
<p>流量可以通过签到获取,基本每天可以用1G流量。</p>
</div><!-- /.box-body -->
</div><!-- /.box -->
</div><!-- /.col (right) -->
<div class="col-md-6">
<div class="box box-solid">
<div class="box-header">
<h3 class="box-title">流量使用情况</h3>
</div><!-- /.box-header -->
<div class="box-body">
<p> 已用流量:<?php echo $transfers."MB";?> </p>
<div class="progress progress-striped">
<div class="progress-bar progress-bar-primary" role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: <?php echo $used_100; ?>%">
<span class="sr-only">Transfer</span>
</div>
</div>
<p> 可用流量:<?php echo $all_transfer ."GB";?> </p>
<p> 剩余流量:<?php echo $unused_transfer."GB";?> </p>
</div><!-- /.box-body -->
</div><!-- /.box -->
</div><!-- /.col (left) -->
<div class="col-md-6">
<div class="box box-solid">
<div class="box-header">
<h3 class="box-title">签到获取流量</h3>
</div><!-- /.box-header -->
<div class="box-body">
<p> 22小时内可以签到一次。</p>
<?php if($oo->is_able_to_check_in()) { ?>
<p id="checkin-btn"> <button id="checkin" class="btn btn-success btn-flat">签到</button></p>
<?php }else{ ?>
<p><a class="btn btn-success btn-flat disabled" href="#">不能签到</a> </p>
<?php } ?>
<p id="checkin-msg" ></p>
<p>上次签到时间:<code><?php echo date('Y-m-d H:i:s',$oo->get_last_check_in_time());?></code></p>
</div><!-- /.box-body -->
</div><!-- /.box -->
</div><!-- /.col (right) -->
<div class="col-md-6">
<div class="box box-solid">
<div class="box-header">
<h3 class="box-title">连接信息</h3>
</div><!-- /.box-header -->
<div class="box-body">
<p> 端口:<code><?php echo $oo->get_port();?></code> </p>
<p> 密码:<?php echo $oo->get_pass();?> </p>
<p> 套餐:<span class="label label-info"> <?php echo $oo->get_plan();?> </span> </p>
<p> 最后使用时间:<code><?php echo date('Y-m-d H:i:s',$unix_time); ?></code> </p>
</div><!-- /.box-body -->
</div><!-- /.box -->
</div><!-- /.col (right) -->
</div><!-- /.row -->
<!-- END PROGRESS BARS -->
</section><!-- /.content -->
</div><!-- /.content-wrapper -->
<?php
require_once '_footer.php'; ?>
<script>
$(document).ready(function(){
$("#checkin").click(function(){
$.ajax({
type:"GET",
url:"_checkin.php",
dataType:"json",
success:function(data){
$("#checkin-msg").html(data.msg);
$("#checkin-btn").hide();
},
error:function(jqXHR){
alert("发生错误:"+jqXHR.status);
}
})
})
})
</script>