From 653989e93565b042cf6805e018989577c1e99d3d Mon Sep 17 00:00:00 2001 From: LyLme Date: Tue, 22 Feb 2022 03:03:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=94=99=E8=AF=AF=E5=92=8C?= =?UTF-8?q?=E8=A7=86=E8=A7=89=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/group.php | 183 ++++++++++++++++++++++-------------------------- admin/link.php | 167 ++++++++++++++++++++++--------------------- 2 files changed, 170 insertions(+), 180 deletions(-) diff --git a/admin/group.php b/admin/group.php index f757ce4..5266d98 100644 --- a/admin/group.php +++ b/admin/group.php @@ -2,154 +2,127 @@ $title='链接管理'; include './head.php'; ?> -
-
+
+ +
+ +
+
+
+
-
-
-

新增链接

'; -echo '
'; -echo '
+echo '

新增分组

+

- +
-
- +
+ +方式1:填写图标的URL地址,如/img/logo.pnghttp://www.xxx.com/img/logo.png
+方式2:粘贴图标的SVG代码,查看教程
方式3:留空使用默认图标
-
-
- -
-
-
- -
-
-'; -echo '
>>返回链接列表'; -echo '
-'; +
+ +
+
<<返回分组列表 +
+'; } elseif($set=='edit') { $id=$_GET['id']; -$row=$DB->get_row("select * from lylme_links where id='$id' limit 1"); -echo '
-
-

修改链接信息

'; -echo '
'; -echo '
+$row2 = mysqli_query($con,"select * from lylme_groups where group_id='$id' limit 1"); +$row=mysqli_fetch_assoc($row2); +echo '

修改分组信息

+
+
-
- +
+
-
- +
+ +方式1:填写图标的URL地址,如/img/logo.pnghttp://www.xxx.com/img/logo.png
+方式2:粘贴图标的SVG代码,查看教程
方式3:留空使用默认图标
-
-
- -
-
- -'; -echo '
>>返回链接列表'; -echo '
-'; +
+ +
+
<<返回分组列表
'; } elseif($set=='add_submit') { -$name=$_POST['name']; -$url=$_POST['url']; -$active=$_POST['active']; -if($name==NULL or $url==NULL){ -showmsg('保存错误,请确保每项都不为空!',3); +$name=$_POST['group_name']; +$icon=$_POST['group_icon']; +if($name==NULL){ + echo ''; } else { -$sql="insert into `lylme_links` (`name`,`url`,`active`) values ('".$name."','".$url."','".$active."')"; -if($DB->query($sql)){ - showmsg('添加链接成功!

>>返回链接列表',1); + +$sql="INSERT INTO `lylme_groups` (`group_id`, `group_name`, `group_icon`) VALUES (NULL, '".$name."', '".$icon."')"; + +if(mysqli_query($con,$sql)){ + echo ''; + exit(); }else - showmsg('添加链接失败!'.$DB->error(),4); + echo ''; + exit(); } +echo ''; } elseif($set=='edit_submit') { $id=$_GET['id']; -$rows=$DB->get_row("select * from lylme_links where id='$id' limit 1"); +$rows2 = mysqli_query($con,"select * from lylme_groups where group_id='$id' limit 1"); +$rows=mysqli_fetch_assoc($rows2); if(!$rows) - showmsg('当前记录不存在!',3); -$name=$_POST['name']; -$url=$_POST['url']; -$active=$_POST['active']; -if($name==NULL or $url==NULL){ -showmsg('保存错误,请确保每项都不为空!',3); + echo ''; +$name=$_POST['group_name']; +$icon=$_POST['group_icon']; +if($name==NULL){ + echo ''; } else { -if($DB->query("update lylme_links set name='$name',url='$url',active='$active' where id='{$id}'")) - showmsg('修改链接成功!

>>返回链接列表',1); + +$sql = "UPDATE `lylme_groups` SET `group_name` = '".$name."', `group_icon` = '".$icon."' WHERE `lylme_groups`.`group_id` = '".$id."';"; + +if(mysqli_query($con,$sql)) +echo ''; else - showmsg('修改链接失败!'.$DB->error(),4); + echo ''; } } elseif($set=='delete') { $id=$_GET['id']; -$sql="DELETE FROM lylme_links WHERE id='$id'"; +$sql="DELETE FROM lylme_groups WHERE group_id='$id'"; if(mysqli_query($con,$sql)) - showmsg('删除成功!

