if (isset($_POST['del']) && is_array($_POST['id'])) { foreach ($_POST['id'] as $key => $val) { $attach_filename = $pdb->GetOne("select picture from {$tb_prefix}brands where id=" . $val); $attachment->deleteBySource($attach_filename); } $deleted = $brand->del($_POST['id']); if (!$deleted) { flash(); } $cache->updateIndexCache(); } if (isset($_POST['recommend'])) { foreach ($_POST['id'] as $val) { $commend_now = $brand->field("if_commend", "id=" . $val); if ($commend_now == "0") { $result = $brand->saveField("if_commend", "1", intval($val)); } else { $result = $brand->saveField("if_commend", "0", intval($val)); } } if ($result) { flash("success"); } else { flash(); } } if (isset($_POST['save']) && !empty($_POST['data'])) { if (isset($_POST['id'])) { $id = intval($_POST['id']); } $vals = array();