当前位置: 首页>>代码示例>>PHP>>正文


PHP Device::update方法代码示例

本文整理汇总了PHP中Device::update方法的典型用法代码示例。如果您正苦于以下问题:PHP Device::update方法的具体用法?PHP Device::update怎么用?PHP Device::update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Device的用法示例。


在下文中一共展示了Device::update方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Device

 public static function Device($type, $data)
 {
     require_once 'device.class.php';
     $class = new Device();
     $status = false;
     $class->setData($data);
     $class->filter = ManagementFunction::getPostVariable('filter');
     switch ($type) {
         case 'add':
             $status = $class->add();
             break;
         case 'update':
             $status = $class->update();
             break;
         case 'delete':
             $status = $class->delete();
             break;
         case 'getsingle':
             $status = $class->getsingle();
             break;
         case 'getpage':
             $status = $class->getpage();
             break;
         case 'search':
             $status = $class->search();
             break;
         default:
             break;
     }
     if ($status) {
         wp_send_json_success($status);
     } else {
         wp_send_json_error($class->error);
     }
 }
开发者ID:khiconit,项目名称:Device-manager,代码行数:35,代码来源:ManagementAdmin.class.php

示例2: foreach

    foreach ($devices as $device) {
        $community = $device->get_community();
        $descr = $device->get_descr();
    }
} else {
    $community = POST('community');
    ossim_valid($community, OSS_ALPHA, OSS_SPACE, OSS_SCORE, OSS_PUNC, OSS_NULLABLE, 'illegal:' . _("name"));
    $descr = POST('descr');
    ossim_valid($descr, OSS_ALPHA, OSS_NULLABLE, OSS_SPACE, OSS_PUNC, OSS_AT, 'illegal:' . _("Description"));
    if (ossim_error()) {
        die(ossim_error());
    }
}
if ($community != "" && GET('ip') == "") {
    // only with POST
    Device::update($conn, $ip, $community, $descr);
    echo "<p>" . _("Device succesfully updated") . "</p>";
    ?>
<script>document.location.href="nedi.php"</script><?php 
}
?>

<form method="post" action="modifydevice.php">
<input type="hidden" name="ip" value="<?php 
echo $ip;
?>
"/>
<table align="center">
  <tr>
    <th> <?php 
echo gettext("Ip");
开发者ID:jhbsz,项目名称:ossimTest,代码行数:31,代码来源:modifydevice.php

示例3:

         $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 {
                 if ($control == Controls::Delete) {
                     $Device->delete();
                     $delete = true;
                 }
开发者ID:luvyatyss,项目名称:nashop,代码行数:31,代码来源:devices.php


注:本文中的Device::update方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。