-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathafisare.php
More file actions
90 lines (60 loc) · 3.29 KB
/
Copy pathafisare.php
File metadata and controls
90 lines (60 loc) · 3.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<!DOCTYPE html>
<html>
<?php
session_start();
require './init.php';
include 'header.php';?>
<style>
<?php include 'afisare.css'; ?>
</style>
</br></br>
<div>
<table class="table" id="table">
<?php
$con = init::getCon();
$querycol="SELECT DISTINCT `Denumire` FROM `preparat`";
$querylinie="SELECT DISTINCT `Denumire` FROM `ingredient`";
$queryColNames = "SELECT `COLUMN_NAME`
FROM `INFORMATION_SCHEMA`.`COLUMNS`
WHERE `TABLE_SCHEMA`='combinatii'
AND `TABLE_NAME`='prepingr' limit 1";
$queryIngr = "Select Distinct denumire from ingredient";
$resultcol=$con->query($querycol); /*mysqli_query($con,$querycol);*/
$resultlinie=$con->query($querylinie);
$resultColsNames = $con->query($queryColNames);
$resultIngr = $con->query($queryIngr);
echo "<tr>";
while ($row = $resultColsNames->fetch(PDO::FETCH_ASSOC)) {
echo "<th>".$row['COLUMN_NAME']."</th>";
}
$contorIngr = 0;
$lungime = 0;
$lista;
while ($row = $resultlinie->fetch(PDO::FETCH_ASSOC)) {
$lista[$contorIngr] = $row['Denumire'];
echo("<th>".$row['Denumire']."</th>");
$contorIngr=$contorIngr+1;
}
echo "</tr><tr>";
while ($row1 = $resultcol->fetch(PDO::FETCH_ASSOC)) {
echo "<td>".$row1['Denumire']."</td>";
init::wh_log($row1['Denumire']);
for($i=0;$i<count($lista);$i=$i+1){
$querygGramaj = "SELECT DISTINCT `gramaj` FROM `prepingr` WHERE preparat='".$row1['Denumire']."' AND ingredient='".$lista[$i]."'";
// init::wh_log($querygGramaj);
$resultQuery = $con->query($querygGramaj);
$row4 = $resultQuery->fetch(PDO::FETCH_ASSOC);
// $total_rating_votes = $row4['gramaj'];
if(!isset($row4['gramaj'])){
echo "<td></td>";
}else{
echo "<td>". $row4['gramaj']."</td>";
}
}
echo "</tr>";
}
?>
</table>
</div>
</body>
</html>