Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
app-stable-website
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Android
app-stable-website
Commits
216741b6
Commit
216741b6
authored
Nov 13, 2019
by
kevin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化详情页
parent
c29ca944
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
210 additions
and
130 deletions
+210
-130
details.php
leankcanary/details.php
+210
-130
No files found.
leankcanary/details.php
View file @
216741b6
<!DOCTYPE html>
<html>
<head>
<meta
charset=
"UTF-8"
>
<title>
日志详情页
</title>
<meta
charset=
"UTF-8"
>
<title>
日志详情页
</title>
</head>
<style
type=
"text/css"
>
.wrapper
{
width
:
1000px
;
margin
:
20px
auto
;}
h2
{
text-align
:
center
;}
.add
{
margin-bottom
:
20px
;}
.add
a
{
text-decoration
:
none
;
color
:
#fff
;
background-color
:
green
;
padding
:
6px
;
border-radius
:
5px
;}
td
{
text-align
:
center
;}
.wrapper
{
width
:
1000px
;
margin
:
20px
auto
;}
h2
{
text-align
:
center
;}
.add
{
margin-bottom
:
20px
;}
.add
a
{
text-decoration
:
none
;
color
:
#fff
;
background-color
:
green
;
padding
:
6px
;
border-radius
:
5px
;}
td
{
text-align
:
center
;}
</style>
<body>
<div
class=
"wrapper"
>
<h2>
日志详情页
</h2>
<table
width=
"960"
>
<?php
// 处理增加操作的页面
require
"dbconfig.php"
;
// 连接mysql
$link
=
@
mysqli_connect
(
HOST
,
USER
,
PASS
,
DBNAME
)
or
die
(
"提示:数据库连接失败!"
);
// 选择数据库
mysqli_select_db
(
$link
,
DBNAME
);
// 编码设置
mysqli_set_charset
(
$link
,
'utf8'
);
$id
=
$_GET
[
'id'
];
// 3. 从DBNAME中查询到news数据库,返回数据库结果集,并按照addtime降序排列
$sql
=
"select * from leakCanary where id=
{
$id
}
order by id asc;"
;
// 结果集
$result
=
mysqli_query
(
$link
,
$sql
)
or
die
(
'添加数据出错:'
.
mysqli_error
());
// var_dump($result);
// 解析结果集,$row为新闻所有数据,$newsNum为新闻数目
$count
=
mysqli_num_rows
(
$result
);
// for($i=0; $i<$count; $i++){
$row
=
mysqli_fetch_assoc
(
$result
);
// echo $row;
$contentJson
=
$row
[
"contentJson"
];
$json
=
json_decode
(
$contentJson
,
true
);
$leakTrace
=
$json
[
"leakTrace"
];
$elements
=
$leakTrace
[
"elements"
];
$className
=
$json
[
"className"
];
echo
"<div class=title>
{
$className
}
</div>"
;
foreach
(
$elements
as
$key
=>
$value
)
{
$classChildName
=
$value
[
"className"
];
$referenceName
=
$value
[
"referenceName"
];
$classHierarchy
=
$value
[
"classHierarchy"
];
echo
"<hr class=line />"
;
echo
"<div class=title-0>
{
$classChildName
}
</div>
<div class=title-1>
{
$referenceName
}
</div>"
;
foreach
(
$classHierarchy
as
$key
=>
$value
)
{
echo
"<div class=title-2>
{
$value
}
</div>"
;
}
}
echo
"<div class=line></div>"
;
/*echo "</tr>";*/
// }
// 5. 释放结果集
mysqli_free_result
(
$result
);
mysqli_close
(
$link
);
?>
</table>
<script
type=
"text/javascript"
>
function
changestatus
(
id
)
{
if
(
confirm
(
"确定要修改该日志吗?"
)){
window
.
location
=
"action-del.php?id="
+
id
;
}
}
function
enterpage
(
id
)
{
window
.
location
=
"detail.php?id="
+
id
;
}
</script>
<style
type=
"text/css"
>
.time
{
margin-top
:
30px
;
font-size
:
16px
;
margin-left
:
20px
;
text-decoration
:
none
;
}
.title
{
margin-top
:
40px
;
font-size
:
32px
;
font-weight
:
bold
;
color
:
#000000
;
}
.title-0
{
margin-top
:
20px
;
font-size
:
16px
;
font-weight
:
bold
;
color
:
#000
;
}
.title-1
{
margin-top
:
10px
;
font-size
:
16px
;
color
:
#000
;
text-decoration
:
underline
;
}
.title-2
{
margin-top
:
10px
;
margin-left
:
50px
;
font-size
:
16px
;
text-decoration
:
none
;
color
:
#ff0000
;
}
.line
{
margin-top
:
20px
;
margin-bottom
:
50px
;
}
.bottom
{
display
:
flex
;
align-items
:
flex-end
;
}
</style>
<div
class=
"wrapper"
>
<?php
// 处理增加操作的页面
require
"dbconfig.php"
;
// 连接mysql
$link
=
@
mysqli_connect
(
HOST
,
USER
,
PASS
,
DBNAME
)
or
die
(
"提示:数据库连接失败!"
);
// 选择数据库
mysqli_select_db
(
$link
,
DBNAME
);
// 编码设置
mysqli_set_charset
(
$link
,
'utf8'
);
$id
=
$_GET
[
'id'
];
// 3. 从DBNAME中查询到news数据库,返回数据库结果集,并按照addtime降序排列
$sql
=
"select * from leakCanary where id=
{
$id
}
order by id asc;"
;
// 结果集
$result
=
mysqli_query
(
$link
,
$sql
)
or
die
(
'添加数据出错:'
.
mysqli_error
());
// var_dump($result);
// 解析结果集,$row为新闻所有数据,$newsNum为新闻数目
$count
=
mysqli_num_rows
(
$result
);
// for($i=0; $i<$count; $i++){
$row
=
mysqli_fetch_assoc
(
$result
);
// echo $row;
$contentJson
=
$row
[
"contentJson"
];
$json
=
json_decode
(
$contentJson
,
true
);
$leakTrace
=
$json
[
"leakTrace"
];
$elements
=
$leakTrace
[
"elements"
];
$className
=
$json
[
"className"
];
echo
"<div class=title>
{
$className
}
</div>"
;
foreach
(
$elements
as
$key
=>
$value
)
{
$classChildName
=
$value
[
"className"
];
$referenceName
=
$value
[
"referenceName"
];
$classHierarchy
=
$value
[
"classHierarchy"
];
echo
"
<div class=
\"
track-rcol
\"
>
<div class=
\"
track-list
\"
>
<ul>
<li class=
\"
first
\"
>
<i class=
\"
node-icon
\"
></i>
<div class=txt>
{
$classChildName
}
</div>
</li>
<li>
"
;
echo
"
<div class=title-1>
{
$referenceName
}
</div>
"
;
foreach
(
$classHierarchy
as
$key
=>
$value
)
{
echo
"
<div class=title-2>
-------
{
$value
}
</div>
"
;
}
echo
"</li>
</ul>
</div>
</div>"
;
}
echo
"<div class=line></div>"
;
/*echo "</tr>";*/
// }
// 5. 释放结果集
mysqli_free_result
(
$result
);
mysqli_close
(
$link
);
?>
</table>
<script
type=
"text/javascript"
>
function
changestatus
(
id
)
{
if
(
confirm
(
"确定要修改该日志吗?"
)){
window
.
location
=
"action-del.php?id="
+
id
;
}
}
function
enterpage
(
id
)
{
window
.
location
=
"detail.php?id="
+
id
;
}
</script>
<style
type=
"text/css"
>
.time
{
margin-top
:
30px
;
font-size
:
16px
;
margin-left
:
20px
;
text-decoration
:
none
;
}
.title
{
margin-top
:
60px
;
margin-bottom
:
60px
;
font-size
:
32px
;
font-weight
:
bold
;
color
:
#000000
;
}
.title-0
{
margin-top
:
20px
;
font-size
:
16px
;
font-weight
:
bold
;
color
:
#000
;
}
.title-1
{
margin-top
:
10px
;
margin-bottom
:
10px
;
font-size
:
18px
;
color
:
#000
;
text-decoration
:
underline
;
}
.title-2
{
margin-top
:
10px
;
font-size
:
14px
;
text-decoration
:
none
;
color
:
#ff0000
;
}
.line
{
margin-top
:
20px
;
margin-bottom
:
50px
;
}
.bottom
{
display
:
flex
;
align-items
:
flex-end
;
}
body
{
font-size
:
12px
;
}
ul
li
{
list-style
:
none
;
}
.track-rcol
{
width
:
100%
;
border
:
1px
solid
#eee
;
}
.track-list
{
margin
:
20px
;
padding-left
:
5px
;
position
:
relative
;
}
.track-list
li
{
position
:
relative
;
padding
:
9px
0
0
25px
;
line-height
:
18px
;
border-left
:
1px
solid
#d9d9d9
;
color
:
#999
;
}
.track-list
li
.first
{
color
:
red
;
padding-top
:
0
;
border-left-color
:
#fff
;
}
.track-list
li
.node-icon
{
position
:
absolute
;
left
:
-6px
;
top
:
50%
;
width
:
11px
;
height
:
11px
;
background
:
url(images/img-1.jpg)
-21px
-72px
no-repeat
;
}
.track-list
li
.first
.node-icon
{
background-position
:
0
-72px
;
}
.track-list
li
.time
{
margin-right
:
20px
;
position
:
relative
;
top
:
4px
;
display
:
inline-block
;
vertical-align
:
middle
;
}
.track-list
li
.txt
{
position
:
relative
;
top
:
4px
;
font-size
:
22px
;
color
:
#000000
;
display
:
inline-block
;
vertical-align
:
middle
;
}
.track-list
li
.first
.time
{
margin-right
:
20px
;
}
.track-list
li
.first
.txt
{
max-width
:
600px
;
}
</style>
</body>
</html>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment