Repository navigation
Expand file tree
/
Copy pathqrcode.php
More file actions
62 lines (55 loc) · 2.5 KB
/
Copy pathqrcode.php
File metadata and controls
62 lines (55 loc) · 2.5 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
59
60
61
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP version 5 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2004 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 3.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available through the world-wide-web at the following url: |
// | http://www.php.net/license/3_0.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Original Author <author@example.com> |
// | Your Name <you@example.com> |
// +----------------------------------------------------------------------+
//
// $Id:$
namespace Endroid\Tests\QrCode;
include('QrCode/Endroid/QrCode/QrCode.php');
use Endroid\QrCode\QrCode;
$msg = 0;
$msgtype = 0;
$node=$DB->query("select * from node where status=1");
//显示二维码
function qr_node($url,$sspass,$port,$method='aes-256-cfb')
{
$url = $method.":{$sspass}@".$url.":{$port}";
$url = "ss://" . base64_encode($url);
$qrCode = new QrCode();
$qrCode->setText($url);
$qrCode->setSize(140);
$qrCode->setPadding(5);
$img= $qrCode->getDataUri();
return $img;
}
?>
<div role="tabpanel">
<!-- Nav tabs -->
<ul class="nav nav-tabs" role="tablist">
<?php foreach($node as $key=>$val){ ?>
<li role="presentation" <?php if($key==0) echo 'class="active"' ;?>><a href="#<?php echo explode('.',$val['url'])[0]; ?>" aria-controls="<?php echo explode('.',$val['url'])[0]; ?>" role="tab" data-toggle="tab"><?php echo $val['name']; ?></a></li>
<?php } ?>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<?php foreach($node as $key=>$val){ ?>
<div role="tabpanel" class="tab-pane <?php if($key==0) echo 'active'; ?>" id="<?php echo explode('.',$val['url'])[0]; ?>">
<p class="text-center"><img src="<?php echo qr_node($val['url'],$sspass,$port); ?>"></br>服务器地址:<?php echo $val['url']; ?></p>
</div>
<?php } ?>
</div>
</div>