first commit

This commit is contained in:
2025-08-02 16:30:27 +02:00
commit 23646bfcee
14851 changed files with 1750626 additions and 0 deletions

35
admin/lists/NewsList.php Normal file
View File

@@ -0,0 +1,35 @@
<?php
use KupShop\AdminBundle\AdminList\BaseList;
class NewsList extends BaseList
{
protected $tableDef = [
'id' => 'a.id',
'fields' => [
'Nadpis' => ['field' => 'a.title', 'size' => 2.5],
'Číslo' => ['field' => 'a.id', 'size' => 0.5],
'Zobrazovat novinku' => ['field' => 'a.figure', 'render' => 'renderBoolean', 'size' => 1],
'Zobrazen' => ['field' => 'a.seen', 'render' => 'renderSeen', 'size' => 0.5],
'Datum přidání' => ['field' => 'datef', 'raw_field' => 'date', 'size' => 1.5],
],
];
public function renderSeen($values, $column)
{
$value = $this->getListRowValue($values, $column['field']);
return "{$value}x";
}
public function getQuery()
{
$qb = sqlQueryBuilder()
->select('a.id', 'a.title', 'DATE_FORMAT(a.date,\''.$GLOBALS['dbcfg']['date_format'].' '.$GLOBALS['dbcfg']['time_format'].'\') AS datef', 'a.figure', 'a.type', 'a.seen')
->from('articles AS a , articles_relation AS ar')
->where('a.id=ar.id_art')
->andWhere('ar.id_branch=2');
return $qb;
}
}