-
Notifications
You must be signed in to change notification settings - Fork 0
/
control_protocol_print.php
116 lines (88 loc) · 3.71 KB
/
control_protocol_print.php
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<!DOCTYPE html>
<html lang="en">
<head>
<title>STOP Zakażeniom! - Dodaj oddział</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<link rel="stylesheet" href="_bootstrap-datetimepicker.scss">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script src="bootstrap-datetimepicker.js"></script>
<style>
/* Set height of the grid so .sidenav can be 100% (adjust if needed) */
.row.content {height: 1500px}
/* Set gray background color and 100% height */
.sidenav {
background-color: #f1f1f1;
height: 100%;
}
/* Set black background color, white text and some padding */
footer {
background-color: #555;
color: white;
padding: 15px;
}
/* On small screens, set height to 'auto' for sidenav and grid */
@media screen and (max-width: 767px) {
.sidenav {
height: auto;
padding: 15px;
}
.row.content {height: auto;}
}
</style>
</head>
<body>
<?php
include 'config.php';
include 'functions.php';
db_connect();
$inspection_name = get_object_data ("inspection", "name", $_GET['inspection_id']);
$oddzial_name = get_object_data ("oddzial", "name", $_GET['oddzial_id']);
?>
<hr style="background: black; border: 1px solid black;" color="black">
<h4><center><b>Protokół kontroli <u><?php echo ($inspection_name); ?></u> na oddziale <u><?php echo ($oddzial_name); ?></u> w dniu<b> 29 Kwietnia 2016</b></center> </h4>
<hr style="background: black; border: 1px solid black;" color="black" size="1">
<?php
?>
<center>
<table class="table table-bordered" style="border: 1px solid black; width: 94%; text-align: center;">
<thead style="border: 1px solid black;">
<tr style="border: 1px solid black;">
<th style="border: 1px solid black; text-align: center;">Pomieszczenie</th>
<th style="border: 1px solid black; text-align: center;">Punkt kontrolowany</th>
<th style="border: 1px solid black; text-align: center;">Ocena</th>
</tr>
</thead>
<tbody style="border: 1px solid black;">
<?php
$inspections = mysql_query("SELECT * FROM inspections WHERE id='".$_GET['inspection_id']."';");
$i = null;
while ($inspections_row = mysql_fetch_array($inspections)) {
$pomieszczenia = mysql_query("SELECT * FROM inspections_data WHERE oddzial_id='".$_GET['oddzial_id']."' AND inspection_id='".$_GET['inspection_id']."';");
while ($pomieszczenia_row = mysql_fetch_array($pomieszczenia)) {
$i++;
$b = $pomieszczenia_row['pomieszczenie_id'];
$cp_number = count_control_points_in_pomieszczenie ($pomieszczenia_row['pomieszczenie_id']);
$cp_name = get_object_data ("control_point", "name", $pomieszczenia_row['cp_id']);
$pomieszczenie_name = get_object_data ("pomieszczenie", "name", $pomieszczenia_row['pomieszczenie_id']);
echo ('<tr style="border: 1px solid black;">');
//echo ($i."");
if ($b != $b_prev ) {
echo ('<td style="border: 1px solid black;" rowspan="'.$cp_number.'">'.$pomieszczenie_name.'</td>');
}
// $b = true;
echo (' <td style="border: 1px solid black;">'.$cp_name.'</td>
<td style="border: 1px solid black;">1</td>
</tr>');
$b_prev = $pomieszczenia_row['pomieszczenie_id'];
}
}
?>
</tbody>
</table>
<hr style="background: black; border: 1px solid black;" color="black" size="1">
</center>
</body>
</html>