Esempio n. 1
0
if (isset($_GET['id'])) {
    $id = (int) $_GET['id'];
    $obj = new Color($id);
}
if (Tools::P('saveColor') == 'edit') {
    if (Validate::isLoadedObject($obj)) {
        $obj->copyFromPost();
        $obj->update();
    }
    if (is_array($obj->_errors) and count($obj->_errors) > 0) {
        $errors = $obj->_errors;
    } else {
        UIAdminAlerts::conf('更新对象成功');
    }
}
$colors = Color::getEntitys();
if (isset($errors)) {
    UIAdminAlerts::MError($errors);
}
$breadcrumb = new UIAdminBreadcrumb();
$breadcrumb->home();
$breadcrumb->add(array('title' => '颜色', 'href' => 'index.php?rule=color'));
$breadcrumb->add(array('title' => '编辑', 'active' => true));
$bread = $breadcrumb->draw();
$btn_group = array(array('type' => 'a', 'title' => '返回', 'href' => 'index.php?rule=color', 'class' => 'btn-primary', 'icon' => 'level-up'), array('type' => 'a', 'title' => '保存', 'id' => 'save-color', 'href' => '#', 'class' => 'btn-success', 'icon' => 'save'));
echo UIViewBlock::area(array('bread' => $bread, 'btn_groups' => $btn_group), 'breadcrumb');
?>
<link href="<?php 
echo _TM_JS_URL;
?>
boootstrap-colorpicker/css/colorpicker.css" rel="stylesheet" type="text/css" media="all" />
Esempio n. 2
0
<?php

$result = Color::getEntitys();
if (isset($errors)) {
    UIAdminAlerts::MError($errors);
}
$breadcrumb = new UIAdminBreadcrumb();
$breadcrumb->home();
$breadcrumb->add(array('title' => '颜色', 'href' => 'index.php?rule=color'));
$breadcrumb->add(array('title' => '关联', 'active' => true));
$bread = $breadcrumb->draw();
$btn_group = array(array('type' => 'a', 'title' => '返回', 'href' => 'index.php?rule=color', 'class' => 'btn-primary', 'icon' => 'level-up'));
echo UIViewBlock::area(array('bread' => $bread, 'btn_groups' => $btn_group), 'breadcrumb');
?>
<div class="row">
	<div class="col-md-12">
		<div class="panel panel-default">
			<div class="panel-heading">
				关联
			</div>
			<div class="panel-body">
				<table class="table_grid" name="list_table" width="100%">
					<tr>
						<td>
							<table class="table" width="100%" cellpadding="0" cellspacing="0" id="order">
								<thead>
								<tr>
									<th width="10%">颜色</th>
									<th>产品</th>
								</tr>
								</thead>