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


PHP Device::GetTags方法代碼示例

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


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

示例1: date

 // insert date formating later for regionalization settings
 $date = date("d M Y", strtotime($row["InstallDate"]));
 $Model = "";
 $Department = "";
 if ($row["TemplateID"] > 0) {
     $templ->TemplateID = $row["TemplateID"];
     $templ->GetTemplateByID();
     $Model = "<a href=\"device_templates.php?TemplateID={$templ->TemplateID}\" target=\"template\">{$templ->Model}</a>";
 }
 if ($row["Owner"] > 0) {
     $dept->DeptID = $row["Owner"];
     $dept->GetDeptByID();
     $Department = $dept->Name;
 }
 $dev->DeviceID = $row["DeviceID"];
 $tags = implode(",", $dev->GetTags());
 $body .= "\t\t<tr>\n\t\t\t\t<td><a href=\"dc_stats.php?dc={$row["DataCenterID"]}\" target=\"datacenter\">{$row["DataCenter"]}</a></td>\n\t\t\t\t<td><a href=\"cabnavigator.php?cabinetid={$row["CabinetID"]}\" target=\"cabinet\">{$row["Location"]}</a></td>\n\t\t\t\t<td>{$row["Position"]}</td>\n\t\t\t\t<td>{$row["Height"]}</td>\n\t\t\t\t<td><a href=\"devices.php?DeviceID={$dev->DeviceID}\" target=\"device\">{$row["Label"]}</a></td>\n\t\t\t\t<td>{$row["SerialNo"]}</td>\n\t\t\t\t<td>{$row["AssetTag"]}</td>\n\t\t\t\t<td><a href=\"search.php?key=dev&DeviceType={$row["DeviceType"]}&search\" target=\"search\">{$row["DeviceType"]}</a></td>\n\t\t\t\t<td>{$Model}</td>\n\t\t\t\t<td>{$tags}</td>\n\t\t\t\t<td>{$Department}</td>\n\t\t\t\t<td>{$date}</td>\n\t\t</tr>\n";
 if ($row["DeviceType"] == "Chassis") {
     // Find all of the children!
     $childList = $dev->GetDeviceChildren();
     foreach ($childList as $child) {
         $cdate = date("d M Y", strtotime($child->InstallDate));
         $cModel = "";
         $cDepartment = "";
         $ctags = implode(",", $child->GetTags());
         if ($child->TemplateID > 0) {
             $templ->TemplateID = $child->TemplateID;
             $templ->GetTemplateByID();
             $cModel = "<a href=\"device_templates.php?TemplateID={$templ->TemplateID}\" target=\"template\">{$templ->Model}</a>";
         }
         if ($child->Owner > 0) {
開發者ID:sengkoil,項目名稱:openDCIM,代碼行數:31,代碼來源:search_export.php

示例2: getTagsString

/**
 * Merge the tags of a Device or Cabinet into one string separated by ', '
 *
 * @param Device|Cabinet $obj
 * @return string
 */
function getTagsString($obj, $emptyVal = null)
{
    $tagNames = $emptyVal;
    $tag_list = $obj->GetTags();
    if (count($tag_list) > 0) {
        $tagNames = implode(', ', $tag_list);
    }
    return $tagNames;
}
開發者ID:dc-admin,項目名稱:openDCIM,代碼行數:15,代碼來源:report_asset_Excel-new.php


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