private function build_table()
    {
        $table_model = new SQLHTMLTableModel(CalendarSetup::$calendar_events_table, 'table', array(new HTMLTableColumn(LangLoader::get_message('form.title', 'common'), 'title'), new HTMLTableColumn(LangLoader::get_message('category', 'categories-common'), 'id_category'), new HTMLTableColumn(LangLoader::get_message('author', 'common'), 'display_name'), new HTMLTableColumn(LangLoader::get_message('date', 'date-common'), 'start_date'), new HTMLTableColumn($this->lang['calendar.titles.repetition']), new HTMLTableColumn('')), new HTMLTableSortingRule('start_date', HTMLTableSortingRule::ASC));
        $table_model->set_caption($this->lang['calendar.events_list']);
        $table_model->add_permanent_filter('parent_id = 0');
        $table_model->add_filter(new HTMLTableDateTimeGreaterThanOrEqualsToSQLFilter('start_date', 'filter1', $this->lang['calendar.labels.start_date'] . ' ' . TextHelper::lowercase_first(LangLoader::get_message('minimum', 'common'))));
        $table_model->add_filter(new HTMLTableDateTimeLessThanOrEqualsToSQLFilter('start_date', 'filter2', $this->lang['calendar.labels.start_date'] . ' ' . TextHelper::lowercase_first(LangLoader::get_message('maximum', 'common'))));
        $table = new HTMLTable($table_model);
        $table->set_filters_fieldset_class_HTML();
        $results = array();
        $result = $table_model->get_sql_results('event
			LEFT JOIN ' . CalendarSetup::$calendar_events_content_table . ' event_content ON event_content.id = event.content_id
			LEFT JOIN ' . DB_TABLE_MEMBER . ' member ON member.user_id = event_content.author_id');
        foreach ($result as $row) {
            $event = new CalendarEvent();
            $event->set_properties($row);
            $category = $event->get_content()->get_category();
            $user = $event->get_content()->get_author_user();
            $edit_link = new LinkHTMLElement(CalendarUrlBuilder::edit_event(!$event->get_parent_id() ? $event->get_id() : $event->get_parent_id()), '', array('title' => LangLoader::get_message('edit', 'common')), 'fa fa-edit');
            $delete_link = new LinkHTMLElement(CalendarUrlBuilder::delete_event($event->get_id()), '', array('title' => LangLoader::get_message('delete', 'common'), 'data-confirmation' => !$event->belongs_to_a_serie() ? 'delete-element' : ''), 'fa fa-delete');
            $user_group_color = User::get_group_color($user->get_groups(), $user->get_level(), true);
            $author = $user->get_id() !== User::VISITOR_LEVEL ? new LinkHTMLElement(UserUrlBuilder::profile($user->get_id()), $user->get_display_name(), !empty($user_group_color) ? array('style' => 'color: ' . $user_group_color) : array(), UserService::get_level_class($user->get_level())) : $user->get_display_name();
            $br = new BrHTMLElement();
            $results[] = new HTMLTableRow(array(new HTMLTableRowCell(new LinkHTMLElement(CalendarUrlBuilder::display_event($category->get_id(), $category->get_rewrited_name(), $event->get_id(), $event->get_content()->get_rewrited_title()), $event->get_content()->get_title()), 'left'), new HTMLTableRowCell(new SpanHTMLElement($category->get_name(), array('style' => $category->get_id() != Category::ROOT_CATEGORY && $category->get_color() ? 'color:' . $category->get_color() : ''))), new HTMLTableRowCell($author), new HTMLTableRowCell(LangLoader::get_message('from_date', 'main') . ' ' . $event->get_start_date()->format(Date::FORMAT_DAY_MONTH_YEAR_HOUR_MINUTE) . $br->display() . LangLoader::get_message('to_date', 'main') . ' ' . $event->get_end_date()->format(Date::FORMAT_DAY_MONTH_YEAR_HOUR_MINUTE)), new HTMLTableRowCell($event->belongs_to_a_serie() ? $this->get_repeat_type_label($event) . ' - ' . $event->get_content()->get_repeat_number() . ' ' . $this->lang['calendar.labels.repeat_times'] : LangLoader::get_message('no', 'common')), new HTMLTableRowCell($edit_link->display() . $delete_link->display())));
        }
        $table->set_rows($table_model->get_number_of_matching_rows(), $results);
        $this->view->put('table', $table->display());
    }
 private function build_table()
 {
     $table = new SQLHTMLTableModel(DB_TABLE_MEMBER, __CLASS__, array(new HTMLTableColumn('pseudo', 'display_name'), new HTMLTableColumn('email'), new HTMLTableColumn('inscrit le', 'registration_date'), new HTMLTableColumn('messages'), new HTMLTableColumn('derniere connexion'), new HTMLTableColumn('messagerie')), new HTMLTableSortingRule('user_id', HTMLTableSortingRule::ASC));
     $table->set_caption('Liste des membres');
     $options = array('horn' => 'Horn', 'coucou' => 'Coucou', 'teston' => 'teston');
     $table->add_filter(new HTMLTableEqualsFromListSQLFilter('display_name', 'filter1', 'login Equals', $options));
     $table->add_filter(new HTMLTableBeginsWithTextSQLFilter('display_name', 'filter2', 'login Begins with (regex)', '`^(?!%).+$`'));
     $table->add_filter(new HTMLTableBeginsWithTextSQLFilter('display_name', 'filter3', 'login Begins with (no regex)'));
     $table->add_filter(new HTMLTableEndsWithTextSQLFilter('display_name', 'filter4', 'login Ends with (regex)', '`^(?!%).+$`'));
     $table->add_filter(new HTMLTableEndsWithTextSQLFilter('display_name', 'filter5', 'login Ends with (no regex)'));
     $table->add_filter(new HTMLTableLikeTextSQLFilter('display_name', 'filter6', 'login Like (regex)', '`^toto`'));
     $table->add_filter(new HTMLTableLikeTextSQLFilter('display_name', 'filter7', 'login Like (no regex)'));
     $table->add_filter(new HTMLTableGreaterThanSQLFilter('user_id', 'filter8', 'id >'));
     $table->add_filter(new HTMLTableGreaterThanSQLFilter('user_id', 'filter9', 'id > (lower=3)', 3));
     $table->add_filter(new HTMLTableGreaterThanSQLFilter('user_id', 'filter10', 'id > (upper=3)', HTMLTableNumberComparatorSQLFilter::NOT_BOUNDED, 3));
     $table->add_filter(new HTMLTableGreaterThanSQLFilter('user_id', 'filter11', 'id > (lower=1, upper=3)', 1, 3));
     $table->add_filter(new HTMLTableLessThanSQLFilter('user_id', 'filter12', 'id <'));
     $table->add_filter(new HTMLTableGreaterThanOrEqualsToSQLFilter('user_id', 'filter13', 'id >='));
     $table->add_filter(new HTMLTableLessThanOrEqualsToSQLFilter('user_id', 'filter14', 'id <='));
     $table->add_filter(new HTMLTableEqualsToSQLFilter('user_id', 'filter15', 'id ='));
     $html_table = new HTMLTable($table);
     $results = array();
     $result = $table->get_sql_results();
     foreach ($result as $row) {
         $results[] = new HTMLTableRow(array(new HTMLTableRowCell($row['display_name']), new HTMLTableRowCell($row['show_email'] == 1 ? '<a href="mailto:' . $row['email'] . '" class="basic-button smaller">Mail</a>' : '&nbsp;'), new HTMLTableRowCell(Date::to_format($row['registration_date'], Date::FORMAT_DAY_MONTH_YEAR_HOUR_MINUTE)), new HTMLTableRowCell(!empty($row['posted_msg']) ? $row['posted_msg'] : '0'), new HTMLTableRowCell(!empty($row['last_connection_date']) ? Date::to_format($row['last_connection_date'], Date::FORMAT_DAY_MONTH_YEAR) : LangLoader::get_message('never', 'main')), new HTMLTableRowCell('<a href="' . Url::to_rel('/user/pm.php?pm=' . $row['user_id']) . '" class="basic-button smaller">MP</a>')));
     }
     $html_table->set_rows($table->get_number_of_matching_rows(), $results);
     return $html_table;
 }