top.window.location = '../../index.php'"; exit; } require_once __DIR__ . "/" . "../../includes/include_geral_new.inc.php"; require_once __DIR__ . "/" . "../../includes/classes/ConnectPDO.php"; use includes\classes\ConnectPDO; $conn = ConnectPDO::getInstance(); $auth = new AuthNew($_SESSION['s_logado'], $_SESSION['s_nivel'], 3, 2); $asset_id = (isset($_GET['asset_id']) ? (int)$_GET['asset_id'] : ""); if (empty($asset_id)) { echo message('warning', 'Ooops!', TRANS('MSG_ERR_NOT_EXECUTE'), '', '', 1); return; } $isAdmin = $_SESSION['s_nivel'] == 1; $trashAction = ' '; $trashAction = ($isAdmin ? $trashAction : ''); ?> <?= APP_NAME; ?> <?= VERSAO; ?> query($query); $row = $resultado->fetch(); if (!$row) { echo message ('warning','Ooops!', TRANS('NO_RECORDS_FOUND'), '', '', 1); return; } $asset_tag = $row['etiqueta']; $asset_unit = $row['cod_inst']; // $client_name = (getUnits($conn, null, $asset_unit)['nickname'] ?? ""); $client_info = getClientByUnitId($conn, $asset_unit); $client_name = (!empty($client_info) ? $client_info['nickname'] : ""); $client_id = (!empty($client_info) ? $client_info['id'] : ""); /* Informações sobre alocação do ativo para algum usuário */ $user_name = ""; $userInfo = getUserFromAssetId ($conn, $row['comp_cod']); $isAlocated = (!empty($userInfo) ? true : false); $department_info = getDepartments($conn, null, $row['tipo_local']); $department_unit = (!empty($department_info['unidade']) ? " (" . $department_info['unidade'] . ")" : ""); $inconsistent_department = (!$isAlocated && $asset_unit != $department_info['loc_unit'] && !empty($department_info['loc_unit'])); $model_id = $row['modelo_cod']; $modelDetails = getModelSpecs($conn, $model_id); $subtext = ''; foreach ($modelDetails as $detail) { $subtext .= '' . $detail['mt_name'] . ': ' . $detail['spec_value'] . '' . $detail['unit_abbrev'] . ''; } $specs = getAssetSpecs($conn, $asset_id, null, false); $specsDigital = getAssetSpecs($conn, $asset_id, null, true); // var_dump($specs); $hasSpecsFields = (count($specs) || count($specsDigital) ? true : false); $hasCustomFields = hasCustomFields($conn, $asset_id, 'assets_x_cfields'); $parentInfo = getAssetParentId($conn, $asset_id); $hasParent = (!empty($parentInfo) ? true : false); $alertText = "
" .TRANS('ASSET_UNIT') . ": " . $row['instituicao'] . "
"; $alertText .= TRANS('DEPARTMENT_UNIT') . ": " . $department_info['unidade']; $inconsistent_alert = ($inconsistent_department ? message('danger', 'Ooops!', TRANS('INCONSISTENT_UNIT_X_DEPARTMENT') . $alertText, '', '', true) : ""); /* Para manter a compatibilidade com versões antigas */ $qryPieces = $QRY["componentexequip_ini"]; $table = "equipxpieces"; $sqlTest = "SELECT * FROM {$table}"; try { $conn->query($sqlTest); } catch (Exception $e) { $table = "equipXpieces"; $qryPieces = $QRY["componenteXequip_ini"]; } /* Componentes avulsos */ $qryPieces .= " and eqp.eqp_equip_inv in ('" . $asset_tag . "') and eqp.eqp_equip_inst=" . $asset_unit . ""; $qryPieces .= $QRY["componenteXequip_fim"]; $resultPieces = $conn->query($qryPieces); $pieces = $resultPieces->rowCount(); /* Arquivos associados ao modelo*/ $sqlFilesModel = "SELECT i.* FROM imagens i WHERE i.img_model ='" . $row['modelo_cod'] . "' order by i.img_inv "; $resFilesModel = $conn->query($sqlFilesModel); $hasFilesFromModel = $resFilesModel->rowCount(); /* Arquivos associados diretamente ao equipamento */ $sqlFilesEquipment = "SELECT i.* FROM imagens i WHERE i.img_inst ='".$row['cod_inst']."' AND i.img_inv ='".$row['etiqueta']."' ORDER BY i.img_inv "; $resFilesEquipment = $conn->query($sqlFilesEquipment); $hasFilesFromEquipment = $resFilesEquipment->rowCount(); /* Arquivos nos chamados relacionados */ $sqlFiles = "SELECT o.*, i.* FROM ocorrencias o , imagens i WHERE (i.img_oco = o.numero) AND (o.equipamento ='" . $asset_tag . "' AND o.instituicao ='" . $asset_unit . "') ORDER BY o.numero "; $resultFiles = $conn->query($sqlFiles); $hasFilesFromTickets = $resultFiles->rowCount(); /* Definições do grid */ $colLabel = "col-sm-3 text-md-right font-weight-bold p-2"; $colsDefault = "small text-break border-bottom rounded p-2 bg-white"; /* border-secondary */ $colContent = $colsDefault . " col-sm-3 col-md-3"; $colContentLine = $colsDefault . " col-sm-9"; $txt_is_product = ($row['is_product'] ? '' . TRANS('ALLOCABLE_RESOURCE') . '' . "  " : ""); ?>
"; echo message('info', '', TRANS('HELPER_ALLOCABLE_RESOURCE'), '', '', 1); } ?>

