One Hat Cyber Team
Your IP :
216.73.216.240
Server IP :
162.240.106.28
Server :
Linux server.ganesand.com 3.10.0-1160.80.1.el7.x86_64 #1 SMP Tue Nov 8 15:48:59 UTC 2022 x86_64
Server Software :
Apache
PHP Version :
7.1.33
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
thoa
/
www
/
admin
/
Edit File:
mg_latest.php
<?php include('config.php'); ?> <?php /* $con = mysql_connect('localhost', 'root', ''); mysql_select_db("ecomm", $con); */ error_reporting(0); ?> <?php $LT_ID = $_GET['LT_ID']; $view = mysql_query("select * from latest where LT_ID = '".$LT_ID."'"); // for editing $data = mysql_fetch_array($view); if($_GET['SAI']){ $STS = $_GET['LT_STS']; if($STS == 0){ $upd_sts = mysql_query("UPDATE latest SET LT_STS ='0' WHERE LT_ID ='".$_GET['SAI']."'"); //for changing status } else{ $upd_sts = mysql_query("UPDATE latest SET LT_STS ='1' WHERE LT_ID ='".$_GET['SAI']."'"); } } if($_GET['del_id']){ ?> <?php $del = mysql_query("delete from latest where LT_ID='".$_GET['del_id']."'"); //for deleting status if($del){?> <script> alert("Image deleted sucessfully"); window.location= "mg_latest.php"; </script> <?php } if(!$del){?> <script> alert("Image Not deleted sucessfully"); window.location= "mg_latest.php"; </script> <?php } } if($_POST['submit']){ $sname = $_POST['title']; $simage = ($_FILES['image']['name']); $sdescription = mysql_real_escape_string($_POST['sdescription']); $tmp_img = $_FILES['image']['tmp_name']; move_uploaded_file($tmp_img, "images/".$simage); if($_GET['LT_ID']==""){ $ins = mysql_query("insert into latest (LT_NAME,LT_IMG) values('$sname','$simage')"); } if($_GET['LT_ID']!=""){ if($_FILES['image']['name']!=""){ $upd = mysql_query("update latest set LT_NAME='$sname', LT_IMG='$simage' where LT_ID='".$LT_ID."'"); //header('Location:mg_slide.php'); } else { $upd = mysql_query("update latest set LT_NAME='$sname' WHERE LT_ID ='".$LT_ID."'"); } if($upd){?> <script>alert("updated sucessfully"); window.location ="mg_latest.php" </script> <?php } if(!$upd){?> <script>alert("Not updated sucessfully"); window.location ="mg_latest.php" </script> <?php } } } ?> <script> function del(id){ var del = confirm("Are you sure Want to delete"); if(del){ window.location.href = "mg_latest.php?del_id="+id+"&del=1"; } else{ window.location.href = "mg_latest.php"; } } </script> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Admin Panel</title> <link href="css/bootstrap.min.css" rel="stylesheet"> <link href="css/datepicker3.css" rel="stylesheet"> <link href="css/styles.css" rel="stylesheet"> <!--[if lt IE 9]> <script src="js/html5shiv.js"></script> <script src="js/respond.min.js"></script> <![endif]--> </head> <body> <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#sidebar-collapse"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="#">Admin</a> <ul class="user-menu"> <li class="dropdown pull-right"> <a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="glyphicon glyphicon-user"></span> User <span class="caret"></span></a> <ul class="dropdown-menu" role="menu"> <li><a href="#"><span class="glyphicon glyphicon-user"></span> Profile</a></li> <li><a href="#"><span class="glyphicon glyphicon-cog"></span> Settings</a></li> <li><a href="logou.php"><span class="glyphicon glyphicon-log-out"></span> Logout</a></li> </ul> </li> </ul> </div> </div><!-- /.container-fluid --> </nav> <div id="sidebar-collapse" class="col-sm-3 col-lg-2 sidebar"> <form role="search"> <div class="form-group"> <input type="text" class="form-control" placeholder="Search"> </div> </form> <ul class="nav menu"> <li class="active"><a href="dash.php"><span class="glyphicon glyphicon-dashboard"></span> Dashboard</a></li> <li><a href="mg_welcome.php"><span class="glyphicon glyphicon-th"></span> Manage Welcome Image</a></li> <li><a href="mg_banner.php"><span class="glyphicon glyphicon-th"></span> Manage Banner</a></li> <li><a href="mg_trending.php"><span class="glyphicon glyphicon-th"></span> Manage Trending News</a></li> <li><a href="mg_latest.php"><span class="glyphicon glyphicon-th"></span>Manage Lastest Movie</a></li> <li><a href="mg_moviedetails.php"><span class="glyphicon glyphicon-th"></span>Manage Movie Details</a></li> <li><a href="mg_gallery.php"><span class="glyphicon glyphicon-th"></span>Manage Gallery</a></li> </ul> </div><!--/.sidebar--> <div class="col-sm-9 col-sm-offset-3 col-lg-10 col-lg-offset-2 main"> <div class="row"> <ol class="breadcrumb"> <li><a href="#"><span class="glyphicon glyphicon-home"></span></a></li> <li class="active">Manage Latest Movies</li> </ol> </div><!--/.row--> <div class="row"> <div class="col-lg-12"> <h2 class="page-header">Add Latest Movie</h2> </div> </div><!--/.row--> <section class="content"> <div class="row"> <!-- left column --> <div class="col-xs-12"> <!-- general form elements --> <div class="box box-primary"> <!-- form start --> <div class="container"> <form role="form" method="post" action="" enctype="multipart/form-data"> <div class="box-body"> <div class="form-group col-sm-11""> <label for="exampleInputEmail1">Movie Name</label> <input type="text" class="form-control" name="title" value="<?php echo $data['LT_NAME']; ?>"> </div> <div class="form-group col-sm-11"> <label for="exampleInputFile">Movie Banner Image</label> <input type="file" name="image" id="exampleInputFile"> <?php if($LT_ID){?> <img src = "images/<?php echo $data['LT_IMG'];?>" height="100" width="100"></img> <?php }?> </div> <!-- /.box-body --> <div class="box-footer col-sm-11"> <button type="submit" name="submit" value="submit" class="btn btn-primary">Submit</button> <button type="reset" class="btn btn-primary">Reset</button> </div> </div> </form> </div> </div> </div> </div> </section> <hr> <div class="row"> <div class="col-lg-12"> <div class="panel panel-default"> <div class="panel-heading">Latest Movie Table</div> <div class="panel-body"> <table data-toggle="table" data-show-refresh="true" data-show-toggle="true" data-show-columns="true" data-search="true" data-select-item-name="toolbar1" data-pagination="true" data-sort-name="name" data-sort-order="desc"> <thead> <tr> <th data-field="state" data-checkbox="true" >Item ID</th> <th data-field="id" data-sortable="true">Item ID</th> <th data-field="name" data-sortable="true">Movie Name</th> <th data-field="image" data-sortable="true">Image</th> <th data-field="action" data-sortable="true">Action</th> <th data-field="status" data-sortable="true">Status</th> </tr> </thead> <tbody> <?php $table = mysql_query("select * from latest"); $LT_ID=1; while($row=mysql_fetch_array($table)) { ?> <tr> <td></td> <td><?php echo $LT_ID;?></td> <td><?php echo $row['LT_NAME'];?></td> <td><img src="images/<?php echo $row['LT_IMG'];?>" height="100" width="100"></td> <td><a href= "mg_latest.php?LT_ID=<?php echo $row['LT_ID'];?>">Edit</a>/<a href="#" onclick="del(<?php echo $row['LT_ID'];?>)">Delete</a></td> <td><?php if($row['LT_STS']==1) {?> <a href = "mg_latest.php?LT_STS=0&SAI=<?php echo $row['LT_ID'];?>">Active</a> <?php } else {?> <a href = "mg_latest.php?LT_STS=1&SAI=<?php echo $row['LT_ID'];?>">InActive </a> <?php } ?></td> </tr> <?php $LT_ID++; }?> </tbody> </table> </div> </div> </div> </div> </div> <!--/.main--> <script src="js/jquery-1.11.1.min.js"></script> <script src="js/bootstrap.min.js"></script> <script src="js/chart.min.js"></script> <script src="js/chart-data.js"></script> <script src="js/easypiechart.js"></script> <script src="js/easypiechart-data.js"></script> <script src="js/bootstrap-datepicker.js"></script> <script src="js/bootstrap-table.js"></script> <script> $('#calendar').datepicker({ }); !function ($) { $(document).on("click","ul.nav li.parent > a > span.icon", function(){ $(this).find('em:first').toggleClass("glyphicon-minus"); }); $(".sidebar span.icon").find('em:first').addClass("glyphicon-plus"); }(window.jQuery); $(window).on('resize', function () { if ($(window).width() > 768) $('#sidebar-collapse').collapse('show') }) $(window).on('resize', function () { if ($(window).width() <= 767) $('#sidebar-collapse').collapse('hide') }) </script> </body> </html>
Simpan