feat: implement direct database-driven KDS status tracking and frontend UI for table order monitoring
This commit is contained in:
+31
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
$serverName = '192.168.20.20';
|
||||
$connectionOptions = ['Database' => 'Gastro', 'Uid' => 'sa', 'PWD' => 'karczma!@#26', 'CharacterSet' => 'UTF-8'];
|
||||
$conn = sqlsrv_connect($serverName, $connectionOptions);
|
||||
|
||||
if (!$conn) {
|
||||
die(print_r(sqlsrv_errors(), true));
|
||||
}
|
||||
|
||||
$tsql = "
|
||||
SELECT TABLE_NAME, COLUMN_NAME
|
||||
FROM INFORMATION_SCHEMA.COLUMNS
|
||||
WHERE COLUMN_NAME LIKE '%KDS%'
|
||||
OR COLUMN_NAME LIKE '%Druk%'
|
||||
OR COLUMN_NAME LIKE '%Kierun%'
|
||||
OR COLUMN_NAME LIKE '%Stanowisk%'
|
||||
OR COLUMN_NAME LIKE '%Ekran%'
|
||||
OR COLUMN_NAME LIKE '%Wydruk%'
|
||||
";
|
||||
|
||||
$stmt = sqlsrv_query($conn, $tsql);
|
||||
if (!$stmt) {
|
||||
die(print_r(sqlsrv_errors(), true));
|
||||
}
|
||||
|
||||
while($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_ASSOC)) {
|
||||
// Only care about related tables like NGastroTowar, NGastroDTRachunekPozycja, etc.
|
||||
if (strpos($row['TABLE_NAME'], 'NGastro') === 0) {
|
||||
echo $row['TABLE_NAME'] . " -> " . $row['COLUMN_NAME'] . "\n";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user