tinyqc/v1/inc/test_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

28 lines
927 B
PHP

<h2>Test</h2>
<a href='?p=test&d=edit&tid=0'>New Test</a> <br/>
<table border='1'>
<tr> <th>ID</th> <th>Dept.</th> <th>Name</th> <th>Method</th> <th>Unit</th> <th>BA</th> <th>CVA</th> <th>TEA</th> </tr>
<?php
$sql = "select t.id, t.name,ba,cva,tea,method,unit, d.id, d.name from DICT_TEST t
left join DICT_DEPT d on d.id=t.deptid";
$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) ) {
$tid = $row[0];
$tname = $row[1];
$ba = $row[2];
$cva = $row[3];
$tea = $row[4];
$method = $row[5];
$unit = $row[6];
$did = $row[7];
$dname = $row[8];
echo "<tr><td>$i</td> <td>$dname</td> <td>$tname</td> <td>$method</td> <td>$unit</td> <td>$ba</td> <td>$cva</td> <td>$tea</td>
<td><a href='?p=test&d=edit&tid=$tid'>edit</a> -
<a href='?p=test&d=del&tid=$tid'>del</a>
</td></tr>";
$i++;
}
?>
</table>