-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdianzan.php
More file actions
219 lines (199 loc) · 6.46 KB
/
dianzan.php
File metadata and controls
219 lines (199 loc) · 6.46 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
<?php
require 'weixin.class.php';
ini_set('session.use_cookies', 0);
if($_GET['code']){
$ret = wxmessage::getAuthToken($_GET['code']);
if(isset($ret['openid'])){
$openid = $ret['openid'];
}
}
ob_start();
$sessionId = md5($openid);
session_id($sessionId);
session_start();
$mysql = new SaeMysql();
$mysql->setCharset("utf8");
$query = "SELECT * FROM user WHERE id = '$sessionId'";
$result = $mysql->runSql($query);
$row = $result->fetch_assoc();
if ($row['dianzan'] == 0) {
if ($result->num_rows == 1) {
$sql = "update user set dianzan = 1 where id = '$sessionId'";
}else {
$sql = "insert into user (id, dianzan)";
$sql .= "values('$sessionId', 1)";
}
$mysql->runSql($sql);
header("location: diangezan.php");
die;
}
header("content-type:text/html;charset=utf-8");
?>
<!DOCTYPE html>
<html class="full" lang="en" xmlns="http://www.w3.org/1999/html">
<!-- Make sure the <html> tag is set to the .full CSS class. Change the background image in the full.css file. -->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>赞一下我们</title>
<!-- Bootstrap Core CSS -->
<link href="css/dianzan/bootstrap.min.css" rel="stylesheet">
<!-- Custom CSS -->
<link href="css/dianzan.css" rel="stylesheet">
<!--First Page CSS-->
<link rel="stylesheet" href="css/dianzanpage1_1.css" type="text/css" />
<link rel="stylesheet" href="css/dianzanpage1_2.css" type="text/css" />
<link rel="stylesheet" href="fonts/iconfont.css" type="text/css" />
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<!-- jQuery -->
<script src="js/jquery.js"></script>
<!-- Navigation -->
<nav class="navbar navbar-inverse navbar-fixed-bottom" role="navigation">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">拼拼团队</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="bottom-menu nav navbar-nav">
<li>
<a href="#zanshu" class="link">点个赞</a>
</li>
<li>
<a href="#showus" class="link">了解我们</a>
</li>
<li>
<a href="#contactgit" class="link">联系我们</a>
</li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container -->
</nav>
<!-- Page Content -->
<div class="container">
<div class="row" id="zanshu">
<div class="col-md-6 col-sm-12">
<div class="box">
<h1><img src="pic/indexpicture.png" width="300" height="150"></h1>
<p>如果觉得我们做的不错的话,就给我们点个赞吧~</p>
</div>
<span id="btn">
<i class="iconfont"></i> 点赞
</span>
<script type="text/javascript">
(function ($) {
$.extend({
tipsBox: function (options) {
options = $.extend({
obj: null,
str: "+1",
startSize: "12px",
endSize: "30px",
interval: 600,
color: "red",
callback: function () { }
}, options);
$("body").append("<span class='num'>" + options.str + "</span>");
var box = $(".num");
var left = options.obj.offset().left + options.obj.width() / 2;
var top = options.obj.offset().top - options.obj.height();
box.css({
"position": "absolute",
"left": left + "px",
"top": top + "px",
"z-index": 9999,
"font-size": options.startSize,
"line-height": options.endSize,
"color": options.color
});
box.animate({
"font-size": options.endSize,
"opacity": "0",
"top": top - parseInt(options.endSize) + "px"
}, options.interval, function () {
box.remove();
options.callback();
});
}
});
})(jQuery);
function niceIn(prop){
prop.find('i').addClass('niceIn');
setTimeout(function(){
prop.find('i').removeClass('niceIn');
},1000);
}
$(function () {
$("#btn").click(function () {
$.tipsBox({
obj: $(this),
str: "+1",
callback: function () {
}
});
niceIn($(this));
});
});
</script>
</div>
</div>
<div class="row" id="showus">
<div class="col-md-6 col-sm-12 ">
<h1>了解我们</h1>
<p>7个信安专业的征途者</p>
<p>7个不断探索的学习者</p>
<p>20岁的秋雨下得很急</p>
<p>20岁的步履走的懵懂</p>
<p>20岁,却从未停在原地</p>
<p>缘分不停歇</p>
<p>拼拼不止步</p>
</div>
</div>
<div class="row" id="contactgit">
<div class="col-md-6 col-sm-12">
<h1>联系我们</h1>
<p>感兴趣?有bug?有建议?<p>
<p>联系我们,我们一起成长!<p>
<h2>我们的GitHub<a href="https://github.com/ZhangQiaolun/PingPing"> 链接</a></h2>
</div>
</div>
<!-- /.row -->
</div>
<!-- /.container -->
<!-- Bootstrap Core JavaScript -->
<script src="js/bootstrap.min.js"></script>
<script>
$(".bottom-menu a").on('click',function(e) {
e.preventDefault(); // stops link form loading
$('.row').hide(); // hides all content divs
$($(this).attr('href') ).show(); //get the href and use it find which div to show
});
</script>
<script>
$(document).ready(function(e) {
$('.row').hide();
$('#zanshu').show();
//do jQuery stuff when DOM is ready
});
</script>
</body>
</html>