박주현

1203

Showing 1 changed file with 23 additions and 21 deletions
...@@ -25,6 +25,8 @@ ...@@ -25,6 +25,8 @@
25 var m = date.getMonth(); 25 var m = date.getMonth();
26 var y = date.getFullYear(); 26 var y = date.getFullYear();
27 27
28 +
29 +
28 $('#calendar').fullCalendar({ 30 $('#calendar').fullCalendar({
29 header: { 31 header: {
30 left: 'prev,next today', 32 left: 'prev,next today',
...@@ -34,8 +36,7 @@ ...@@ -34,8 +36,7 @@
34 editable: true, 36 editable: true,
35 events: [ 37 events: [
36 38
37 - <?php 39 + <?php
38 -
39 //python 40 //python
40 $command = escapeshellcmd('test.py'); 41 $command = escapeshellcmd('test.py');
41 $output = shell_exec($command); 42 $output = shell_exec($command);
...@@ -52,31 +53,32 @@ ...@@ -52,31 +53,32 @@
52 $result2=mysqli_query($conn,$sql2); 53 $result2=mysqli_query($conn,$sql2);
53 $data2 = array(); 54 $data2 = array();
54 $row2=mysqli_fetch_array($result2); 55 $row2=mysqli_fetch_array($result2);
55 - echo $row2[0]; 56 + $rowcnt = $row2[0];
56 57
57 - $sql="select * from gametime"; 58 + $sql="select * from gametime order by day asc";
58 59
59 60
60 $result=mysqli_query($conn,$sql); 61 $result=mysqli_query($conn,$sql);
61 $data = array(); 62 $data = array();
62 $cnt = 0; 63 $cnt = 0;
63 - if($result){ 64 + ?>
64 - 65 + <?php if($result){
65 - while($row=mysqli_fetch_array($result)){ 66 + while( $row=mysqli_fetch_array($result) ) {
66 - array_push($data, array('day'=>$row[0], 'time'=>$row[1] )); 67 + array_push($data, array('day'=>$row[0], 'time'=>$row[1] ));
67 - $row_arr = explode('-', $row[0]); 68 +
68 - ?> 69 + $row_arr = explode('-', $row[0]);
69 - 70 + $cnt++;
70 - 71 + ?>
71 - { 72 + {
72 - title: 'Long Event', 73 + title: '1h',
73 - start: new Date(y, <?php echo $row_arr[1];?>, <?php echo $row_arr[2];?>), 74 + start: new Date(<?php $row[0] ?>),
74 - allDay: false 75 + allDay: false
75 - } 76 + }
76 - 77 + <?php if ( $cnt != $rowcnt ) { echo ","; }?>
77 - <?php $cnt++; if ( $cnt != $row[0] ) { echo ","; }?> 78 +
78 - <?php} //while 79 +
79 - } //if ?> 80 + <?php }
81 + } ?>
80 82
81 83
82 84
......