pivi_vault_system/actions/print.php

74 lines
2.7 KiB
PHP

<!DOCTYPE html>
<html>
<head>
<?php
include '../header.php';
include '../config.php';
$id = $_GET['doc_id'];
$url = "qrcode.php?id=$id";
$sql = "SELECT documents.id,documents.number,type.name as doc_type,
documents.description,department.name as department,company.name as company, files.web_path as companyLogo,
city.name as city,province.name as province,documents.vault,documents.folder
FROM documents
LEFT JOIN type on type.id = documents.type
LEFT JOIN department on department.id = documents.department
LEFT JOIN company on company.id = documents.company
LEFT JOIN city on city.id = documents.city
LEFT JOIN province on province.id = documents.province
LEFT JOIN files ON files.id = company.logo
WHERE documents.id = $id;";
$result = $conn->query($sql);
$row = $result->fetch_assoc();
$doc_no = $row['number'];
$doc_type = $row['doc_type'];
$description = $row['description'];
$department = $row['department'];
$company = $row['company'];
$companyLogo = $row['companyLogo'];
$city = $row['city'];
$province = $row['province'];
$folder = $row['folder'];
$vault = $row['vault'];
?>
</head>
<body class="dt-example dt-example-bootstrap">
<div class="container">
<table class="table table-bordered">
<tr>
<td rowspan='4' width='150' style="text-align: center; vertical-align: middle;">
<img src=<?php echo $url; ?> alt="" width="150" style="display: block; margin: auto;">
</td>
<th width='1'>Document_Number</th>
<td colspan=2><?php echo $doc_no; ?></td>
<th>Folder / Vault</th>
<td><?php echo $folder . " / " . $vault; ?></td>
<td rowspan='4' width='150' style="text-align: center; vertical-align: middle;">
<img src="<?php echo $companyLogo; ?>" alt="" width="150" style="display: block; margin: auto;">
</td>
</tr>
<tr>
<th>Document_Type</th>
<td><?php echo $doc_type; ?></td>
<th>Description</th>
<td colspan=2><?php echo $description; ?></td>
</tr>
<tr>
<th>City</th>
<td><?php echo $city; ?></td>
<th>Province</th>
<td colspan=2><?php echo $province; ?></td>
</tr>
<tr>
<th>Department</th>
<td><?php echo $department; ?></td>
<th>Company</th>
<td colspan=2><?php echo $company; ?></td>
</tr>
</table>
</div>
</body>
</html>