41 lines
1018 B
PHP
41 lines
1018 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace KupShop\SalesmanBundle\Admin;
|
|
|
|
use Query\Operator;
|
|
|
|
class Salesman extends \Window
|
|
{
|
|
protected $tableName = 'salesman';
|
|
|
|
protected $template = 'window/salesman.tpl';
|
|
|
|
public function get_vars()
|
|
{
|
|
$vars = parent::get_vars();
|
|
|
|
$pageVars = getVal('body', $vars);
|
|
if (!empty($pageVars['data']['id_photo'])) {
|
|
$photo = sqlQueryBuilder()->select('*')->from('photos', 'ph')
|
|
->andWhere(Operator::equals(['ph.id' => $pageVars['data']['id_photo']]))
|
|
->execute()->fetchAssociative();
|
|
if ($photo) {
|
|
$pageVars['data']['photo'] = getImage($photo['id'],
|
|
$photo['image_2'],
|
|
$photo['source'],
|
|
'product_catalog',
|
|
$photo['descr'],
|
|
strtotime($photo['date_update']));
|
|
}
|
|
}
|
|
|
|
$vars['body'] = $pageVars;
|
|
|
|
return $vars;
|
|
}
|
|
}
|
|
|
|
return Salesman::class;
|