Esempio n. 1
0
<script language="javascript">
	$("#save-user-form").click(function(){
		$("#user-form").submit();
	})
</script>
<?php 
$form = new UIAdminEditForm('post', 'index.php?rule=user_save' . (isset($id) ? '&id=' . $id : ''), 'form-horizontal', 'brand-form', 'multipart/form-data');
$form->items = array('name' => array('title' => '姓名', 'type' => 'text', 'value' => isset($obj) ? $obj->name : Tools::Q('name')), 'active' => array('title' => '状态', 'type' => 'bool', 'value' => isset($obj) ? $obj->active : Tools::Q('active')), 'email' => array('title' => '邮箱', 'type' => 'text', 'value' => isset($obj) ? $obj->email : Tools::Q('email')), 'passwd' => array('title' => '密码', 'type' => 'text', 'value' => ""), 'sveUser' => array('type' => 'hidden', 'value' => 'edit'), 'submit' => array('title' => '保存', 'type' => 'submit', 'class' => 'btn-success', 'icon' => 'save'));
echo UIViewBlock::area(array('title' => '编辑', 'class' => 'col-md-5', 'body' => $form->draw()), 'panel');
?>
<div class="row">
<?php 
if (isset($obj)) {
    $carts = $obj->getCarts();
    if ($carts) {
        $cartTable = new UIAdminTable('cart', 'User', 'id_cart');
        $cartTable->header = array(array('sort' => false, 'name' => 'id_cart', 'title' => '购物车ID'), array('sort' => false, 'name' => 'status_label', 'title' => '状态', 'color' => true), array('sort' => false, 'name' => 'add_date', 'title' => '添加时间'));
        $cartTable->data = $carts;
        echo UIViewBlock::area(array('title' => '购物车清单', 'row' => false, 'class' => 'col-md-3', 'body' => $cartTable->draw()), 'panel');
    }
    $orders = $obj->getOrders();
    if ($orders) {
        $orderTable = new UIAdminTable('order', 'User', 'id_order');
        $orderTable->header = array(array('sort' => false, 'name' => 'id_order', 'title' => '定单ID'), array('sort' => false, 'name' => 'status', 'title' => '状态', 'color' => true), array('sort' => false, 'name' => 'add_date', 'title' => '添加时间'));
        $orderTable->data = $orders;
        echo UIViewBlock::area(array('title' => '定单历史', 'row' => false, 'class' => 'col-md-3', 'body' => $orderTable->draw()), 'panel');
    }
}
?>
</div>