本文整理汇总了PHP中convDateTime函数的典型用法代码示例。如果您正苦于以下问题:PHP convDateTime函数的具体用法?PHP convDateTime怎么用?PHP convDateTime使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了convDateTime函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: write
function write($file, $text, $type, $ID_Device, $debug = 0)
{
global $CFG_GLPI;
$config = new PluginFusioninventoryConfigSNMPScript();
if ($config->getValue("logs") == '1' and $debug == '0') {
error_log("[" . convDateTime(date("Y-m-d H:i:s")) . "][" . $type . "][" . $ID_Device . "] " . $text . "\n", 3, GLPI_LOG_DIR . "/" . $file . ".log");
} else {
if ($config->getValue("logs") == '2') {
error_log("[" . convDateTime(date("Y-m-d H:i:s")) . "][" . $type . "][" . $ID_Device . "] " . $text . "\n", 3, GLPI_LOG_DIR . "/" . $file . ".log");
}
}
}
示例2: getEntries
function getEntries($ID, $begin, $limit)
{
global $DB;
$datas = array();
$query = "SELECT *\n FROM " . $this->table . "\n\t\t\t\t WHERE `FK_printers` = '" . $ID . "'\n LIMIT " . $begin . ", " . $limit . ";";
if ($result = $DB->query($query)) {
$i = 0;
while ($data = $DB->fetch_assoc($result)) {
$data['date'] = convDateTime($data['date']);
$datas["{$i}"] = $data;
$i++;
}
return $datas;
}
return false;
}
示例3: getDatasForTemplate
/**
* Get all data needed for template processing
**/
function getDatasForTemplate($event, $options = array())
{
global $LANG;
//User who tries to add or update an item in DB
$action = $options['action_user'] ? $LANG['log'][20] : $LANG['log'][21];
$this->datas['##unicity.action_type##'] = $action;
$this->datas['##unicity.action_user##'] = $options['action_user'];
$this->datas['##unicity.message##'] = $options['message'];
$this->datas['##unicity.date##'] = convDateTime($options['date']);
$item = new $options['itemtype']();
$this->datas['##unicity.itemtype##'] = $item->getTypeName();
$this->datas['##unicity.entity##'] = Dropdown::getDropdownName('glpi_entities', $options['entities_id']);
if ($options['refuse']) {
$this->datas['##unicity.action##'] = $LANG['setup'][821];
} else {
$this->datas['##unicity.action##'] = $LANG['setup'][823];
}
$this->getTags();
foreach ($this->tag_descriptions[NotificationTarget::TAG_LANGUAGE] as $tag => $values) {
if (!isset($this->datas[$tag])) {
$this->datas[$tag] = $values['label'];
}
}
}
示例4: displayLastAlert
static function displayLastAlert($itemtype, $items_id)
{
global $DB, $LANG;
if ($items_id) {
$query = "SELECT `date`\n FROM `glpi_alerts`\n WHERE `itemtype` = '{$itemtype}'\n AND `items_id` = '{$items_id}'\n ORDER BY `date` DESC\n LIMIT 1";
$result = $DB->query($query);
if ($DB->numrows($result) > 0) {
echo " " . $LANG['mailing'][52] . ' ' . convDateTime($DB->result($result, 0, 'date'));
}
}
}
示例5: showForm
/**
* Print the contact form
*
* @param $ID integer ID of the item
* @param $options array
* - target for the Form
* - withtemplate : template or basic item
*
*@return Nothing (display)
**/
function showForm($ID, $options = array())
{
global $LANG;
if (!haveRight("budget", "r")) {
return false;
}
$use_cache = true;
$rowspan = 4;
if ($ID > 0) {
$rowspan++;
$this->check($ID, 'r');
} else {
// Create item
$this->check(-1, 'w');
}
$this->showTabs($options);
$this->showFormHeader($options);
echo "<tr class='tab_bg_1'>";
echo "<td>" . $LANG['common'][16] . " : </td>";
echo "<td>";
autocompletionTextField($this, "name");
echo "</td>";
echo "<td rowspan='{$rowspan}' class='middle right'>" . $LANG['common'][25] . " : </td>";
echo "<td class='center middle' rowspan='{$rowspan}'><textarea cols='45' rows='4'\n name='comment' >" . $this->fields["comment"] . "</textarea></td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . $LANG['financial'][21] . " :</td>";
echo "<td><input type='text' name='value' size='14'\n value='" . formatNumber($this->fields["value"], true) . "'></td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . $LANG['search'][8] . " : </td>";
echo "<td>";
showDateFormItem("begin_date", $this->fields["begin_date"]);
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . $LANG['search'][9] . " : </td>";
echo "<td>";
showDateFormItem("end_date", $this->fields["end_date"]);
echo "</td></tr>";
if ($ID > 0) {
echo "<tr class='tab_bg_1'>";
echo "<td>" . $LANG['common'][26] . " : </td>";
echo "<td>";
echo $this->fields["date_mod"] ? convDateTime($this->fields["date_mod"]) : $LANG['setup'][307];
echo "</td></tr>";
}
$this->showFormButtons($options);
$this->addDivForTabs();
return true;
}
示例6: showLdapUsers
/** Show LDAP users to add or synchronise
*
* @return nothing
**/
static function showLdapUsers()
{
global $CFG_GLPI, $LANG;
$values['order'] = 'DESC';
$values['start'] = 0;
foreach ($_SESSION['ldap_import'] as $option => $value) {
$values[$option] = $value;
}
$results = array();
$limitexceeded = false;
$ldap_users = self::getAllUsers($values, $results, $limitexceeded);
if (is_array($ldap_users)) {
$numrows = count($ldap_users);
$action = "toprocess";
$form_action = "process_ok";
if ($numrows > 0) {
if ($limitexceeded) {
echo "<table class='tab_cadre_fixe'>";
echo "<tr><th class='red'>";
echo "<img class='center' src='" . $CFG_GLPI["root_doc"] . "/pics/warning.png'\n alt='warning'> " . $LANG['ldap'][8];
echo "</th></tr></table><br>";
}
printPager($values['start'], $numrows, $_SERVER['PHP_SELF'], '');
// delete end
array_splice($ldap_users, $values['start'] + $_SESSION['glpilist_limit']);
// delete begin
if ($values['start'] > 0) {
array_splice($ldap_users, 0, $values['start']);
}
echo "<form method='post' id='ldap_form' name='ldap_form' action='" . $_SERVER['PHP_SELF'] . "'>";
echo "<table class='tab_cadre_fixe'>";
echo "<tr><th>" . (!$_SESSION['ldap_import']['mode'] ? $LANG['buttons'][37] : $LANG['ldap'][15]) . "</th>";
$num = 0;
echo Search::showHeaderItem(HTML_OUTPUT, $LANG['Menu'][14], $num, $_SERVER['PHP_SELF'] . "?order=" . ($values['order'] == "DESC" ? "ASC" : "DESC"));
echo "<th>" . $LANG['common'][26] . " " . $LANG['ldap'][13] . "</th>";
if ($_SESSION['ldap_import']['mode']) {
echo "<th>" . $LANG['common'][26] . " " . $LANG['ldap'][14] . "</th>";
}
echo "</tr>";
foreach ($ldap_users as $userinfos) {
$link = $user = $userinfos["user"];
if (isset($userinfos['id']) && haveRight('user', 'r')) {
$link = "<a href='" . getItemTypeFormURL('User') . '?id=' . $userinfos['id'] . "'>{$user}</a>";
}
if (isset($userinfos["timestamp"])) {
$stamp = $userinfos["timestamp"];
} else {
$stamp = '';
}
if (isset($userinfos["date_sync"])) {
$date_sync = $userinfos["date_sync"];
} else {
$date_sync = '';
}
echo "<tr class='tab_bg_2 center'>";
//Need to use " instead of ' because it doesn't work with names with ' inside !
echo "<td><input type='checkbox' name=\"" . $action . "[" . $user . "]\"></td>";
echo "<td>" . $link . "</td>";
if ($stamp != '') {
echo "<td>" . convDateTime(date("Y-m-d H:i:s", $stamp)) . "</td>";
} else {
echo "<td> </td>";
}
if ($_SESSION['ldap_import']['mode']) {
if ($date_sync != '') {
echo "<td>" . convDateTime($date_sync) . "</td>";
} else {
echo "<td> </td>";
}
}
echo "</tr>";
}
if ($_SESSION['ldap_import']['mode']) {
$colspan = 6;
} else {
$colspan = 5;
}
echo "</table>";
openArrowMassive("ldap_form", true);
closeArrowMassive($form_action, $_SESSION['ldap_import']['mode'] ? $LANG['ldap'][15] : $LANG['buttons'][37]);
echo "</form>";
printPager($values['start'], $numrows, $_SERVER['PHP_SELF'], '');
} else {
echo "<div class='center b'>" . ($_SESSION['ldap_import']['mode'] ? $LANG['ldap'][43] : $LANG['ldap'][3]) . "</div>";
}
} else {
echo "<div class='center b'>" . ($_SESSION['ldap_import']['mode'] ? $LANG['ldap'][43] : $LANG['ldap'][3]) . "</div>";
}
}
示例7: showForm
function showForm($input = '')
{
global $DB, $LANG, $CFG_GLPI, $INFOFORM_PAGES;
$CommonItem = new CommonItem();
$np = new Netport();
echo "<table class='tab_cadre' cellpadding='5' width='950'>";
echo "<tr class='tab_bg_1'>";
echo "<th>";
echo $LANG['plugin_fusioninventory']["processes"][1];
echo " <a href='" . GLPI_ROOT . "/plugins/fusioninventory/front/agents.processes.form.php'>(" . $LANG['common'][66] . ")</a>";
echo "</th>";
echo "<th>";
echo $LANG['common'][27];
echo "</th>";
echo "<th>";
echo $LANG['common'][1];
echo "</th>";
echo "<th>";
echo $LANG['joblist'][0];
echo "</th>";
echo "<th>";
echo $LANG['common'][1];
echo "</th>";
echo "</tr>";
if (!isset($input['process_number'])) {
$condition = '';
} else {
$condition = "WHERE `process_number`='" . $input['process_number'] . "'";
if (isset($input['created'])) {
$condition .= " AND `creation`='" . $input['created'] . "' ";
}
}
$query = "SELECT * FROM `" . $this->table . "`\n " . $condition . "\n ORDER BY `date`DESC , `process_number` DESC";
if ($result = $DB->query($query)) {
while ($data = $DB->fetch_array($result)) {
echo "<tr class='tab_bg_1 center'>";
echo "<td>";
echo "<a href='" . GLPI_ROOT . "/plugins/fusioninventory/front/agents.processes.form.php?h_process_number=" . $data['process_number'] . "'>" . $data['process_number'] . "</a>";
echo "</td>";
echo "<td>";
echo convDateTime($data['date']);
echo "</td>";
echo "<td>";
$np->getFromDB($data['FK_port_source']);
$CommonItem->getFromDB($np->fields["device_type"], $np->fields["on_device"]);
$link1 = $CommonItem->getLink(1);
$link = "<a href=\"" . $CFG_GLPI["root_doc"] . "/front/networking.port.php?ID=" . $np->fields["ID"] . "\">";
if (rtrim($np->fields["name"]) != "") {
$link .= $np->fields["name"];
} else {
$link .= $LANG['common'][0];
}
$link .= "</a>";
echo $link . " " . $LANG['networking'][25] . " " . $link1;
echo "</td>";
echo "<td>";
if ($data['creation'] == '1') {
echo "<img src='" . GLPI_ROOT . "/plugins/fusioninventory/pics/connection_ok.png'/>";
} else {
echo "<img src='" . GLPI_ROOT . "/plugins/fusioninventory/pics/connection_notok.png'/>";
}
echo "</td>";
echo "<td>";
$np->getFromDB($data['FK_port_destination']);
$CommonItem->getFromDB($np->fields["device_type"], $np->fields["on_device"]);
$link1 = $CommonItem->getLink(1);
$link = "<a href=\"" . $CFG_GLPI["root_doc"] . "/front/networking.port.php?ID=" . $np->fields["ID"] . "\">";
if (rtrim($np->fields["name"]) != "") {
$link .= $np->fields["name"];
} else {
$link .= $LANG['common'][0];
}
$link .= "</a>";
echo $link . " " . $LANG['networking'][25] . " " . $link1;
echo "</td>";
echo "</tr>";
}
}
echo "</table>";
}
示例8: computerState
function computerState($target, $ID)
{
global $DB, $LANG;
$np = new Netport();
$pta = new PluginFusioninventoryAgents();
echo "<br/>";
echo "<div align='center'>";
echo "<form method='post' name='' id='' action=\"" . $target . "\">";
echo "<table class='tab_cadre_fixe'>";
echo "<tr>";
echo "<th colspan='2'>";
echo $LANG['plugin_fusioninventory']["agents"][15];
echo "</th>";
echo "</tr>";
$a_datas = $this->find("`device_id`='" . $ID . "'", "", "1");
if (empty($a_datas)) {
// Ajouter une entrée
$this->fields['device_id'] = $ID;
$this->fields['date_mod'] = date("Y-m-d H:i:s");
$data['ID'] = $this->addToDB();
$data['date_mod'] = $this->fields['date_mod'];
$data['state'] = 0;
} else {
// Afficher l'état
foreach ($a_datas as $device_id => $values) {
$data = $a_datas[$device_id];
}
}
echo "<tr class='tab_bg_1'>";
echo "<td align='center'>";
echo convDateTime($data['date_mod']);
echo " : </td>";
echo "<td align='center'>";
switch ($data['state']) {
case 0:
echo $LANG['plugin_fusioninventory']["agents"][16];
break;
case 1:
echo $LANG['plugin_fusioninventory']["agents"][22];
break;
case 2:
echo $LANG['plugin_fusioninventory']["agents"][17];
break;
case 3:
echo $LANG['plugin_fusioninventory']["agents"][18];
break;
case 4:
echo $LANG['plugin_fusioninventory']["agents"][19];
break;
case 5:
echo $LANG['plugin_fusioninventory']["agents"][20];
break;
case 6:
echo $LANG['plugin_fusioninventory']["agents"][21];
break;
default:
break;
}
echo "</td>";
echo "</tr>";
$ip = "";
if ($data['state'] == 0 or $data['state'] == 6) {
$a_data = $np->find("`on_device`='" . $ID . "' AND `device_type`='1'");
foreach ($a_data as $port_id => $port) {
echo "<tr class='tab_bg_1'>";
echo "<td align='center'>";
if (!($fp = fsockopen($port['ifaddr'], 62354, $errno, $errstr, 1))) {
echo $port['ifaddr'] . " : </td><td align='center'><b>" . $LANG['plugin_fusioninventory']["task"][9] . "</b>";
} else {
echo $port['ifaddr'] . " : </td><td align='center'><b>" . $LANG['plugin_fusioninventory']["task"][8] . "</b>";
$ip = $port['ifaddr'];
fclose($fp);
}
echo "</td>";
echo "</tr>";
}
}
echo "<tr class='tab_bg_2'>";
echo "<td align='center' colspan='2'>";
$a_datasagent = $pta->find("`on_device`='" . $ID . "' AND `device_type`='1' ", "", "1");
if (!empty($a_datasagent)) {
foreach ($a_datasagent as $agent_id => $dataagent) {
echo "<input type='hidden' name='agentID' value='" . $agent_id . "'/>";
}
}
echo "<input type='hidden' name='ID' value='" . $ID . "'/>";
echo "<input type='hidden' name='ip' value='" . $ip . "'/>";
echo "<input type='submit' name='startagent' value=\"" . $LANG['plugin_fusioninventory']["task"][12] . "\" class='submit' >";
echo "</td>";
echo "</tr>";
echo "</table>";
echo "</form>";
echo "</div>";
$glpiroot = GLPI_ROOT . "/plugins/fusioninventory/front/";
if (strstr($_SERVER["PHP_SELF"], "fusioninventory")) {
$glpiroot = '../plugins/fusioninventory/front/';
}
if ($data['state'] > 0 and $data['state'] < 6) {
echo "<script type='text/javascript'>\nExt.getCmp('fusioninventory_1').getUpdater().startAutoRefresh(3,'" . GLPI_ROOT . "/plugins/fusioninventory/front/agents.state.php?ID=" . $ID . "');\n \n </script>";
} else {
//.........这里部分代码省略.........
示例9: showList
/**
* Print a nice tab for last event
*
* Print a great tab to present lasts events occured on glpi
*
* @param $target where to go when complete
* @param $order order by clause occurences (eg: )
* @param $sort order by clause occurences (eg: date)
* @param $start
**/
static function showList($target, $order = 'DESC', $sort = 'date', $start = 0)
{
global $DB, $CFG_GLPI, $LANG;
// Show events from $result in table form
list($logItemtype, $logService) = self::logArray();
// Columns of the Table
$items = array("items_id" => array($LANG['event'][0], "colspan='2'"), "date" => array($LANG['common'][27], ""), "service" => array($LANG['event'][2], "width='8%'"), "level" => array($LANG['event'][3], "width='8%'"), "message" => array($LANG['event'][4], "width='50%'"));
// define default sorting
if (!isset($items[$sort])) {
$sort = "date";
}
if ($order != "ASC") {
$order = "DESC";
}
// Query Database
$query_limit = "SELECT *\n FROM `glpi_events`\n ORDER BY `{$sort}` {$order}\n LIMIT " . intval($start) . "," . intval($_SESSION['glpilist_limit']);
// Number of results
$numrows = countElementsInTable("glpi_events");
// Get results
$result = $DB->query($query_limit);
$number = $DB->numrows($result);
// No Events in database
if ($number < 1) {
echo "<div class='center b'>" . $LANG['central'][4] . "</div>";
return;
}
// Output events
$i = 0;
echo "<div class='center'>";
$parameters = "sort={$sort}&order={$order}";
printPager($start, $numrows, $target, $parameters);
echo "<table class='tab_cadre_fixe'>";
echo "<tr>";
foreach ($items as $field => $args) {
echo "<th " . $args[1] . ">";
if ($sort == $field) {
if ($order == "DESC") {
echo "<img src=\"" . $CFG_GLPI["root_doc"] . "/pics/puce-down.png\" alt='' title=''>";
} else {
echo "<img src=\"" . $CFG_GLPI["root_doc"] . "/pics/puce-up.png\" alt='' title=''>";
}
}
echo "<a href='{$target}?sort={$field}&order=" . ($order == "ASC" ? "DESC" : "ASC") . "'>" . $args[0] . "</a></th>";
}
echo "</tr>";
while ($i < $number) {
$ID = $DB->result($result, $i, "id");
$items_id = $DB->result($result, $i, "items_id");
$type = $DB->result($result, $i, "type");
$date = $DB->result($result, $i, "date");
$service = $DB->result($result, $i, "service");
$level = $DB->result($result, $i, "level");
$message = $DB->result($result, $i, "message");
$itemtype = " ";
if (isset($logItemtype[$type])) {
$itemtype = $logItemtype[$type];
} else {
$type = getSingular($type);
if (class_exists($type)) {
$item = new $type();
$itemtype = $item->getTypeName();
}
}
echo "<tr class='tab_bg_2'>";
echo "<td>{$itemtype} :</td>";
echo "<td class='center b'>";
self::displayItemLogID($type, $items_id);
echo "</td><td>" . convDateTime($date) . "</td>";
echo "<td class='center'>" . (isset($logService[$service]) ? $logService[$service] : $service);
echo "</td><td class='center'>{$level}</td><td>{$message}</td></tr>";
$i++;
}
echo "</table></div><br>";
}
示例10: arsort
arsort($files);
if (count($files)) {
foreach ($files as $file => $date) {
$taille_fic = filesize($path . "/" . $file) / 1024;
$taille_fic = (int) $taille_fic;
echo "<tr class='tab_bg_2'><td>{$file} </td>" . "<td class='right'> " . $taille_fic . " kB </td>" . "<td> " . convDateTime(date("Y-m-d H:i", $date)) . "</td>" . "<td> " . "<a href=\"javascript:confirmAction('" . addslashes($file . " - " . $LANG['backup'][17]) . "',\n 'backup.php?delfile={$file}')\">" . $LANG['buttons'][6] . "</a> </td>" . "<td> " . "<a href=\"javascript:confirmAction('" . addslashes($file . " - " . $LANG['backup'][16]) . "',\n 'backup.php?file={$file}&donotcheckversion=1')\">" . $LANG['buttons'][21] . "</a> </td>" . "<td> <a href=\"document.send.php?file=_dumps/{$file}\">" . $LANG['backup'][13] . "</a>" . "</td></tr>";
}
}
closedir($dir);
$dir = opendir($path);
unset($files);
$files = array();
while ($file = readdir($dir)) {
if ($file != "." && $file != ".." && preg_match("/\\.xml\$/i", $file)) {
$files[$file] = filemtime($path . "/" . $file);
}
}
arsort($files);
if (count($files)) {
foreach ($files as $file => $date) {
$taille_fic = filesize($path . "/" . $file) / 1024;
$taille_fic = (int) $taille_fic;
echo "<tr class='tab_bg_1'><td colspan='6'><hr noshade></td></tr>" . "<tr class='tab_bg_2'><td>{$file} </td>" . "<td class='right'> " . $taille_fic . " kB </td>" . "<td> " . convDateTime(date("Y-m-d H:i", $date)) . "</td>" . "<td> " . "<a href=\"javascript:confirmAction('" . addslashes($file . " - " . $LANG['backup'][17]) . "',\n 'backup.php?delfile={$file}')\">" . $LANG['buttons'][6] . "</a> </td>" . "<td> - </td>" . "<td> <a href=\"document.send.php?file=_dumps/{$file}\">" . $LANG['backup'][13] . "</a>" . "</td></tr>";
}
}
closedir($dir);
?>
</table>
</div>
<?php
commonFooter();
示例11: showShortForTicket
static function showShortForTicket($ID)
{
global $DB, $CFG_GLPI, $LANG;
// Print Followups for a job
$showprivate = haveRight("show_full_ticket", "1");
$RESTRICT = "";
if (!$showprivate) {
$RESTRICT = " AND (`is_private` = '0'\n OR `users_id` ='" . getLoginUserID() . "') ";
}
// Get Number of Followups
$query = "SELECT *\n FROM `glpi_ticketfollowups`\n WHERE `tickets_id` = '{$ID}'\n {$RESTRICT}\n ORDER BY `date` DESC";
$result = $DB->query($query);
$out = "";
if ($DB->numrows($result) > 0) {
$out .= "<div class='center'><table class='tab_cadre' width='100%'>\n\n <tr><th>" . $LANG['common'][27] . "</th><th>" . $LANG['job'][4] . "</th>\n <th>" . $LANG['joblist'][6] . "</th></tr>\n";
while ($data = $DB->fetch_array($result)) {
$out .= "<tr class='tab_bg_3'>\n <td class='center'>" . convDateTime($data["date"]) . "</td>\n <td class='center'>" . getUserName($data["users_id"], 1) . "</td>\n <td width='70%' class='b'>" . resume_text($data["content"], $CFG_GLPI["cut"]) . "\n </td></tr>";
}
$out .= "</table></div>";
}
return $out;
}
示例12: ShowProcesses
function ShowProcesses()
{
global $DB, $LANG;
$ci = new commonitem();
echo "<table class='tab_cadre' cellpadding='5' width='1150'>";
$this->ShowHeader();
$i = 0;
$query = "SELECT * FROM `" . $this->table . "`\n ORDER BY `process_number` DESC";
if ($result = $DB->query($query)) {
while ($data = $DB->fetch_array($result)) {
$i++;
if ($i == '8') {
echo "<tr class='tab_bg_2'>";
echo "<td colspan='14' height='5'></td>";
echo "</tr>";
$this->ShowHeader();
$i = 0;
}
echo "<tr class='tab_bg_2'>";
echo "<td colspan='14' height='5'></td>";
echo "</tr>";
echo "<tr class='tab_bg_1 center'>";
echo "<td rowspan='2'>";
echo $data['process_number'];
echo "</td>";
echo "<td rowspan='2'>";
$ci->getFromDB(PLUGIN_FUSIONINVENTORY_SNMP_AGENTS, $data['FK_agent']);
echo $ci->getLink(1);
echo "</td>";
echo "<td rowspan='2'>";
switch ($data['status']) {
case 3:
echo "<img src='../pics/export.png' />";
break;
case 2:
echo "<img src='../pics/wait.png' />";
break;
case 1:
echo "<img src='../pics/ok2.png' />";
break;
}
echo "</td>";
echo "<td rowspan='2'>";
echo convDateTime($data['start_time']);
echo "</td>";
echo "<td rowspan='2'>";
if ($data['start_time'] != '0000-00-00 00:00:00' and $data['end_time'] != '0000-00-00 00:00:00') {
$duree_timestamp = strtotime($data['end_time']) - strtotime($data['start_time']);
echo timestampToString($duree_timestamp);
} else {
echo '-';
}
echo "</td>";
echo "<td height='28'>";
if ($data['start_time_discovery'] != '0000-00-00 00:00:00') {
if ($data['end_time_discovery'] != '0000-00-00 00:00:00') {
echo "<img src='../pics/export.png' />";
} else {
echo "<img src='../pics/wait.png' />";
}
} else {
if ($data['discovery_core'] != '0') {
echo "<img src='../pics/ok2.png' />";
}
}
echo "</td>";
echo "<td>";
if ($data['start_time_discovery'] != '0000-00-00 00:00:00') {
echo convDateTime($data['start_time_discovery']);
} else {
echo '-';
}
echo "</td>";
echo "<td>";
if ($data['start_time_discovery'] != '0000-00-00 00:00:00' and $data['end_time_discovery'] != '0000-00-00 00:00:00') {
$duree_timestamp = strtotime($data['end_time_discovery']) - strtotime($data['start_time_discovery']);
echo timestampToString($duree_timestamp);
} else {
echo '-';
}
echo "</td>";
echo "<td>";
echo $data['discovery_core'];
echo "</td>";
echo "<td>";
echo $data['discovery_threads'];
echo "</td>";
echo "<td>";
echo $data['discovery_nb_ip'];
echo "</td>";
echo "<td>";
echo $data['discovery_nb_found'];
if ($data['discovery_nb_error'] > 0) {
echo " / <a href='" . GLPI_ROOT . "/plugins/fusioninventory/front/agents.processes.form.php?process_number=" . $data['process_number'] . "&agent_type=NETDISCOVERY'>\n <font color='#ff0000'>" . $data['discovery_nb_error'] . "</font></a>";
} else {
echo " / " . $data['discovery_nb_error'];
}
echo "</td>";
echo "<td>";
echo $data['discovery_nb_exists'];
//.........这里部分代码省略.........
示例13: showForm
/**
* Print the document form
*
* @param $ID integer ID of the item
* @param $options array
* - target filename : where to go when done.
* - withtemplate boolean : template or basic item
*
* @return Nothing (display)
**/
function showForm($ID, $options = array())
{
global $CFG_GLPI, $LANG;
if (!haveRight("document", "r")) {
return false;
}
if ($ID > 0) {
$this->check($ID, 'r');
} else {
// Create item
$this->check(-1, 'w');
}
$this->showTabs($options);
$options['formoptions'] = " enctype='multipart/form-data'";
$this->showFormHeader($options);
if ($ID > 0) {
echo "<tr><th colspan='2'>";
if ($this->fields["users_id"] > 0) {
echo $LANG['document'][42] . " " . getUserName($this->fields["users_id"], 1);
} else {
echo " ";
}
echo "</th>";
echo "<th colspan='2'>" . $LANG['common'][26] . " : " . convDateTime($this->fields["date_mod"]) . "</th>";
echo "</tr>\n";
}
echo "<tr class='tab_bg_1'>";
echo "<td>" . $LANG['common'][16] . " :</td>";
echo "<td>";
autocompletionTextField($this, "name");
echo "</td>";
echo "<td rowspan='6' class='middle right'>" . $LANG['common'][25] . " : </td>";
echo "<td class='center middle' rowspan='6'>";
echo "<textarea cols='45' rows='8' name='comment' >" . $this->fields["comment"] . "</textarea>";
echo "</td></tr>";
if ($ID > 0) {
echo "<tr class='tab_bg_1'>";
echo "<td>" . $LANG['document'][22] . " :</td>";
echo "<td>" . $this->getDownloadLink('', 45);
echo "<input type='hidden' name='current_filepath' value='" . $this->fields["filepath"] . "'>";
echo "<input type='hidden' name='current_filename' value='" . $this->fields["filename"] . "'>";
echo "</td></tr>";
}
echo "<tr class='tab_bg_1'>";
echo "<td>" . $LANG['document'][2] . " (" . self::getMaxUploadSize() . ") :</td>";
echo "<td><input type='file' name='filename' value='" . $this->fields["filename"] . "' size='39'>";
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . $LANG['document'][36] . " :</td>";
echo "<td>";
$this->showUploadedFilesDropdown("upload_file");
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . $LANG['document'][33] . " :</td>";
echo "<td>";
autocompletionTextField($this, "link");
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . $LANG['document'][3] . " :</td>";
echo "<td>";
Dropdown::show('DocumentCategory', array('value' => $this->fields["documentcategories_id"]));
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . $LANG['document'][4] . " :</td>";
echo "<td>";
autocompletionTextField($this, "mime");
if ($ID > 0) {
echo "</td><td>" . $LANG['document'][1] . " :</td>";
echo "<td>" . $this->fields["sha1sum"];
}
echo "</td></tr>";
$this->showFormButtons($options);
$this->addDivForTabs();
return true;
}
示例14: getEntries
function getEntries($type, $ID, $begin, $limit)
{
global $DB;
$datas = array();
$query = "SELECT *\n FROM " . $this->table . " ";
if ($type == COMPUTER_TYPE) {
$query .= "WHERE `device_type` = '" . COMPUTER_TYPE . "' ";
} else {
if ($type == NETWORKING_TYPE) {
$query .= "WHERE `device_type` = '" . NETWORKING_TYPE . "' ";
} else {
// $type == PRINTER_TYPE
$query .= "WHERE `device_type` = '" . PRINTER_TYPE . "' ";
}
}
$query .= "AND `device_id` = '" . $ID . "' " . "LIMIT " . $begin . ", " . $limit . ";";
if ($result = $DB->query($query)) {
$i = 0;
while ($data = $DB->fetch_assoc($result)) {
$data['first_pb_date'] = convDateTime($data['first_pb_date']);
$data['last_pb_date'] = convDateTime($data['last_pb_date']);
$datas["{$i}"] = $data;
$i++;
}
return $datas;
}
return false;
}
示例15: showForm
/**
* Print the computer form
*
* @param $ID integer ID of the item
* @param $options array
* - target for the Form
* - withtemplate template or basic computer
*
*@return Nothing (display)
*
**/
function showForm($ID, $options = array())
{
global $LANG, $CFG_GLPI, $DB;
if (!haveRight("computer", "r")) {
return false;
}
if ($ID > 0) {
$this->check($ID, 'r');
} else {
// Create item
$this->check(-1, 'w');
}
if (isset($options['withtemplate']) && $options['withtemplate'] == 2) {
$template = "newcomp";
$datestring = $LANG['computers'][14] . " : ";
$date = convDateTime($_SESSION["glpi_currenttime"]);
} else {
if (isset($options['withtemplate']) && $options['withtemplate'] == 1) {
$template = "newtemplate";
$datestring = $LANG['computers'][14] . " : ";
$date = convDateTime($_SESSION["glpi_currenttime"]);
} else {
$datestring = $LANG['common'][26] . ": ";
$date = convDateTime($this->fields["date_mod"]);
$template = false;
}
}
$this->showTabs($options);
$this->showFormHeader($options);
echo "<tr class='tab_bg_1'>";
echo "<td>" . $LANG['common'][16] . ($template ? "*" : "") . " :</td>";
echo "<td>";
$objectName = autoName($this->fields["name"], "name", $template === "newcomp", $this->getType(), $this->fields["entities_id"]);
autocompletionTextField($this, 'name', array('value' => $objectName));
echo "</td>";
echo "<td>" . $LANG['state'][0] . " :</td>";
echo "<td>";
Dropdown::show('State', array('value' => $this->fields["states_id"]));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . $LANG['common'][15] . " : </td>";
echo "<td>";
Dropdown::show('Location', array('value' => $this->fields["locations_id"], 'entity' => $this->fields["entities_id"]));
echo "</td>";
echo "<td>" . $LANG['common'][17] . " : </td>";
echo "<td>";
Dropdown::show('ComputerType', array('value' => $this->fields["computertypes_id"]));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . $LANG['common'][10] . " : </td>";
echo "<td>";
User::dropdown(array('name' => 'users_id_tech', 'value' => $this->fields["users_id_tech"], 'right' => 'interface', 'entity' => $this->fields["entities_id"]));
echo "</td>";
echo "<td>" . $LANG['common'][5] . " : </td>";
echo "<td>";
Dropdown::show('Manufacturer', array('value' => $this->fields["manufacturers_id"]));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . $LANG['common'][21] . " : </td>";
echo "<td >";
autocompletionTextField($this, 'contact_num');
echo "</td>";
echo "<td>" . $LANG['common'][22] . " : </td>";
echo "<td>";
Dropdown::show('ComputerModel', array('value' => $this->fields["computermodels_id"]));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . $LANG['common'][18] . " :</td>";
echo "<td>";
autocompletionTextField($this, 'contact');
echo "</td>";
echo "<td>" . $LANG['common'][19] . " :</td>";
echo "<td >";
autocompletionTextField($this, 'serial');
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . $LANG['common'][34] . " : </td>";
echo "<td>";
User::dropdown(array('value' => $this->fields["users_id"], 'entity' => $this->fields["entities_id"], 'right' => 'all'));
echo "</td>";
echo "<td>" . $LANG['common'][20] . ($template ? "*" : "") . " :</td>";
echo "<td>";
$objectName = autoName($this->fields["otherserial"], "otherserial", $template === "newcomp", $this->getType(), $this->fields["entities_id"]);
autocompletionTextField($this, 'otherserial', array('value' => $objectName));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . $LANG['common'][35] . " :</td>";
echo "<td>";
Dropdown::show('Group', array('value' => $this->fields["groups_id"], 'entity' => $this->fields["entities_id"]));
//.........这里部分代码省略.........