我想更改单个事件的背景色。代码是我将数据发送到事件的方式。textColor似乎发生了变化,但backgroundColor或borderColor的颜色没有变化。我做错了什么,或者颜色可以改变吗。我正在使用V1
include("connect.php");
require_once("function.php");
$pid = $_SESSION['pid'];
$events = array();
foreach($db->query("SELECT * FROM `signings` WHERE `pid` = '$pid' AND `done`= 0") as $row) {
$notaryid = $row['notayid'];
$title = $row['fname'].' '.$row['lname'] . ' ' . $row['coname'] . ' ' . $row['city'] . ' ' . $row['state'];
$signstart = $row['signstart'] . ' ' . $row['starttime'];
$id = $row['id'];
$ordern = $row['ordern'];
$address = $row['street1'] . ' ' . $row['street2'] . ' ' . $row['city'] . ', ' . $row['state'] . ', ' . $row['zip'];
$hphone = 'Home Phone ' . $row['hphone'];
$cphone = 'Cell Phone ' . $row['cphone'];
$wphone = 'Work Phone ' . $row['wphone'];
$custid = $row['custid'];
$sql1 = "Select name from customers WHERE custid = '$custid'";
$stmt1 = $db->query($sql1);
$row1 = $stmt1->fetchObject();
$name = $row1->name;
$sql2 = "Select firstname,lastname,color from notarys WHERE nid = '$notaryid'";
$stmt2 = $db->query($sql2);
$row2 = $stmt2->fetchObject();
$colors = $row2->color;
$notary = $row2->firstname . " " . $row2->lastname;
$eventsArray['id'] = $id;
$eventsArray['ordern'] = $ordern;
$eventsArray['title'] = $title . ' ' . $name;
$eventsArray['start'] = $signstart;
$eventsArray['date1'] = phpdatetimeam($signstart);
$eventsArray['address'] = $address;
$eventsArray['hphone'] = $hphone;
$eventsArray['cphone'] = $cphone;
$eventsArray['wphone'] = $wphone;
$eventsArray['notary'] = $notary;
$eventsArray['allDay'] = "";
$eventsArray['color'] = $colors; <-- This is were I change the color
$eventsArray['textColor'] = "#FFFFFF"; I have tried backgroundColor and
BorderColor but now of them work
$events[] = $eventsArray;
}
echo json_encode($events);
foreach后面的第一行有一个拼写错误:
$notaryid = $row['notayid'];
应为:
$notaryid = $row['notaryid'];
我不知道这是否是个问题,我想看看你在事件数组中设置背景色的位置,我只看到文本颜色,它是数组的最后一个元素。