이상원

version 2

...@@ -2,5 +2,6 @@ module.exports = { ...@@ -2,5 +2,6 @@ module.exports = {
2 server_port : 3030, 2 server_port : 3030,
3 route_info : [{file : './search', path : '/search',method : 'search', type : 'get'}, 3 route_info : [{file : './search', path : '/search',method : 'search', type : 'get'},
4 {file : './search', path : '/',method : 'home', type : 'get'}, 4 {file : './search', path : '/',method : 'home', type : 'get'},
5 - {file : './search', path : '/detail',method : 'detail', type : 'get'}] 5 + {file : './search', path : '/detail',method : 'detail', type : 'get'},
6 + {file : './search', path : '/compare',method : 'compare', type : 'get'}]
6 }; 7 };
......
...@@ -20,10 +20,24 @@ var detail = function(req,res){ ...@@ -20,10 +20,24 @@ var detail = function(req,res){
20 var mode = req.query.mode || req.body.mode; 20 var mode = req.query.mode || req.body.mode;
21 check.detaildata(id,region,mode,function(result){ 21 check.detaildata(id,region,mode,function(result){
22 console.log(req.connection.remoteAddress + ' 가' + id + '으로 상세정보' ); 22 console.log(req.connection.remoteAddress + ' 가' + id + '으로 상세정보' );
23 - res.render('detail.ejs',{id:id,result:result}); 23 + res.render('detail.ejs',{id:id,region:region,mode:mode,result:result});
24 + });
25 +
26 +};
27 +var compare = function(req,res){
28 + var id = req.query.id || req.body.id;
29 + var id2 = req.query.id2 || req.body.id2;
30 + var region = req.query.region || req.body.region;
31 + var mode = req.query.mode || req.body.mode;
32 + check.detaildata(id,region,mode,function(result){
33 + check.detaildata(id2,region,mode,function(result1){
34 + console.log(req.connection.remoteAddress + ' 가' + id +' 와 ' + id2 +'으로 비교');
35 + res.render('compare.ejs',{id:id,id2:id2,region:region,mode:mode,result:result,result1:result1});
36 + });
24 }); 37 });
25 38
26 }; 39 };
27 module.exports.search =search; 40 module.exports.search =search;
28 module.exports.home =home; 41 module.exports.home =home;
29 module.exports.detail = detail; 42 module.exports.detail = detail;
43 +module.exports.compare = compare;
......
1 +<!DOCTYPE html>
2 +<html>
3 + <head>
4 + <meta charset="UTF-8">
5 + <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1">
6 + <title>PUBG 핵쟁이</title>
7 + <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
8 + <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
9 + <style>
10 + body { background: url('../public/image/bg2.jpg') no-repeat fixed 50% 50%/100% 100%;}
11 + #con{
12 + padding-top:30%;
13 + }
14 + h1{
15 + color: rgb(255,255,255);
16 + text-align: center;
17 + }
18 + #info{
19 + width: 100%;
20 + height: 50px;
21 + color : rgb(255,255,255);
22 + font-size: 12pt;
23 + text-align: center;
24 + }
25 + .fth{
26 + width : 25%;
27 + }
28 + #result{
29 + border: 1px none;
30 + font-size: 20pt;
31 + }
32 + .user2{
33 + color : red;
34 + }
35 + </style>
36 + </head>
37 + <body>
38 + <div class="container" >
39 + <div class = "row">
40 + <div class ="col-sm-12">
41 + <h1><%= id %></h1>
42 + <h1 class = "user2"><%= id2 %></h1>
43 + <br>
44 + <br>
45 + </div>
46 + </div>
47 + <div class="row">
48 + <div class ="col-sm-12">
49 + <table id = "info">
50 + <tr>
51 + <th><img src="../public/image/round.png">총 플레이한 라운드</th>
52 + <th><%= result['round'] %></th>
53 + <th class = "user2"> <%= result1['round'] %></th>
54 + <th><img src="../public/image/chi.png">치킨 뜯은 횟수</th>
55 + <th><%= result['wins'] %></th>
56 + <th class = "user2"> <%= result1['wins'] %></th>
57 + <th><img src="../public/image/top10.png">TOP 10 에 든 횟수</th>
58 + <th><%= result['top10'] %></th>
59 + <th class = "user2"> <%= result1['top10'] %></th>
60 + </tr>
61 + <tr><th><br></th></tr>
62 + <tr>
63 + <th><img src="../public/image/lose.png">패배한 횟수</th>
64 + <th><%= result['lose'] %></th>
65 + <th class = "user2"> <%= result1['lose'] %></th>
66 + <th><img src="../public/image/rate.png">현재 레이팅</th>
67 + <th><%= result['rating'] %></th>
68 + <th class = "user2"> <%= result1['rating'] %></th>
69 + <th><img src="../public/image/best.png">최고 레이팅</th>
70 + <th><%= result['bestrate'] %></th>
71 + <th class = "user2"> <%= result1['bestrate'] %></th>
72 + </tr>
73 + <tr><th><br></th></tr>
74 + <tr>
75 + <th><img src="../public/image/deal.png">게임 당 딜량</th>
76 + <th><%= result['dmg'] %></th>
77 + <th class = "user2"> <%= result1['dmg'] %></th>
78 + <th><img src="../public/image/head1.png">게임 당 헤드샷 비율</th>
79 + <th><%= result['head'] %></th>
80 + <th class = "user2"> <%= result1['head'] %></th>
81 + <th><img src="../public/image/heal.png">게임당 치료량</th>
82 + <th ><%= result['heal'] %></th>
83 + <th class = "user2"> <%= result1['heal'] %></th>
84 + </tr>
85 + <tr><th><br></th></tr>
86 + <tr>
87 + <th><img src="../public/image/kill1.png">게임 당 킬량</th>
88 + <th><%= result['kill'] %></th>
89 + <th class = "user2"> <%= result1['kill'] %></th>
90 + <th><img src="../public/image/distance.png">게임 당 이동거리</th>
91 + <th><%= result['distance'] %></th>
92 + <th class = "user2"> <%= result1['distance'] %></th>
93 + <th><img src="../public/image/revive.png">게임 당 부활횟수</th>
94 + <th><%= result['revive'] %></th>
95 + <th class = "user2"> <%= result1['revive'] %></th>
96 + </tr>
97 + <tr><th><br></th></tr>
98 + <tr>
99 + <th><img src="../public/image/road.png">게임 당 로드킬 횟수</th>
100 + <th><%= result['road'] %></th>
101 + <th class = "user2"> <%= result1['road'] %></th>
102 + <th><img src="../public/image/teamkill.png">게임 당 팀킬 횟수</th>
103 + <th><%= result['team'] %></th>
104 + <th class = "user2"> <%= result1['team'] %></th>
105 + <th><img src="../public/image/time.png">게임 당 생존시간</th>
106 + <th><%= result['survive'] %></th>
107 + <th class = "user2"> <%= result1['survive'] %></th>
108 + </tr>
109 + <tr><th><br></th></tr>
110 + <tr>
111 + <th><img src="../public/image/long.png">가장 멀리서 죽인 거리</th>
112 + <th><%= result['long'] %></th>
113 + <th class = "user2"> <%= result1['long'] %></th>
114 + </tr>
115 + </table>
116 + <br>
117 + </div>
118 + </div>
119 + <div class = "row">
120 + <div class ="col-sm-4">
121 + <form action="/compare" method="get" >
122 + <input type="hidden" name="id" value="<%= id %>">
123 + <input type="hidden" name="mode" value="<%= mode %>">
124 + <input type="hidden" name="region" value="<%= region %>">
125 + <div class="input-group">
126 + <input type="text" class="form-control input-sm" placeholder="Search for..." name = "id2">
127 + <span class="input-group-btn">
128 + <button class="btn btn-default btn-sm" type="submit">다른사람과비교</button>
129 + </span>
130 + </div>
131 + </form>
132 + </div>
133 + </div>
134 + <div class = "row">
135 + <div class ="col-sm-12">
136 + <form action="/" method="get" >
137 + <br>
138 + <button class="btn btn-default btn-sm" type="submit">홈으로 가기</button>
139 + </form>
140 + <br>
141 + <br>
142 + </div>
143 + </div>
144 + </div>
145 + </body>
146 +</html>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
19 width: 100%; 19 width: 100%;
20 height: 50px; 20 height: 50px;
21 color : rgb(255,255,255); 21 color : rgb(255,255,255);
22 - font-size: 15pt; 22 + font-size: 12pt;
23 text-align: center; 23 text-align: center;
24 } 24 }
25 .fth{ 25 .fth{
...@@ -97,15 +97,29 @@ ...@@ -97,15 +97,29 @@
97 </div> 97 </div>
98 </div> 98 </div>
99 <div class = "row"> 99 <div class = "row">
100 - <div class ="col-sm-12 col-sm-offset-10"> 100 + <div class ="col-sm-4">
101 + <form action="/compare" method="get" >
102 + <input type="hidden" name="id" value="<%= id %>">
103 + <input type="hidden" name="mode" value="<%= mode %>">
104 + <input type="hidden" name="region" value="<%= region %>">
105 + <div class="input-group">
106 + <input type="text" class="form-control input-sm" placeholder="Search for..." name = "id2">
107 + <span class="input-group-btn">
108 + <button class="btn btn-default btn-sm" type="submit">다른사람과비교</button>
109 + </span>
110 + </div>
111 + </form>
112 + </div>
113 + </div>
114 + <div class = "row">
115 + <div class ="col-sm-12">
101 <form action="/" method="get" > 116 <form action="/" method="get" >
117 + <br>
102 <button class="btn btn-default btn-sm" type="submit">홈으로 가기</button> 118 <button class="btn btn-default btn-sm" type="submit">홈으로 가기</button>
103 - </span> 119 + </form>
104 <br> 120 <br>
105 <br> 121 <br>
106 </div> 122 </div>
107 - </form>
108 - </div>
109 </div> 123 </div>
110 </div> 124 </div>
111 </body> 125 </body>
......