Mini Shell
<?php
require_once("../config.php");
require_once("function-file.php");
require_once("function-menu.php");
cookiecheck();
if(isset($_POST['save'])){
$key=$_POST['key'];
if(!empty($_FILES['team_img']['name'])){
//Upload Image
$name=$_FILES['team_img']['name'];
$team_img=str_replace(" ","_",$name);
$tmp_name=$_FILES['team_img']['tmp_name'];
$target_path="img/page/";
$target_path=$target_path.basename($team_img);
move_uploaded_file($_FILES['team_img']['tmp_name'],$target_path);
$sts = $_POST["option_sts"];
$conn->exec("UPDATE options SET `option_value` = '$team_img', `option_status` = '$sts' WHERE `option_name`='$key'");
header("location:side-banners.php");
//--
}
else{
$team_img = $_POST["currentImgNam"];
$sts = $_POST["option_sts"];
$conn->exec("UPDATE options SET `option_value` = '$team_img', `option_status` = '$sts' WHERE `option_name`='$key'");
header("location:side-banners.php");
}
// $conn->exec("update options (team_name,team_position,team_img,cate,description) VALUES ('$team_name','$team_position','$team_img','$cate','$description')");
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Side Banners</title>
<!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<?php cssfile();?>
</head>
<body class="hold-transition skin-blue layout-top-nav">
<!-- Site wrapper -->
<div class="wrapper">
<?php headermenu();?>
<!-- =============================================== -->
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<!-- Main content -->
<section class="content">
<!-- Default box -->
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">Side Banners</h3>
<div class="box-tools pull-right">
<!-- <a href="our-team.php" class="btn btn-info btn-sm" ><i class="fa fa-angle-double-left"></i> Back</a> -->
</div>
</div>
<div class="box-body">
<?php
$key=$_GET['key'];
$data = $conn->query("select * from options where option_name='$key'");
$result=$data->fetchall();
$img = !empty($result[0]['option_value']) ? $result[0]['option_value'] : '';
?>
<form action="#" method="post" role="form" class="form-horizontal" enctype="multipart/form-data">
<input type="hidden" name="key" class="form-control" value="<?php echo $_REQUEST['key']; ?>">
<div class="form-group">
<div class="col-sm-4"><label>Image:</label><br>
<?php echo "<label>Image Size: ".$result[0]['img_size']."</label>"; ?>
<input type="file" id="file" name="team_img" type="file" class="form-control" accept="image/*" onchange="loadFile(event)">
<div><img id="output" class="img-responsive img-thumbnail" src="img/page/<?php echo $img; ?>" /></div>
<input type="hidden" value="<?php echo $img; ?>" name="currentImgNam">
</div>
</div>
<?php
if(($key == "offer_mobile_bg") || ($key == "offer_bg")){
?>
<div class="form-group">
<?php
if($result[0]['option_status'] == 1){
echo '<div class="col-md-5 col-sm-4 cs-checkbox"><label>Display Offer </label><input type="checkbox" name="option_sts" checked value="1"></div>';
}
else{
echo '<div class="col-md-5 col-sm-4 cs-checkbox"><label>Display Offer </label><input type="checkbox" name="option_sts" value="1"></div>';
}
?>
</div>
<?php
}
?>
<div class="form-group">
<div class="col-sm-12" align="right">
<button type="reset" class="btn btn-default" rows="4">Reset</button>
<button type="submit" name="save" class="btn btn-success" >Save</button>
</div>
</div>
</form>
</div><!-- /.box-body -->
</div><!-- /.box -->
</section><!-- /.content -->
</div></div><!-- /.content-wrapper -->
<?php footer();?>
</div><!-- ./wrapper -->
<?php jsfile();ratenum();?>
<script>
var loadFile = function(event) {
var output = document.getElementById('output');
output.src = URL.createObjectURL(event.target.files[0]);
};
</script>
</body>
</html>
Zerion Mini Shell 1.0