Beispiel #1
0
 // 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) {
/**
 * 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;
}