nL +D 550 H ? M x ,D"v ] q v ;6 * Z qn )ZP 0 !1 A "#a$2Qr
<?php
session_start();
include_once 'dbconnection.php';
$permission = $_SESSION['permission'];
if (!isset($_SESSION['username'])) {
header("location: ../404.php");
die();
} else if ($permission == 'admin' || $permission == 'adminstration') {
$res = mysqli_query($con, "SELECT * FROM admin WHERE username='$_SESSION[username]'");
$userRow = mysqli_fetch_array($res);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<link rel="shortcut icon" href="image/favicon.png">
<meta name="title" content=" ">
<meta name="ROBOTS" content="INDEX,FOLLOW">
<!-- Bootstrap -->
<link href="./css/bootstrap.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="./css/stylesheets.css" rel="stylesheet">
<link href="./css/admin.css" rel="stylesheet">
<!-- <script src="https://cloud.tinymce.com/stable/tinymce.min.js"></script>
<script>tinymce.init({ selector:'textarea' });</script>-->
</head>
<body>
<div class="container-fluid">
<div class="row">
<div class="col-sm-2" style=" padding: 0px;">
<?php include_once('menu.php'); ?>
</div>
<div class="col-sm-10" style="padding: 0px;">
<div class=" lineupheader">
<img src="../img/about-header.png" class="img-responsive center-block text-center" />
</div>
<div class="mainbg">
<div style=" float: right;"><a href="dashboard.php" class="title2"><button>Back</button></a> </div>
<div class="text-left">
<div class="filmstitle" style="font-size:40px; "> Deleting Movie </div>
</div>
<div style="margin-bottom:40px; min-height:500px;">
<div class="titletextbold" style="margin-top:50px;"> Select the film title you want to Delete: </div>
<form name="delete category" method="POST">
<tr>
<td class="checkboxinput">
<?php
$sql = mysqli_query($con, "SELECT * FROM films where filmdelete = 'no' ORDER BY film_title ");
$row = mysqli_fetch_array($sql);
?>
<select class="multi-choice" name="id" style="width:50%; border:1px solid #9E9E9E;">
<?php do { ?>
<option value="<?php echo $row['id']; ?>" class="submenu"> <?php echo substr($row['film_title'], 0, 70); ?> </option>
<?php } while ($row = mysqli_fetch_array($sql)); ?>
</select>
</td>
<td><input name="submit" class="submitbutton" type="submit" value="Delete"></td>
</tr>
</form>
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$id = $_POST["id"];
$update = mysqli_query($con, "UPDATE `films` SET `filmdelete` = 'yes' WHERE `films`.`id` = '$id'");
if ($update) {
echo "
<meta http-equiv='refresh' content='0'>
<div class='col-8 alert-success form-success'>Section update Successfully</div>
<script>setTimeout(function(){document.querySelector('.form-success').remove()}, 3000)</script>
";
} else {
echo "
<div class='col-8 alert-danger'>failed to update Section</div>
<script>setTimeout(function(){document.querySelector('.alert-danger').remove()}, 3000)</script>
";
}
}
?>
</div>
</div>
<?php include_once('footer.php'); ?>
</div>
</div>
</div>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="./js/jquery.1.11.3.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="./js/bootstrap.min.js"></script>
</body>
</html>
<?php } else {
header("location: ../404.php");
die();
}
?>