本文整理汇总了PHP中Device::setStatus方法的典型用法代码示例。如果您正苦于以下问题:PHP Device::setStatus方法的具体用法?PHP Device::setStatus怎么用?PHP Device::setStatus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Device
的用法示例。
在下文中一共展示了Device::setStatus方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
if (isset($_POST["txtControl"])) {
$control->setValue($_POST["txtControl"]);
}
if (isset($_POST["txtDeviceID"])) {
$Device->setDeviceID($_POST["txtDeviceID"]);
}
if (isset($_POST["txtDeviceName"])) {
$Device->setDeviceName($_POST["txtDeviceName"]);
}
if ($control == Controls::Insert) {
$Device->insert();
$insert = true;
} else {
if ($control == Controls::Update) {
if (isset($_POST["chkStatus"])) {
$Device->setStatus($_POST["chkStatus"]);
} else {
$Device->setStatus(0);
}
$Device->update();
$update = true;
}
}
} else {
if (isset($_GET["DeviceID"]) && isset($_GET["control"])) {
$control->setValue($_GET["control"]);
$Device = Device::getDevice($_GET["DeviceID"]);
if ($Device != null) {
if ($control == Controls::Update) {
echo "<script> \$(function () { \$(window).load(function(){ \$('#modalDevice').modal( { backdrop: 'static', keyboard: false }, 'show');}); });</script>";
} else {
示例2: convertToDeviceObject
public function convertToDeviceObject($deviceDto)
{
$datetime = new DateTime('-10 seconds');
$tenSecondsBeforeNow = $datetime->format("Y-m-d H:i:s");
$device = new Device();
$device->setId($deviceDto->getId());
$device->setSerialNumber($deviceDto->getSerialNumber());
$device->setTitle($deviceDto->getTitle());
$device->setStatisticsPagePasscode($deviceDto->getStatisticsPagePasscode());
$device->setResetCounterButton($deviceDto->getResetCounterButton());
$device->setAmd100Qty($deviceDto->getAmd100Qty());
$device->setAmd200Qty($deviceDto->getAmd200Qty());
$device->setAmd500Qty($deviceDto->getAmd500Qty());
$device->setAmd100ChargeSeconds($deviceDto->getAmd100ChargeSeconds());
$device->setAmd200ChargeSeconds($deviceDto->getAmd200ChargeSeconds());
$device->setAmd500ChargeSeconds($deviceDto->getAmd500ChargeSeconds());
$device->setIsBusy($deviceDto->getIsBusy());
$device->setLastPing($deviceDto->getLastPing());
$device->setServerPingUrl($deviceDto->getServerPingUrl());
$device->setServerImagePostUrl($deviceDto->getServerImagePostUrl());
$device->setCameraAvailable($deviceDto->getCameraAvailable());
$device->setServerHost($deviceDto->getServerHost());
$lastPing = $deviceDto->getLastPing();
$deviceIsOn = $tenSecondsBeforeNow < $deviceDto->getLastPing() && !empty($lastPing);
if (!$deviceIsOn) {
$device->setStatus('off');
} else {
$device->setStatus($deviceDto->getIsBusy() == 1 ? 'busy' : 'free');
}
$totalAmd = $deviceDto->getAmd100Qty() * 100 + $deviceDto->getAmd200Qty() * 200 + $deviceDto->getAmd500Qty() * 500;
$device->setTotalAmd($totalAmd);
return $device;
}
示例3: Device
//truyền số record cần hiển thịs
}
$offset = ($curPage - 1) * $rowsPerPage;
// tính offset bắt đầu load
//filter
$SortName = "";
$SortType = true;
$filterDevice = new Device();
if (isset($_POST['DeviceID']) & !empty($_POST['DeviceID'])) {
$filterDevice->setDeviceID($_POST['DeviceID']);
}
if (isset($_POST['DeviceName']) & !empty($_POST['DeviceName'])) {
$filterDevice->setDeviceName($_POST['DeviceName']);
}
if (isset($_POST['Status']) & !empty($_POST['Status'])) {
$filterDevice->setStatus($_POST['Status']);
}
if (isset($_POST['SortName']) & !empty($_POST['SortName'])) {
$SortName = $_POST['SortName'];
}
if (isset($_POST['SortType']) & !empty($_POST['SortType'])) {
$SortType = $_POST['SortType'];
}
$numberOfRows = $filterDevice->countRecords();
// Số lượng dòng của bảng
$ListDevices = array();
if ($rowsPerPage == -1) {
// nếu là chọn hiển thị là ALL
$rowsPerPage = $numberOfRows;
$ListDevices = $filterDevice->loadLimit($rowsPerPage, 0, $SortName, $SortType);
} else {