static function displayBody($data) { global $CFG_GLPI; $computer = new computer(); $computer->getFromDB($data["id"]); $body = "<tr class='tab_bg_2'><td><a href=\"" . $CFG_GLPI["root_doc"] . "/front/computer.form.php?id=" . $computer->fields["id"] . "\">" . $computer->fields["name"]; if ($_SESSION["glpiis_ids_visible"] == 1 || empty($computer->fields["name"])) { $body .= " ("; $body .= $computer->fields["id"] . ")"; } $body .= "</a></td>"; if (Session::isMultiEntitiesMode()) { $body .= "<td class='center'>" . Dropdown::getDropdownName("glpi_entities", $data["entities_id"]) . "</td>"; } $body .= "<td>" . Dropdown::getDropdownName("glpi_operatingsystems", $computer->fields["operatingsystems_id"]) . "</td>"; $body .= "<td>" . Dropdown::getDropdownName("glpi_states", $computer->fields["states_id"]) . "</td>"; $body .= "<td>" . Dropdown::getDropdownName("glpi_locations", $computer->fields["locations_id"]) . "</td>"; $body .= "<td>"; if (!empty($computer->fields["users_id"])) { $body .= "<a href=\"" . $CFG_GLPI["root_doc"] . "/front/user.form.php?id=" . $computer->fields["users_id"] . "\">" . getUserName($computer->fields["users_id"]) . "</a>"; } if (!empty($computer->fields["groups_id"])) { $body .= " - <a href=\"" . $CFG_GLPI["root_doc"] . "/front/group.form.php?id=" . $computer->fields["groups_id"] . "\">"; } $body .= Dropdown::getDropdownName("glpi_groups", $computer->fields["groups_id"]); if ($_SESSION["glpiis_ids_visible"] == 1) { $body .= " ("; $body .= $computer->fields["groups_id"] . ")"; } $body .= "</a>"; if (!empty($computer->fields["contact"])) { $body .= " - " . $computer->fields["contact"]; } $body .= " - </td>"; $body .= "<td>" . Html::convdatetime($data["last_ocs_update"]) . "</td>"; $body .= "<td>" . Html::convdatetime($data["last_update"]) . "</td>"; $body .= "<td>" . Dropdown::getDropdownName("glpi_plugin_ocsinventoryng_ocsservers", $data["plugin_ocsinventoryng_ocsservers_id"]) . "</td>"; $body .= "</tr>"; return $body; }
<?php use src\Home; use src\Computer; use src\Customer; use src\Tariff; use src\utilities; $computers = new computer(); $customers_info = new Customer(); $tariff_info = new Tariff(); if (isset($_GET['pcid']) && $_GET['pcid'] > 0) { ?> <script type="text/javascript" src="webcam/webcam.js"></script> <script> webcam.set_api_url( 'webcam/upload.php' ); webcam.set_quality( 90 ); // JPEG quality (1 - 100) webcam.set_shutter_sound( true ); // play shutter click sound webcam.set_hook( 'onComplete', 'my_completion_handler' ); function take_snapshot() { // take snapshot and upload to server document.getElementById('upload_results').innerHTML = '<img src="webcam/uploading.gif">'; webcam.snap(); } function my_completion_handler(msg) { // extract URL out of PHP output if (msg.match(/(http\:\/\/\S+)/)) { var image_url = RegExp.$1; // show JPEG image in page