Files
quality_recticel/py_app/app/templates/scan.html
2025-10-09 01:10:05 +03:00

74 lines
2.9 KiB
HTML
Executable File

{% extends "base.html" %}
{% block title %}Scan Module{% endblock %}
{% block head %}
<link rel="stylesheet" href="{{ url_for('static', filename='css/scan.css') }}">
{% endblock %}
{% block content %}
<div class="scan-container">
<!-- Input Form Card -->
<div class="card scan-form-card">
<h3>Scan Input</h3>
<form method="POST" class="form-centered">
<label for="operator_code">Quality Operator Code:</label>
<input type="text" id="operator_code" name="operator_code" maxlength="4" required>
<label for="cp_code">CP Code:</label>
<input type="text" id="cp_code" name="cp_code" maxlength="15" required>
<label for="oc1_code">OC1 Code:</label>
<input type="text" id="oc1_code" name="oc1_code" maxlength="4" required>
<label for="oc2_code">OC2 Code:</label>
<input type="text" id="oc2_code" name="oc2_code" maxlength="4" required>
<label for="defect_code">Defect Code:</label>
<input type="text" id="defect_code" name="defect_code" maxlength="4" required>
<label for="date">Date:</label>
<input type="text" id="date" name="date" value="{{ now().strftime('%Y-%m-%d') }}" placeholder="yyyy-mm-dd" pattern="\d{4}-\d{2}-\d{2}" required>
<label for="time">Time:</label>
<input type="text" id="time" name="time" value="{{ now().strftime('%H:%M:%S') }}" readonly>
<button type="submit" class="btn">Submit</button>
</form>
</div>
<!-- Latest Scans Card -->
<div class="card scan-table-card">
<h3>Latest Scans</h3>
<table class="scan-table">
<thead>
<tr>
<th>ID</th>
<th>Op Code</th>
<th>CP Code</th>
<th>OC1 Code</th>
<th>OC2 Code</th>
<th>Defect Code</th>
<th>Date</th>
<th>Time</th>
<th>Apr. Quantity</th>
<th>Rejec. Quantity</th>
</tr>
</thead>
<tbody>
{% for row in scan_data %}
<tr>
<td>{{ row[0] }}</td> <!-- Id -->
<td>{{ row[1] }}</td> <!-- operator_code -->
<td>{{ row[2] }}</td> <!-- CP_full_code -->
<td>{{ row[3] }}</td> <!-- OC1_code -->
<td>{{ row[4] }}</td> <!-- OC2_code -->
<td>{{ row[5] }}</td> <!-- quality_code -->
<td>{{ row[6] }}</td> <!-- date -->
<td>{{ row[7] }}</td> <!-- time -->
<td>{{ row[8] }}</td> <!-- approved_quantity -->
<td>{{ row[9] }}</td> <!-- rejected_quantity -->
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endblock %}