public function view() { if (user::issetRight('delete')) { ui::newButton(lang::get('BTN_CLEAR_JORNAL'), 'javascript:clearJornal();'); } ui::addLeftButton('Системный журнал', 'system_view'); ui::addLeftButton('Журнал БД', 'db_view'); function getState($val) { if ($val == info) { return 'info'; } else { if ($val == error) { return 'error'; } else { if ($val == warning) { return 'warning'; } } } } function getEditUser($val, $obj) { if (user::issetRight('user_upd', 'users')) { return '<a href="' . system::au() . '/users/user_upd/' . $obj['rev_user_id'] . '" target="_blank">' . $val . '</a>'; } else { return $val; } } $count = db::q('SELECT count(rev_id) count FROM <<revue>>, <<objects>> WHERE rev_obj_id = o_id;', value); $max_count = uiTable::getMaxCount(); if (uiTable::getCurPage() != 1) { $niz = empty($start_pos) ? uiTable::getCurPage() * $max_count - $max_count : 0; $limit = ' LIMIT ' . $niz . ', ' . $max_count; } else { $limit = ' LIMIT ' . $max_count; } $mas = db::q('SELECT rev_state, rev_user, rev_user_id, rev_datetime, concat(rev_message, " <b>", o_name, "</b>") rev_msg, rev_ip FROM <<revue>>, <<objects>> WHERE rev_obj_id = o_id ORDER BY rev_datetime DESC ' . $limit, records); /* Сделать фильтры: - важность - пользователь - тип данных - периуд времени - IP */ $table = new uiTable($mas, $count); $table->addColumn('rev_state', 'Важность', 0, false, false, 'getState'); $table->addColumn('rev_user', 'Пользователь', 0, false, false, 'getEditUser'); $table->addColumn('rev_msg', 'Действие', 400); $table->addColumn('rev_datetime', 'Дата / Время', 0, false, false, 'viewDateTime2'); $table->addColumn('rev_ip', 'IP'); $table->emptyText('В журнале нет записей!'); return $table->getHTML(); }
public function __construct() { ui::checkClasses('handbook'); ui::addLeftButton(lang::right('list'), 'list'); ui::addLeftButton(lang::right('state'), 'state'); ui::addLeftButton(lang::right('delivery'), 'delivery'); ui::addLeftButton(lang::right('payment'), 'payment'); }
public function view() { if (user::issetRight('delete')) { ui::newButton(lang::get('BTN_CLEAR_JORNAL'), 'javascript:clearJornal();'); } ui::addLeftButton('Системный журнал', 'system_view'); ui::addLeftButton('Журнал БД', 'db_view'); function removeQuotes($val, $obj) { return substr($val, 1, strlen($val) - 2); } function rqDateTime($val, $obj) { return date('d.m.Y H:i:s', $val); } function sortByTime($a, $b) { if ($a[1] == $b[1]) { return 0; } return $a[1] > $b[1] ? -1 : 1; } $mas = array(); $system_file = ROOT_DIR . '/revue.log'; if (file_exists($system_file)) { // Читаем файл, формируем массив $tmp_mas = array(); $file = file($system_file); while (list($key, $val) = each($file)) { $tmp = explode(Chr(9), $val); if (!empty($tmp[1])) { $tmp[1] = strtotime(removeQuotes($tmp[1], $tmp[1])); $tmp_mas[] = $tmp; } } // Сортиуем массив по времени usort($tmp_mas, 'sortByTime'); // Выбераем часть массива в соотвествии с постраничной навигацией $count = count($tmp_mas); $max_count = uiTable::getMaxCount(); if (uiTable::getCurPage() != 1) { $niz = empty($start_pos) ? uiTable::getCurPage() * $max_count - $max_count : 0; $mas = array_slice($tmp_mas, $niz, $max_count); } else { $mas = array_slice($tmp_mas, 0, $max_count); } } else { $count = 0; } $table = new uiTable($mas, $count); $table->emptyText('В системном журнале нет записей!'); $table->addColumn('2', 'Важность', 0, false, false, 'removeQuotes'); $table->addColumn('3', 'Пользователь', 0, false, false, 'removeQuotes'); $table->addColumn('4', 'Действие', 400); $table->addColumn('1', 'Дата / Время', 0, false, false, 'rqDateTime'); $table->addColumn('0', 'IP'); return $table->getHTML(); }
public function defAction() { ui::addLeftButton(lang::right('list'), 'list'); ui::addLeftButton(lang::right('state'), 'state'); ui::addLeftButton(lang::right('delivery'), 'delivery'); ui::addLeftButton(lang::right('payment'), 'payment'); ui::newButton(lang::get('ESHOP_ADD_PAYMENT'), '/eshop/payment_add'); $sel = new ormSelect('eshop_payment_method'); $table = new uiTable($sel); $table->addColumn('name', 'Название', 500); $table->defaultRight('payment_upd'); $table->addRight('payment_upd', 'edit', single); $table->addRight('payment_del', 'drop', multi); return $table->getHTML(); }
public function defAction() { ui::addLeftButton(lang::right('list'), 'list'); ui::addLeftButton(lang::right('state'), 'state'); ui::addLeftButton(lang::right('delivery'), 'delivery'); ui::addLeftButton(lang::right('payment'), 'payment'); ui::newButton(lang::get('ESHOP_ADD_DELIVERY'), '/eshop/delivery_add'); $sel = new ormSelect('eshop_delivery_method'); $table = new uiTable($sel); $table->addColumn('name', 'Название', 500); $table->addColumn('price', 'Добавочная стоимость (руб.)', 300); $table->defaultRight('delivery_upd'); $table->addRight('delivery_upd', 'edit', single); $table->addRight('delivery_del', 'drop', multi); return $table->getHTML(); }
public function defAction() { ui::addLeftButton(lang::right('list'), 'list'); ui::addLeftButton(lang::right('state'), 'state'); ui::addLeftButton(lang::right('delivery'), 'delivery'); ui::addLeftButton(lang::right('payment'), 'payment'); ui::newButton(lang::get('ESHOP_ADD_STATE'), '/eshop/state_add'); $sel = new ormSelect('eshop_status'); //$sel->where('form_id', '<>', 0); $sel->orderBy('number', asc); $table = new uiTable($sel); $table->showFilters(true); $table->formatValues(true); $table->addColumn('number', '#', 10); $table->addColumn('name', 'Название', 200); $table->addColumn('notice', 'Описание', 400); $table->defaultRight('state_upd'); $table->addRight('state_upd', 'edit', single); $table->addRight('state_del', 'drop', multi); return $table->getHTML(); }