CasperSecurity
<?php
include("../includes/connection.php");
if (!isset($_SESSION['id'])):
header("location:index.php");
endif;
$page1 = "home";
$url=$connect->real_escape_string($_POST['url']);
$stage = $connect->real_escape_string($_POST['stage']);
if ($delid != ""){
$upsql = "delete from mng_notice where id={$delid}";
db_query($upsql);
$msg = "Record Deleted Successfully.";
setcookie("msg", $msg, time() + 3);
header("Location: mng_welcome.php");
}
if ($stage == 2) {
$sql = "INSERT INTO `link`( `url`) VALUES ('$url')";
db_query($sql);
//include('pagemanipulate.php');
$msg = "Notic Added Successfully.";
setcookie("msg", $msg, time() + 3);
print "<script>";
print "self.location = 'mng_welcome.php';";
print "</script>";
exit;
}
// print_r($sql);
/*SELECT BANNER*/
$sql="SELECT * FROM mng_notice";
$result = db_query($sql);
$row = $result->fetch_assoc();
// print_r($row['page_image']);
// die();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php include("css.php"); ?>
<script src="tinymce/tinymce.min.js" referrerpolicy="origin"></script>
<script>
tinymce.init({
selector: '#buyers,#sellers,#content',
height: 300,
plugins: 'print preview paste importcss searchreplace autolink autosave save directionality code visualblocks visualchars fullscreen image link media template codesample table charmap hr pagebreak nonbreaking anchor toc insertdatetime advlist lists wordcount imagetools textpattern noneditable help charmap emoticons',
menubar: 'file edit view insert format tools table help',
toolbar: 'undo redo | bold italic underline strikethrough | fontselect fontsizeselect formatselect | alignleft aligncenter alignright alignjustify | outdent indent | numlist bullist | forecolor backcolor removeformat | pagebreak | charmap emoticons | fullscreen preview save print | insertfile image media template link anchor codesample | ltr rtl',
toolbar_sticky: false,
image_advtab: true,
external_filemanager_path:"filemanager/",
filemanager_title:"Filemanager" ,
external_plugins: { "filemanager" : "../filemanager/plugin.min.js"},
content_css: [
'//fonts.googleapis.com/css?family=Lato:300,300i,400,400i',
'//www.tiny.cloud/css/codepen.min.css'
],
extended_valid_elements: 'span[class=]',
importcss_append: false,
});
function chnageLang(val){
self.location = 'mng_welcome.php';
}
</script>
</head>
<body class="sidebar-pinned">
<?php include("left.php") ?>
<main class="admin-main">
<!--site header begins-->
<?php include("admin_header.php");?>
<!--site header ends -->
<section class="admin-content ">
<div class="bg-dark">
<div class="container m-b-30">
<div class="row">
<div class="col-12 text-white p-t-40 p-b-90">
<h4 class="">Manage Link</h4>
<p class="opacity-75 "></p>
</div>
</div>
</div>
</div>
<div class="container pull-up">
<div class="row" style="margin: 0 auto; width:100%; align-items: center;
justify-content: center;">
<!--message-->
<?php if ($_COOKIE['msg']) { ?>
<div class="clearfix"></div>
<div class="col-lg-8">
<div class="alert alert-success">
<a href="#" class="close" data-dismiss="alert" onClick="$('.alert').hide('slow');">×</a>
<?php print str_replace("+", " ", $_COOKIE['msg']); ?>
</div>
</div>
<?php } ?>
<!--message-->
<div class="col-lg-12">
<div class="card m-b-30">
<div class="card-header">
<h5 class="m-b-0">
</h5>
<p class="m-b-0 text-muted">
</p>
</div>
<form method="POST" name="cms" action="mng_welcome.php" enctype="multipart/form-data">
<input type="hidden" name="stage" value="2">
<div class="card-body ">
<div class="form-row m-b-30">
<label for="buyers">URL</label>
<input type="text" class="form-control" value="<?php print $row['url'];?>" name="url" >
</div>
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary">Submit</button>
</div>
</div>
</form>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-hover">
<thead>
<tr>
<th>#</th>
<th>URL</th>
<th class="text-center" style="width:240px;">Action</th>
</tr>
</thead>
<tbody>
<?php
$sqlfetch = "SELECT * FROM link";
$sqlfetch = db_query($sqlfetch);
$i = 1;
while ($row = mysqli_fetch_array($sqlfetch))
{
$id=$row['id'];
?>
<tr>
<td><?php echo $i; ?></td>
<td><?php echo $row[1]; ?></td>
<td class="text-center">
<a href=mng_welcome.php"?delid=<?php print $row['id']; ?>" onclick ="return confirm('Are you sure to delete ?')"><i class="mdi mdi-delete-forever"></i></a></td>
</td>
</tr>
<?php
$i++;
} ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</section>
</main>
<?php include("js.php"); ?>
<!--Additional Page includes-->
<script src="assets/vendor/apexchart/apexcharts.min.js"></script>
<!--chart data for current dashboard-->
<script src="assets/js/dashboard-01.js" type="text/javascript"></script>
<script>
grecaptcha.ready(function () {
grecaptcha.execute('<?php print $sitekey; ?>',{action:'login'}).then(function(token){
var recaptchaResponse = document.getElementById('recaptchaResponse');
recaptchaResponse.value = token;
});
});
</script>
</body>
</html>