質問編集履歴

1

コードの画像ではなく、質問に直接埋め込みました

2019/11/30 13:09

投稿

yuu_gt0208
yuu_gt0208

スコア27

test CHANGED
File without changes
test CHANGED
@@ -20,13 +20,219 @@
20
20
 
21
21
  以下が、ページのプログラムです。
22
22
 
23
- ![イメージ説明](994e8fc8e0e95281cd8497f0e61e214b.png)
24
-
25
- ![イメージ説明](d323fbe516d6f069f888a105b404b6e7.png)
26
-
27
- ![イメージ説明](97ce85e9366c0bd99d1e24bba97fd738.png)
28
-
29
- ![イメージ説明](0dc552e5e7102cda74b833858b18bd80.png)
23
+ ```
24
+
25
+ <?php
26
+
27
+
28
+
29
+ require("../../db/db_connect.php");//DB接続
30
+
31
+
32
+
33
+ $user_id = 1;
34
+
35
+
36
+
37
+ try{
38
+
39
+
40
+
41
+ $db = new PDO(Conf::DB_DNS, Conf::DB_USERNAME, Conf::DB_PASSWORD);
42
+
43
+ $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
44
+
45
+ $db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
46
+
47
+
48
+
49
+ //場所イベントの点数結果
50
+
51
+ $sqlSelect = "SELECT Event.event_jenre,Sum(Answer.point) FROM Answer INNER JOIN AnswerChosenUser ON Answer.id = AnswerChosenUser.answer_id INNER JOIN Event ON answer.event_id = Event.id WHERE $user_id = 1 AND event_jenre = 'P'";
52
+
53
+ $stmt = $db->query($sqlSelect);
54
+
55
+ if($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
56
+
57
+ $placepoint = $row['point'];
58
+
59
+ }
60
+
61
+ }
62
+
63
+ catch(PDOException $ex){
64
+
65
+ echo $ex->getMessage();
66
+
67
+ }
68
+
69
+
70
+
71
+ ?>
72
+
73
+
74
+
75
+ <!DOCTYPE html>
76
+
77
+ <html lang="ja">
78
+
79
+ <head>
80
+
81
+ <meta charset="UTF-8">
82
+
83
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
84
+
85
+ <meta http-equiv="X-UA-Compatible" content="ie=edge">
86
+
87
+ <link rel="stylesheet" href="https://use.typekit.net/csc1gvk.css"><!-- futuraPT -->
88
+
89
+ <script type="text/javascript" src="./js/source-han-serif.js"></script><!-- 源ノ角ゴシック -->
90
+
91
+ <link rel="stylesheet" type="text/css" href="./css/reset.css"><!-- リセット用css-->
92
+
93
+ <link rel="stylesheet" type="text/css" href="./css/allStyle.css"><!-- 全適用css -->
94
+
95
+ <link rel="stylesheet" type="text/css" href="./css/style.css">
96
+
97
+ <title>採点結果画面</title>
98
+
99
+ </head>
100
+
101
+ <body>
102
+
103
+ <!-- wrapper -->
104
+
105
+ <div id="wrapper">
106
+
107
+ <!-- datePlanCont-->
108
+
109
+ <div id="scoringCont">
110
+
111
+ <h1>score</h1>
112
+
113
+ <div id="scoringHumanArea">
114
+
115
+ <img id="man" src="./img/scoringMan.svg" alt="">
116
+
117
+ <img id="woman" src="./img/scoringWoman.svg" alt="">
118
+
119
+ <div id="heartCont">
120
+
121
+ <div id="heart">
122
+
123
+ <p>10<span id="percent">%</span></p>
124
+
125
+ </div>
126
+
127
+ </div> <!---heartCont-->
128
+
129
+ <div id="gauge">
130
+
131
+ <div id="gaugeArea">
132
+
133
+ <div>
134
+
135
+ <div>
136
+
137
+ <img id="gauge1" src="./img/scoringGauge1.svg" alt="">
138
+
139
+ <p>20</p>
140
+
141
+ </div>
142
+
143
+ <div class="innerText">
144
+
145
+ <img id="Item1" src="./img/scoringItem1.svg" alt="">
146
+
147
+ <p>気遣い力</p>
148
+
149
+ </div>
150
+
151
+ </div>
152
+
153
+ <div>
154
+
155
+ <div>
156
+
157
+ <img id="gauge2" src="./img/scoringGauge2.svg" alt="">
158
+
159
+ <p>20</p>
160
+
161
+ </div>
162
+
163
+ <div class="innerText">
164
+
165
+ <img id="Item2" src="./img/scoringItem1.svg" alt="">
166
+
167
+ <p>ドキドキ</p>
168
+
169
+ </div>
170
+
171
+ </div>
172
+
173
+ <div>
174
+
175
+ <div>
176
+
177
+ <img id="gauge3" src="./img/scoringGauge3.svg" alt="">
178
+
179
+ <p><?php echo htmlspecialchars($placepoint,ENT_QUOTES); ?></p>
180
+
181
+ </div>
182
+
183
+ <div class="innerText">
184
+
185
+ <img id="Item3" src="./img/scoringItem1.svg" alt="">
186
+
187
+ <p>独自イベント</p>
188
+
189
+ </div>
190
+
191
+ </div>
192
+
193
+
194
+
195
+ </div><!--gaugeArea-->
196
+
197
+ </div><!--gauge-->
198
+
199
+
200
+
201
+ <div id="textArea">
202
+
203
+ <img src="./img/scoringTextArea.svg">
204
+
205
+ <p>テキストが入ります。テキストが入ります。テキストが入ります。</p>
206
+
207
+ </div>
208
+
209
+
210
+
211
+ </div><!----scoringHumanAreas-->
212
+
213
+
214
+
215
+ <footer>
216
+
217
+
218
+
219
+ </footer>
220
+
221
+ </div><!-- scoringCont-->
222
+
223
+
224
+
225
+
226
+
227
+ </div>
228
+
229
+ <!-- wrapper -->
230
+
231
+ </body>
232
+
233
+ </html>
234
+
235
+ ```
30
236
 
31
237
 
32
238