From 627b8e416d138112ad20b1299aca21dccebcd11c Mon Sep 17 00:00:00 2001 From: chai Date: Sat, 19 Mar 2022 12:26:19 +0800 Subject: *admin music page --- admin.php | 8 ++-- admin_add_music.php | 4 +- admin_config.php | 9 ++++ admin_header.php | 2 +- admin_music.php | 73 ++++++++++++++++++++++++++++++ admin_new_music.php | 16 +++++++ admin_paginate.php | 25 ++++++++++ admin_template.php | 25 ++++++++++ functions.php | 31 ++++--------- header.php | 12 +++++ login.php | 14 +++++- new.php | 17 ------- res/admin.css | 128 ++++++++++++++++++++++++++++++++++++++++++++++++++++ res/styles.css | 15 ++++++ search.php | 2 +- template.php | 2 +- uber.php | 37 +++++++++++++++ utils.php | 29 ++++++++++++ 18 files changed, 399 insertions(+), 50 deletions(-) create mode 100644 admin_config.php create mode 100644 admin_music.php create mode 100644 admin_new_music.php create mode 100644 admin_paginate.php create mode 100644 admin_template.php delete mode 100644 new.php create mode 100644 uber.php create mode 100644 utils.php diff --git a/admin.php b/admin.php index 32e5604..d0adc6a 100644 --- a/admin.php +++ b/admin.php @@ -41,16 +41,16 @@ form .text {
- + - Add Music + Music - Add Album + Albums - Delete Tag + Tags
diff --git a/admin_add_music.php b/admin_add_music.php index 9599a8c..6480318 100644 --- a/admin_add_music.php +++ b/admin_add_music.php @@ -27,7 +27,7 @@ form .text {
- + @@ -37,7 +37,7 @@ form .text {

Add Music

-
+
diff --git a/admin_config.php b/admin_config.php new file mode 100644 index 0000000..60a97cd --- /dev/null +++ b/admin_config.php @@ -0,0 +1,9 @@ + \ No newline at end of file diff --git a/admin_header.php b/admin_header.php index 30e4383..d877ef3 100644 --- a/admin_header.php +++ b/admin_header.php @@ -25,7 +25,7 @@ Logout Site Main - Music + Music Albums Tags
diff --git a/admin_music.php b/admin_music.php new file mode 100644 index 0000000..c378adb --- /dev/null +++ b/admin_music.php @@ -0,0 +1,73 @@ + + + + + + + + + +
+ + + + + + + + + +
+ + + new music +
+
+ +
+ 0){ + foreach($arr as $music){ + html_admin_music($music); + } + } + + $url = "./admin_music.php?"; + $current_page_index = $page; + ?> + +
+ + + +
+ + + \ No newline at end of file diff --git a/admin_new_music.php b/admin_new_music.php new file mode 100644 index 0000000..ceb761e --- /dev/null +++ b/admin_new_music.php @@ -0,0 +1,16 @@ + + + + + + \ No newline at end of file diff --git a/admin_paginate.php b/admin_paginate.php new file mode 100644 index 0000000..9d4f74c --- /dev/null +++ b/admin_paginate.php @@ -0,0 +1,25 @@ + +
+ + 1){ + for ($p=0; $p<$total_page; $p++) { + if($p == $current_page_index){ + html_admin_paginate_link_current($url, $p); + } + else { + html_admin_paginate_link($url, $p); + } + } + } +?> + + +
+ +
\ No newline at end of file diff --git a/admin_template.php b/admin_template.php new file mode 100644 index 0000000..b745e44 --- /dev/null +++ b/admin_template.php @@ -0,0 +1,25 @@ + + + +'; + echo ''; + echo ''; + echo ''; + echo 'Delete'; + echo 'Modify'; + echo '
'; + echo '
'; +} + +function html_admin_paginate_link($url, $pagei) { + echo '' . ($pagei + 1) . ''; +} + +function html_admin_paginate_link_current($url, $pagei) { + echo '' . ($pagei + 1) . ''; +} + +?> \ No newline at end of file diff --git a/functions.php b/functions.php index 8a7824b..6d3d3cc 100644 --- a/functions.php +++ b/functions.php @@ -1,29 +1,14 @@ "; -} -function println($content) -{ - print_r($content); - echo "
"; } -// 替换为html转义字符,否则插入sql会有问题 -function html_escape_string($str) { - $str = str_replace("'", "'", $str); // ' - $str = str_replace('"', """, $str); // " - return $str; -} - -?> - +?> \ No newline at end of file diff --git a/header.php b/header.php index e4286e4..5286ba5 100644 --- a/header.php +++ b/header.php @@ -1,5 +1,17 @@
\ No newline at end of file diff --git a/login.php b/login.php index 5bd43c6..8db59c4 100644 --- a/login.php +++ b/login.php @@ -21,13 +21,25 @@ form .section{ form .text { width: 100%; } +#login_site_link { + text-decoration:none; + color:black; + padding:0 5px; + font-size: 12px; +} +#login_site_link:hover { + color:white; + background:black; +}
- + + Site +
diff --git a/new.php b/new.php deleted file mode 100644 index d6ccac3..0000000 --- a/new.php +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/admin.css b/res/admin.css index 64b6fc8..beca966 100644 --- a/res/admin.css +++ b/res/admin.css @@ -9,5 +9,133 @@ body{ min-height:100%; padding:10px; box-sizing: border-box; + position:relative; +} + +#add-music-link { + text-decoration: none; + color:black; + float:right; + font-size:12px; + padding: 5px; +} + +#add-music-link:hover { + color:white; + background-color: black; +} + +.admin-h1{ + float:left; + font-size:20px; + display:block; + color:#c5c5c5; + height: 25px; + font-weight: bold; +} + +.admin-music { + background-color: #fafafa; + box-sizing: border-box; + padding: 5px; + margin-bottom: 10px; +} + +.admin-music .admin-music-cover { + width:30px; + height:30px; + float: left; +} + +#admin-music-list{ + margin: 10px 0; +} + +.admin-music a{ + display: block; + float:right; + height:30px; + line-height: 30px; + text-decoration: none; + padding: 0 10px; + font-size:12px; + font-weight: bold; +} + +.admin-music a:hover{ + color: white; +} + +.admin-music .admin-music-modify { + color:black; + margin-right: 10px; +} + +.admin-music .admin-music-modify:hover { + background-color: black; +} + +.admin-music .admin-music-delete { + color:red; +} + +.admin-music .admin-music-delete:hover { + background-color: red; + color:white; +} + +.admin-music-name { + display: block; + float: left; + height: 30px; + line-height: 30px; + font-size: 15px; + margin-left: 30px; + width: 150px; + overflow:hidden; +} + +.admin-music-id { + display: block; + float: left; + height: 30px; + line-height: 30px; + font-size: 15px; + margin-left: 10px; + width: 30px; +} + +/* paginate */ + +#admin-paginate { + width: 100%; + position: absolute; + bottom: 0; +} + +#admin-paginate a { + color:rgb(0, 0, 0); + text-decoration-line: none; + display: block; + width: 30px; + height: 30px; + text-align: center; + line-height: 30px; + float:left; + margin-right: 5px; +} + +#admin-paginate a:hover{ + color:#fff; + background-color: #000; + text-decoration-line: none; + display: block; +} + +#admin-paginate .current{ + color:#fff; + background-color: #000; + text-decoration-line: none; + display: block; } diff --git a/res/styles.css b/res/styles.css index cb0e0a3..6ddcc6e 100644 --- a/res/styles.css +++ b/res/styles.css @@ -16,6 +16,21 @@ body{ float: left; } +#header #login-link{ + float:right; + font-size:12px; + text-decoration: none; + color:black; + display: block; + padding:5px; + margin-left: 5px; +} + +#header #login-link:hover{ + color:white; + background: black; +} + #site_title{ font-size:12px; } diff --git a/search.php b/search.php index 71d5a63..890c5b1 100644 --- a/search.php +++ b/search.php @@ -13,7 +13,7 @@ - + - + \ No newline at end of file diff --git a/utils.php b/utils.php new file mode 100644 index 0000000..8a7824b --- /dev/null +++ b/utils.php @@ -0,0 +1,29 @@ +"; +} + +function println($content) +{ + print_r($content); + echo "
"; +} + +// 替换为html转义字符,否则插入sql会有问题 +function html_escape_string($str) { + $str = str_replace("'", "'", $str); // ' + $str = str_replace('"', """, $str); // " + return $str; +} + +?> + -- cgit v1.1-26-g67d0