Пример #1
0
<?php

if ($item) {
    ?>
    <?php 
    $section_action = <<<BTN
<a class="btn btn-sm btn-danger" onclick="javascript:remove_parent_tr(this)" href="javascript:;"><span class="glyphicon glyphicon-minus"></span></a>
<input style="display:none" name="{$field}" type="text" value="{$item->id}">
BTN;
    $table = new KTable();
    $table->th('名称')->setWidth('10%')->th('图片')->setWidth('10%')->th('供应商')->setWidth('10%')->th('操作')->setWidth('10%')->td($item->name)->td(HTML::image($item->getImage()), [], false)->td($item->provider->providable->name)->td($section_action, [], false)->tr();
    ?>
    <?php 
    echo $table->draw();
}
Пример #2
0
<?php

$items = $class::where('username', 'like', "%{$pattern}%")->orWhere('mobile', 'like', "%{$pattern}%")->orWhere('email', 'like', "%{$pattern}%")->paginate(20);
foreach ($items as $item) {
    $item->_modal_field = $field;
}
$table = new KTable();
$table->th('姓名')->functional(function ($user) {
    return e($user->username);
})->th('邮件')->functional(function ($user) {
    return e($user->email);
})->th('手机')->functional(function ($user) {
    return e($user->mobile);
})->th('选择')->functional(function ($user) use($action) {
    $url = URL::action($action);
    $token = Session::getToken();
    $btn = <<<BTN
        <a class="btn btn-sm btn-success" onclick="javascript:modal_select_this_one_btn(this)" data-attr-id="{$user->id}" data-attr-url="{$url}" data-csrf-token="{$token}" href="javascript:;"><span class="glyphicon glyphicon-plus"></span></a>
BTN;
    return $btn;
});
$table->itemsToTbody($items);
echo $table->draw();
Пример #3
0
<?php

if ($item) {
    ?>
    <?php 
    $section_action = <<<BTN
<a class="btn btn-sm btn-danger" onclick="javascript:remove_parent_tr(this)" href="javascript:;"><span class="glyphicon glyphicon-minus"></span></a>
<input style="display:none" name="{$field}" type="text" value="{$item->id}">
BTN;
    $table = new KTable();
    $table->th('姓名')->setWidth('10%')->th('邮件')->setWidth('10%')->th('手机')->setWidth('10%')->th('性别')->setWidth('10%')->th('操作')->setWidth('10%')->td($item->username)->td($item->email)->td($item->mobile)->td($item->gender)->td($section_action, [], false)->tr();
    ?>
    <?php 
    echo $table->draw();
}
Пример #4
0
<?php

$items = $class::where('name', 'like', "%{$pattern}%")->orWhere('origin_place', 'like', "%{$pattern}%")->paginate(20);
foreach ($items as $item) {
    $item->_modal_field = $field;
}
$table = new KTable();
$table->th('名称')->functional(function ($item) {
    return e($item->name);
})->th('图片')->functional(function ($item) {
    return HTML::image($item->getImage());
})->th('供应商')->functional(function ($item) {
    return e($item->providerName());
})->th('选择')->functional(function ($item) use($action) {
    $url = URL::action($action);
    $token = Session::getToken();
    $btn = <<<BTN
        <a class="btn btn-sm btn-success" onclick="javascript:modal_select_this_one_btn(this)" data-attr-id="{$item->id}" data-attr-url="{$url}" data-csrf-token="{$token}" href="javascript:;"><span class="glyphicon glyphicon-plus"></span></a>
BTN;
    return $btn;
});
$table->itemsToTbody($items);
echo $table->draw();
Пример #5
0
<?php

if ($item) {
    ?>
    <?php 
    $section_action = <<<BTN
<a class="btn btn-sm btn-danger" onclick="javascript:remove_parent_tr(this)" href="javascript:;"><span class="glyphicon glyphicon-minus"></span></a>
<input style="display:none" name="{$field}" type="text" value="{$item->id}">
BTN;
    $table = new KTable();
    $table->th('订单号')->setWidth('10%')->th('收件人')->setWidth('10%')->th('手机')->setWidth('10%')->th('地址')->setWidth('10%')->th('状态')->setWidth('10%')->th('操作')->setWidth('10%')->td($item->order_no)->td($item->accept_name)->td($item->mobile)->td(KTable::textInsideTd($item->fullAddress(8)), [], false)->td($item->status)->td($section_action, [], false)->tr();
    ?>
    <?php 
    echo $table->draw();
}
<?php

if ($item) {
    ?>
    <?php 
    $section_action = <<<BTN
<a class="btn btn-sm btn-danger" onclick="javascript:remove_parent_tr(this)" href="javascript:;"><span class="glyphicon glyphicon-minus"></span></a>
<input style="display:none" name="{$field}" type="text" value="{$item->id}">
BTN;
    $table = new KTable();
    $table->th('名称')->setWidth('10%')->th('图片')->setWidth('10%')->th('操作')->setWidth('10%')->td($item->activity_title)->td(HTML::image($item->getImage()), [], false)->td($section_action, [], false)->tr();
    ?>
    <?php 
    echo $table->draw();
}
Пример #7
0
<?php

$items = $class::where('order_no', 'like', "%{$pattern}%")->orWhere('mobile', 'like', "%{$pattern}%")->paginate(20);
foreach ($items as $item) {
    $item->_modal_field = $field;
}
$table = new KTable();
$table->th('订单号')->functional(function ($order) {
    return e($order->order_no);
})->th('收件人')->functional(function ($order) {
    return e($order->accept_name);
})->th('手机')->functional(function ($order) {
    return e($order->mobile);
})->th('地址')->functional(function ($order) {
    return KTable::textInsideTd($order->fullAddress());
})->th('状态')->functional(function ($order) {
    return e($order->status);
})->th('选择')->functional(function ($item) use($action) {
    $url = URL::action($action);
    $token = Session::getToken();
    $btn = <<<BTN
        <a class="btn btn-sm btn-success" onclick="javascript:modal_select_this_one_btn(this)" data-attr-id="{$item->id}" data-attr-url="{$url}" data-csrf-token="{$token}" href="javascript:;"><span class="glyphicon glyphicon-plus"></span></a>
BTN;
    return $btn;
});
$table->itemsToTbody($items);
echo $table->draw();