-
Notifications
You must be signed in to change notification settings - Fork 0
/
print.php
65 lines (58 loc) · 2.65 KB
/
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
<!DOCTYPE html>
<html lang="pl">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="main_style.css">
</head>
<body>
<?php
require('utils/is_logged_in.php');
include('utils/get_by_id_from_db.php');
if (!isset($_POST['id'])) {
header('Location: /error.php?code=400&message=Missing%20required%20parameter%20id');
}
$id = intval($_POST['id']);
$application = get_application_by_id($id);
if ($application == null) {
header('Location: /error.php?code=404&message=Application%20not%20found');
}
echo "<table id=\"print_table\">";
echo "<tr><td>Klient</td><td>".$application['client_name']."</td></tr>";
echo "<tr><td>Telefon Klienta</td><td>".$application['client_phone']."</td></tr>";
echo "<tr><td>Dealer</td><td>".$application['dealer_name']."</td></tr>";
echo "<tr><td>Telefon Dealera</td><td>".$application['dealer_phone']."</td></tr>";
echo "<tr><td>Marka</td><td>".$application['scooter_make']."</td></tr>";
echo "<tr><td>Model</td><td>".$application['scooter_model']."</td></tr>";
echo "<tr><td>Nr ramy</td><td>".$application['scooter_frame_number']."</td></tr>";
echo "<tr><td>Data zakupu</td><td>".$application['scooter_date_of_purchase']."</td></tr>";
echo "<tr><td>Data zgłoszenia</td><td>".explode(" ",$application['application_date_created'])[0]."</td></tr>";
echo "<tr><td>Data edycji</td><td>".explode(" ", $application['application_date_changed'])[0]."</td></tr>";
echo "<tr><td>Status</td><td>";
switch ($application['application_status']) {
case "created":
echo "utworzono";
break;
case "received":
echo "odebrano";
break;
case "service_wwa":
echo "serwis w Warszawie";
break;
case "in_progress":
echo "w trakcie";
break;
case "finished":
echo "ukończono";
break;
default:
echo $application['application_status'];
break;
}
echo "</td></tr>";
echo "<tr><td>Opis</td><td>".$application['application_description']."</td></tr>";
echo "</table>";
?>
</body>
</html>