public function save_order() { $homeimage_array = $_POST['homeimage_id']; $order_array = $_POST['order']; $homeimage = new HomeImage(); foreach ($homeimage_array as $key => $value) { $homeimage_id = $value; $homeimage_order = $order_array[$key]; $homeimage->update('HomeImage', array('sequence' => $homeimage_order), 'id=' . $homeimage_id); } Flash::set('success', __('This homeimage sequence has been saved.')); redirect(get_url('homeimage')); }
$hi_update->loadById(); $isEdit = true; } if ($action == "modify") { // 提交更改 $hi_modify = new HomeImage(); $id = $_POST["id"]; $iname = $_POST["iname"]; $href = $_POST["href"]; $rank = $_POST["rank"]; $hi_modify->setId($id); $hi_modify->loadById(); $hi_modify->setIname($iname); $hi_modify->setHref($href); $hi_modify->setRank($rank); $hi_modify->update(); header("location:homeImagesController.php"); exit; } $hi = new HomeImage(); $list = $hi->getRollImages(); echo "\n <table class='table'>\n <thead>\n <th>编号</th>\n <th>名称</th>\n <th>图片</th>\n <th>跳转链接</th>\n <th>添加时间</th>\n <th>优先级(优先级高的排在前面显示)</th>\n <th>操作</th>\n </thead>\n"; foreach ($list as $one) { ?> <tr> <td><?php echo $one->getId(); ?> </td> <td><?php echo $one->getIname();