Passed
Push — master ( 41940e...005d4f )
by Michael
36s queued 18s
created
Labels
Severity
1
<?php
2
/*
3
 You may not change or alter any portion of this comment or credits
4
 of supporting developers from this source code or any supporting source code
5
 which is considered copyrighted (c) material of the original comment or credit authors.
6
7
 This program is distributed in the hope that it will be useful,
8
 but WITHOUT ANY WARRANTY; without even the implied warranty of
9
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10
*/
11
12
/**
13
 * pedigree module for XOOPS
14
 *
15
 * @copyright   {@link http://sourceforge.net/projects/xoops/ The XOOPS Project}
16
 * @license     {@link http://www.fsf.org/copyleft/gpl.html GNU public license}
17
 * @package     pedigree
18
 * @author      XOOPS Module Dev Team
19
 */
20
21
use Xmf\Request;
22
23
//require_once  dirname(dirname(__DIR__)) . '/mainfile.php';
24
require_once __DIR__ . '/header.php';
25
$moduleDirName = basename(__DIR__);
26
xoops_loadLanguage('main', $moduleDirName);
27
require_once __DIR__ . '/include/config.php';
28
require_once XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/include/common.php';
29
$dogid = Request::getInt('dogid', 0, 'GET');
30
31
//create data and variables
32
$queryString = '
33
SELECT d.Id as d_id,
34
d.NAAM as d_naam,
35
d.roft as d_roft,
36
d.foto as d_foto,
37
f.Id as f_id,
38
f.NAAM as f_naam,
39
f.foto as f_foto,
40
m.Id as m_id,
41
m.NAAM as m_naam,
42
m.foto as m_foto,
43
ff.Id as ff_id,
44
ff.NAAM as ff_naam,
45
ff.foto as ff_foto,
46
mf.Id as mf_id,
47
mf.NAAM as mf_naam,
48
mf.foto as mf_foto,
49
fm.Id as fm_id,
50
fm.NAAM as fm_naam,
51
fm.foto as fm_foto,
52
mm.Id as mm_id,
53
mm.NAAM as mm_naam,
54
mm.foto as mm_foto,
55
fff.Id as fff_id,
56
fff.NAAM as fff_naam,
57
ffm.Id as ffm_id,
58
ffm.NAAM as ffm_naam,
59
fmf.Id as fmf_id,
60
fmf.NAAM as fmf_naam,
61
fmm.Id as fmm_id,
62
fmm.NAAM as fmm_naam,
63
mmf.Id as mmf_id,
64
mmf.NAAM as mmf_naam,
65
mff.Id as mff_id,
66
mff.NAAM as mff_naam,
67
mfm.Id as mfm_id,
68
mfm.NAAM as mfm_naam,
69
mmm.Id as mmm_id,
70
mmm.NAAM as mmm_naam
71
FROM ' . $GLOBALS['xoopsDB']->prefix('pedigree_tree') . ' d
72
LEFT JOIN ' . $GLOBALS['xoopsDB']->prefix('pedigree_tree') . ' f ON d.father = f.Id
73
LEFT JOIN ' . $GLOBALS['xoopsDB']->prefix('pedigree_tree') . ' m ON d.mother = m.Id
74
LEFT JOIN ' . $GLOBALS['xoopsDB']->prefix('pedigree_tree') . ' ff ON f.father = ff.Id
75
LEFT JOIN ' . $GLOBALS['xoopsDB']->prefix('pedigree_tree') . ' fff ON ff.father = fff.Id
76
LEFT JOIN ' . $GLOBALS['xoopsDB']->prefix('pedigree_tree') . ' ffm ON ff.mother = ffm.Id
77
LEFT JOIN ' . $GLOBALS['xoopsDB']->prefix('pedigree_tree') . ' mf ON m.father = mf.Id
78
LEFT JOIN ' . $GLOBALS['xoopsDB']->prefix('pedigree_tree') . ' mff ON mf.father = mff.Id
79
LEFT JOIN ' . $GLOBALS['xoopsDB']->prefix('pedigree_tree') . ' mfm ON mf.mother = mfm.Id
80
LEFT JOIN ' . $GLOBALS['xoopsDB']->prefix('pedigree_tree') . ' fm ON f.mother = fm.Id
81
LEFT JOIN ' . $GLOBALS['xoopsDB']->prefix('pedigree_tree') . ' fmf ON fm.father = fmf.Id
82
LEFT JOIN ' . $GLOBALS['xoopsDB']->prefix('pedigree_tree') . ' fmm ON fm.mother = fmm.Id
83
LEFT JOIN ' . $GLOBALS['xoopsDB']->prefix('pedigree_tree') . ' mm ON m.mother = mm.Id
84
LEFT JOIN ' . $GLOBALS['xoopsDB']->prefix('pedigree_tree') . ' mmf ON mm.father = mmf.Id
85
LEFT JOIN ' . $GLOBALS['xoopsDB']->prefix('pedigree_tree') . " mmm ON mm.mother = mmm.Id
86
where d.Id=$dogid";
87
88
$result = $GLOBALS['xoopsDB']->query($queryString);
89
while (false !== ($row = $GLOBALS['xoopsDB']->fetchArray($result))) {
90
    echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
91
    <html><head>
92
    <meta http-equiv="Content-Type" content="text/html">
93
    <meta name="AUTHOR" content="' . $GLOBALS['xoopsConfig']['sitename'] . '">
94
    <meta name="COPYRIGHT" content="Copyright (c) 2018 by ' . $GLOBALS['xoopsConfig']['sitename'] . '">
95
    <meta name="GENERATOR" content="XOOPS Pedigree database">
96
    </head>
97
    <body bgcolor="#ffffff" text="#000000" onload="window.print()">
98
    <table border="0" width="640">
99
        <tr>
100
            <td>';
101
    $male   = '<img src="assets/images/male.gif">';
102
    $female = '<img src="assets/images/female.gif">';
103
    if (0 == $row['d_roft']) {
104
        $gender = $male;
105
    } else {
106
        $gender = $female;
107
    }
108
109
    echo "    <table width='100%' cellspacing='2' border='2'>\n"
110
         . "      <!-- header (dog name) -->\n"
111
         . "      <tr>\n"
112
         . "          <th colspan='4' style='text-align:center;'>\n"
113
         . '              '
114
         . stripslashes($row['d_naam'])
115
         . "\n"
116
         . "          </th>\n"
117
         . "      </tr>\n"
118
         . "      <tr>\n"
119
         . "          <!-- selected dog -->\n"
120
         . "          <td width='25%' rowspan='8'>\n"
121
         . "              {$gender}"
122
         . stripslashes($row['d_naam'])
123
         . "\n";
124
    if ('' != $row['d_foto']) {
125
        echo "              <br><img src='" . PEDIGREE_UPLOAD_URL . '/images/thumbnails/' . $row['d_foto'] . "_150.jpeg' width='150px;'>";
0 ignored issues
show
The constant PEDIGREE_UPLOAD_URL was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
126
    }
127
    echo "          </td>\n" . "             <!-- father -->\n" . "             <td width='25%' rowspan='4'>\n" . "                 {$male}" . stripslashes($row['f_naam']) . "\n";
128
    if ('' != $row['f_foto']) {
129
        echo "                 <br><img src='" . PEDIGREE_UPLOAD_URL . '/images/thumbnails/' . $row['f_foto'] . "_150.jpeg' width='150px;'>\n";
130
    }
131
    echo "          </td>\n" . "             <!-- father father -->\n" . "             <td width='25%' rowspan='2'>\n" . "                 {$male}" . stripslashes($row['ff_naam']) . "\n";
132
    if ('' != $row['ff_foto']) {
133
        echo "                 <br><img src='" . PEDIGREE_UPLOAD_URL . '/images/thumbnails/' . $row['ff_foto'] . "_150.jpeg' width='150px;'>\n";
134
    }
135
    echo "          </td>\n"
136
         . "             <!-- father father father -->\n"
137
         . "             <td width='25%'>\n"
138
         . "                 {$male}"
139
         . stripslashes($row['fff_naam'])
140
         . "\n"
141
         . "             </td>\n"
142
         . "         </tr>\n"
143
         . "         <tr>\n"
144
         . "             <!-- father father mother -->\n"
145
         . "             <td width='25%'>\n"
146
         . "                 {$female}"
147
         . stripslashes($row['ffm_naam'])
148
         . "\n"
149
         . "             </td>\n"
150
         . "         </tr>\n"
151
         . "         <tr>\n"
152
         . "         <!-- father mother -->\n"
153
         . "             <td width='25%' rowspan='2'>\n"
154
         . "                 {$female}"
155
         . stripslashes($row['fm_naam'])
156
         . "\n";
157
    if ('' != $row['fm_foto']) {
158
        echo "                 <br><img src='" . PEDIGREE_UPLOAD_URL . '/images/thumbnails/' . $row['fm_foto'] . "_150.jpeg' width='150px;'>\n";
159
    }
160
    echo "             </td>\n"
161
         . "                <!-- father mother father -->\n"
162
         . "                <td width='25%'>\n"
163
         . "                    {$male}"
164
         . stripslashes($row['fmf_naam'])
165
         . "\n"
166
         . "                </td>\n"
167
         . "            </tr>\n"
168
         . "            <tr>\n"
169
         . "                <!-- father mother mother -->\n"
170
         . "                <td width='25%'>\n"
171
         . "                    {$female}"
172
         . stripslashes($row['fmm_naam'])
173
         . "\n"
174
         . "                </td>\n"
175
         . "            </tr>\n"
176
         . "            <tr>\n"
177
         . "                <!-- mother -->\n"
178
         . "                <td width='25%' rowspan='4'>\n"
179
         . "                    {$female}"
180
         . stripslashes($row['m_naam'])
181
         . "\n";
182
    if ('' != $row['m_foto']) {
183
        echo "                 <br><img src='" . PEDIGREE_UPLOAD_URL . '/images/thumbnails/' . $row['m_foto'] . "_150.jpeg' width='150px;'>\n";
184
    }
185
    echo "             </td>\n" . "                <!- mother father -->\n" . "                <td width='25%' rowspan='2'>\n" . "                    {$male}" . stripslashes($row['mf_naam']) . "\n";
186
    if ('' != $row['mf_foto']) {
187
        echo "                 <br><img src='" . PEDIGREE_UPLOAD_URL . '/images/thumbnails/' . $row['mf_foto'] . "_150.jpeg' width='150px;'>\n";
188
    }
189
    echo "                    </td>\n"
190
         . "                    <!-- mother father father -->\n"
191
         . "                    <td width='25%'>\n"
192
         . "                      {$male}"
193
         . stripslashes($row['mff_naam'])
194
         . "\n"
195
         . "                    </td>\n"
196
         . "                </tr>\n"
197
         . "                <tr>\n"
198
         . "                    <!-- mother father mother -->\n"
199
         . "                    <td width='25%'>\n"
200
         . "                        {$female}"
201
         . stripslashes($row['mfm_naam'])
202
         . "\n"
203
         . "                    </td>\n"
204
         . "                </tr>\n"
205
         . "                <tr>\n"
206
         . "                    <!-- mother mother -->\n"
207
         . "                    <td width='25%' rowspan='2'>\n"
208
         . "                        {$female}"
209
         . stripslashes($row['mm_naam'])
210
         . "\n"
211
         . "                    </td>\n"
212
         . "                    <!-- mother mother father -->\n"
213
         . "                    <td width='25%'>\n"
214
         . "                        {$male}"
215
         . stripslashes($row['mmf_naam'])
216
         . "\n"
217
         . "                    </td>\n"
218
         . "                </tr>\n"
219
         . "                <tr>\n"
220
         . "                    <!-- mother mother mother -->\n"
221
         . "                    <td width='25%'>\n"
222
         . "                        {$female}"
223
         . stripslashes($row['mmm_naam'])
224
         . "\n"
225
         . "                    </td>\n"
226
         . "                </tr>\n"
227
         . "                <!-- footer (dog url) -->\n"
228
         . "                <tr>\n"
229
         . "                    <th colspan='4' style='text-align:center;'>\n"
230
         . "                        <a href='"
231
         . $GLOBALS['xoops']->url("www/modules/pedigree/pedigree.php?pedid={$dogid}")
232
         . "'>"
233
         . $GLOBALS['xoops']->url("www/modules/pedigree/pedigree.php?pedid={$dogid}")
234
         . "</a>\n"
235
         . "                    </th>\n"
236
         . "                </tr>\n"
237
         . "            </table>\n"
238
         . "            </td>\n"
239
         . "        </tr>\n"
240
         . "    </table>\n"
241
         . "    </body>\n"
242
         . "    </html>\n";
243
}
244