新增链接
<<返回
';
} elseif ($set == 'edit') {
$id = $_GET['id'];
$row2 = $DB->query("select * from lylme_links where id='$id' limit 1");
$row = $DB->fetch($row2);
preg_match_all('/
/i', $row['name'], $color);
echo '修改链接信息
<<返回
';
} elseif ($set == 'add_submit') {
$color = $_POST['color'];
$name = $_POST['name'];
if (empty($color)) {
$name1 = $name;
} else {
$name1 = '
' . $name . '';
}
$url = $_POST['url'];
$icon = $_POST['icon'];
$group_id = $_POST['group_id'];
$link_order = $linksrows + 1;
if ($name == null or $url == null) {
echo '';
} else {
$sql = "INSERT INTO `lylme_links` (`id`, `name`, `group_id`, `url`, `icon`, `link_desc`,`link_order`) VALUES (NULL, '" . $name1 . "', '" . $group_id . "', '" . $url . "', '" . $icon . "', '" . $name . "', '" . $link_order . "');";
if ($DB->query($sql)) {
echo '';
} else {
echo '';
}
}
} elseif ($set == 'edit_submit') {
$id = $_GET['id'];
$rows2 = $DB->query("select * from lylme_links where id='$id' limit 1");
$rows = $DB->fetch($rows2);
if (!$rows) {
exit('');
}
$color = $_POST['color'];
$name = $_POST['name'];
if (empty($color)) {
$name1 = $name;
} else {
$name1 = '
' . $name . '';
}
$url = $_POST['url'];
$icon = $_POST['icon'];
$link_pwd = $_POST['link_pwd'];
$group_id = $_POST['group_id'];
if ($name == null or $url == null) {
echo '';
} else {
$sql = "UPDATE `lylme_links` SET `name` = '" . $name1 . "', `url` = '" . $url . "', `icon` = '" . $icon . "', `group_id` = '" . $group_id . "', `link_pwd` = " . $link_pwd . " WHERE `lylme_links`.`id` = '" . $id . "';";
// exit($sql);
if ($DB->query($sql)) {
echo '';
} else {
echo '';
}
}
// } elseif ($set == 'delete') {
// $id = $_GET['id'];
// $sql = "DELETE FROM lylme_links WHERE id='$id'";
// if ($DB->query($sql)) echo '';
// else echo '';
} else {
echo '
';
}
include './footer.php';
?>