'; } else { $badge_remove_user_link = ""; $btDisabled = (empty($client_id) ? " disabled" : ""); $hint = (empty($client_id) ? 'data-toggle="popover" data-placement="top" data-trigger="hover" data-content="'.TRANS("MSG_ASSET_NEED_TO_IN_CLIENT").'"' : ""); $btAlocateToUser = ''; $user_name = $btAlocateToUser; } ?>
' . $categorieName . ''; ?>
'.$parentInfo['comp_inv'].' '; ?>

 '.$spec['comp_inv'].' ' : ''); $spec_options = ''; if (empty($tagged)) { $spec_options = ' '; } $modelSpecs = getModelSpecs($conn, $spec['marc_cod']); $subtext = ""; $specText = ""; foreach ($modelSpecs as $mspec) { if (strlen((string)$subtext)) $subtext .= " | "; $specText = $mspec['mt_name'] . ': ' . $mspec['spec_value'] . '' . $mspec['unit_abbrev']; $subtext .= ''.$specText.''; } $subtext = (!empty($subtext) ? ' (' . $subtext . ') ' : ''); ?>

 '.$spec['comp_inv'].' ' : ''); $spec_options = ''; if (empty($tagged)) { $spec_options = ' '; } $modelSpecs = getModelSpecs($conn, $spec['marc_cod']); $subtext = ""; $specText = ""; foreach ($modelSpecs as $mspec) { if (strlen((string)$subtext)) $subtext .= " | "; $specText = $mspec['mt_name'] . ': ' . $mspec['spec_value'] . '' . $mspec['unit_abbrev']; $subtext .= ''.$specText.''; } $subtext = (!empty($subtext) ? ' (' . $subtext . ') ' : ''); ?>

'; } elseif ($field['field_type'] == 'textarea') { $isTextArea = true; } $col = ($col > $number_of_collumns ? 1 : $col); if ($col == 1) { ?>
$value) { if ($value) { $hasDeprecatedConfigs = true; break; } } foreach ($deprecatedPrinterConfigs as $key => $value) { if ($value) { $hasDeprecatedPrinterConfigs = true; break; } } if ($hasDeprecatedConfigs || $hasDeprecatedPrinterConfigs) { ?>

0 ? '' : ' disabled'); $ariaDisabledPieces = ($pieces > 0 ? '' : ' true'); $classDisabledFilesFromEquipment = ($hasFilesFromEquipment > 0 ? '' : ' disabled'); $ariaDisabledFilesFromEquipment = ($hasFilesFromEquipment > 0 ? '' : ' true'); $classDisabledFilesFromModel = ($hasFilesFromModel > 0 ? '' : ' disabled'); $ariaDisabledFilesFromModel = ($hasFilesFromModel > 0 ? '' : ' true'); $classDisabledFilesFromTickets = ($hasFilesFromTickets > 0 ? '' : ' disabled'); $ariaDisabledFilesFromTickets = ($hasFilesFromTickets > 0 ? '' : ' true'); ?>
fetchAll() as $rowPiece) { $oldManufacturer = ($rowPiece['fabricante'] ? $rowPiece['fabricante'] . " " : ""); $manufacturer = ($rowPiece['fab_nome'] ? $rowPiece['fab_nome'] . " " : ""); ?>
#
fetchAll() as $rowFiles) { $size = round($rowFiles['img_size'] / 1024, 1); $rowFiles['img_tipo'] . "](" . $size . "k)"; if (isImage($rowFiles["img_tipo"])) { $viewImage = " "; } else { $viewImage = ""; } ?>
#
k
fetchAll() as $rowFiles) { $size = round($rowFiles['img_size'] / 1024, 1); $rowFiles['img_tipo'] . "](" . $size . "k)"; if (isImage($rowFiles["img_tipo"])) { $viewImage = " "; } else { $viewImage = ""; } ?>
#
k
fetchAll() as $rowFiles) { $size = round($rowFiles['img_size'] / 1024, 1); $rowFiles['img_tipo'] . "](" . $size . "k)"; if (isImage($rowFiles["img_tipo"])) { $viewImage = " "; } else { $viewImage = ""; } ?>
#
k