These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
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 | * @copyright {@link https://xoops.org/ XOOPS Project} |
||
14 | * @license {@link http://www.gnu.org/licenses/gpl-2.0.html GNU GPL 2 or later} |
||
15 | * @package extcal |
||
16 | * @since |
||
17 | * @author XOOPS Development Team, |
||
18 | */ |
||
19 | |||
20 | include __DIR__ . '/../../mainfile.php'; |
||
21 | require_once __DIR__ . '/include/constantes.php'; |
||
22 | |||
23 | require_once XOOPS_ROOT_PATH . '/language/' . $xoopsConfig['language'] . '/calendar.php'; |
||
24 | |||
25 | View Code Duplication | if (!isset($_GET['event'])) { |
|
26 | $eventId = 0; |
||
27 | } else { |
||
28 | $eventId = (int)$_GET['event']; |
||
29 | } |
||
30 | $eventHandler = xoops_getModuleHandler(_EXTCAL_CLS_EVENT, _EXTCAL_MODULE); |
||
31 | $event = $eventHandler->objectToArray($eventHandler->getEvent($eventId), ['cat_id']); |
||
32 | |||
33 | //adding location |
||
34 | /** @var ExtcalEtablissementHandler $locationHandler */ |
||
35 | $locationHandler = xoops_getModuleHandler('etablissement', _EXTCAL_MODULE); |
||
36 | if ($event['event_etablissement'] > 0) { |
||
37 | $location = $locationHandler->objectToArray($locationHandler->getEtablissement($event['event_etablissement'], true)); |
||
38 | } |
||
39 | |||
40 | // Adding formated date for start and end event |
||
41 | $eventHandler->formatEventDate($event, $xoopsModuleConfig['event_date_event']); |
||
42 | |||
43 | echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">' . "\n"; |
||
44 | echo '<html xmlns="http://www.w3.org/1999/xhtml">' . "\n"; |
||
45 | echo '<head>' . "\n"; |
||
46 | echo '<meta http-equiv="content-type" content="text/html; charset=' . _CHARSET . '">' . "\n"; |
||
47 | echo '<title>' . $event['cat']['cat_name'] . ' - ' . $event['event_title'] . '</title>' . "\n"; |
||
48 | echo '</head>' . "\n"; |
||
49 | echo '<body onload="window.print()">' . "\n"; |
||
50 | echo '<table style="border:1px solid black; width:640px;" cellspacing="0" cellspadding="0">' . "\n"; |
||
51 | echo '<tr>' . "\n"; |
||
52 | echo '<td colspan="2" style="font-size:1.2em; border:1px solid black;">' . "\n"; |
||
53 | echo $event['event_title'] . "\n"; |
||
54 | echo '</td>' . "\n"; |
||
55 | echo '</tr>' . "\n"; |
||
56 | echo '<tr>' . "\n"; |
||
57 | echo '<td style="width:50%; border:1px solid black;">' . "\n"; |
||
58 | echo '<b>' . $event['cat']['cat_name'] . '</b><br>' . "\n"; |
||
59 | echo '<span style="font-weight:normal;">' . $event['cat']['cat_desc'] . '</span>' . "\n"; |
||
60 | echo '</td>' . "\n"; |
||
61 | echo '<td style="border:1px solid black;">' . "\n"; |
||
62 | if (!$event['event_isrecur']) { |
||
63 | echo '<b>' . _MD_EXTCAL_START . ' :</b> <span style="font-weight:normal;">' . $event['formated_event_start'] . '</span><br>' . "\n"; |
||
64 | echo '<b>' . _MD_EXTCAL_END . ' :</b> <span style="font-weight:normal;">' . $event['formated_event_end'] . '</span>' . "\n"; |
||
65 | } else { |
||
66 | echo '<b>' . _MD_EXTCAL_RECCUR_RULE . ' :</b> <span style="font-weight:normal;">' . $event['formated_reccur_rule'] . '</span>' . "\n"; |
||
67 | } |
||
68 | echo '</td>' . "\n"; |
||
69 | echo '</tr>' . "\n"; |
||
70 | |||
71 | echo '<tr>' . "\n"; |
||
72 | if ($event['event_desc'] != '') { |
||
73 | echo '<td style="border:1px solid black;">' . $event['event_desc'] . '</td>' . "\n"; |
||
74 | } |
||
75 | if ($event['event_price'] != '') { |
||
76 | echo '<td style="border:1px solid black;">' . _MD_EXTCAL_ETABLISSEMENT_PRICE . $event['event_price'] . ' ' . _MD_EXTCAL_DEVISE2 . '</td>' . "\n"; |
||
77 | } |
||
78 | echo '</tr>' . "\n"; |
||
79 | |||
80 | //show contact info |
||
81 | if ($event['event_contact'] != '') { |
||
82 | echo '<tr>' . "\n"; |
||
83 | echo '<td style="border:1px solid black;">' . "\n"; |
||
84 | echo '<b>' . _MD_EXTCAL_CONTACT_INFO . '</b><br>' . "\n"; |
||
85 | echo '<span style="font-weight:normal;">' . $event['event_organisateur'] . '<br>' . "\n"; |
||
86 | echo '<span style="font-weight:normal;">' . $event['event_contact'] . '<br>' . "\n"; |
||
87 | echo $event['event_address'] . '</span>' . "\n"; |
||
88 | echo '</td>' . "\n"; |
||
89 | echo '<td style="border:1px solid black;">' . "\n"; |
||
90 | echo '<b>' . _MD_EXTCAL_EMAIL . ' :</b> <a href="mailto:' . $event['event_email'] . '">' . $event['event_email'] . '</a><br>' . "\n"; |
||
91 | echo '<b>' . _MD_EXTCAL_URL . ' :</b> <a href="' . $event['event_url'] . '">' . $event['event_url'] . '</a>' . "\n"; |
||
92 | echo '</td>' . "\n"; |
||
93 | echo '</tr>' . "\n"; |
||
94 | } |
||
95 | |||
96 | //show location |
||
97 | if ($event['event_etablissement'] = 0) { |
||
98 | echo '<tr>' . "\n"; |
||
99 | |||
100 | // echo($location['nom']); |
||
101 | // var_dump($location); |
||
102 | // var_dump($event); |
||
103 | |||
104 | echo '<td style="border:1px solid black;">' . "\n"; |
||
105 | echo '<b>' . _MD_EXTCAL_ETABLISSEMENT . '</b>' . "\n"; |
||
106 | if ($location['categorie'] != '') { |
||
107 | echo '<span style="font-weight:normal;"> (' . $location['categorie'] . ') <br>' . "\n"; |
||
108 | } |
||
109 | if ($location['logo'] != '') { |
||
110 | echo '<img align=right style="border:1px solid #FFFFFF;margin-right:6px" src=' . XOOPS_URL . '/uploads/extcal/etablissement/' . $location['logo'] . ' height="75px">' . '' . "\n"; |
||
111 | } |
||
112 | |||
113 | echo '<span style="font-weight:normal;">' . $location['nom'] . '<br>' . "\n"; |
||
114 | echo $location['description'] . '<br>' . "\n"; |
||
115 | echo $location['adresse'] . '</span> <br>' . "\n"; |
||
116 | if ($location['adresse2'] != '') { |
||
117 | echo $location['adresse2'] . '</span> <br>' . "\n"; |
||
118 | } |
||
119 | echo $location['ville'] . "\n"; |
||
120 | echo $location['cp'] . '<br>' . "\n"; |
||
121 | |||
122 | if ($location['horaires'] != '') { |
||
123 | echo $location['horaires'] . '</span> <br>' . "\n"; |
||
124 | } |
||
125 | |||
126 | if ($location['divers'] != '') { |
||
127 | echo $location['divers'] . '</span> <br>' . "\n"; |
||
128 | } |
||
129 | |||
130 | if ($location['tarifs'] != '') { |
||
131 | echo $location['tarifs'] . '</span> ' . _MD_EXTCAL_DEVISE2 . "\n"; |
||
132 | } |
||
133 | |||
134 | echo '</td>' . "\n"; |
||
135 | echo '<td style="border:1px solid black;">' . "\n"; |
||
136 | |||
137 | if ($location['tel_fixe'] != '') { |
||
138 | echo '<b>' . _MD_EXTCAL_ETABLISSEMENT_TEL_FIXE . ' :</b>' . $location['tel_fixe'] . '<br>' . "\n"; |
||
139 | } |
||
140 | if ($location['tel_portable'] != '') { |
||
141 | echo '<b>' . _MD_EXTCAL_ETABLISSEMENT_TEL_PORTABLE . ' :</b>' . $location['tel_portable'] . '<br>' . "\n"; |
||
142 | } |
||
143 | |||
144 | echo '<b>' . _MD_EXTCAL_EMAIL . ' :</b> <a href="mailto:' . $location['mail'] . '">' . $location['mail'] . '</a><br>' . "\n"; |
||
145 | echo '<b>' . _MD_EXTCAL_URL . ' :</b> <a href="' . $location['site'] . '">' . $location['site'] . '</a>' . '<br>' . "\n"; |
||
146 | echo '<b>' . _MD_EXTCAL_ETABLISSEMENT_MAP . ' :</b> <a href="' . $location['map'] . '">' . _MD_EXTCAL_ETABLISSEMENT_MAP2 . '</a>' . "\n"; |
||
147 | |||
148 | echo '</td>' . "\n"; |
||
149 | echo '</tr>' . "\n"; |
||
150 | } |
||
151 | //show images |
||
152 | |||
153 | if (($event['event_picture1'] != '') || ($event['event_picture2'] != '')) { |
||
154 | echo '<tr>' . "\n"; |
||
155 | View Code Duplication | if ($event['event_picture1'] != '') { |
|
0 ignored issues
–
show
|
|||
156 | echo '<td style="border:1px solid black;">' . "\n"; |
||
157 | echo '<img align=left style="border:1px solid #FFFFFF;margin-right:6px" src=' . XOOPS_URL . '/uploads/extcal/' . $event['event_picture1'] . ' height="100px">' . '' . "\n"; |
||
158 | echo '</td>' . "\n"; |
||
159 | } |
||
160 | View Code Duplication | if ($event['event_picture2'] != '') { |
|
0 ignored issues
–
show
This code seems to be duplicated across your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
161 | echo '<td style="border:1px solid black;">' . "\n"; |
||
162 | echo '<img align=left style="border:1px solid #FFFFFF;margin-right:6px" src=' . XOOPS_URL . '/uploads/extcal/' . $event['event_picture2'] . ' height="100px">' . '' . "\n"; |
||
163 | echo '</td>' . "\n"; |
||
164 | } |
||
165 | echo '</tr>' . "\n"; |
||
166 | } |
||
167 | //-------------------- |
||
168 | |||
169 | echo '</table><br>' . "\n"; |
||
170 | echo '<div style="text-align:center; width:640px;">'; |
||
171 | echo $xoopsConfig['sitename'] . ' - ' . $xoopsConfig['slogan'] . '<br>'; |
||
172 | echo '<a href="' . XOOPS_URL . '/modules/extcal/event.php?event=' . $event['event_id'] . '">' . XOOPS_URL . '/modules/extcal/event.php?event=' . $event['event_id'] . '</a>'; |
||
173 | echo '</div>'; |
||
174 | echo '</body>' . "\n"; |
||
175 | echo '</html>' . "\n"; |
||
176 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.