PageRenderTime 19ms CodeModel.GetById 7ms app.highlight 3ms RepoModel.GetById 2ms app.codeStats 0ms

/administrator/components/com_easysocial/themes/default/events/default.php

https://gitlab.com/vnsoftdev/swc
PHP | 222 lines | 181 code | 31 blank | 10 comment | 21 complexity | 4da29740e74505117c721706a8860ccf MD5 | raw file
  1<?php
  2/**
  3* @package      EasySocial
  4* @copyright    Copyright (C) 2010 - 2014 Stack Ideas Sdn Bhd. All rights reserved.
  5* @license      GNU/GPL, see LICENSE.php
  6* EasySocial is free software. This version may have been modified pursuant
  7* to the GNU General Public License, and as distributed it includes or
  8* is derivative of works licensed under the GNU General Public License or
  9* other free or open source software licenses.
 10* See COPYRIGHT.php for copyright notices and details.
 11*/
 12defined('_JEXEC') or die('Unauthorized Access');
 13?>
 14<form action="" method="post" name="adminForm" class="esForm" id="adminForm" data-table-grid>
 15    <div class="filter-bar form-inline">
 16        <div class="form-group">
 17            <?php echo $this->html('filter.search', $search); ?>
 18        </div>
 19
 20        <?php if ($this->tmpl != 'component') { ?>
 21        <div class="form-group">
 22            <strong><?php echo JText::_('COM_EASYSOCIAL_FILTER_BY'); ?> :</strong>
 23            <div>
 24                <?php echo $this->html('filter.published', 'state', $state); ?>
 25                <select class="form-control input-sm" name="type" id="filterType" data-table-grid-filter>
 26                    <option value="all"<?php echo $type == 'all' ? ' selected="selected"' : '';?>><?php echo JText::_('COM_EASYSOCIAL_FILTER_EVENT_TYPE'); ?></option>
 27                    <option value="1"<?php echo $type == 1 ? ' selected="selected"' : '';?>><?php echo JText::_('COM_EASYSOCIAL_EVENTS_OPEN_EVENT'); ?></option>
 28                    <option value="2"<?php echo $type == 2 ? ' selected="selected"' : '';?>><?php echo JText::_('COM_EASYSOCIAL_EVENTS_CLOSED_EVENT'); ?></option>
 29                    <option value="3"<?php echo $type == 3 ? ' selected="selected"' : '';?>><?php echo JText::_('COM_EASYSOCIAL_EVENTS_INVITE_EVENT'); ?></option>
 30                </select>
 31            </div>
 32        </div>
 33        <?php } ?>
 34
 35        <div class="form-group pull-right">
 36            <div><?php echo $this->html('filter.limit', $limit); ?></div>
 37        </div>
 38    </div>
 39
 40    <table class="table table-striped table-es table-hover">
 41        <thead>
 42            <tr>
 43                <th width="1%" class="center">
 44                    <input type="checkbox" name="toggle" data-table-grid-checkall />
 45                </th>
 46
 47                <th>
 48                    <?php echo $this->html('grid.sort', 'a.title', JText::_('COM_EASYSOCIAL_TABLE_COLUMN_TITLE'), $ordering, $direction); ?>
 49                </th>
 50
 51                <?php if ($this->tmpl != 'component') { ?>
 52                <th class="center" width="15%">
 53                    <?php echo $this->html('grid.sort', 'b.title', JText::_('COM_EASYSOCIAL_TABLE_COLUMN_CATEGORY'), $ordering, $direction); ?>
 54                </th>
 55
 56                <th class="center" width="5%">
 57                    <?php echo $this->html( 'grid.sort' , 'a.featured' , JText::_('COM_EASYSOCIAL_TABLE_COLUMN_FEATURED') , $ordering , $direction ); ?>
 58                </th>
 59
 60                <th width="5%" class="center">
 61                    <?php echo $this->html('grid.sort', 'a.state', JText::_('COM_EASYSOCIAL_TABLE_COLUMN_STATUS'), $ordering, $direction); ?>
 62                </th>
 63
 64
 65                <th class="center" width="5%">
 66                    <?php echo $this->html('grid.sort', 'a.created_by', JText::_('COM_EASYSOCIAL_TABLE_COLUMN_CREATED_BY'), $ordering, $direction); ?>
 67                </th>
 68
 69                <th width="5%" class="center">
 70                    <?php echo JText::_('COM_EASYSOCIAL_TABLE_COLUMN_USERS'); ?>
 71                </th>
 72                <?php } ?>
 73
 74                <th class="center" width="10%">
 75                    <?php echo $this->html('grid.sort', 'a.created', JText::_('COM_EASYSOCIAL_TABLE_COLUMN_CREATED'), $ordering, $direction); ?>
 76                </th>
 77
 78                <th width="5%" class="center">
 79                    <?php echo $this->html('grid.sort', 'a.id', JText::_('COM_EASYSOCIAL_TABLE_COLUMN_ID'), $ordering, $direction); ?>
 80                </th>
 81        </thead>
 82        <tbody>
 83        <?php if (!empty($events)) { ?>
 84            <?php $i = 0;?>
 85            <?php foreach ($events as $event) { ?>
 86                <tr class="row<?php echo $i; ?>" data-grid-row data-id="<?php echo $event->id; ?>">
 87                    <td align="center">
 88                        <?php echo $this->html('grid.id', $i, $event->id); ?>
 89                    </td>
 90
 91                    <td>
 92                        <div class="media">
 93                            <div class="media-object pull-left">
 94                                <img src="<?php echo $event->getAvatar();?>" class="es-avatar" />
 95                            </div>
 96
 97                            <div class="media-body">
 98                                <a href="<?php echo FRoute::url(array('view' => 'events', 'layout' => 'form', 'id' => $event->id));?>" style="font-size: 16px;font-weight:700;"
 99                                    data-event-insert
100                                    data-id="<?php echo $event->id;?>"
101                                    data-avatar="<?php echo $event->getAvatar();?>"
102                                    data-title="<?php echo $this->html('string.escape', $event->getName());?>"
103                                    data-alias="<?php echo $event->getAlias();?>"
104                                    style="font-size: 16px;font-weight:700;"
105                                >
106                                    <?php echo JText::_($event->title); ?>
107                                </a>
108
109                                <p class="mt-5 mb-10 fd-small">
110                                    <?php if ($event->description){ ?>
111                                        <?php echo $this->html('string.truncater', $event->description, 180);?>
112                                    <?php } else { ?>
113                                        <?php echo JText::_('COM_EASYSOCIAL_EVENTS_NO_DESCRIPTION'); ?>
114                                    <?php } ?>
115                                </p>
116
117                                <div class="es-event-labels">
118                                    <?php if ($event->isOpen()){ ?>
119                                    <span class="label label-success" data-original-title="<?php echo FD::_('COM_EASYSOCIAL_EVENTS_OPEN_EVENT_TOOLTIP', true);?>" data-es-provide="tooltip" data-placement="top">
120                                        <i class="ies-earth"></i> <?php echo JText::_('COM_EASYSOCIAL_EVENTS_OPEN_EVENT'); ?>
121                                    </span>
122                                    <?php } ?>
123
124                                    <?php if ($event->isClosed()){ ?>
125                                    <span class="label label-danger" data-original-title="<?php echo FD::_('COM_EASYSOCIAL_EVENTS_CLOSED_EVENT_TOOLTIP', true);?>" data-es-provide="tooltip" data-placement="top">
126                                        <i class="ies-locked"></i> <?php echo JText::_('COM_EASYSOCIAL_EVENTS_CLOSED_EVENT'); ?>
127                                    </span>
128                                    <?php } ?>
129
130                                    <?php if ($event->isInviteOnly()){ ?>
131                                    <span class="label label-warning" data-original-title="<?php echo FD::_('COM_EASYSOCIAL_EVENTS_INVITE_EVENT_TOOLTIP', true);?>" data-es-provide="tooltip" data-placement="top">
132                                        <i class="ies-locked"></i> <?php echo JText::_('COM_EASYSOCIAL_EVENTS_INVITE_EVENT'); ?>
133                                    </span>
134                                    <?php } ?>
135
136                                    <?php if ($event->isOver()) { ?>
137                                    <span class="label label-warning" data-original-title="<?php echo FD::_('COM_EASYSOCIAL_EVENTS_OVER_EVENT_TOOLTIP', true);?>" data-es-provide="tooltip" data-placement="top">
138                                        <i class="ies-flag"></i> <?php echo JText::_('COM_EASYSOCIAL_EVENTS_OVER_EVENT'); ?>
139                                    </span>
140                                    <?php } ?>
141
142                                    <?php if ($event->isOngoing()) { ?>
143                                    <span class="label label-info" data-original-title="<?php echo FD::_('COM_EASYSOCIAL_EVENTS_ONGOING_EVENT_TOOLTIP', true);?>" data-es-provide="tooltip" data-placement="top">
144                                        <i class="ies-flag"></i> <?php echo JText::_('COM_EASYSOCIAL_EVENTS_ONGOING_EVENT'); ?>
145                                    </span>
146                                    <?php } ?>
147
148                                    <?php if ($event->isUpcoming()) { ?>
149                                    <span class="label label-success" data-original-title="<?php echo FD::_('COM_EASYSOCIAL_EVENTS_UPCOMING_EVENT_TOOLTIP', true);?>" data-es-provide="tooltip" data-placement="top">
150                                        <i class="ies-alarm"></i> <?php echo JText::_('COM_EASYSOCIAL_EVENTS_UPCOMING_EVENT'); ?>
151                                    </span>
152                                    <?php } ?>
153
154                                    <?php if ($event->isRecurringEvent()) { ?>
155                                    <span class="label label-warning" data-original-title="<?php echo FD::_('COM_EASYSOCIAL_EVENTS_RECURRING_EVENT_TOOLTIP', true);?>" data-es-provide="tooltip" data-placement="top">
156                                        <i class="ies-refresh"></i> <?php echo JText::_('COM_EASYSOCIAL_EVENTS_RECURRING_EVENT'); ?>
157                                    </span>
158                                    <?php } ?>
159                                </div>
160                            </div>
161                        </div>
162                    </td>
163
164                    <?php if ($this->tmpl != 'component') { ?>
165                    <td class="center">
166                        <a href="<?php echo FRoute::url(array('view' => 'events', 'layout' => 'category', 'id' => $event->category_id)); ?>" target="_blank"><?php echo JText::_($event->getCategory()->title); ?></a>
167                    </td>
168
169                    <td class="center">
170                        <?php echo $this->html('grid.featured', $event, 'events', 'featured'); ?>
171                    </td>
172
173                    <td class="center">
174                        <?php echo $this->html('grid.published', $event, 'events', 'state', array(2 => 'approve'), array(2 => 'COM_EASYSOCIAL_GRID_TOOLTIP_APPROVE_ITEM'), array(2 => 'pending')); ?>
175                    </td>
176
177                    <td class="center">
178                        <a href="<?php echo FRoute::url(array('view' => 'users', 'layout' => 'form', 'id' => $event->getCreator()->id)); ?>" target="_blank"><?php echo $event->getCreator()->getName(); ?></a>
179                    </td>
180
181                    <td class="center">
182                        <?php echo $event->getTotalGuests(); ?>
183                    </td>
184                    <?php } ?>
185
186                    <td class="center">
187                        <?php echo $event->created; ?>
188                    </td>
189
190                    <td class="center">
191                        <?php echo $event->id;?>
192                    </td>
193                </tr>
194            <?php $i++; ?>
195            <?php } ?>
196        <?php } else { ?>
197            <tr class="is-empty">
198                <td colspan="9" class="center empty">
199                    <?php echo JText::_('COM_EASYSOCIAL_EVENTS_NO_EVENT_CREATED_YET');?>
200                </td>
201            </tr>
202        <?php } ?>
203        </tbody>
204
205        <tfoot>
206            <tr>
207                <td colspan="9" class="center">
208                    <div class="footer-pagination"><?php echo $pagination->getListFooter(); ?></div>
209                </td>
210            </tr>
211        </tfoot>
212    </table>
213
214    <?php echo JHTML::_('form.token'); ?>
215    <input type="hidden" name="ordering" value="<?php echo $ordering;?>" data-table-grid-ordering />
216    <input type="hidden" name="direction" value="<?php echo $direction;?>" data-table-grid-direction />
217    <input type="hidden" name="boxchecked" value="0" data-table-grid-box-checked />
218    <input type="hidden" name="task" value="" data-table-grid-task />
219    <input type="hidden" name="option" value="com_easysocial" />
220    <input type="hidden" name="view" value="events" />
221    <input type="hidden" name="controller" value="events" />
222</form>