當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Device::setStatus方法代碼示例

本文整理匯總了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 {
開發者ID:luvyatyss,項目名稱:nashop,代碼行數:31,代碼來源:devices.php

示例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;
 }
開發者ID:pars5555,項目名稱:photobooth,代碼行數:33,代碼來源:DevicesManager.class.php

示例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 {
開發者ID:luvyatyss,項目名稱:nashop,代碼行數:31,代碼來源:devicesBody.php


注:本文中的Device::setStatus方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。