本文整理汇总了PHP中Device::get_type_name方法的典型用法代码示例。如果您正苦于以下问题:PHP Device::get_type_name方法的具体用法?PHP Device::get_type_name怎么用?PHP Device::get_type_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Device
的用法示例。
在下文中一共展示了Device::get_type_name方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
function get_config($id = '')
{
// MUST HAVE<input type='hidden' name='id' value=".$id."></input>
// the name of the property must follow the conventions plugin_<Classname>_<propertyName>
// have the form post and make sure the submit button is named widget_update
// make sure there is also a hidden value giving the name of this Class file
// Get defaults
$subquery = "select device_id, enabled FROM plugin_SNMPPoller_devices";
$result2 = mysql_query($subquery);
if (!$result2) {
return "<b>Oops something went wrong, unable to read plugin_SNMPPoller_devices SQL table </b>";
}
$devices = array();
while ($obj = mysql_fetch_object($result2)) {
$devices[$obj->device_id] = $obj->enabled;
}
// Now we have the defaults in $devices;
$content .= "<h1>Please select the Devices you would like to Monitor with the SNMP poller</h1>";
$content .= "<form id='configForm' method='post' name='edit_devices'>\r\n\t\t\t<input type='hidden' name='class' value='SNMPPoller'></input>\r\n\t\t\t<input type='hidden' name='id' value=" . $id . "></input> ";
$select_all = "<input name='all' type='checkbox' value='Select All' onclick=\"checkAll(document.edit_devices['devices[]'],this)\"";
#$content .= "<table border=1><tr><th>$select_all</th><th>Device</th><th>Device Type</th><th>Location</th></tr>";
$form = new Form("auto", 4);
$keyHandlers = array();
$keyData = array();
$keyTitle = array();
foreach (Device::get_devices() as $id => $name) {
if (array_key_exists($id, $devices) && $devices[$id] == 1) {
$checked = "checked='yes'";
} else {
$checked = "";
}
$deviceInfo = new Device($id);
array_push($keyData, "<input type=checkbox name=devices[] value='{$id}' {$checked} >");
array_push($keyData, $name);
array_push($keyData, $deviceInfo->get_type_name());
array_push($keyData, $deviceInfo->get_location_name());
#$content .= "<tr><td><input type=checkbox name=devices[] value='$id' $checked ></td>";
#$content .= "<td>$name</td><td>". $deviceInfo->get_type_name() ."</td>";
#$content .= "<td>". $deviceInfo->get_location_name() ."</td></tr>";
}
#$content .= "</table> <br>";
//get all the device and display them all in the 3 sections "Device Name", "Device Type", "Location".
$heading = array($select_all, "Device Name", "Device Type", "Location ");
$form->setSortable(true);
// or false for not sortable
$form->setHeadings($heading);
$form->setEventHandler($handler);
$form->setData($keyData);
$form->setTableWidth("auto");
$content .= $form->showForm();
$content .= "<div style='clear:both;'></div><input type='submit' class='submitBut' name='plugin_update' value='Update configuration'/>\r\n\t\t\t</form> ";
return "{$content}";
}
示例2: displayAllArchived
function displayAllArchived($devices)
{
//global the tool and make a tool bar for adding a device, and the IP Report
global $tool, $deviceForm;
if ($_SESSION['access'] >= 50) {
$toolNames = array("Add New Device", "All Device", "IP Report");
$toolIcons = array("add", "device", "report");
$toolHandlers = array("handleEvent('devices.php?action=add')", "handleEvent('devices.php')");
} else {
$toolNames = array("All Device", "IP Report");
$toolIcons = array("device", "report");
$toolHandlers = array("handleEvent('devices.php')", "handleEvent('devices.php?action=ipReport')");
}
echo $tool->createNewTools($toolNames, $toolIcons, $toolHandlers);
$keyHandlers = array();
$keyData = array();
$keyTitle = array();
foreach (Device::get_devices(1) as $id => $name) {
$deviceInfo = new Device($id);
array_push($keyHandlers, "handleEvent('devices.php?action=showID&ID={$id}')");
array_push($keyTitle, $name);
array_push($keyData, $deviceInfo->get_type_name());
array_push($keyData, $deviceInfo->get_location_name());
}
//get all the devices and display them all in the 3 sections "Device Name", "Device Type", "Location".
$headings = array("Device Name", "Device Type", "Location");
echo $deviceForm->showAll($headings, $keyTitle, $keyData, $keyHandlers);
}