質問編集履歴

1

詳細な文法など

2019/07/30 05:35

投稿

twinparadox
twinparadox

スコア42

test CHANGED
File without changes
test CHANGED
@@ -1,12 +1,10 @@
1
1
  ### 前提・実現したいこと
2
2
 
3
+
4
+
3
5
  cloud9上でプレビューがみたい
4
6
 
5
- ここに質問の内容を詳しく書いてください。
7
+
6
-
7
- (例)PHP(CakePHP)で●●なシステムを作っています。
8
-
9
- ■■な機能を実装中に以下のエラーメッセージが発生しました。
10
8
 
11
9
  PHPでカレンダーアプリを作成中です。毎日プレビュー出来ていたのに急にプレビュー出来なくなりました。
12
10
 
@@ -16,11 +14,25 @@
16
14
 
17
15
  ### 発生している問題・エラーメッセージ
18
16
 
17
+ cloud9↓
18
+
19
+
20
+
19
21
  One or more other sessions or collaborators are active on this environment. Switching to the minimal code completion engine to conserve memory.``
20
22
 
21
23
  エラーメッセージ
22
24
 
23
- ```
25
+ CSS↓
26
+
27
+
28
+
29
+ bash: line 1: styles.css: command not found
30
+
31
+
32
+
33
+
34
+
35
+ Process exited with code: 127
24
36
 
25
37
 
26
38
 
@@ -28,11 +40,265 @@
28
40
 
29
41
 
30
42
 
31
- ```ここに言語名を入力
43
+ CSS PHP
32
44
 
33
45
  ソースコード
34
46
 
