Assembla home | Assembla project page
 

root/tags/com_mls_events/0.1.6/mls_events.html.php

Revision 164, 33.2 kB (checked in by moensch, 2 years ago)

com_mls_events: Changed year in common footer, remove old upgrade triggers in admin.mls_events.php

Line 
1 <?php
2 defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
3 require_once( "includes/HTML_toolbar.php" );
4 ?>
5 <script>
6 function deEnrolConfirm(OPTION,EVENTID,ITEMID,PAID) {
7     var URL = '?option=' + OPTION + '&task=deenrol&eventid=' + EVENTID + '&Itemid=' + ITEMID;
8     if(PAID == 1) {
9         var varRet = confirm('<?php echo $l->m("msg_cancel_confirm","general"); ?>');
10         if(varRet == true) {
11             document.location = URL;
12         }
13     } else {
14         document.location = URL;
15     }
16 }
17 </script>
18 <!-- end of CSS and JavaScript -->
19
20 <?php
21 class HTML_MLS_events {
22     function listEvents(&$rows, $paid, $option, $Itemid) {
23         global $database,$my,$l;
24         $l->setBlock("events");
25         ?>
26        
27         <table cellpadding="5" cellspacing="0" border="0" width="100%">
28             <tr>
29                 <td><div class="componentheading"><?php echo $l->m("lanparty_events"); ?></div></td>
30             </tr>
31         </table>
32        
33         <table cellpadding="3" cellspacing="1" border="0" width="100%">
34             <tr>
35                 <td class="sectiontableheader"><?php echo $l->m("name"); ?>:</td>
36                 <td class="sectiontableheader"><?php echo $l->m("start"); ?>:</td>
37                 <td class="sectiontableheader"><?php echo $l->m("city"); ?>:</td>
38                 <td class="sectiontableheader"><?php echo $l->m("registrations"); ?>:</td>
39                 <td class="sectiontableheader"></td>
40                 <td class="sectiontableheader"></td>
41                 <td class="sectiontableheader"></td>
42             </tr>
43         <?php
44         $k = 0;
45         for($i = 0, $n = count($rows); $i < $n; $i++) {
46             $row = $rows[$i];
47             $row->paid = array_search($row->id,$paid) ? 1 : NULL;
48             $img = $row->paid ? "tick.png" : "publish_x.png";
49             $pre = $row->paid ? "" : "<a href=\"?option=".$option."&task=pay&eventid=".$row->id."&Itemid=".$Itemid."\">";
50             $post = $row->paid ? "" : "</a>";
51             $y = $k + 1;
52             $class = "sectiontableentry" . $y;
53             SefRelToAbs("?option=".$option."&task=details&eventid=".$row->id."&Itemid=".$Itemid);
54             ?>
55             <tr>
56                 <td class="<?php echo $class;?>"><a href="?option=<?php echo $option?>&task=details&eventid=<?php echo $row->id?>&Itemid=<?php echo $Itemid?>"><?php echo $row->name; ?></a></td>
57                 <td class="<?php echo $class;?>"><?php echo date("D, d.m.Y H:i", strtotime($row->start)); ?></td>
58                 <td class="<?php echo $class;?>"><?php echo $row->loc_zip; ?> <?php echo $row->loc_city; ?></td>
59                 <td class="<?php echo $class;?>"><?php echo $row->usercount; ?>/<?php echo $row->participants_number; ?></td>
60                 <td class="<?php echo $class;?>">
61                     <?php if($row->enrol AND !$row->enrolled) { ?>
62                         <a href="?option=<?php echo $option?>&task=enrol&eventid=<?php echo $row->id?>&Itemid=<?php echo $Itemid?>"><?php echo $l->m("enrol"); ?></a>
63                     <?php } elseif($row->enrol AND $row->enrolled) { ?>
64                         <a href="#" onclick="javascript:deEnrolConfirm('<?php echo $option?>','<?php echo $row->id?>','<?php echo $Itemid?>','<?php echo $row->paid?>');"><?php echo $l->m("de_enrol"); ?></a>
65                     <?php } else { ?>
66                         &nbsp;
67                     <?php } ?>
68                 </td>
69                 <td class="<?php echo $class;?>">
70                     <?php if($row->enrol) { ?>
71                         <a href="?option=<?php echo $option?>&task=show_participants&eventid=<?php echo $row->id?>&Itemid=<?php echo $Itemid?>"><?php echo $l->m("participants"); ?></a>
72                     <?php } else { ?>
73                         &nbsp;
74                     <?php } ?>
75                 </td>
76                 <td class="<?php echo $class;?>">
77                     <?php if($row->enrolled) {?>
78                         <?php echo $pre;?><img src="administrator/images/<?php echo $img?>" width="12" height="12" alt="" border="0" /><?php echo $post;?>
79                     <?php } else { ?>
80                         &nbsp;
81                     <?php } ?>
82                 </td>
83             </tr>
84             <?php
85             $k = 1 - $k;
86         }
87         ?>
88         <tr>
89             <td class="sectiontablefooter" colspan="7" align="center" valign="middle">
90             <img src="administrator/images/publish_x.png" width="12" height="12" alt="" /> <?php echo $l->m("awaiting_payment"); ?> |
91             <img src="administrator/images/tick.png" width="12" height="12" alt="" /> <?php echo $l->m("payment_received"); ?>
92             </td>
93         </table>
94         <?php
95         HTML_MLS_events::printFooter();
96     }
97     
98     function showEvent(&$row, $option, $Itemid) {
99         global $database,$my,$l;
100         $l->setBlock("events");
101         ?>
102         <div align="center">
103         <nobr><a href="?option=<?php echo $option?>&Itemid=<?php echo $Itemid?>"><?php echo $l->m("back_to_list"); ?></a></nobr> |
104         <?php if($row->enrol) { ?>
105             <?php if(!$row->enrolled) { ?>
106                 <nobr><a href="?option=<?php echo $option?>&task=enrol&eventid=<?php echo $row->id?>&Itemid=<?php echo $Itemid?>"><?php echo $l->m("enrol"); ?></a></nobr> |
107             <?php } else { ?>
108                 <nobr><a href="#" onclick="javascript:deEnrolConfirm('<?php echo $option?>','<?php echo $row->id?>','<?php echo $Itemid?>','<?php echo $row->paid?>');"><?php echo $l->m("cancel_enrolment"); ?></a></nobr> |
109                 <?php if(!$row->paid) { ?>
110                     <nobr><a href="?option=<?php echo $option?>&task=pay&eventid=<?php echo $row->id?>&Itemid=<?php echo $Itemid?>"><?php echo $l->m("pay"); ?></a></nobr> |
111                 <?php } ?>
112             <?php } ?>
113             <nobr><a href="?option=<?php echo $option?>&task=show_participants&eventid=<?php echo $row->id?>&Itemid=<?php echo $Itemid?>"><?php echo $l->m("participants"); ?> (<?php echo $row->usercount ?> [<span style="color: #00FF00;"><?php echo $row->usercount_paid ?></span>/<span style="color: #FF0000;"><?php echo $row->usercount_unpaid ?></span>])</a></nobr> |
114         <?php } ?>
115         <nobr><a href="?option=<?php echo $option?>&task=list_comments&eventid=<?php echo $row->id?>&Itemid=<?php echo $Itemid?>"><?php echo $l->m("comments"); ?> (<?php echo $row->commentcount ?>)</a></nobr> |
116         <nobr><a href="?option=<?php echo $option?>&task=list_reviews&eventid=<?php echo $row->id?>&Itemid=<?php echo $Itemid?>"><?php echo $l->m("reviews"); ?> (<?php echo $row->reviewcount ?>)</a></nobr>
117         </div>
118        
119         <table cellpadding="5" cellspacing="0" border="0" width="100%">
120             <tr>
121                 <td colspan="5"><div class="componentheading"><?php echo $l->m("event_details"); ?></div></td>
122             </tr>
123         </table>
124        
125         <table cellpadding="3" cellspacing="1" border="0" width="100%">
126             <tr>
127                 <td colspan="2" class="sectiontableheader"><?php echo $l->m("general_information"); ?></td>
128             </tr>
129             <tr>
130                 <td class="sectiontableheader" valign="top" width="130"><?php echo $l->m("name"); ?>:</td>
131                 <td valign="top" class="sectiontableentry2"><?php echo $row->name; ?></td>
132             </tr>
133            
134             <?php if($row->wwcl_pid) { ?>
135             <tr>
136                 <td class="sectiontableheader" valign="top"><?php echo $l->m("wwcl_pid"); ?>:</td>
137                 <td valign="top" class="sectiontableentry2"><?php echo $row->wwcl_pid; ?></td>
138             </tr>
139             <?php } ?>
140             <?php if($row->ngl_pid) { ?>
141             <tr>
142                 <td class="sectiontableheader" valign="top"><?php echo $l->m("ngl_pid"); ?>:</td>
143                 <td valign="top" class="sectiontableentry2"><?php echo $row->ngl_pid; ?></td>
144             </tr>
145             <?php } ?>
146             <?php if($row->start) { ?>
147             <tr>
148                 <td class="sectiontableheader" valign="top"><?php echo $l->m("start"); ?>:</td>
149                 <td valign="top" class="sectiontableentry2"><?php echo date("l, d. F Y H:i", strtotime($row->start)); ?></td>
150             </tr>
151             <?php } ?>
152             <?php if($row->end) { ?>
153             <tr>
154                 <td class="sectiontableheader" valign="top"><?php echo $l->m("end"); ?>:</td>
155                 <td valign="top" class="sectiontableentry2"><?php echo date("l, d. F Y H:i", strtotime($row->end)); ?></td>
156             </tr>
157             <?php } ?>
158             <?php if($row->infos) { ?>
159             <tr>
160                 <td class="sectiontableheader" valign="top"><?php echo $l->m("information"); ?>:</td>
161                 <td valign="top" class="sectiontableentry2"><?php echo nl2br($row->infos); ?></td>
162             </tr>
163             <?php } ?>
164            
165             <tr>
166                 <td colspan="2">&nbsp;</td>
167             </tr>
168             <tr>
169                 <td colspan="2" class="sectiontableheader"><?php echo $l->m("location"); ?></td>
170             </tr>
171             <?php if($row->loc_journey_desc) { ?>
172             <tr>
173                 <td class="sectiontableheader" valign="top"><?php echo $l->m("journey_description"); ?>:</td>
174                 <td valign="top" class="sectiontableentry2"><?php echo nl2br($row->loc_journey_desc); ?></td>
175             </tr>
176             <?php } ?>
177             <?php if($row->loc_location_name) { ?>
178             <tr>
179                 <td class="sectiontableheader" valign="top"><?php echo $l->m("location_name"); ?>:</td>
180                 <td valign="top" class="sectiontableentry2"><?php echo $row->loc_location_name; ?></td>
181             </tr>
182             <?php } ?>
183             <?php if($row->loc_street) { ?>
184             <tr>
185                 <td class="sectiontableheader" valign="top"><?php echo $l->m("street_name"); ?>:</td>
186                 <td valign="top" class="sectiontableentry2"><?php echo $row->loc_street; ?></td>
187             </tr>
188             <?php } ?>
189             <?php if($row->loc_street_no) { ?>
190             <tr>
191                 <td class="sectiontableheader" valign="top"><?php echo $l->m("street_number"); ?>:</td>
192                 <td valign="top" class="sectiontableentry2"><?php echo $row->loc_street_no; ?></td>
193             </tr>
194             <?php } ?>
195             <?php if($row->loc_zip) { ?>
196             <tr>
197                 <td class="sectiontableheader" valign="top"><?php echo $l->m("zip"); ?>:</td>
198                 <td valign="top" class="sectiontableentry2"><?php echo $row->loc_zip; ?></td>
199             </tr>
200             <?php } ?>
201             <?php if($row->loc_city) { ?>
202             <tr>
203                 <td class="sectiontableheader" valign="top"><?php echo $l->m("city"); ?>:</td>
204                 <td valign="top" class="sectiontableentry2"><?php echo $row->loc_city; ?></td>
205             </tr>
206             <?php } ?>
207             <?php if($row->loc_country) { ?>
208             <tr>
209                 <td class="sectiontableheader" valign="top"><?php echo $l->m("country"); ?>:</td>
210                 <td valign="top" class="sectiontableentry2"><?php echo $row->loc_country; ?></td>
211             </tr>
212             <?php } ?>
213             <?php if($row->loc_parking_space) { ?>
214             <tr>
215                 <td class="sectiontableheader" valign="top"><?php echo $l->m("parking_space"); ?>:</td>
216                 <td valign="top" class="sectiontableentry2"><?php echo $row->loc_parking_space; ?></td>
217             </tr>
218             <?php } ?>
219            
220             <tr>
221                 <td colspan="2">&nbsp;</td>
222             </tr>
223             <tr>
224                 <td colspan="2" class="sectiontableheader"><?php echo $l->m("financial"); ?><a name="financial">&nbsp;</a></td>
225             </tr>
226             <?php if($row->price_advance_sale > 0) { ?>
227             <tr>
228                 <td class="sectiontableheader" valign="top"><?php echo $l->m("price_advance"); ?>:</td>
229                 <td valign="top" class="sectiontableentry2"><?php echo $row->price_advance_sale; ?></td>
230             </tr>
231             <?php } ?>
232             <?php if($row->price_direct_sale > 0) { ?>
233             <tr>
234                 <td class="sectiontableheader" valign="top"><?php echo $l->m("price_direct"); ?>:</td>
235                 <td valign="top" class="sectiontableentry2"><?php echo $row->price_direct_sale; ?></td>
236             </tr>
237             <?php } ?>
238             <?php if($row->price_payment_instructions) { ?>
239             <tr>
240                 <td class="sectiontableheader" valign="top"><?php echo $l->m("payment_instructions"); ?>:</td>
241                 <td valign="top" class="sectiontableentry2"><?php echo $row->price_payment_instructions; ?></td>
242             </tr>
243             <?php } ?>
244            
245             <tr>
246                 <td colspan="2">&nbsp;</td>
247             </tr>
248             <tr>
249                 <td colspan="2" class="sectiontableheader"><?php echo $l->m("participants_title"); ?></td>
250             </tr>
251             <?php if($row->participants_number) { ?>
252             <tr>
253                 <td class="sectiontableheader" valign="top"><?php echo $l->m("number_of_participants"); ?>:</td>
254                 <td valign="top" class="sectiontableentry2"><?php echo $row->participants_number; ?></td>
255             </tr>
256             <?php } ?>
257             <?php if($row->participants_visitors) { ?>
258             <tr>
259                 <td class="sectiontableheader" valign="top"><?php echo $l->m("visitors_info"); ?>:</td>
260                 <td valign="top" class="sectiontableentry2"><?php echo $row->participants_visitors; ?></td>
261             </tr>
262             <?php } ?>
263             <tr>
264                 <td class="sectiontableheader" valign="top"><?php echo $l->m("minimum_age"); ?>:</td>
265                 <td valign="top" class="sectiontableentry2"><?php echo $row->participants_min_age ? $row->participants_min_age.' '.$l->m("years") : $l->m("not_defined"); ?></td>
266             </tr>
267            
268             <tr>
269                 <td colspan="2">&nbsp;</td>
270             </tr>
271             <tr>
272                 <td colspan="2" class="sectiontableheader"><?php echo $l->m("features"); ?></td>
273             </tr>
274             <tr>
275                 <td class="sectiontableheader" valign="top"><?php echo $l->m("smokers_section"); ?>:</td>
276                 <td valign="top" class="sectiontableentry2"><?php echo $row->features_smokers_section ? $l->m("yes","general") : $l->m("no","general"); ?></td>
277             </tr>
278            
279             <?php if($row->features_network) { ?>
280             <tr>
281                 <td class="sectiontableheader" valign="top"><?php echo $l->m("network_description"); ?>:</td>
282                 <td valign="top" class="sectiontableentry2"><?php echo nl2br($row->features_network); ?></td>
283             </tr>
284             <?php } ?>
285             <?php if($row->features_internet) { ?>
286             <tr>
287                 <td class="sectiontableheader" valign="top"><?php echo $l->m("internet_connection"); ?>:</td>
288                 <td valign="top" class="sectiontableentry2"><?php echo nl2br($row->features_internet); ?></td>
289             </tr>
290             <?php } ?>
291            
292             <tr>
293                 <td colspan="2">&nbsp;</td>
294             </tr>
295             <tr>
296                 <td colspan="2" class="sectiontableheader"><?php echo $l->m("contact"); ?></td>
297             </tr>
298             <?php if($row->contact_icq) { ?>
299             <tr>
300                 <td class="sectiontableheader" valign="top"><?php echo $l->m("contact_icq"); ?>:</td>
301                 <td valign="top" class="sectiontableentry2"><?php echo $row->contact_icq; ?></td>
302             </tr>
303             <?php } ?>
304             <?php if($row->contact_irc) { ?>
305             <tr>
306                 <td class="sectiontableheader" valign="top"><?php echo $l->m("contact_irc"); ?>:</td>
307                 <td valign="top" class="sectiontableentry2"><?php echo $row->contact_irc; ?></td>
308             <tr>
309             <?php } ?>
310             <?php if($row->contact_mail) { ?>
311             <tr>
312                 <td class="sectiontableheader" valign="top"><?php echo $l->m("contact_email"); ?>:</td>
313                 <td valign="top" class="sectiontableentry2"><?php echo $row->contact_mail; ?></td>
314             <tr>
315             <?php } ?>
316         </table>
317         <?php
318         HTML_MLS_events::printFooter();
319     }
320     
321     function listReviews(&$rows,$event,$unpub, $option,$Itemid) {
322         global $database,$my,$mainframe,$l, $acl;
323         $l->setBlock("reviews");
324         ?>
325         <div align="center">
326         <a href="?option=<?php echo $option?>&Itemid=<?php echo $Itemid?>&task=details&eventid=<?php echo $event->id?>"><?php echo $l->m("back_to_details"); ?></a> |
327         <a href="?option=<?php echo $option?>&Itemid=<?php echo $Itemid?>&task=write_review&eventid=<?php echo $event->id?>"><?php echo $l->m("write_review"); ?></a>
328         </div>
329         <table cellpadding="5" cellspacing="0" border="0" width="100%">
330             <tr>
331                 <td><div class="componentheading"><?php echo $l->m("event_reviews"); ?>' '<?php echo $event->name?>'</div></td>
332             </tr>
333             <tr>
334                 <td><?php echo $l->m("num_unpublished_reviews"); ?>: <?php echo $unpub; ?></td>
335             </tr>
336         </table>
337        
338        
339         <table cellpadding="3" cellspacing="1" border="0" width="100%">
340             <tr>
341                 <td class="sectiontableheader"><?php echo $l->m("author"); ?>:</td>
342                 <td class="sectiontableheader"><?php echo $l->m("title"); ?>:</td>
343                 <td class="sectiontableheader" width="15%"><?php echo $l->m("written"); ?>:</td>
344             </tr>
345             <?php
346             $k = 0;
347             for($i = 0, $n = count($rows); $i < $n; $i++) {
348                 $row = $rows[$i];
349                 $grp $acl->getAroGroup( $my->id );
350                 $backend = $acl->is_group_child_of(intval($grp->group_id),"Public Backend");
351                 $pub = $grp->name == "Publisher" ? 1 : 0;
352                 if($row->published || (!$row->published && ($backend || $pub) )) {
353                     if(!$row->published) {
354                         $row->title .= " (".$l->m("unpublished","general").")";
355                     }
356                     $y = $k + 1;
357                     $class = "sectiontableentry" . $y;
358                     ?>
359                     <tr>
360                         <td class="<?php echo $class;?>"><?php echo $row->username; ?></td>
361                         <td class="<?php echo $class;?>"><a href="<?php echo "?option=".$option."&task=read_review&id=".$row->id."&Itemid=".$Itemid; ?>"><?php echo $row->title; ?></a></td>
362                         <td class="<?php echo $class;?>" width="15%" nowrap="nowrap"><?php echo mosFormatDate( $row->time,"%a, %d.%m.%Y %H:%M" ); ?></td>
363                     </tr>
364                     <?php
365                     $k = 1 - $k;
366                 }
367             }
368             ?>
369         </table>
370         <?php
371         HTML_MLS_events::printFooter();
372     }
373     
374     function editReview(&$row, $event, $option, $Itemid) {
375         global $database, $my, $mainframe, $l, $gid;
376         
377         $l->setBlock("reviews");
378         ?>
379         <div align="center">
380         <a href="?option=<?php echo $option?>&Itemid=<?php echo $Itemid?>&task=list_reviews&eventid=<?php echo $event->id;?>"><?php echo $l->m("back","general"); ?></a>
381         </div>
382        
383         <form action="index.php" method="POST" name="adminForm" id="adminForm">
384         <table cellpadding="4" cellspacing="0" border="0" width="100%">
385             <tr>
386                 <td><div class="componentheading"><?php echo $row->id ? $l->m("edit_event_review") : $l->m("add_event_review");?>: '<?php echo $event->name?>'</div></td>
387             </tr>
388             <tr>
389                 <td align="right">
390                 <div style="float: right;">
391                 <?php
392                 mosToolBar::startTable();
393                 mosToolBar::spacer();
394                 mosToolBar::save('save_review');
395                 mosToolBar::cancel('list_reviews');
396                 mosToolBar::endtable();
397                 ?>
398                 </div>
399                 </td>
400             </tr>
401         </table>
402        
403         <table cellpadding="3" cellspacing="1" border="0">
404             <tr>
405                 <td class="sectiontableentry2" valign="top"><?php echo $l->m("title"); ?>:<br>
406                 <input type="text" class="inputbox" name="title" value="<?php echo $row->title; ?>" size="70" maxlength="255" /></td>
407             </tr>
408             <tr>
409                 <td class="sectiontableentry2" valign="top"><?php echo $l->m("text_html_allowed"); ?>:<br>
410                 <?php // parameters : areaname, content, hidden field, width, height, rows, cols
411                 editorArea( 'editor2'$row->text , 'text', '100%;', '350', '75', '20' ) ; ?></td>
412             </tr>
413         </table>
414         <input type="hidden" name="option" value="<?php echo $option; ?>" />
415         <input type="hidden" name="task" value="" />
416         <input type="hidden" name="Itemid" value="<?php echo $Itemid;?>" />
417         <input type="hidden" name="userid" value="<?php echo $row->userid; ?>" />
418         <input type="hidden" name="eventid" value="<?php echo $row->eventid; ?>" />
419         <input type="hidden" name="id" value="<?php echo $row->id; ?>" />
420         <input type="hidden" name="time" value="<?php echo $row->time; ?>" />
421         <input type="hidden" name="published" value="<?php echo $row->published; ?>" />
422         </form>
423        
424         <?php
425         HTML_MLS_events::printFooter();
426     }
427     
428     function showParticipants(&$rows,$fields, $event,$link,$pageNav,$search,$option,$Itemid) {
429         global $database,$my,$mainframe,$l;
430         $l->setBlock("participants");
431         ?>
432         <div align="center">
433         <a href="?option=<?php echo $option?>&Itemid=<?php echo $Itemid?>"><?php echo $l->m("back_to_list"); ?></a> |
434         <a href="?option=<?php echo $option?>&Itemid=<?php echo $Itemid?>&task=details&eventid=<?php echo $event->id?>"><?php echo $l->m("back_to_details"); ?></a>
435         </div>
436         <form method="POST" action="<?php echo $link?>">
437         <table cellpadding="5" cellspacing="0" border="0" width="100%">
438             <tr>
439                 <td colspan="5"><div class="componentheading"><?php echo $l->m("event_participants"); ?> '<?php echo $event->name?>'</div></td>
440             </tr>
441            
442             <tr>
443                 <td align="left" width="90%">&nbsp;</td>
444                 <td align="right" width="50"><nobr><?php echo $l->m("num_display","general"); ?></nobr></td>
445                 <td align="right" width="40"> <?php echo $pageNav->writeLimitBox($link); ?> </td>
446                 <td align="right" width="60" nowrap="nowrap"><?php echo $l->m("search","general"); ?>:</td>
447                 <td align="right" width="150"><input type="text" size="20" name="search" value="<?php echo $search;?>" class="inputbox" /></td>
448             </tr>
449         </table>
450         </form>
451        
452         <table cellpadding="3" cellspacing="1" border="0" width="100%">
453         <!--
454             <tr>
455                 <td class="sectiontableheader" width="20" align="center">#</td>
456                 <td class="sectiontableheader"><?php echo $l->m("name"); ?>:</td>
457                 <td class="sectiontableheader" width="125"><?php echo $l->m("subscribed"); ?>:</td>
458                 <td class="sectiontableheader" width="50" style="text-align: center"><?php echo $l->m("paid"); ?>:</td>
459                 <td class="sectiontableheader" width="60" style="text-align: center"><?php echo $l->m("checkin"); ?>:</td>
460                 <td class="sectiontableheader" width="60" style="text-align: center"><?php echo $l->m("checkout"); ?>:</td>
461             </tr> -->
462             <tr>
463                 <td class="sectiontableheader" width="20" align="center">#</td>
464                 <?php
465                 foreach($fields["fields"] AS $fieldname) {
466                     ?>
467                     <td class="sectiontableheader" style="white-space: nowrap;"><?php echo $fields["titles"][$fieldname]; ?>:</td>
468                     <?php
469                 }
470                 ?>
471             </tr>
472         <?php
473         $k = 0;
474         for($i = 0, $n = count($rows); $i < $n; $i++) {
475             $row = $rows[$i];
476             $img_mylansite_paid = $row->paid ? 'tick.png' : 'publish_x.png';
477             $img_mylansite_checked_in = $row->mylansite_checked_in ? 'tick.png' : 'publish_x.png';
478             $img_mylansite_checked_out = $row->mylansite_checked_out ? 'tick.png' : 'publish_x.png';
479             $y = $k + 1;
480             $class = "sectiontableentry" . $y;
481             ?>
482             <!-- <tr>
483                 <td class="<?php echo $class;?>" width="20" align="center"><?php echo $i + $pageNav->limitstart + 1; ?></td>
484                 <td class="<?php echo $class;?>"><?php echo $row->joomla_username; ?></td>
485                 <td class="<?php echo $class;?>" width="125"><nobr><?php echo date("D, d.m.Y H:i", strtotime($row->subscribed_time)); ?></nobr></td>
486                 <td class="<?php echo $class;?>" width="50" style="text-align: center"><img src="administrator/images/<?php echo $img_paid;?>" width="12" height="12" border="0" alt="" /></td>
487                 <td class="<?php echo $class;?>" width="60" style="text-align: center"><img src="administrator/images/<?php echo $img_in;?>" width="12" height="12" border="0" alt="" /></td>
488                 <td class="<?php echo $class;?>" width="60" style="text-align: center"><img src="administrator/images/<?php echo $img_out;?>" width="12" height="12" border="0" alt="" /></td>
489             </tr> -->
490             <tr>
491                 <td class="<?php echo $class;?>" width="20" align="center"><?php echo $i + $pageNav->limitstart + 1; ?></td>
492                 <?php
493                 foreach($fields["fields"] AS $fieldname) {
494                     if(eregi("checked_in",$fieldname) || eregi("checked_out",$fieldname) || eregi("paid",$fieldname)) {
495                         $imgname = "img_".$fieldname;
496                         ?>
497                         <td class="<?php echo $class;?>" width="60" style="text-align: center"><img src="administrator/images/<?php echo $$imgname;?>" width="12" height="12" border="0" alt="" /></td>
498                         <?php
499                     } else {
500                         ?>
501                         <td class="<?php echo $class;?>"><?php echo $row->$fieldname; ?></td>
502                         <?php
503                     }
504                 }
505                 ?>
506             </tr>
507             <?php
508             $k = 1 - $k;
509         }
510         ?>
511             <tr>
512                 <td colspan="6">&nbsp;</td>
513             </tr>
514             <tr>
515                 <td align="center" colspan="6" class="sectiontablefooter"><?php echo $pageNav->writePagesLinks($link); ?></td>
516             </tr>
517             <tr>
518                 <td align="center" colspan="6" class="sectiontablefooter"><?php echo $pageNav->writePagesCounter(); ?></td>
519             </tr>
520         </table>
521         <?php
522         HTML_MLS_events::printFooter();
523     }
524     
525     function readReview(&$row, $event, $option, $Itemid) {
526         global $database, $my, $l, $acl;
527         $l->setBlock("reviews");
528         $grp $acl->getAroGroup( $my->id );
529         $backend = $acl->is_group_child_of(intval($grp->group_id),"Public Backend");
530         $pub = $grp->name == "Publisher" ? 1 : 0;
531         if($row->published || (!$row->published && ($backend || $pub) )) {
532         ?>
533         <div align="center">
534             <a href="?option=<?php echo $option?>&Itemid=<?php echo $Itemid?>&task=list_reviews&eventid=<?php echo $event->id?>"><?php echo $l->m("back","general"); ?></a>
535         </div>
536         <table cellpadding="0" cellspacing="1" border="0" width="100%">
537             <tr>
538                 <td><div class="componentheading"><?php echo $l->m("event_reviews"); ?> '<?php echo $event->name?>': <?php echo $row->title;?></div></td>
539             </tr>
540         </table>
541         <table cellpadding="3" cellspacing="1" border="0" width="100%">
542             <tr>
543                 <td width="70%" align="left" valign="top">
544                 <span class="small"><?php echo $l->m("written_by"); ?> <?php echo $row->username?> (<?php echo $row->realname?>)</span>
545                 </td>
546             </tr>
547             <tr>
548                 <td valign="top" colspan="2">
549                 <span class="createdate"><?php echo date("l, d. F Y H:i", strtotime($row->time)); ?></span><br>
550                 </td>
551             </tr>
552         </table>
553         <span style="text-align: left"><?php echo $row->text; ?></span>
554         <?php
555         }
556         HTML_MLS_events::printFooter();
557     }
558     
559     function listComments(&$rows, $e, $option, $Itemid) {
560         global $database, $my, $l, $task;
561         $l->setBlock("comments");
562         ?>
563         <div align="center">
564             <a href="?option=<?php echo $option?>&Itemid=<?php echo $Itemid?>&task=details&eventid=<?php echo $e->id?>"><?php echo $l->m("back_to_details"); ?></a>
565         </div>
566         <table cellpadding="5" cellspacing="0" border="0" width="100%">
567             <tr>
568                 <td><div class="componentheading"><?php echo $l->m("event_comments"); ?>: <?php echo $e->name; ?></div></td>
569             </tr>
570         </table>
571         <form method="POST" action="index.php">
572         <table cellpadding="3" cellspacing="1" width="100%" border="0">
573         <?php
574         $num = count($rows);
575         for($i = 0, $n = count($rows); $i < $n; $i++) {
576             $row = $rows[$i];
577             ?>
578             <tr>
579                 <td class="sectiontableheader" colspan="2"><?php echo date("l, d. F Y H:i", strtotime($row->time)); ?></td>
580             </tr>
581             <tr>
582                 <td width="20" align="center" class="sectiontableheader">#<?php echo $num;?></td>
583                 <td class="sectiontableheader"><?php echo $row->username;?></td>
584             </tr>
585             <tr>
586                 <td class="sectiontableentry2" colspan="2"><?php echo nl2br(htmlspecialchars($row->text)); ?></td>
587             </tr>
588             <tr>
589                 <td colspan="2">&nbsp;</td>
590             </tr>
591             <?php
592             $num--;
593         }
594         
595         if($my->id) {
596             ?>
597             <tr>
598                 <td class="sectiontableheader" colspan="2"><?php echo $l->m("add_event_comment"); ?></td>
599             </tr>
600             <tr>
601                 <td class="sectiontableentry2" colspan="2"><textarea class="inputbox" name="text" rows="5" cols="60"></textarea><br>
602                 <input type="submit" class="button" name="save_comment" value="<?php echo $l->m("save","general"); ?>" />
603                 </td>
604             </tr>
605             <?php
606         }
607         ?>
608         </table>
609         <input type="hidden" name="userid" value="<?php echo $my->id;?>" />
610         <input type="hidden" name="option" value="<?php echo $option;?>" />
611         <input type="hidden" name="Itemid" value="<?php echo $Itemid;?>" />
612         <input type="hidden" name="task" value="<?php echo $task;?>" />
613         <input type="hidden" name="eventid" value="<?php echo $e->id;?>" />
614         </form>
615         <?php
616         HTML_MLS_events::printFooter();
617     }
618     
619     function payEvent($event, $packages_event, $packages_general, $option, $Itemid) {
620         global $option, $l, $my, $cnf_mls_pp;
621         $l->setBlock("pay");
622         ?>
623         <div align="center">
624             <a href="?option=<?php echo $option?>&Itemid=<?php echo $Itemid?>"><?php echo $l->m("back_to_list"); ?></a> |
625             <a href="?option=<?php echo $option?>&Itemid=<?php echo $Itemid?>&task=details&eventid=<?php echo $event->id?>"><?php echo $l->m("back_to_details"); ?></a>
626         </div>
627         <table cellpadding="5" cellspacing="0" border="0" width="100%">
628             <tr>
629                 <td><div class="componentheading"><?php echo $l->m("pay_for_event"); ?>: <?php echo $event->name; ?></div></td>
630             </tr>
631         </table>
632         <table cellpadding="3" cellspacing="1" width="100%" border="0">
633             <?php if($event->price_payment_instructions) { ?>
634                 <tr>
635                     <td colspan="4"><h3><?php echo $l->m("payment_instructions","events"); ?></h3></h4>
636                 </tr>
637                 <tr>
638                     <td colspan="4" class="sectiontableentry1" width="160" colspan="2"><?php echo nl2br($event->price_payment_instructions) ;?></td>
639                 </tr>
640                 <tr>
641                     <td colspan="4">&nbsp;</td>
642                 </tr>
643             <?php } ?>
644             <tr>
645                 <td class="sectiontableentry1" width="160" colspan="2"><strong><?php echo $l->m("price_advance","events"); ?></strong><br />event_<?php echo $event->id;?>_<?php echo $my->id;?></td>
646                 <td class="sectiontableentry1" style="text-align: right;"><nobr><?php echo $event->price_advance_sale; ?> <?php echo $event->price_currency; ?></nobr></td>
647                 <td class="sectiontableentry1" width="50" style="text-align: center;"><?php if($cnf_mls_pp["enabled"] && $cnf_mls_pp["enabled_events"] && $my->id) HTML_MLS_events::showPayPalButton($event->name, 'event_'.$event->id.'_'.$my->id, $event->price_advance_sale, $event->price_currency, $event->loc_country); ?></td>
648             </tr>
649             <tr>
650                 <td colspan="4">&nbsp;</td>
651             </tr>
652             <tr>
653                 <td colspan="4"><h3><?php echo $l->m("packages_for_this_event"); ?></h3></h4>
654             </tr>
655             <?php
656             $k = 0;
657             for($i = 0; $i < count($packages_event); $i ++) {
658                 $row = $packages_event[$i];
659                 $class = $k ? "sectiontableentry2" : "sectiontableentry1";
660                 ?>
661                 <tr>
662                     <td class="<?php echo $class;?>" width="160"><strong><?php echo $row->name; ?></strong><br /><?php echo $row->code;?></td>
663                     <td class="<?php echo $class;?>"><?php echo nl2br($row->description); ?></td>
664                     <td class="<?php echo $class;?>" style="text-align: right;"><nobr><?php echo $row->price; ?> <?php echo $row->currency; ?></nobr></td>
665                     <td class="<?php echo $class;?>" width="50" style="text-align: center;"><?php if($cnf_mls_pp["enabled"] && $cnf_mls_pp["enabled_packages"] && $my->id) HTML_MLS_events::showPayPalButton($row->name, 'package_'.$row->id.'_'.$my->id, $row->price, $row->currency, $event->loc_country); ?></td>
666                 </tr>
667                 <?php if($row->timeid) { ?>
668                     <tr>
669                         <td class="<?php echo $class;?>">&nbsp;</td>
670                         <td class="<?php echo $class;?>"><strong><?php echo $l->m("arrival"); ?></strong>: <?php echo  date("D d. M H:i",strtotime($row->start)); ?><br />
671                         <strong><?php echo $l->m("departure"); ?></strong>: <?php echo  date("D d. M H:i",strtotime($row->end)); ?></td>
672                         <td class="<?php echo $class;?>">&nbsp;</td>
673                         <td class="<?php echo $class;?>">&nbsp;</td>
674                     </tr>
675                     <?php
676                 }
677                 $k = 1 - $k;
678             }
679             ?>
680             <tr>
681                 <td colspan="4">&nbsp;</td>
682             </tr>
683             <tr>
684                 <td colspan="4"><h3><?php echo $l->m("general_packages"); ?></h3></h4>
685             </tr>
686             <?php
687             $k = 0;
688             for($i = 0; $i < count($packages_general); $i ++) {
689                 $row = $packages_general[$i];
690                 $class = $k ? "sectiontableentry2" : "sectiontableentry1";
691                 ?>
692                 <tr>
693                     <td class="<?php echo $class;?>" width="160"><strong><?php echo $row->name; ?></strong><br /><?php echo $row->code;?></td>
694                     <td class="<?php echo $class;?>"><?php echo  nl2br($row->description); ?></td>
695                     <td class="<?php echo $class;?>" style="text-align: right;"><nobr><?php echo $row->price; ?> <?php echo $row->currency; ?></nobr></td>
696                     <td class="<?php echo $class;?>" width="50" style="text-align: center;"><?php if($cnf_mls_pp["enabled"] && $cnf_mls_pp["enabled_packages"] && $my->id) HTML_MLS_events::showPayPalButton($row->name, 'package_'.$row->id.'_'.$my->id, $row->price, $row->currency, $event->loc_country); ?></td>
697                 </tr>
698                 <tr>
699                     <td class="<?php echo $class;?>">&nbsp;</td>
700                     <td class="<?php echo $class;?>">
701                     <?php if($row->type == 1) { ?>
702                         <?php echo $row->eventamount; ?> <?php echo $l->m("upcoming_events"); ?>
703                     <?php } elseif($row->type == 2) { ?>
704                         <?php echo $l->m("membership_for"); ?> <?php echo $row->timeamount; ?> <?php echo $l->m($row->timetype); ?>
705                     <?php } ?>
706                     </td>
707                     <td class="<?php echo $class;?>">&nbsp;</td>
708                     <td class="<?php echo $class;?>">&nbsp;</td>
709                 </tr>
710                 <?php
711                 $k = 1 - $k;
712             }
713             ?>
714         </table>
715         <?php
716         HTML_MLS_events::printFooter();
717     }
718     
719     function showCouponForm( $event, $option, $Itemid ) {
720         global $l;
721         $l->setBlock("coupons");
722         ?>
723         <div align="center">
724             <a href="?option=<?php echo $option?>&Itemid=<?php echo $Itemid?>"><?php echo $l->m("back_to_list"); ?></a> |
725             <a href="?option=<?php echo $option?>&Itemid=<?php echo $Itemid?>&task=details&eventid=<?php echo $event->id?>"><?php echo $l->m("back_to_details"); ?></a>
726         </div>
727         <table cellpadding="5" cellspacing="0" border="0" width="100%">
728             <tr>
729                 <td><div class="componentheading"><?php echo $l->m("enter_coupon"); ?>: <?php echo $event->name; ?></div></td>
730             </tr>
731         </table>
732        
733         <form action="index.php" method="POST" name="couponForm">
734         <table cellpadding="3" cellspacing="1" width="100%" border="0">
735             <tr>
736                 <td class="sectiontableheader" colspan="2"><?php echo $l->m("coupon_info"); ?></h4>
737             </tr>
738             <tr>
739                 <td class="sectiontableheader" valign="top" width="130"><?php echo $l->m("code"); ?>:</td>
740                 <td valign="top" class="sectiontableentry2">
741                     <input type="text" class="text_area" name="couponcode" size="20" maxlength="50" />
742                 </td>
743             </tr>
744             <tr>
745                 <td>&nbsp;</td>
746                 <td>
747                     <input type="submit" class="button" name="submit" value="<?php echo $l->m("enrol","events"); ?>" />
748                 </td>
749             </tr>
750         </table>
751         <input type="hidden" name="eventid" value="<?php echo $event->id; ?>" />
752         <input type="hidden" name="option" value="<?php echo $option; ?>" />
753         <input type="hidden" name="Itemid" value="<?php echo $Itemid; ?>" />
754         <input type="hidden" name="task" value="enrol_coupon" />
755         </form>
756         <?php
757         HTML_MLS_events::printFooter();
758     }
759     
760     function showPayPalButton($item_name, $item_number, $amount, $currency_code, $lc) {
761         global $cnf_mls_pp;
762         $ret = "<form action=\"https://".$cnf_mls_pp["validation_url"]."/cgi-bin/webscr\" method=\"POST\">\n";
763         $ret .= "<input type=\"hidden\" name=\"cmd\" value=\"_xclick\">\n";
764         $ret .= "<input type=\"hidden\" name=\"business\" value=\"".$cnf_mls_pp["recipient_email"]."\">\n";
765         $ret .= "<input type=\"hidden\" name=\"item_name\" value=\"".$item_name."\">\n";
766         $ret .= "<input type=\"hidden\" name=\"item_number\" value=\"".$item_number."\">\n";
767         $ret .= "<input type=\"hidden\" name=\"amount\" value=\"".$amount."\">\n";
768         $ret .= "<input type=\"hidden\" name=\"no_note\" value=\"1\">\n";
769         $ret .= "<input type=\"hidden\" name=\"currency_code\" value=\"".$currency_code."\">\n";
770         $ret .= "<input type=\"hidden\" name=\"lc\" value=\"".$lc."\">\n";
771         $ret .= "<input type=\"image\" src=\"".$cnf_mls_pp["button_url"]."\" border=\"0\" name=\"submit\" alt=\"Make payments with PayPal - it's fast, free and secure!\">\n";
772         $ret .= "</form>\n";
773         
774         echo $ret;
775     }
776     
777     function printFooter() {
778         global $option, $mosConfig_absolute_path, $database;
779         $versionTable = "#__" . substr($option,4) . "_version";
780         $database->setQuery( "SELECT `version`,`date` FROM `".$versionTable."` LIMIT 1" );
781         $database->loadObject($currentVersion);
782         ?>
783         <table width="100%" border="0" align="center">
784             <tr>
785                 <td height="20">&nbsp;</td>
786             </tr>
787             <tr>
788                 <td style="text-align: center; color: #ABABAB;">
789                 <a href="http://www.mylansite.org/" target="_top">myLANsite Events Component for Joomla <?php echo $currentVersion->version;?></a> (com_mls_events)<br>
790                 &copy; 2005 - 2007 Samuel Suter &lt;<a href="mailto:samuel.suter@mylansite.org">samuel.suter@mylansite.org</a>&gt;<br>
791                 This is Free Software released under the GNU/GPL License.
792                  </td>
793              </tr>
794          </table>
795          <?php
796      }
797 };
798 ?>
Note: See TracBrowser for help on using the browser.