Skip to content

Commit

Permalink
在后台导航栏添加了搜索影片功能
Browse files Browse the repository at this point in the history
  • Loading branch information
kangvcar committed Nov 1, 2018
1 parent 3ccef1e commit 73ba444
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 17 deletions.
14 changes: 7 additions & 7 deletions admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
<div class="col-md-8 column">
<!-- 导航栏固定在顶部 start -->
<?php include("headnav.php") ?>
<br><br><br>
<!-- 导航栏固定在顶部 end -->
<!-- 按钮选项 start -->
<hr><hr>
<form action="" method="GET">
<button name="allmovie" value="on" class="btn btn-lg btn-block">查询所有电影信息</button>
<button name="addmovie" value="on" class="btn btn-info btn-lg btn-block">添加电影信息</button>
Expand All @@ -45,13 +45,13 @@
// }
?>
<!-- 页面默认显示信息 start -->
<?php if ((!isset($_GET['allmovie']) & !isset($_GET['addmovie']) & !isset($_GET['fmdmovie']) & !isset($_GET['commentmovie']) & !isset($_GET['usermanagenment']))) {
<?php if ((!isset($_POST['navsearch']) & !isset($_GET['allmovie']) & !isset($_GET['addmovie']) & !isset($_GET['fmdmovie']) & !isset($_GET['commentmovie']) & !isset($_GET['usermanagenment']))) {
include("welcome.php");
} ?>
<!-- 页面默认显示信息 end -->

<!-- 点击“查询所有电影信息”后显示的内容 start -->
<?php if (isset($_GET['allmovie'])) {
<?php if (isset($_GET['allmovie']) or isset($_POST['navsearch'])) {
// include("deletemovie.php");
if (!isset($_POST['fbuttom']) && !isset($_POST['modifymid']) && !isset($_POST['dmid'])) {
include("allMovie.php");
Expand All @@ -64,15 +64,15 @@
<!-- 点击“查询所有电影信息”后显示的内容 end -->

<!-- 点击“添加电影信息”后显示的内容 start -->
<?php if (isset($_GET['addmovie'])) {
<?php if (isset($_GET['addmovie']) & !isset($_POST['navsearch'])) {

include("addmovieaction.php");
include("addMovie.php");
} ?>
<!-- 点击“添加电影信息”后显示的内容 end -->

<!-- 点击“查询/修改/删除电影信息”后显示的内容 start -->
<?php if (isset($_GET['fmdmovie'])) {
<?php if (isset($_GET['fmdmovie']) & !isset($_POST['navsearch'])) {
// include("fmdmovieaction.php");
include("deletemovie.php");
include("modifymovieaction.php");
Expand All @@ -81,14 +81,14 @@
<!-- 点击“查询/修改/删除电影信息”后显示的内容 end -->

<!-- 点击“评论管理”后显示的内容 start -->
<?php if (isset($_GET['commentmovie'])) {
<?php if (isset($_GET['commentmovie']) & !isset($_POST['navsearch'])) {
include("deletecommentaction.php");
include("commentMovie.php");
} ?>
<!-- 点击“评论管理”后显示的内容 end -->

<!-- 点击“用户管理”后显示的内容 start -->
<?php if (isset($_GET['usermanagenment'])) {
<?php if (isset($_GET['usermanagenment']) & !isset($_POST['navsearch'])) {
include("deleteuseraction.php");
include("userManagenment.php");
} ?>
Expand Down
14 changes: 12 additions & 2 deletions allMovie.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,18 @@
}
$num_rec_per_page=10; // 每页显示数量
$start_from = ($page-1) * $num_rec_per_page;
include("dbconnection.php");
$allmovieinfosql = "SELECT mid, mname, myear FROM movie LIMIT $start_from, $num_rec_per_page;";
include("dbconnection.php");
if (isset($_POST['navsearch'])) {
$smname = $_POST['smname'];
// $namesearchmoviesql = "SELECT mid, mname, myear FROM movie WHERE mname like '%$smname%';";
$allmovieinfosql = "SELECT mid, mname, myear FROM movie WHERE mname like '%$smname%';";
}else{
// $allmovieinfosql = "SELECT mid, mname, myear FROM movie LIMIT $start_from, $num_rec_per_page;";
$allmovieinfosql = "SELECT mid, mname, myear FROM movie LIMIT $start_from, $num_rec_per_page;";
}



if ($result2 = $conn->query($allmovieinfosql)) {
if ($result2->num_rows == 0) {
print <<<EOT
Expand Down
2 changes: 1 addition & 1 deletion headnav.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
导航栏固定在顶部 start -->
<!-- 导航栏固定在顶部 start -->
<script type="text/javascript">
function showTime(){
nowtime=new Date();
Expand Down
7 changes: 0 additions & 7 deletions searchmovieaction.php

This file was deleted.

0 comments on commit 73ba444

Please sign in to comment.