search.php
5.14 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
<?
// http://override1592.tistory.com/20
// 소개 글
// http://dovetail.tistory.com/38
// //스누피 크롤링
// https://discussion.developer.riotgames.com/questions/4188/request-api.html
// https://discussion.developer.riotgames.com/articles/61/public-libraries-for-the-riot-games-api.html
?>
<!DOCTYPE >
<html>
<head>
<link rel='stylesheet' type='text/css' href='http://www.blueb.co.kr/data/201010/IJ12872423858253/fullcalendar.css' />
<script type='text/javascript' src='http://www.blueb.co.kr/data/201010/IJ12872423858253/jquery.js'></script>
<script type='text/javascript' src='http://www.blueb.co.kr/data/201010/IJ12872423858253/jquery-ui-custom.js'></script>
<script type='text/javascript' src='http://www.blueb.co.kr/data/201010/IJ12872423858253/fullcalendar.min.js'></script>
<script type='text/javascript'>
$(document).ready(function() {
var date = new Date();
var d = date.getDate();
var m = date.getMonth();
var y = date.getFullYear();
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,basicWeek,basicDay'
},
editable: true,
events: [
<?php
//python
$command = escapeshellcmd('test.py');
$output = shell_exec($command);
//mysql
$host = 'localhost';
$user = 'root';
$pw = 'autoset';
$dbname = 'lol';
$conn = mysqli_connect($host, $user, $pw, $dbname);
$sql2 = "select count(day) from gametime";
$result2=mysqli_query($conn,$sql2);
$data2 = array();
$row2=mysqli_fetch_array($result2);
echo $row2[0];
$sql="select * from gametime";
$result=mysqli_query($conn,$sql);
$data = array();
$cnt = 0;
if($result){
while($row=mysqli_fetch_array($result)){
array_push($data, array('day'=>$row[0], 'time'=>$row[1] ));
$row_arr = explode('-', $row[0]);
?>
{
title: 'Long Event',
start: new Date(y, <?php echo $row_arr[1];?>, <?php echo $row_arr[2];?>),
allDay: false
}
<?php $cnt++; if ( $cnt != $row[0] ) { echo ","; }?>
<?php} //while
} //if ?>
// {
// title: 'Long Event',
// start: new Date(y, m, 2),
// end: new Date(y, m, 3)
// },
// {
// id: 999,
// title: 'Repeating Event',
// start: new Date(y, m, d-3, 16, 0),
// allDay: false
// },
// {
// title: 'All Day Event',
// start: new Date(y, m, 1)
// },
// {
// title: 'Long Event',
// start: new Date(y, m, 2),
// end: new Date(y, m, 3)
// },
// {
// id: 999,
// title: 'Repeating Event',
// start: new Date(y, m, d-3, 16, 0),
// allDay: false
// },
// {
// id: 999,
// title: 'Repeating Event',
// start: new Date(y, m, d+4, 16, 0),
// allDay: false
// },
// {
// title: 'Meeting',
// start: new Date(y, m, d, 10, 30),
// allDay: false
// },
// {
// title: 'Lunch',
// start: new Date(y, m, d, 12, 0),
// end: new Date(y, m, d, 14, 0),
// allDay: false
// },
// {
// title: 'Birthday Party',
// start: new Date(y, m, d+1, 19, 0),
// end: new Date(y, m, d+1, 22, 30),
// allDay: false
// },
// {
// title: 'Click for Google',
// start: new Date(y, m, 28),
// end: new Date(y, m, 29),
// url: 'http://google.com/'
// }
]
});
});
</script>
<script type='text/javascript'>
function httpGet($url)
{
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
// curl_setopt($ch,CURLOPT_HEADER, false);
$output=curl_exec($ch);
curl_close($ch);
return $output;
}
</script>
<style type='text/css'>
body {
margin-top: 40px;
text-align: center;
font-size: 14px;
font-family: "Lucida Grande",Helvetica,Arial,Verdana,sans-serif;
}
#calendar {
width: 900px;
margin: 0 auto;
}
</style>
</head>
<body>
<?php
$api_key = "RGAPI-eb66d6f1-a940-4ded-8679-9554c559ad75"; // 자신의 api_key
$usernames = strtolower(trim("abc"));
$username = "바사노바";//preg_replace("/\s+/", "", $usernames);
$url = "https://kr.api.riotgames.com/lol/summoner/v3/summoners/by-name/".$username."?api_key=".$api_key ;
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
$output=curl_exec($ch);
curl_close($ch);
$get_id = json_decode($output, true);
$userid = $get_id[$username]['id']; // ID
$nick = $get_id[$username]['name']; // 닉네임
$level = $get_id[$username]['summonerLevel']; // 레벨
$profileIcon = $get_id[$username]['profileIconId']; // 프로필아이콘번호
echo $userid;
//
// $status = json_decode(httpGet("https://kr.api.pvp.net/api/lol/kr/v2.5/league/by-summoner/".$userid."/entry?api_key=".$api_key), true);
// $tier = $status[$userid][0]['tier']; // 티어
// $division = $status[$userid][0]['entries'][0]['division']; // 상세 티어
// $point = $status[$userid][0]['entries'][0]['leaguePoints']; // 리그포인트
// $win = $status[$userid][0]['entries'][0]['wins']; // 승
// $lose = $status[$userid][0]['entries'][0]['losses']; // 패
?>
<div id='calendar'></div>
</body>
</html>