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


PHP Tags::FindAll方法代码示例

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


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

示例1: __

<?php

require_once 'db.inc.php';
require_once 'facilities.inc.php';
$subheader = __("Inventory Reporting By Tag");
$tagsList = Tags::FindAll();
$body = "";
if (isset($_REQUEST['tagid'])) {
    $tag = isset($_POST['tagid']) ? $_POST['tagid'] : $_GET['tagid'];
    if ($tag != '') {
        $tag = intval($tag);
        if ($tag == 0) {
            $sql = "SELECT dev.Label, dc.Name as DC, c.Location as Rack, dept.Name as Owner, t.Name as Tag, dev.Notes FROM fac_Tags t, fac_Device dev, fac_Cabinet c, fac_DataCenter dc, fac_DeviceTags dt, fac_Department dept WHERE t.TagID=dt.TagID AND dt.DeviceID=dev.DeviceID AND dev.Cabinet=c.CabinetID AND dc.DataCenterID=c.DataCenterID AND dept.DeptID=dev.Owner ORDER BY dev.Label ASC, Tag ASC;";
        } else {
            $sql = "SELECT dev.Label, dc.Name as DC, c.Location as Rack, dept.Name as Owner, t.Name as Tag, dev.Notes FROM fac_Tags t, fac_Device dev, fac_Cabinet c, fac_DataCenter dc, fac_DeviceTags dt, fac_Department dept WHERE t.TagID=dt.TagID AND dt.DeviceID=dev.DeviceID AND dev.Cabinet=c.CabinetID AND dc.DataCenterID=c.DataCenterID AND dept.DeptID=dev.Owner AND dt.TagID={$tag} ORDER BY dev.Label ASC, Tag ASC;";
        }
        $result = $dbh->query($sql);
    } else {
        $result = array();
    }
    // Left these expanded in case we need to add or remove columns.  Otherwise I would have just collapsed entirely.
    $body = "<table id=\"export\" class=\"display\">\n\t<thead>\n\t\t<tr>\n\n\t\t\t\t<th>" . __("Device Label") . "</th>\n\t\t\t\t<th>" . __("Datacenter") . "</th>\n\t\t\t\t<th>" . __("Rack") . "</th>\n\t\t\t\t<th>" . __("Owner") . "</th>\n\t\t\t\t<th>" . __("Tag") . "</th>\n\t\t\t\t<th>" . __("Notes") . "</th>\n\t\t\t</tr>\n\t</thead>\n\t<tbody>\n";
    // suppressing errors for when there is a fake data set in place
    foreach ($result as $row) {
        $body .= "\t\t<tr>\n\t\t\t\t<td>{$row["Label"]}</td>\n\t\t\t\t<td>{$row["DC"]}</td>\n\t\t\t\t<td>{$row["Rack"]}</td>\n\t\t\t\t<td>{$row["Owner"]}</td>\n\t\t\t\t<td>{$row["Tag"]}</td>\n\t\t\t\t<td>" . strip_tags($row["Notes"]) . "</td>\n\t\t\t\t\t</tr>\n";
    }
    $body .= "\t\t</tbody>\n\t</table>\n";
    if (isset($_REQUEST['ajax'])) {
        echo $body;
        exit;
    }
开发者ID:paragm,项目名称:openDCIM,代码行数:31,代码来源:report_tags.php

示例2: elseif

         $options[$cabrow->CabRowID] = $cabrow->Name;
     }
 } elseif ($containmentType == 4) {
     # filter by cabinet
     $cList = new Cabinet();
     $cList = $cList->ListCabinets();
     $body .= "<select name=cabid id=cabid>";
     foreach ($cList as $cabinet) {
         $dc = new DataCenter();
         $dc->DataCenterID = $cabinet->DataCenterID;
         $dc->GetDataCenter();
         $options[$cabinet->CabinetID] = $dc->Name . "::" . $cabinet->Location;
     }
 } elseif ($containmentType == 5) {
     # filter by custom tag
     $tList = Tags::FindAll();
     $body .= "<select name=tagname id=tagname>";
     foreach ($tList as $TagID => $Name) {
         $options[$Name] = $Name;
     }
 }
 # sort and output the options based on the name of the option
 asort($options);
 foreach ($options as $key => $val) {
     $body .= "<option value=" . $key . ">" . $val . "</option>";
 }
 $body .= "</select>" . "<select name=mediaid id=mediaid>" . "<option value=-1>All Media Types</option>" . "<option value=0>Unknown Media Types</option>";
 foreach (MediaTypes::GetMediaTypeList() as $mt) {
     $body .= "<option value=" . $mt->MediaID . ">" . $mt->MediaType . "</option>";
 }
 $body .= "</select>" . "<select name=colortype id=colortype>" . "<option value=0>Try to use colors from the database</option>" . "<option value=1>Randomize colors, per color</option>" . "<option value=2>Randomize colors, per mediatype</option>" . "<option value=3 selected>Randomize colors, per color and mediatype</option>" . "</select>" . "<input type=\"checkbox\" name=edgelabels checked value=true>Label Cables" . "<select name=format id=format onchange='this.form.submit()'>" . "<option value=''>Select format</option>" . "<option value=0>SVG</option>" . "<option value=1>PNG</option>" . "<option value=2>JPG</option>" . "<option value=3>DOT</option>" . "</select>" . "</form>";
开发者ID:paragm,项目名称:openDCIM,代码行数:31,代码来源:report_network_map.php


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