mirror of
https://github.com/FlyInTheBox/31TSAI.git
synced 2024-12-22 22:37:00 +01:00
Compare commits
No commits in common. "f1b201c121ce5f4e974973e8382d4d39653cf3ce" and "3d57b00d353ebc64f71f45382b202acf81ed89a8" have entirely different histories.
f1b201c121
...
3d57b00d35
2 changed files with 10 additions and 23 deletions
Binary file not shown.
Before Width: | Height: | Size: 280 KiB |
|
@ -13,24 +13,19 @@
|
|||
$id_conn = mysqli_connect('localhost', 'root', '', 'baza_testowa');
|
||||
$zapytanie = "SELECT ord.id,
|
||||
customer.name,
|
||||
DATE_FORMAT(ord.date_ordered,'%Y-%m-%d') as date_ordered,
|
||||
DATE_FORMAT(ord.date_shipped,'%Y-%m-%d') as date_shipped,
|
||||
CONCAT(emp.first_name,' ',emp.last_name) as sprzedawca,
|
||||
ord.date_ordered,
|
||||
ord.date_shipped,
|
||||
emp.first_name,
|
||||
emp.last_name,
|
||||
ord.total,
|
||||
ord.payment_type,
|
||||
ord.order_filled,
|
||||
product.name as nazwaProduktu,
|
||||
item.price,
|
||||
item.quantity
|
||||
FROM ord join customer on customer.id=ord.customer_id
|
||||
join emp on ord.sales_rep_id=emp.id
|
||||
join item on ord.id = item.ord_id
|
||||
join product on product.id = item.product_id WHERE ord.id >= 100;";
|
||||
ord.order_filled
|
||||
FROM ord join customer on customer.id=ord.customer_id join emp on ord.sales_rep_id=emp.id WHERE ord.id >= 100;";
|
||||
$wynik = mysqli_query($id_conn, $zapytanie);
|
||||
?>
|
||||
<table cellspacing="0" cellpadding="0" border="1" style="width: 90%;" align="center">
|
||||
<tbody align="center">
|
||||
<tr bgcolor="#A000FF">
|
||||
<tr bgcolor="grey">
|
||||
<td>ID</td>
|
||||
<td>Nazwa Klienta</td>
|
||||
<td>Data zamówienia</td>
|
||||
|
@ -39,12 +34,10 @@ $wynik = mysqli_query($id_conn, $zapytanie);
|
|||
<td>Wartość</td>
|
||||
<td>Typ płatności</td>
|
||||
<td>Status</td>
|
||||
<td>Nazwa produktu</td>
|
||||
<td>Cena</td>
|
||||
<td>Ilość</td>
|
||||
</tr>
|
||||
<?php
|
||||
while ($row = mysqli_fetch_array($wynik)) {
|
||||
while ($row = mysqli_fetch_array($wynik))
|
||||
{
|
||||
echo '<tr><td>';
|
||||
printf("%d", $row['id']);
|
||||
echo '</td><td>';
|
||||
|
@ -54,19 +47,13 @@ $wynik = mysqli_query($id_conn, $zapytanie);
|
|||
echo '</td><td>';
|
||||
printf("%s", $row['date_shipped']);
|
||||
echo '</td><td>';
|
||||
printf("%s", $row['sprzedawca']);
|
||||
printf("%s", $row['first_name']." ".$row['last_name']);
|
||||
echo '</td><td>';
|
||||
printf("%s", $row['total']);
|
||||
echo '</td><td>';
|
||||
printf("%s", $row['payment_type']);
|
||||
echo '</td><td>';
|
||||
printf("%s", $row['order_filled']);
|
||||
echo '</td><td>';
|
||||
printf("%s", $row['nazwaProduktu']);
|
||||
echo '</td><td>';
|
||||
printf("%s", $row['price']);
|
||||
echo '</td><td>';
|
||||
printf("%s", $row['quantity']);
|
||||
echo '</td></tr>';
|
||||
}
|
||||
?>
|
||||
|
|
Loading…
Reference in a new issue