-
Notifications
You must be signed in to change notification settings - Fork 0
/
rentalclientslist.php
105 lines (72 loc) · 3.33 KB
/
rentalclientslist.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
<?php
include 'mysql.php';
echo "<html>\n";
echo "\t<head>\n";
echo "\t\t<link href=\"inc/style.css\" rel=\"stylesheet\" type=\"text/css\">\n";
echo "<script language='JavaScript' type='text/JavaScript' src='inc/common.js'> </script>\n";
echo "<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>\n";
echo "\t</head>\n";
echo "\t<body>\n";
echo "<div class=\"mainmargin\">\n";
echo "<h1>Lista klientów</h1>\n";
echo "<table cellpadding=\"4\" width=\"100%\">\n";
echo "<tr class=\"dark\">\n";
echo "<td class=\"fleftu\">Firma</td>\n";
echo "<td class=\"fbt\">Numer dokumentu</td>\n";
echo "<td class=\"fbt\">Ulica</td>\n";
echo "<td class=\"fbt\">Kod pocztowy</td>\n";
echo "<td class=\"fbt\">Miasto</td>\n";
echo "<td class=\"fbt\">Telefon</td>\n";
echo "<td class=\"fbt\">NIP</td>\n";
echo "<td class=\"fbt\">Email</td>\n";
echo "<td class=\"frightu\"></td>\n";
echo "</tr>\n";
$q = "SELECT * FROM `rental_clients` ORDER BY `id`";
$r = mysql_query($q);
while ($row = mysql_fetch_assoc($r)) {
$id = $row["id"];
$company = $row["company"];
$document_no = $row["document_no"];
$street = $row["street"];
$zip = $row["zip"];
$city = $row["city"];
$phone = $row["phone"];
$email = $row["email"];
$nip = $row["nip"];
if ($id%2 == 0) {
//Pętla if odpowiedzialna za rozróżnianie id parzystych i nie parzystych
echo "<tr class=\"light\" onmouseover=\"addClass(this, 'highlight')\" onmouseout=\"removeClass(this, 'highlight')\">\n";
echo "\t<td onClick=\"top.location.href='/cma_service/?m=historiaurzadzen&search_type=2&client_id=".$id."';\" class=\"fleft\">" . $company . "</td>\n";
echo "\t<td>" . $document_no . "</td>\n";
echo "\t<td>" . $street . "</td>\n";
echo "\t<td>" . $zip . "</td>\n";
echo "\t<td>" . $city . "</td>\n";
echo "\t<td>" . $phone . "</td>\n";
echo "\t<td>" . $nip . "</td>\n";
echo "\t<td>" . $email . "</td>\n";
echo "\t<td class=\"fright\"><a href=\"rentalclientdel.php?&id=".$id. "\" OnClick=\"return confirmLink(this, 'Czy jesteś pewien, że chcesz usunąć klienta " . $firstname . " " . $lastname . " " . $company . " z bazy?');\"><img src=\"img/delete.gif\"></a> <img src=\"img/edit.gif\"></td>\n";
echo "</tr>\n\n";
} else {
echo "<tr class=\"lucid\" onmouseover=\"addClass(this, 'highlight')\" onmouseout=\"removeClass(this, 'highlight')\">\n";
echo "\t<td onClick=\"top.location.href='/cma_service/?m=historiaurzadzen&search_type=2&client_id=".$id."';\" class=\"fleft\">" . $company . "</td>\n";
echo "\t<td>" . $document_no . "</td>\n";
echo "\t<td>" . $street . "</td>\n";
echo "\t<td>" . $zip . "</td>\n";
echo "\t<td>" . $city . "</td>\n";
echo "\t<td>" . $phone . "</td>\n";
echo "\t<td>" . $nip . "</td>\n";
echo "\t<td>" . $email . "</td>\n";
echo "\t<td class=\"fright\"><a href=\"rentalclientdel.php?&id=".$id. "\" OnClick=\"return confirmLink(this, 'Czy jesteś pewien, że chcesz usunąć klienta " . $firstname . " " . $lastname . " " . $company . " z bazy?');\"><img src=\"img/delete.gif\"></a> <a href=\"editrentalclient.php?id=".$id."\"><img src=\"img/edit.gif\"></a></td>\n";
echo "</tr>\n\n";
}
}
echo "<tr class=\"dark\">\n";
echo "\t<td class=\"fall\" colspan=\"11\">Strona</td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "</div>\n";
echo "\t</body>\n";
echo "</html>\n";
//$vars = get_defined_vars();
//print_r($vars);
?>