-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdoc.php
More file actions
114 lines (111 loc) · 2.3 KB
/
doc.php
File metadata and controls
114 lines (111 loc) · 2.3 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
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
<!DOCTYPE html>
<html>
<head>
<title>Doc</title>
<meta charset = "utf-8"/>
<meta name = "viewport" content = "width = device-width, initial-scale = 1, maximum-scale = 1, user-scalable = no">
<script src = "js/jquery-1.11.1.min.js"></script>
<script>
$(function() {
$("table tr").each(function() {
$(this).find("td").eq(1).bind("mouseover", function() {
$(this).css("cursor", "pointer").attr("title", "点击查询" + $(this).text() + "源代码")
.bind("click", function() {
location.href = "doc.php?action=" + $(this).text() + "#code";
});
})
});
});
</script>
<style>
@charset "utf-8";
body {
word-break: break-all;
}
h2 {
text-align: center;
font-size: 28px;
}
* {
font-family: 'consolas';
font-size:14px;
}
#code {
width: calc(100% - 100px);
margin: 0 auto;
padding: 0 20px;
border: 1px solid #e1e1e1;
-webkit-box-shadow: 0 0 3px #eee,inset 0 0 3px #fff;
box-shadow: 0 0 3px #eee,inset 0 0 3px #fff;
background: #fbfbfb;
border-radius:7px;
}
table{
width: calc(100% - 60px);
margin: 10px auto;
border-collapse: collapse;
border-spacing: 0;
clear:both;
}
th {
height: auto;
border-bottom: 0;
color: #666;
background-color: #f2f2f2;
white-space: nowrap;
}
tr{
background-color: #f9f9f9 !important;
}
tr td:first-child {
text-align: center;
}
td,th{
padding: 6px 12px;
border: 1px solid #dddddd;
}
</style>
</head>
<body>
<?php
header("content-type : text/html; charset = utf-8");
$arr = array();
$file = 'doc.txt';
$fp = fopen($file, "r");
while (!feof($fp)) {
$buffer = fgets($fp);
$col = explode("\t", ($buffer));
$col[count($col)-1] = trim($col[count($col)-1]);
$arr[] = $col;
}
fclose($fp);
?>
<h2>Action Table</h2>
<table>
<thead>
<tr>
<th>Index</th>
<th>Action</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<?php
for($i = 0; $i < count($arr); $i ++) {
$index = $i + 1;
echo "<tr><td>{$index}</td>";
for($j = 0; $j < count($arr[$i]); $j ++) {
echo "<td>{$arr[$i][$j]}</td>";
}
echo "</tr>";
}
?>
</tbody>
<table>
<h2>Action Code</h2>
<div id = "code">
<?php empty($_GET['action'])? $action = 'UserLoginAction': $action = $_GET['action']; ?>
<?= highlight_file('action/' . $action . '.php') ?>
</div>
</body>
</html>