質問編集履歴
4
url追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
+
[卒研メモ: FullCalendar利用方法](https://cs-tklab.na-inet.jp/?p=1356)
|
2
|
+
|
1
|
-
|
3
|
+
上記のサイトを見て作ってます
|
2
4
|
|
3
5
|
|
4
6
|
|
3
タグ変更
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
2
プログラム変更
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,4 +1,14 @@
|
|
1
|
-
fullcalendar
|
1
|
+
fullcalendarが表示されません
|
2
|
+
|
3
|
+
|
4
|
+
|
5
|
+
index.phpの12行目:$(document).ready(function() と
|
6
|
+
|
7
|
+
123行目:$('#edit_time_submit').click(function(event) {
|
8
|
+
|
9
|
+
の変数名が定義されていないとでます。
|
10
|
+
|
11
|
+
|
2
12
|
|
3
13
|
|
4
14
|
|
@@ -18,19 +28,13 @@
|
|
18
28
|
|
19
29
|
<tittle>XXXXXXXX</tittle>
|
20
30
|
|
21
|
-
<link href=
|
31
|
+
<link href='../lib/main.css' rel='stylesheet' />
|
22
|
-
|
32
|
+
|
23
|
-
|
33
|
+
<script src='../lib/main.js'></script>
|
24
|
-
|
25
|
-
<script src="js/jquery.min.js"></script>
|
26
|
-
|
27
|
-
<script src="js/fullcalendar.js"></script>
|
28
|
-
|
29
|
-
<script src="js/locale-all.js"></script>
|
30
34
|
|
31
35
|
<script>
|
32
36
|
|
33
|
-
var global_fullcalendar_event = null
|
37
|
+
var global_fullcalendar_event = null;
|
34
38
|
|
35
39
|
var default_ymd_format = 'YYYY-MM-DD HH:mm';
|
36
40
|
|
@@ -118,9 +122,9 @@
|
|
118
122
|
|
119
123
|
events: {
|
120
124
|
|
121
|
-
url: 'php/read.php'
|
125
|
+
url: 'php/read.php',
|
122
|
-
|
126
|
+
|
123
|
-
error:function()
|
127
|
+
error: function(){
|
124
128
|
|
125
129
|
console.log("read error!");
|
126
130
|
|
@@ -166,7 +170,7 @@
|
|
166
170
|
|
167
171
|
},
|
168
172
|
|
169
|
-
dragRevertDuration
|
173
|
+
dragRevertDuration: 0,
|
170
174
|
|
171
175
|
eventDragStop: function(event, jsEvent, ui, view) {
|
172
176
|
|
@@ -178,7 +182,7 @@
|
|
178
182
|
|
179
183
|
(ofs.top <= jsEvent.pageY)&&(jsEvent.pageY <=ofs.top + trashcan.outerHeight(true))) {
|
180
184
|
|
181
|
-
if(confirm('「'+event.title'」('+event.id+')捨てますよ?')) {
|
185
|
+
if(confirm('「'+event.title+'」('+event.id+')捨てますよ?')) {
|
182
186
|
|
183
187
|
if(event.id == undefined) id =event._id;
|
184
188
|
|
@@ -208,6 +212,8 @@
|
|
208
212
|
|
209
213
|
<body>
|
210
214
|
|
215
|
+
|
216
|
+
|
211
217
|
<div id ="read-error" style="display::none">読み込めません</div>
|
212
218
|
|
213
219
|
<div id="loading">読み込み中</div>
|
@@ -364,6 +370,204 @@
|
|
364
370
|
|
365
371
|
```
|
366
372
|
|
373
|
+
```ここに言語を入力
|
374
|
+
|
375
|
+
update.php
|
376
|
+
|
377
|
+
|
378
|
+
|
379
|
+
<?php
|
380
|
+
|
381
|
+
require "database.php";
|
382
|
+
|
383
|
+
|
384
|
+
|
385
|
+
echo "update.phpの処理結果<br>\n";
|
386
|
+
|
387
|
+
|
388
|
+
|
389
|
+
$json = json_decode($_POST['allevents']);
|
390
|
+
|
391
|
+
|
392
|
+
|
393
|
+
echo "登録開始!・・・";
|
394
|
+
|
395
|
+
foreach($json as $array) {
|
396
|
+
|
397
|
+
if(!property_exists($array, 'id')) {
|
398
|
+
|
399
|
+
$sql = "INSERT INTO" . $table_name . "(start, end, title) VALUES(";
|
400
|
+
|
401
|
+
$sql .= '"' . $array->start . '", "' . $array->end . '", "' . $array->tittle . '"'; $sql .=')';
|
402
|
+
|
403
|
+
} else {
|
404
|
+
|
405
|
+
$sql = "INSERT INTO" . $table_name . "(id, start, end, title) VALUES(";
|
406
|
+
|
407
|
+
$sql .= $array->id . ',"' . $array->start . '","' . $array->end . '","' . $array->title . '"';
|
408
|
+
|
409
|
+
$sql .= ') ON DUPLICATE KEY UPDATE';
|
410
|
+
|
411
|
+
$sql .= 'start=VALUES(start), end=VALUES(end), tittle=VALUES(tittle)';
|
412
|
+
|
413
|
+
}
|
414
|
+
|
415
|
+
|
416
|
+
|
417
|
+
echo $sql . "<br>\n";
|
418
|
+
|
419
|
+
$query_ret = mysqli_query($db, $sql);
|
420
|
+
|
421
|
+
}
|
422
|
+
|
423
|
+
echo count($json) . "件登録終了\n";
|
424
|
+
|
425
|
+
|
426
|
+
|
427
|
+
mysqli_close($db);
|
428
|
+
|
429
|
+
|
430
|
+
|
431
|
+
?>
|
432
|
+
|
433
|
+
```
|
434
|
+
|
435
|
+
|
436
|
+
|
437
|
+
```ここに言語を入力
|
438
|
+
|
439
|
+
read.php
|
440
|
+
|
441
|
+
|
442
|
+
|
443
|
+
<?php
|
444
|
+
|
445
|
+
require "database.php";
|
446
|
+
|
447
|
+
|
448
|
+
|
449
|
+
$range_start = parseDateTime(htmlspecialchars($_GET['start'], ENT_QUOTES), $default_timezone);
|
450
|
+
|
451
|
+
$range_end = parseDateTime(htmlspecialchars($_GET['end'], ENT_QUOTES), $default_timezone);
|
452
|
+
|
453
|
+
|
454
|
+
|
455
|
+
$sql = "SELECT * FROM" .$table_name;
|
456
|
+
|
457
|
+
|
458
|
+
|
459
|
+
$event_array = array();
|
460
|
+
|
461
|
+
$query_ret = mysqli_query($db, $sql);
|
462
|
+
|
463
|
+
while($array ~ mysqli_fetch_assoc($query_ret)) {
|
464
|
+
|
465
|
+
$event = new Event($array, $default_timezone);
|
466
|
+
|
467
|
+
|
468
|
+
|
469
|
+
if ($event->isWithinDayRange($range_start, $range_end)) {
|
470
|
+
|
471
|
+
$event_array[] = $event->toArray();
|
472
|
+
|
473
|
+
}
|
474
|
+
|
475
|
+
}
|
476
|
+
|
477
|
+
|
478
|
+
|
479
|
+
mysqli_close($db);
|
480
|
+
|
481
|
+
|
482
|
+
|
483
|
+
echo json_encode($event_array);
|
484
|
+
|
485
|
+
|
486
|
+
|
487
|
+
?>
|
488
|
+
|
489
|
+
```
|
490
|
+
|
491
|
+
```ここに言語を入力
|
492
|
+
|
493
|
+
delete.php
|
494
|
+
|
495
|
+
|
496
|
+
|
497
|
+
<?php
|
498
|
+
|
499
|
+
require "database.php";
|
500
|
+
|
501
|
+
|
502
|
+
|
503
|
+
$id = htmlspecialchars($_POST['id'], ENT_QUOTES);
|
504
|
+
|
505
|
+
|
506
|
+
|
507
|
+
$sql = "DELETE FROM" . $table_name . ' WHERE id=' . $id;
|
508
|
+
|
509
|
+
|
510
|
+
|
511
|
+
$query_ret = mysqli_query($db, $sql);
|
512
|
+
|
513
|
+
|
514
|
+
|
515
|
+
mysqli_close($db);
|
516
|
+
|
517
|
+
|
518
|
+
|
519
|
+
?>
|
520
|
+
|
521
|
+
```
|
522
|
+
|
523
|
+
```ここに言語を入力
|
524
|
+
|
525
|
+
database.php
|
526
|
+
|
527
|
+
|
528
|
+
|
529
|
+
<?php
|
530
|
+
|
531
|
+
$default_timezone_str = 'Asia/Tokyo';
|
532
|
+
|
533
|
+
date_default_timezone_set($default_timezone_str);
|
534
|
+
|
535
|
+
$default_timezone = new DataTImeZone($default_timezone_str);
|
536
|
+
|
537
|
+
|
538
|
+
|
539
|
+
require dirname(__FILE__) . '/utils.php';
|
540
|
+
|
541
|
+
|
542
|
+
|
543
|
+
$host_name = 'localhost';
|
544
|
+
|
545
|
+
|
546
|
+
|
547
|
+
$database_name = "schedule";
|
548
|
+
|
549
|
+
|
550
|
+
|
551
|
+
$table_name = 'contents';
|
552
|
+
|
553
|
+
|
554
|
+
|
555
|
+
$username = "root";
|
556
|
+
|
557
|
+
$password ="";
|
558
|
+
|
559
|
+
|
560
|
+
|
561
|
+
$db = mysqli_connect($host_name, $username, $password . $database_name) or die('Cannot connect MYSQL and DATABASE in it!');
|
562
|
+
|
563
|
+
mysqli_set_charset($db, 'utf8');
|
564
|
+
|
565
|
+
|
566
|
+
|
567
|
+
?>
|
568
|
+
|
569
|
+
```
|
570
|
+
|
367
|
-
実行
|
571
|
+
実行結果です
|
368
|
-
|
572
|
+
|
369
|
-
![実行
|
573
|
+
![実行結果です](a5d572865209494c3834c09c7f3a0680.jpeg)
|
1
画像挿入
test
CHANGED
File without changes
|
test
CHANGED
@@ -363,3 +363,7 @@
|
|
363
363
|
|
364
364
|
|
365
365
|
```
|
366
|
+
|
367
|
+
実行した結果です。
|
368
|
+
|
369
|
+
![実行した結果です](d3023c7a0fe976ce5448c92771e7e8ef.jpeg)
|