Differences From Artifact [add9991889]:

To Artifact [068c042ff2]:


310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
        if ($field == 'id' || $field == 'code_postal')
            $where = 'WHERE '.$field.' = \''.$db->escapeString($query).'\'';
        else
            $where = 'WHERE '.$field.' LIKE \'%'.$db->escapeString($query).'%\'';

        return $db->simpleStatementFetch(
            'SELECT id, id_categorie, nom, email, code_postal, ville, strftime(\'%s\', date_cotisation) AS date_cotisation FROM membres '.$where.'
                ORDER BY transliterate_to_ascii(nom) LIMIT 100;',
            SQLITE3_ASSOC
        );
    }

    public function listByCategory($cat = 0, $page = 1)
    {
        $begin = ($page - 1) * self::ITEMS_PER_PAGE;

        $db = Garradin_DB::getInstance();

        if (is_int($cat) && $cat)
            $where = 'WHERE id_categorie = '.(int)$cat;
        elseif (is_array($cat))
            $where = 'WHERE id_categorie IN ('.implode(',', $cat).')';
        else
            $where = '';

        return $db->simpleStatementFetch(
            'SELECT id, id_categorie, nom, email, code_postal, ville, strftime(\'%s\', date_cotisation) AS date_cotisation FROM membres '.$where.'
                ORDER BY transliterate_to_ascii(nom) LIMIT ?, ?;',
            SQLITE3_ASSOC,
            $begin,
            self::ITEMS_PER_PAGE
        );
    }

    public function countByCategory($cat = 0)







|



















|







310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
        if ($field == 'id' || $field == 'code_postal')
            $where = 'WHERE '.$field.' = \''.$db->escapeString($query).'\'';
        else
            $where = 'WHERE '.$field.' LIKE \'%'.$db->escapeString($query).'%\'';

        return $db->simpleStatementFetch(
            'SELECT id, id_categorie, nom, email, code_postal, ville, strftime(\'%s\', date_cotisation) AS date_cotisation FROM membres '.$where.'
                ORDER BY transliterate_to_ascii(nom) COLLATE NOCASE LIMIT 100;',
            SQLITE3_ASSOC
        );
    }

    public function listByCategory($cat = 0, $page = 1)
    {
        $begin = ($page - 1) * self::ITEMS_PER_PAGE;

        $db = Garradin_DB::getInstance();

        if (is_int($cat) && $cat)
            $where = 'WHERE id_categorie = '.(int)$cat;
        elseif (is_array($cat))
            $where = 'WHERE id_categorie IN ('.implode(',', $cat).')';
        else
            $where = '';

        return $db->simpleStatementFetch(
            'SELECT id, id_categorie, nom, email, code_postal, ville, strftime(\'%s\', date_cotisation) AS date_cotisation FROM membres '.$where.'
                ORDER BY transliterate_to_ascii(nom) COLLATE NOCASE LIMIT ?, ?;',
            SQLITE3_ASSOC,
            $begin,
            self::ITEMS_PER_PAGE
        );
    }

    public function countByCategory($cat = 0)