';
} elseif ($set == 'edit') {
$id = $_GET['id'];
$row2 = $DB->query("select * from lylme_groups where group_id='$id' limit 1");
$row = $DB->fetch($row2);
echo '
修改分组信息
';
} elseif ($set == 'add_submit') {
$name = $_POST['group_name'];
$icon = $_POST['group_icon'];
$pwd = $_POST['group_pwd'];
$group_order = $groupsrows + 1;
if ($name == NULL) {
echo '';
} else {
$sql = "INSERT INTO `lylme_groups` (`group_id`, `group_name`, `group_icon`,`group_order`,`group_pwd`) VALUES (NULL, '" . $name . "', '" . $icon . "', '" . $group_order . "', '" . $pwd . "')";
if ($DB->query($sql)) {
echo '';
exit();
} else echo '';
exit();
}
echo '';
} elseif ($set == 'edit_submit') {
$id = $_GET['id'];
$rows2 = $DB->query("select * from lylme_groups where group_id='$id' limit 1");
$rows = $DB->fetch($rows2);
if (!$rows) echo '';
$name = $_POST['group_name'];
$icon = $_POST['group_icon'];
$pwd = $_POST['group_pwd'];
if ($name == NULL) {
echo '';
} else {
$sql = "UPDATE `lylme_groups` SET `group_name` = '" . $name . "', `group_icon` = '" . $icon . "',`group_pwd` = '" . $pwd . "' WHERE `lylme_groups`.`group_id` = '" . $id . "';";
if ($DB->query($sql)) echo '';
else echo '';
}
} elseif ($set == 'del') {
$id = $_POST['group_id'];
$delsql1 = 'DELETE FROM `lylme_links` WHERE group_id =' . $id;
$delsql2 = 'DELETE FROM `lylme_groups` WHERE group_id=' . $id;
$DB->query($delsql1);
$DB->query($delsql2);
exit();
} elseif ($set == 'on') {
$id = $_POST['group_id'];
$sql = "UPDATE `lylme_groups` SET `group_status` = '1' WHERE `lylme_groups`.`group_id` =" . $id;
$DB->query($sql);
exit();
} elseif ($set == 'off') {
$id = $_POST['group_id'];
$sql = "UPDATE `lylme_groups` SET `group_status` = '0' WHERE `lylme_groups`.`group_id` =" . $id;
$DB->query($sql);
exit();
}
elseif ($set == 'sort') {
for ($i=0; $i
query($sql);
}
exit();
}
// elseif ($set == 'up') {
// //上移
// $id = $_GET['id'];
// $order = $DB->get_row("SELECT `group_id`, `group_order` FROM `lylme_groups` WHERE `group_id` = ".$id.";")['group_order']; //当前排序
// $pl = $DB->get_row("SELECT * FROM `lylme_groups` WHERE `group_order` < ".$order." ORDER BY `lylme_groups`.`group_order` DESC LIMIT 1"); //上一行
// $DB->query("UPDATE `lylme_groups` SET `group_order` = '".$pl['group_order']."' WHERE `lylme_groups`.`group_id` = ".$id.";"); //设置为上一行的排序
// $DB->query("UPDATE `lylme_groups` SET `group_order` = '".$order."' WHERE `lylme_groups`.`group_id` = ".$pl['group_id'].";"); //设置上一行的排序为当前行
// echo '';
// exit();
// } elseif ($set == 'down') {
// $id = $_GET['id'];
// $order = $DB->get_row("SELECT `group_id`, `group_order` FROM `lylme_groups` WHERE `group_id` = ".$id.";")['group_order']; //当前排序
// $nl = $DB->get_row("SELECT * FROM `lylme_groups` WHERE `group_order` > ".$order." ORDER BY `lylme_groups`.`group_order` ASC LIMIT 1"); //下一行
// $DB->query("UPDATE `lylme_groups` SET `group_order` = '".$nl['group_order']."' WHERE `lylme_groups`.`group_id` = ".$id.";"); //设置为下一行的排序
// $DB->query("UPDATE `lylme_groups` SET `group_order` = '".$order."' WHERE `lylme_groups`.`group_id` = ".$nl['group_id'].";"); //设置下一行的排序为当前行
// echo '';
// exit();
// }
else {
?>