Пример #1
0
<div class="money">
  <div class="content">
    <?php 
$table = new \Ui\Table();
$table->name = 'Ваши счета';
$table->setCols(['№', 'Описание', 'Сумма', 'Валюта', '', '']);
foreach ($pays as $pay) {
    $table->addRow([$pay->id, $pay->description, $pay->sum, $pay->currency->name(), '<a href = "/money/merchants/pay/' . $pay->id . '" class="btn btn-success btn-sm">Оплатить</a>', '<a href = "/money/merchants/cancelPay/' . $pay->id . '" class="btn btn-danger btn-sm">Отказаться</a>']);
}
$table->draw();
?>
  </div>
</div>
Пример #2
0
<?php

$table = new Ui\Table();
$table->name = 'Шаблоны';
$table->addButton(['text' => 'Создать шаблон', 'href' => '/admin/view/createTemplate']);
$table->setCols(['Шаблон', '', '']);
if (!empty($templates['app']['installed'])) {
    foreach ($templates['app']['installed'] as $template => $name) {
        $table->addRow([$name, empty($templates['app']['current']) || $templates['app']['current'] != $template ? '<a href = "/admin/view/setDefault/' . $template . '">Установить по умолчанию</a>' : 'Тема по умолчанию', '<a href = "/admin/view/template/editFile/' . $template . '">Файлы</a> <a href = "/admin/view/editTemplate/' . $template . '">Редактировать</a>']);
    }
}
$table->draw();
Пример #3
0
<?php

$table = new Ui\Table();
$table->name = 'Страницы';
$table->setCols(['Адрес', 'Операции']);
$table->addButton(['href' => "/admin/modules/createControllerMethod/{$module}/{$type}/{$controller}", 'text' => 'Создать']);
$class = CodeGenerator::parseClass(Modules::getModulePath($module) . '/' . $type . '/' . $controller . '.php');
foreach ($class->methods as $method) {
    $name = str_replace('Action', '', $method->name);
    $table->addRow([$name, ['class' => 'actionTd', 'html' => '<a class="btn btn-xs btn-success" href="/admin/modules/editControllerMethod/' . $module . '/' . $type . '/' . $controller . '/' . $name . '"><i class="glyphicon glyphicon-edit"></i></a>' . ' <a class="btn btn-xs btn-danger" href="/admin/modules/delControllerMethod/' . $module . '/' . $type . '/' . $controller . '/' . $name . '"><i class="glyphicon glyphicon-remove"></i></a>']]);
}
$table->draw();
Пример #4
0
<h3>Блокировки на счете</h3>
<?php 
$currency_id = !empty($_GET['currency_id']) ? (int) $_GET['currency_id'] : 0;
$wallets = App::$cur->money->getUserWallets();
if ($currency_id && empty($wallets[$currency_id])) {
    Msg::add('У вас нет такого кошелька');
    Msg::show();
    return;
}
if ($currency_id) {
    $ids = $wallets[$currency_id]->id;
} else {
    $ids = [];
    foreach ($wallets as $wallet) {
        $ids[] = $wallet->id;
    }
    $ids = implode(',', $ids);
}
$table = new \Ui\Table();
$table->setCols(['№', 'Кошелек', 'Сумма', 'Комментарий', 'Дата']);
//items pages
$pages = new \Ui\Pages($_GET, ['count' => \Money\Wallet\Block::getCount(['where' => ['wallet_id', $ids, 'IN']]), 'limit' => 20]);
$histories = \Money\Wallet\Block::getList(['where' => ['wallet_id', $ids, 'IN'], 'order' => [['date_create', 'DESC'], ['id', 'DESC']], 'start' => $pages->params['start'], 'limit' => $pages->params['limit']]);
foreach ($histories as $history) {
    $amount = $history->amount;
    $table->addRow([$history->id, $history->wallet->currency->name(), '<span class = "' . ($amount > 0 ? "text-success" : 'text-danger') . '">' . $amount . '</span>', $history->comment, $history->date_create]);
}
$table->draw();
$pages->draw();
Пример #5
0
<?php

