preparations for sef
[eventlist:eventlist.git] / views / details / tmpl / default_attendees.php
1 <h2 class="register"><?php echo JText::_( 'REGISTERED USERS' ).':'; ?></h2>
2 <?php 
3 //only set style info if users allready have registered
4 if ($this->registers) : 
5 ?>
6         <ul class="user floattext">
7 <?php endif; ?>
8
9
10 <?php
11 //loop through attendees
12 foreach ($this->registers as $register) :
13                                         
14         //if CB
15         if ($this->elsettings->comunsolution == 1) :
16
17                 $thumb_path = 'images/comprofiler/tn';
18                 $no_photo       = ' alt="'.$register->urname.'" border=0';
19         
20                 //avatars should be displayed
21                 if (($this->elsettings->comunoption == 2) && ($this->elsettings->comunoption != 0)) :
22                                                 
23                         foreach ($this->pics as $pic) :
24                                                                 
25                                 //User has avatar
26                                 if(($pic->avatar!='') && ($register->uid!='0')) :
27                                         echo "<li><a href='".JRoute::_('index.php?option=com_comprofiler&task=userProfile&user='.$register->uid )."'><img src=".$thumb_path.$pic->avatar.$no_photo." alt='no photo' /><span class='username'>".$register->urname."</span></a></li>";
28                                                                 
29                                 //User has no avatar
30                                 else :
31                                         echo "<li><a href='".JRoute::_( 'index.php?option=com_comprofiler&task=userProfile&user='.$register->uid )."'><img src=\"components/com_comprofiler/images/english/tnnophoto.jpg\" border=0 alt=\"no photo\" /><span class='username'>".$register->urname."</span></a></li>";
32                                 endif;
33                                                         
34                         endforeach;
35                         
36                 endif;
37
38         //only show the username with link to profile
39         if ($this->elsettings->comunoption == 1) :
40                 echo "<li><span class='username'><a href='".JRoute::_( 'index.php?option=com_comprofiler&amp;task=userProfile&amp;user='.$register->uid )."'>".$register->urname." </a></span></li>";
41         endif;
42                                                 
43                                                 
44 //if CB end - if not CB than only name
45 endif;
46
47 //no communitycomponent is set so only show the username
48 if (($this->elsettings->comunoption == 0) || ($this->elsettings->comunsolution == 0)) :
49         echo "<li><span class='username'>".$register->urname."</span></li>";
50 endif;
51
52 //end loop through attendees
53 endforeach;
54 ?>
55                         
56 <?php 
57 //only set style info if users allready have registered
58 if ($this->registers) : ?>
59         </ul>
60 <?php endif; ?>
61
62 <?php
63 switch ($this->formhandler) {
64         
65         case 1:
66                 echo JText::_( 'TOO LATE REGISTER' );
67         break;
68                 
69         case 2:
70                 echo JText::_( 'LOGIN' );
71         break;
72         
73         case 3:
74                 
75                 //the user is allready registered. Let's check if he can unregister from the event
76                 if ($this->row->unregistra == 0) :
77                 
78                         //no he is not allowed to unregister
79                         echo JText::_( 'ALLREADY REGISTERED' );
80                         
81                 else:
82                 
83                         //he is allowed to unregister -> display form
84                         ?>
85                         <form name="Eventlist" action="index.php" method="post">
86                         <input type="hidden" name="option" value="<?php echo $option ; ?>">
87                         <input type="hidden" name="Itemid" value="<?php echo $Itemid ; ?>">
88                         <input type="hidden" name="rdid" value="<?php echo $this->row->did ; ?>">
89                         <input type="hidden" name="<?php echo JUtility::getToken(); ?>" value="1" />
90                         <input type="hidden" name="task" value="delreguser">
91
92                         <?php echo JText::_( 'UNREGISTER BOX' ); ?>
93
94                         <input type="checkbox" name="reg_check" onClick="check(this, document.Eventlist.senden)">
95                         <br /><br />
96                         <input type="submit" name="senden" value="<?php echo JText::_( 'UNREGISTER' ); ?>" disabled>
97                         </form>
98
99                         <script language="JavaScript">
100                         function check(checkbox, senden) {
101                                 if(checkbox.checked==true){
102                                         senden.disabled = false;
103                                 } else {
104                                         senden.disabled = true;
105                                 }
106                         }
107                         </script>
108                         <?php
109                 endif;
110                 
111         break;
112         
113         case 4:
114                 
115                 //the user is not registered allready -> display registration form
116                 ?>
117                 <form name="Eventlist" action="index.php" method="post">
118                 <input type="hidden" name="option" value="<?php echo $option ; ?>">
119                 <input type="hidden" name="Itemid" value="<?php echo $Itemid ; ?>">
120                 <input type="hidden" name="rdid" value="<?php echo $this->row->did ; ?>">               
121                 <input type="hidden" name="<?php echo JUtility::getToken(); ?>" value="1" />            
122                 <input type="hidden" name="task" value="userregister">
123
124                 <?php echo JText::_( 'I WILL GO' ).':'; ?>
125
126                 <input type="checkbox" name="reg_check" onClick="check(this, document.Eventlist.senden)">
127                 <br /><br />
128                 <input type="submit" name="senden" value="<?php echo JText::_( 'REGISTER' ); ?>" disabled>
129                 </form>
130
131                 <script language="JavaScript">
132                 function check(checkbox, senden) {
133                         if(checkbox.checked==true){
134                                 senden.disabled = false;
135                         } else {
136                                 senden.disabled = true;
137                         }
138                 }
139                 </script>
140                 <?php
141         break;
142 }
143 ?>