47
+ body {
48
+
49
+ font-family: Arial, sans-serif;
50
+
51
+ font-size: 14px;
52
+
53
+ }
54
+
35
- ```
55
+ a {
56
+
57
+ text-decoration: none;
58
+
59
+ }
60
+
61
+ table {
62
+
63
+ margin: 15px auto;
64
+
65
+ border: 1px solid #ddd;
66
+
67
+ border-collapse: collapse;
68
+
69
+ }
70
+
71
+ th {
72
+
73
+ background: #eee;
74
+
75
+ }
76
+
77
+ th, td {
78
+
79
+ padding: 7px;
80
+
81
+ text-align: center;
82
+
83
+ }
84
+
85
+
86
+
87
+ .youbi_0 {
88
+
89
+ color: red;
90
+
91
+ }
92
+
93
+ .youbi_6 {
94
+
95
+ color: blue;
96
+
97
+ }
98
+
99
+ .today {
100
+
101
+ font-weight: bold;
102
+
103
+ }
104
+
105
+ .gray {
106
+
107
+ color: #dedede;
108
+
109
+ }
110
+
111
+
112
+
113
+
114
+
115
+ <?php
116
+
117
+
118
+
119
+ function h($s){
120
+
121
+ return htmlspecialchars($s, ENT_QUOTES, 'UTF-8');
122
+
123
+ }
124
+
125
+
126
+
127
+ try{
128
+
129
+ if (!isset($_GET['t']) || !preg_match('/\A\d{4}-\d{2}\z/', $_GET['t'])){
130
+
131
+ throw new Exception();
132
+
133
+
134
+
135
+ }
136
+
137
+ $thisMonth = new DateTime($_GET['t']);
138
+
139
+ } catch (Exception $e) {
140
+
141
+ $thisMonth = new DateTime('first day of this month');
142
+
143
+ }
144
+
145
+
146
+
147
+ $dt = clone $thisMonth;
148
+
149
+ $prev = $dt->modify('-1 month')->format('Y-m');
150
+
151
+ $dt = clone $thisMonth;
152
+
153
+ $next = $dt->modify('+1 month')->format('Y-m');
154
+
155
+ $yearMonth = $thisMonth->format('F Y');
156
+
157
+
158
+
159
+
160
+
161
+ $tail = '';
162
+
163
+ $lastDayOfPrevMonth = new DateTime('last day of ' . $yearMonth . ' -1 month');
164
+
165
+ while ($lastDayOfPrevMonth->format('w') < 6 ){
166
+
167
+ $tail = sprintf('<td class="gray">%d</td>', $lastDayOfPrevMonth->format('d')) . $tail;
168
+
169
+ $lastDayOfPrevMonth->sub(new DateInterval('P1D'));
170
+
171
+
172
+
173
+ }
174
+
175
+
176
+
177
+
178
+
179
+
180
+
181
+ $body = '';
182
+
183
+ $period = new DatePeriod(
184
+
185
+ new DateTime('first day of ' . $yearMonth),
186
+
187
+ new DateInterval('P1D'),
188
+
189
+ new DateTime('first day of ' . $yearMonth . '+1 month')
190
+
191
+ );
192
+
193
+ $today = new DateTime('today');
194
+
195
+
196
+
197
+ foreach ($period as $day) {
198
+
199
+ if ($day->format('w') % 7 === 0) { $body .= '</tr><tr>'; }
200
+
201
+ $todayclass = ($day->format('Y-m-d') === $today->format('Y-m-d')) ? 'today' : '';
202
+
203
+ $body .= sprintf('<td class="youbi_%d %s">%d</td>', $day->format('w'), $todayclass,$day->format('d'));
204
+
205
+ }
206
+
207
+ $head = '';
208
+
209
+ $firstDayOfNextMonth = new DateTime('first day of ' . $yearMonth . ' +1 month');
210
+
211
+ while ($firstDayOfNextMonth->format('w') > 0) {
212
+
213
+ $head .= sprintf('<td class="gray">%d</td>', $firstDayOfNextMonth->format('d'));
214
+
215
+ $firstDayOfNextMonth->add(new DateInterval('P1D'));
216
+
217
+
218
+
219
+ }
220
+
221
+ $html = '<tr>' . $tail . $body . $head . '</tr>';
222
+
223
+
224
+
225
+ ?>
226
+
227
+ <!DOCTYPE html>
228
+
229
+ <html lang="ja">
230
+
231
+ <head>
232
+
233
+ <meta charset="utf-8">
234
+
235
+ <title>Calendar</title>
236
+
237
+ <link rel="stylesheet" href="styles.css">
238
+
239
+ </head>
240
+
241
+ <body>
242
+
243
+ <table>
244
+
245
+ <thead>
246
+
247
+ <tr>
248
+
249
+ <th><a href="/?t=<?php echo h($prev); ?>">&laquo;</a></th>
250
+
251
+ <th colspan="5"><?php echo h($yearMonth); ?></th>
252
+
253
+ <th><a href="/?t=<?php echo h($next); ?>">&raquo;</a></th>
254
+
255
+ </tr>
256
+
257
+ </thead>
258
+
259
+ <tbody>
260
+
261
+ <tr>
262
+
263
+ <td>Sun</td>
264
+
265
+ <td>Mon</td>
266
+
267
+ <td>Tue</td>
268
+
269
+ <td>Wed</td>
270
+
271
+ <td>Thu</td>
272
+
273
+ <td>Fri</td>
274
+
275
+ <td>Sat</td>
276
+
277
+ </tr>
278
+
279
+ <?php echo $html; ?>
280
+
281
+
282
+
283
+ </tr>
284
+
285
+ </tbody>
286
+
287
+ <tfoot>
288
+
289
+ <tr>
290
+
291
+ <th colspan="7"><a href="/">Today</a></th>
292
+
293
+ </tr>
294
+
295
+ </tfoot>
296
+
297
+ </table>
298
+
299
+ </body>
300
+
301
+ </html>
36
302
 
37
303
 
38
304
 
@@ -40,7 +306,11 @@
40
306
 
41
307
 
42
308
 
309
+ runnerの変更
310
+
311
+
312
+
43
- ここに問題に対して試したことを記載してください。
313
+ サインイン サインアウト
44
314
 
45
315
 
46
316
 
@@ -48,4 +318,4 @@
48
318
 
49
319
 
50
320
 
51
- ここより詳細な情報記載てください
321
+ 関係無いとは思いますがdookeeperてgithubとの連携をしました