Mini Shell
<?php
/* Database connection */
include("config.php");
$conn = dbconnect();
session_start();
// login or not
if ($_SESSION['name'] == '' || $_SESSION['admin_id'] == '') {
header('location:logout.php');
die();
}
$name = $_SESSION['name'];
$admin_id = $_SESSION['admin_id'];
$query = "SELECT * FROM tb1_admin WHERE name='" . $name . "' AND admin_id='" . $admin_id . "'";
$res_query = mysqli_query($conn, $query);
$fetch = mysqli_fetch_object($res_query);
$username = $fetch->user_name;
$phone = $fetch->phone;
$adminposition = $fetch->position;
if ($adminposition == 1) {
$type = 'Main Admin';
} elseif ($adminposition == 2) {
$type = 'Accounts';
} elseif ($adminposition == 3) {
$type = 'Marketing';
} else {
$type = 'Others';
}
$url_query = "SELECT * FROM tb1_url WHERE url_title='slider'";
$res_url = mysqli_query($conn, $url_query);
$fetch_url = mysqli_fetch_object($res_url);
$url_path = $fetch_url->url_path;
?>
<!DOCTYPE html>
<html lang="en">
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>Admin - Sri Aravindar Arts & Science College </title>
<!-- Meta -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimal-ui">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<!-- Favicon icon -->
<link rel="icon" href="assets/images/favicon.png" type="image/x-icon">
<!-- Google font-->
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600,800" rel="stylesheet">
<!-- Required Fremwork -->
<link rel="stylesheet" type="text/css" href="plugin/bootstrap/dist/css/bootstrap.min.css">
<!-- feather Awesome -->
<link rel="stylesheet" type="text/css" href="assets/icon/feather/css/feather.css">
<!-- Style.css -->
<link rel="stylesheet" type="text/css" href="assets/css/style.css">
<link rel="stylesheet" type="text/css" href="assets/css/jquery.mCustomScrollbar.css">
<!-- jquery file upload Frame work -->
<link href="assets/pages/jquery.filer/css/jquery.filer.css" type="text/css" rel="stylesheet" />
<link href="assets/pages/jquery.filer/css/themes/jquery.filer-dragdropbox-theme.css" type="text/css" rel="stylesheet" />
<!-- animation nifty modal window effects css -->
<link rel="stylesheet" type="text/css" href="assets/css/component.css">
<link rel="stylesheet" type="text/css" href="assets/css/validation/tooltip-style.css">
<style>
.loader-container {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
.spinner-container {
display: flex;
justify-content: center;
align-items: center;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
z-index: 9999;
}
/* HTML: <div class="loader"></div> */
/* HTML: <div class="loader"></div> */
/* HTML: <div class="loader"></div> */
.loader {
width: 100px;
height: 100px;
padding: 10px;
box-sizing: border-box;
display: grid;
background: #fff;
filter: blur(4px) contrast(10) hue-rotate(240deg);
mix-blend-mode: darken;
}
.loader:before {
content: "";
grid-area: 1/1;
margin: 30px 0;
border-radius: 100px;
background: #00ffff;
}
.loader:after {
content: "";
grid-area: 1/1;
height: 35px;
width: 35px;
margin: auto;
border-radius: 50%;
background: #00ffff;
animation: l5 2s infinite linear;
}
@keyframes l5 {
0% {
transform: translate(30px)
}
25% {
transform: translate(0)
}
50% {
transform: translate(-30px)
}
75% {
transform: translate(0)
}
100% {
transform: translate(30px)
}
}
.hideloader {
display: none;
}
</style>
</head>
<!-- Menu sidebar static layout -->
<body>
<div id="loaderid" class="spinner-container hideloader">
<div class="loader"></div>
</div>
<!-- Pre-loader start -->
<div class="theme-loader">
<div class="ball-scale">
<div class='contain'>
<div class="ring">
<div class="frame"></div>
</div>
<div class="ring">
<div class="frame"></div>
</div>
<div class="ring">
<div class="frame"></div>
</div>
<div class="ring">
<div class="frame"></div>
</div>
<div class="ring">
<div class="frame"></div>
</div>
<div class="ring">
<div class="frame"></div>
</div>
<div class="ring">
<div class="frame"></div>
</div>
<div class="ring">
<div class="frame"></div>
</div>
<div class="ring">
<div class="frame"></div>
</div>
<div class="ring">
<div class="frame"></div>
</div>
</div>
</div>
</div>
<!-- Pre-loader end -->
<div id="pcoded" class="pcoded">
<div class="pcoded-overlay-box"></div>
<div class="pcoded-container navbar-wrapper">
<?php include('static-header.php') ?>
<div class="pcoded-main-container">
<div class="pcoded-wrapper">
<?php include('static-sidebar.php') ?>
<div class="pcoded-content">
<div class="pcoded-inner-content">
<div class="main-body">
<div class="page-wrapper">
<!-- Page-header start -->
<div class="page-header">
<div class="row align-items-end">
<div class="col-lg-8">
<div class="page-header-title">
<div class="d-inline">
<h4>Slider</h4>
<span>You can edit The website slider image here!</span>
</div>
</div>
</div>
<div class="col-lg-4">
<div class="page-header-breadcrumb">
<ul class="breadcrumb-title">
<li class="breadcrumb-item" style="float: left;">
<a href="dashboard"> <i class="feather icon-home"></i> </a>
</li>
<li class="breadcrumb-item" style="float: left;"><a href="#!">Home Page</a>
</li>
<li class="breadcrumb-item" style="float: left;"><a href="#!">Slider</a>
</li>
</ul>
</div>
</div>
</div>
</div>
<!-- Page-header end -->
<!-- Page body start -->
<div class="page-body">
<?php
$content_query = "SELECT * FROM tb1_slider ORDER BY slider_id ASC";
$content_res = mysqli_query($conn, $content_query);
$counter = 0;
/* Loop start */
while ($content_row = mysqli_fetch_object($content_res)) {
$counter++;
$slider_id = $content_row->slider_id;
$status = $content_row->status;
$slider_header1 = $content_row->slider_header1;
$slider_header2 = $content_row->slider_header2;
$slider_para = $content_row->slider_para;
$slider_img = $content_row->slider_img;
$crm_id = $content_row->crm_id;
$updated_at = $content_row->updated_log;
$updated_log = date('d-m-Y h:i:s A', strtotime($updated_at));
$crm_query = "SELECT * FROM tb1_admin WHERE admin_id ='$crm_id' ";
$crm_res = mysqli_query($conn, $crm_query);
$crm_row = mysqli_fetch_object($crm_res);
$crm_name = strtolower($crm_row->name);
?>
<div class="col-xl-12 col-md-12">
<div class="card user-card-full">
<div class="row m-l-0 m-r-0">
<div class="col-sm-4 bg-c-lite-green user-profile">
<div class="card-block text-center text-white">
<div class="m-b-25">
<img src="<?php echo $url_path . $slider_img; ?>" class="img-radius img-fluid img-thumbnail" alt="User-Profile-Image">
</div>
</div>
</div>
<div class="col-sm-8">
<div class="card-block">
<!-- <h6 class="m-b-20 p-b-5 b-b-default f-w-600">Header Text 1 - <span style="font-size: 12px;"> <?php echo $slider_header1; ?> </span></h6>
<h6 class="m-b-20 p-b-5 b-b-default f-w-600">Header Text 2 - <span style="font-size: 12px;"> <?php echo $slider_header2; ?> </span> </h6>
<h6 class="m-b-10 m-t-10 p-b-5 b-b-default f-w-600">
Paragraph Text</h6>
<div class="row">
<div class="col-sm-12">
<h6 class="f-w-400"><?php echo $slider_para; ?>
</h6>
</div>
</div> -->
<h6 class="m-b-10 m-t-10 p-b-5 b-b-default f-w-600">
Last Updates</h6>
<div class="row">
<div class="col-sm-6 text-left">
<h6 class="f-w-400">Updated Date : <?php echo $updated_log; ?>
</h6>
</div>
<div class="col-sm-6 text-right">
<h6 class="f-w-400">Updated By : <?php echo ucfirst($crm_name); ?>
</h6>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<button type="button" class="btn btn-primary pl-3 pr-3 mt-3 waves-effect md-trigger" data-modal="modal-10" data-id="<?php echo $slider_id; ?>">Change Slider</button>
</div>
<div class="col-sm-6 text-right">
<?php
if ($status == 1) {
?>
<button class="btn btn-danger pl-3 pr-3 mt-3 inactive" type="button" data-id='<?php echo $slider_id ?>'>Click to Inactive</button>
<?php
} else {
?>
<button class="btn btn-success pl-3 pr-3 mt-3 active1" type="button" data-id='<?php echo $slider_id ?>'>Click to Active</button>
<?php
}
?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<hr>
<?php
}
?>
<div class="md-modal md-effect-10" id="modal-10">
<div class="col-md-12 text-right">
<button class="md-close btn" style="background: #fe5d70; position: absolute;left: 99%;color: #fff;cursor: pointer;">X</button>
</div>
<div class="md-content">
</div>
</div>
<div class="md-overlay"></div>
</div>
<!-- Page body end -->
</div>
<div id="styleSelector">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Required Jquery -->
<script type="text/javascript" src="plugin/jquery/dist/jquery.min.js"></script>
<script type="text/javascript" src="plugin/jquery-ui/jquery-ui.min.js"></script>
<script type="text/javascript" src="plugin/popper.js/dist/umd/popper.min.js"></script>
<script type="text/javascript" src="plugin/bootstrap/dist/js/bootstrap.min.js"></script>
<!-- jquery slimscroll js -->
<script type="text/javascript" src="plugin/jquery-slimscroll/jquery.slimscroll.js"></script>
<!-- modernizr js -->
<script type="text/javascript" src="plugin/modernizr/modernizr.js"></script>
<script type="text/javascript" src="plugin/modernizr/feature-detects/css-scrollbars.js"></script>
<!-- <script type="text/javascript" src="assets/js/modal.js"></script>
-->
<!-- modalEffects js nifty modal window effects -->
<script type="text/javascript" src="assets/js/modalEffects.js"></script>
<script type="text/javascript" src="assets/js/classie.js"></script>
<!-- jquery file upload js -->
<script src="assets/pages/jquery.filer/js/jquery.filer.min.js"></script>
<script src="assets/pages/filer/custom-filer.js" type="text/javascript"></script>
<script src="assets/pages/filer/jquery.fileuploads.init.js" type="text/javascript"></script>
<!-- Custom js -->
<script src="assets/js/pcoded.min.js"></script>
<script src="assets/js/vartical-layout.min.js"></script>
<script src="assets/js/sweetalert.min.js"></script>
<script src="assets/js/jquery.mCustomScrollbar.concat.min.js"></script>
<script type="text/javascript" src="assets/js/script.js"></script>
<script type="text/javascript">
$('.md-trigger').click(function() {
var id = $(this).attr('data-id');
$.ajax({
url: "slideredit_model.php?id=" + id,
cache: false,
success: function(result) {
$(".md-content").html(result);
}
});
});
</script>
<script type="text/javascript">
$(".active1").on('click', function() {
var type = "active";
var slider_id = $(this).attr('data-id');
swal({
title: 'Are you sure?',
text: "You want to active this slider?",
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3f51b5',
cancelButtonColor: '#ff4081',
confirmButtonText: 'Great ',
closeOnEsc: false,
closeOnClickOutside: false,
buttons: {
cancel: {
text: "No",
value: null,
visible: true,
className: "btn btn-danger",
closeModal: true,
},
confirm: {
text: "Yes",
value: true,
visible: true,
className: "btn btn-primary",
closeModal: true
}
}
}).then((value) => {
if (value == true) {
$('#loaderid').removeClass('hideloader');
$.ajax({
url: "ajax/slider_action.php",
type: "POST",
data: {
"slider_id": slider_id,
"type": type
},
dataType: "json",
success: function(data) {
$('#loaderid').addClass('hideloader');
if (data == 'done') {
swal({
title: "Successfully Activated!",
text: "The slider has been successfully activated.",
type: "success",
icon: 'success',
confirmButtonColor: '#3f51b5',
confirmButtonText: 'OK ',
closeOnEsc: false,
closeOnClickOutside: false,
buttons: {
confirm: {
text: "Okay",
value: true,
visible: true,
className: "btn btn-primary",
closeModal: true
}
}
}).then((value) => {
if (value == true) {
location.reload();
}
})
} else {
swal("Internal Server Error!", "Please try again", "error");
}
},
error: function(xhr, ajaxOptions, thrownError) {
swal("Internal Server Error!", "Please try again", "error");
}
});
} else {
// swal(`The returned value is: ${value}`);
}
});
});
</script>
<script type="text/javascript">
$(".inactive").on('click', function() {
var type = "inactive";
var slider_id = $(this).attr('data-id');
console.log('m');
swal({
title: 'Are you sure?',
text: "You want to inactive this slider?",
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3f51b5',
cancelButtonColor: '#ff4081',
confirmButtonText: 'Great ',
closeOnEsc: false,
closeOnClickOutside: false,
buttons: {
cancel: {
text: "No",
value: null,
visible: true,
className: "btn btn-danger",
closeModal: true,
},
confirm: {
text: "Yes",
value: true,
visible: true,
className: "btn btn-primary",
closeModal: true
}
}
}).then((value) => {
if (value == true) {
$.ajax({
url: "ajax/slider_action.php",
type: "POST",
data: {
"slider_id": slider_id,
"type": type
},
dataType: "json",
success: function(data) {
if (data == 'done') {
swal({
title: "Successfully Deleted!",
text: "The slider has been successfully deactivated.",
type: "success",
icon: 'success',
confirmButtonColor: '#3f51b5',
confirmButtonText: 'OK ',
closeOnEsc: false,
closeOnClickOutside: false,
buttons: {
confirm: {
text: "Okay",
value: true,
visible: true,
className: "btn btn-primary",
closeModal: true
}
}
}).then((value) => {
if (value == true) {
location.reload();
}
})
} else {
swal("Internal Server Error!", "Please try again", "error");
}
},
error: function(xhr, ajaxOptions, thrownError) {
swal("Internal Server Error!", "Please try again", "error");
}
});
} else {
// swal(`The returned value is: ${value}`);
}
});
});
</script>
</body>
</html>
Zerion Mini Shell 1.0