>>返回链接列表',1); + echo ''; else - showmsg('删除失败!'.$DB->error(),4); + echo ''; } else { $sql=" 1"; -$con='系统共有 '.$numrows.' 个链接
新增链接'; +$cons='系统共有 '.$groupsrows.' 个分组
新建分组'; echo '
'; -echo $con; +echo $cons; echo '
'; ?>
- + '; +echo ''; } ?>
ID名称链接状态操作
ID名称操作
'.$res['id'].''.$res['name'].''.$res['url'].''.($res['active']==1?'显示中':'未显示').'编辑 删除
'.$res['group_id'].''.$res['group_name'].'编辑 删除
+
+
+
+
+ +
+
+ -
\ No newline at end of file +include './footer.php'; +?> \ No newline at end of file diff --git a/admin/link.php b/admin/link.php index 202bdb0..3fe70a5 100644 --- a/admin/link.php +++ b/admin/link.php @@ -1,20 +1,25 @@ -
-
+
+ +
+ +
+
+
+
-
-
-

新增链接

'; -echo '
'; -echo '
+echo '

新增链接

+
+

@@ -25,106 +30,100 @@ echo '

- + +方式1:填写图标的URL地址,如/img/logo.pnghttp://www.xxx.com/img/logo.png
+方式2:粘贴图标的SVG代码,查看教程
方式3:留空使用默认图标
-
- -
-
+
+'; -echo '
>>返回链接列表'; -echo '
-'; +echo '
+
+ +
+
<<返回链接列表 +
'; } elseif($set=='edit') { $id=$_GET['id']; -$row=$DB->get_row("select * from lylme_links where id='$id' limit 1"); -echo '
-
-

修改链接信息

'; -echo '
'; -echo '
+$row2 = mysqli_query($con,"select * from lylme_links where id='$id' limit 1"); +$row=mysqli_fetch_assoc($row2); +echo '

修改链接信息

+
+
-
+
-
+
-
- +
+ +方式1:填写图标的URL地址,如/img/logo.pnghttp://www.xxx.com/img/logo.png
+方式2:粘贴图标的SVG代码,查看教程
方式3:留空使用默认图标
方式3:留空使用默认图标
-
- -'; -echo '
>>返回链接列表'; -echo '
-'; +echo ' +
+
+ +
+
<<返回链接列表 +
'; } elseif($set=='add_submit') { $name=$_POST['name']; $url=$_POST['url']; -$active=$_POST['active']; +$icon=$_POST['icon']; +$group_id=$_POST['group_id']; if($name==NULL or $url==NULL){ -showmsg('保存错误,请确保每项都不为空!',3); + echo ''; } else { -$sql="insert into `lylme_links` (`name`,`url`,`active`) values ('".$name."','".$url."','".$active."')"; -if($DB->query($sql)){ - showmsg('添加链接成功!

>>返回链接列表',1); +$sql="INSERT INTO `lylme_links` (`id`, `name`, `group_id`, `url`, `icon`, `PS`) VALUES (NULL, '".$name."', '".$group_id."', '".$url."', '".$icon."', '".$name."');"; + +if(mysqli_query($con,$sql)){ + echo ''; }else - showmsg('添加链接失败!'.$DB->error(),4); + echo ''; } } elseif($set=='edit_submit') { $id=$_GET['id']; -$rows=$DB->get_row("select * from lylme_links where id='$id' limit 1"); +$rows2 = mysqli_query($con,"select * from lylme_links where id='$id' limit 1"); +$rows=mysqli_fetch_assoc($rows2); if(!$rows) - showmsg('当前记录不存在!',3); + echo ''; $name=$_POST['name']; $url=$_POST['url']; -$active=$_POST['active']; +$icon=$_POST['icon']; +$group_id=$_POST['group_id']; if($name==NULL or $url==NULL){ -showmsg('保存错误,请确保每项都不为空!',3); + echo ''; } else { -if($DB->query("update lylme_links set name='$name',url='$url',active='$active' where id='{$id}'")) - showmsg('修改链接成功!

>>返回链接列表',1); + +$sql = "UPDATE `lylme_links` SET `name` = '".$name."', `url` = '".$url."', `icon` = '".$icon."', `group_id` = '".$group_id."' WHERE `lylme_links`.`id` = '".$id."';"; +if(mysqli_query($con,$sql)) +echo ''; else - showmsg('修改链接失败!'.$DB->error(),4); + echo ''; } } elseif($set=='delete') @@ -132,24 +131,24 @@ elseif($set=='delete') $id=$_GET['id']; $sql="DELETE FROM lylme_links WHERE id='$id'"; if(mysqli_query($con,$sql)) - showmsg('删除成功!

>>返回链接列表',1); + echo ''; else - showmsg('删除失败!'.$DB->error(),4); + echo ''; } else { $sql=" 1"; -$con='系统共有 '.$numrows.' 个链接
新增链接'; +$cons='系统共有 '.$linksrows.' 个链接
新增链接'; echo '
'; -echo $con; +echo $cons; echo '
'; ?>
- + '; +echo ''; } ?>
ID名称链接状态操作
ID名称链接分组ID操作
'.$res['id'].''.$res['name'].''.$res['url'].''.($res['active']==1?'显示中':'未显示').'编辑 删除
'.$res['id'].''.$res['name'].''.$res['url'].''.$res['group_id'].'编辑 删除
+
+
+
+
+ +
+ + \ No newline at end of file