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


PHP Device::insert方法代碼示例

本文整理匯總了PHP中Device::insert方法的典型用法代碼示例。如果您正苦於以下問題:PHP Device::insert方法的具體用法?PHP Device::insert怎麽用?PHP Device::insert使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Device的用法示例。


在下文中一共展示了Device::insert方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: POST

    include "../hmenu.php";
}
$ip = "";
$community = "";
$descr = "";
$ip = POST('ip');
$community = POST('community');
$descr = POST('descr');
ossim_valid($ip, OSS_IP_ADDR, OSS_NULLABLE, 'illegal:' . _("ip"));
ossim_valid($community, OSS_ALPHA, OSS_SPACE, OSS_SCORE, OSS_PUNC, OSS_NULLABLE, 'illegal:' . _("name"));
ossim_valid($descr, OSS_ALPHA, OSS_NULLABLE, OSS_SPACE, OSS_PUNC, OSS_AT, 'illegal:' . _("Description"));
if (ossim_error()) {
    die(ossim_error());
}
if ($ip != "" && $community != "") {
    Device::insert($conn, $ip, $community, $descr);
    echo "<p>" . _("Device succesfully inserted") . "</p>";
    ?>
<script>document.location.href="nedi.php"</script><?php 
}
?>

<form method="post" action="newdevice.php">
<table align="center">
  <tr>
    <th> <?php 
echo gettext("Ip");
?>
 </th>
    <td style="text-align:left;padding-left:3px;" class="nobborder"><input type="text" name="ip" value="<?php 
echo $ip;
開發者ID:jhbsz,項目名稱:ossimTest,代碼行數:31,代碼來源:newdevice.php

示例2: Controls

 $delete = null;
 $control = new Controls(Controls::Insert);
 //Chưa chọn loại sản phẩm;
 $Device = new Device();
 if (isset($_POST["btnSave"])) {
     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"]);
開發者ID:luvyatyss,項目名稱:nashop,代碼行數:31,代碼來源:devices.php


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