- 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
29 lines
995 B
PHP
29 lines
995 B
PHP
<?php
|
|
$cid = $_GET['cid'];
|
|
$ctid = $_GET['ctid'];
|
|
if(!isset($_POST['submit'])) {
|
|
$sql = "select dt.name, ct.mean, ct.sd from DICT_TEST dt, CONTROL_TEST ct
|
|
where ct.testid=dt.id and ct.id='$ctid'";
|
|
$stmt = sqlsrv_query( $conn1, $sql );
|
|
if( $stmt == false) { die( print_r( sqlsrv_errors(), true) ); }
|
|
$row = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_NUMERIC );
|
|
$tname = $row[0];
|
|
$mean = $row[1];
|
|
$sd = $row[2];
|
|
?>
|
|
<form method='POST'>
|
|
<h2><?php echo "$tname ";?></h2>
|
|
mean<br/><input type='text' name='mean' value='<?php echo $mean;?>' /><br/>
|
|
sd<br/><input type='text' name='sd' value='<?php echo $sd;?>' /><br/>
|
|
<input type='submit' name='submit' value='update' />
|
|
<?php
|
|
} else {
|
|
$ctid = $_GET['ctid'];
|
|
$mean = $_POST['mean'];
|
|
$sd = $_POST['sd'];
|
|
$sql = "UPDATE CONTROL_TEST SET mean='$mean', sd='$sd' WHERE id='$ctid'";
|
|
$stmt = sqlsrv_query( $conn1, $sql );
|
|
if( $stmt == false) { die( print_r( sqlsrv_errors(), true) ); }
|
|
echo "<META http-equiv='refresh' content='0;url=?p=ct&cid=$cid'>";
|
|
}
|
|
?>
|