} if ($action === "edit") { $id = $_GET["id"]; $hi_update = new HomeImage(); $hi_update->setId($id); $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