public static function showListTable($carID = null) { if (is_null($carID)) { $carID = MyCar::getDefaultCarID(); } $arList = static::getTsList($carID); if ($arList) { echo '<div id="tsList"></div><div id="tsPager"></div>'; $dateHelper = new CoreLib\DateHelper(); $imgSrcPath = CoreLib\Tools::getSitePath(CoreLib\Loader::getTemplate('icar') . "images/"); //msDebug($arList); $arDatas = array(); foreach ($arList as $list) { $arDatas[] = array('id' => $list['ID'], 'ts' => "ТО-" . $list['TS_NUM'], 'date' => $list['DATE'], 'timestamp' => "=" . $dateHelper->getDateTimestamp($list['DATE']), 'odo' => "=" . $list['ODO'], 'cost' => "=" . $list['COST'], 'executors_name' => $list['EXECUTORS_NAME'], 'point_name' => $list['POINT_NAME'], 'point_latitude' => $list['POINT_LATITUDE'], 'point_longitude' => $list['POINT_LONGITUDE'], 'yandex_map' => "<img src='https://static-maps.yandex.ru/1.x/?l=map&z=12&size=600,450&pt=" . $list['POINT_LONGITUDE'] . "," . $list['POINT_LATITUDE'] . ",pm2blm'>", 'point_type' => $list['POINT_TYPE_NAME'], 'info' => strlen($list['INFO']) > 0 ? "<img src='" . $imgSrcPath . "info.png'>" : "", 'comment' => $list['INFO'], 'edit' => "<a href='edit.php?id=" . $list['ID'] . "'><img src='" . $imgSrcPath . "edit.png'></a>", 'delete' => "<a href='delete.php?id=" . $list['ID'] . "'><img src='" . $imgSrcPath . "delete.png'></a>"); } $webixHelper = new IcarWebixHelper(); $webixHelper->addFunctionSortByTimestamp(); $arData = array('grid' => 'tsGrid', 'container' => 'tsList', 'footer' => true, 'tooltip' => true, 'pager' => array('container' => 'tsPager'), 'columns' => array($webixHelper->getColumnArray('DATE', array('footer' => '={text:"Итого:", colspan:3}')), $webixHelper->getColumnArray('TS'), $webixHelper->getColumnArray('ODO'), $webixHelper->getColumnArray('EXECUTORS'), $webixHelper->getColumnArray('COST', array('footer' => '={ content:"summColumn" }')), $webixHelper->getColumnArray('POINT'), $webixHelper->getColumnArray('INFO'), $webixHelper->getColumnArray('EDIT'), $webixHelper->getColumnArray('DELETE')), 'data' => $arDatas); return CoreLib\Webix::showDataTable($arData); } else { echo 'Нет данных о прохождении ТО'; return false; } }
<?php use MSergeev\Core\Lib; use MSergeev\Packages\Finances\Lib\Accounts; header('Content-type: text/html; charset=utf-8'); Lib\Buffer::start("page"); Lib\Webix::init(); $path = Lib\Loader::getSitePublic('finances'); ?> <!DOCTYPE html> <html> <head> <title>Семейные Финансы - <?php echo Lib\Buffer::showTitle("Главная"); ?> </title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <?php echo Lib\Buffer::showCSS(); ?> <?php echo Lib\Buffer::showJS(); ?> </head> <body> <table class="finances"> <tr> <td class="logo"><a href="<?php echo $path; ?> ">Главная</a></td>