$table = new Ui\Table();
$table->name = 'Установленные модули';
$table->addButton(['href' => '/admin/modules/create', 'text' => 'Создать']);
$table->addButton(['href' => '/admin/modules/install', 'text' => 'Установить']);
$table->setCols(['Модуль', 'Панель администратора', 'Публичная часть', 'Управление', 'По умолчанию']);
$default = !empty(App::$primary->config['defaultModule']) ? App::$primary->config['defaultModule'] : '';
foreach (Module::getInstalled(App::$cur) as $module) {
    $info = Module::getInfo($module);
    $table->addRow([empty($info['name']) ? $module : $info['name'], '', '', "<a class = 'btn btn-primary btn-xs' href = '/admin/modules/editor/{$module}'>Редактировать</a>", $default == $module ? 'По умолчанию' : "<a class = 'btn btn-primary btn-xs' href = '/admin/modules/setDefault/{$module}'>Установить по умолчанию</a>"]);
}
$table->draw();
Пример #6
0
        case 'image':
            $file = Files\File::get($item->{$colName});
            if ($file) {
                $value = '<img src="' . $file->path . '?resize=60x120" />';
            } else {
                $value = '<img src="/static/system/images/no-image.png?resize=60x120" />';
            }
            break;
        case 'bool':
            $value = $item->{$colName} ? 'Да' : 'Нет';
            break;
        default:
            $value = $item->{$colName};
            break;
    }
    $table->addRow([!empty($modelName::$labels[$colName]) ? $modelName::$labels[$colName] : $colName, $value]);
}
$table->draw();
?>
<div>
  <h3>Комментарии (<?php 
echo \Dashboard\Comment::getCount(['where' => [['item_id', $item->id], ['model', $modelName]]]);
?>
)</h3>
  <?php 
foreach (\Dashboard\Comment::getList(['where' => [['item_id', $item->id], ['model', $modelName]], 'order' => ['date_create', 'desc']]) as $comment) {
    ?>
      <div class="row">
        <div class="col-sm-3" style="max-width: 300px;">
          <a href='/admin/Users/view/User/<?php 
    echo $comment->user->pk();
Пример #7
0
$table->name = 'Модели';
$table->addButton(['href' => "/admin/modules/createModel/{$module}", 'text' => 'Создать']);
$table->setCols(['Модель', 'Внешние изменения', 'Операции']);
$modulePath = Module::getModulePath($module);
$path = $modulePath . '/models';
$config = Config::custom(App::$primary->path . '/modules/' . $module . '/generatorHash.php');
if (file_exists($path)) {
    $files = array_slice(scandir($path), 2);
    foreach ($files as $file) {
        if (is_dir($path . '/' . $file)) {
            continue;
        }
        $modelName = pathinfo($file, PATHINFO_FILENAME);
        $table->addRow([$modelName, !empty($config['models/' . $file]) && $config['models/' . $file] == md5(file_get_contents($path . '/' . $file)) ? '<b class="text-success">Нету</b>' : '<b class="text-danger">Есть</b>', ['class' => 'actionTd', 'html' => '<a class="btn btn-xs btn-success" href="/admin/modules/editModel/' . $module . '/' . $modelName . '"><i class="glyphicon glyphicon-edit"></i></a>' . ' <a class="btn btn-xs btn-danger" href="/admin/modules/delModel/' . $module . '/' . $modelName . '"><i class="glyphicon glyphicon-remove"></i></a>']]);
    }
}
$table->draw();
$table = new Ui\Table();
$table->name = 'Контроллеры';
$table->addButton(['href' => "/admin/modules/createController/{$module}", 'text' => 'Создать']);
$table->setCols(['Контроллер', 'Тип', 'Операции']);
$types = ['appControllers', 'appAdminControllers', 'Controllers'];
foreach ($types as $type) {
    if (file_exists($modulePath . '/' . $type)) {
        $files = array_slice(scandir($modulePath . '/' . $type), 2);
        foreach ($files as $file) {
            $table->addRow([pathinfo($file, PATHINFO_FILENAME), $type, ['class' => 'actionTd', 'html' => '<a class="btn btn-xs btn-success" href="/admin/modules/controllerEditor/' . $module . '/' . $type . '/' . pathinfo($file, PATHINFO_FILENAME) . '"><i class="glyphicon glyphicon-edit"></i></a>' . ' <a class="btn btn-xs btn-danger" href="/admin/modules/delController/' . $module . '/' . $type . '/' . pathinfo($file, PATHINFO_FILENAME) . '"><i class="glyphicon glyphicon-remove"></i></a>']]);
        }
    }
}
$table->draw();