Add php files

This commit is contained in:
2025-05-12 15:44:39 +00:00
parent c951760058
commit 82d5804ac4
9534 changed files with 2638137 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
<?php
/**
* Klasa reprezentująca wpis na paragonie
* @author Krzysztof Raciniewski
*
*/
class ReceiptItems {
/**
* Pobera wszystkie pozycje paragonu o unikalnym ID
*
* @param $id -
* unikalny ID paragonu
*/
public static function getByReceiptId($id) {
$db = $GLOBALS ['db'];
$query = "SELECT * FROM ecmreceiptitems WHERE ecmreceipt_id='$id'";
$result = $db->query ( $query );
return ReceiptItems::getAllFromResult ( $result );
}
/**
* Zwraca w formie tablicy wszystkie wiersze odpowiedzi na zapytanie
*
* @param
* $result
* @return Zwraca wiersze w postacie tablicy
*/
public static function getAllFromResult($result) {
$itemsArray = array ();
while ( $row = $result->fetch_assoc () ) {
array_push ( $itemsArray, $row );
}
return $itemsArray;
}
}
?>