jquery完整日历:来自MySQL的每个事件随机不同的颜色

时间:2013-12-03 01:55:37

标签: javascript php jquery mysql fullcalendar

我开始使用jQuery full calendar并在MySQL数据库中创建事件。我希望日历事件随机有不同的颜色。我怎么能这样做?

这是我的代码:

<?php if ($event[$j]['allday'] == 0){?>
    { title: '[<?php echo $event[$j]['courseid'];?> by <?php echo $event[$j]['tutorid'];?>]',
    start: new Date(start_year[<?php echo $j?>],
                    start_month[<?php echo $j?>]-1,
                    start_day[<?php echo $j?>],
                    start_hour[<?php echo $j?>],
                    start_mins[<?php echo $j?>]),
    end: new Date(end_year[<?php echo $j?>],
                  end_month[<?php echo $j?>]-1,
                  end_day[<?php echo $j?>],
                  end_hour[<?php echo $j?>],
                  end_mins[<?php echo $j?>]),
    url: 'mg_course.php?courseid=<?php echo $event[$j]['courseid']; ?>'
    },                  
<?php };
if ($event[$j]['allday'] == 1) {?>
    { title: '[<?php echo $event[$j]['courseid'];?> by <?php echo $event[$j]['tutorid'];?>]',
    start: new Date(start_year[<?php echo $j?>],
                    start_month[<?php echo $j?>]-1,
                    start_day[<?php echo $j?>],
                    start_hour[<?php echo $j?>],
                    start_mins[<?php echo $j?>]),
    end: new Date(end_year[<?php echo $j?>],
                  end_month[<?php echo $j?>]-1,
                  end_day[<?php echo $j?>],
                  end_hour[<?php echo $j?>],
                  end_mins[<?php echo $j?>]),
    url: 'mg_course.php?courseid=<?php echo $event[$j]['courseid']; ?>',
    allDay: 'false'
},      
<?php } ?>

0 个答案:

没有答案