26 lines
917 B
PHP
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>
|