tinyqc/v1/inc/control_index.php
mahdahar ff90e0eb29 Initial commit: Add CodeIgniter 4 QC application with full MVC structure
- CodeIgniter 4 framework setup with SQL Server database config
- Models: Control, Test, Dept, Result, Daily/ Monthly entry models
- Controllers: Dashboard, Control, Test, Dept, Entry, Report, API endpoints
- Views: CRUD pages with modal dialogs, dashboard, reports
- Database: Migrations for control test and daily/monthly result tables
- Legacy v1 PHP application preserved in /v1 directory
- Documentation: AGENTS.md, VIEWS_RULES.md for development guidelines
2026-01-14 16:49:27 +07:00

26 lines
917 B
PHP

<h2>Control</h2>
<a href='?p=control&d=add'>New Control</a>
<table border='1'>
<tr> <th>ID</th> <th>Name</th> <th>Lot#</th> <th>Producer</th> <th>EXPdate</th> </tr>
<?php
$sql = "select id,name,lot,producer,expdate from DICT_CONTROL order by expdate DESC";
$stmt = sqlsrv_query( $conn1, $sql );
if( $stmt == false) { die( print_r( sqlsrv_errors(), true) ); }
$i=1;
while( $row = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_NUMERIC) ) {
$cid = $row[0];
$cname = $row[1];
$lot = $row[2];
$producer = $row[3];
if($row[4] != '') {
$expdate = date_format($row[4],"d-m-Y");
} else { $expdate = ''; }
echo "<tr><td>$i</td> <td>$cname</td> <td>$lot</td> <td>$producer</td> <td>$expdate</td>
<td><a href='?p=control&d=lot_add'>add lot</a></td>
<td><a href='?p=ct&cid=$cid'>detail</a> - <a href='?p=control&d=edit&cid=$cid'>edit</a> -
<a href='?p=control&d=del&cid=$cid'>del</a>
</td></tr>";
$i++;
}
?>
</table>