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
/
public_html
/
admin
/
Edit File:
mg_images.php
<?php include('config.php'); ?> <?php /* $con = mysqli_connect('localhost', 'root', ''); mysqli_select_db("ecomm", $con); */ error_reporting(0); ?> <?php session_start(); $IMG_ID = $_GET['IMG_ID']; $CON_ID = $_GET['CON_ID']; $view = mysql_query("select * from images where IMG_ID = '".$IMG_ID."'"); // for editing $data = mysql_fetch_array($view); if($_GET['SAI']){ $STS = $_GET['IMG_STS']; if($STS == 0){ $upd_sts = mysql_query("UPDATE images SET IMG_STS ='0' WHERE IMG_ID ='".$_GET['SAI']."'"); //for changing status } else{ $upd_sts = mysql_query("UPDATE images SET IMG_STS ='1' WHERE IMG_ID ='".$_GET['SAI']."'"); } } if($_GET['del_id']){ ?> <?php $del = mysql_query("delete from images where IMG_ID='".$_GET['del_id']."'"); //for deleting status if($del){?> <script> alert("Image deleted sucessfully"); window.location= "mg_images.php?CON_ID=<? echo $CON_ID;?>"; </script> <?php } if(!$del){?> <script> alert("Image Not deleted sucessfully"); window.location= "mg_images.php?CON_ID=<?echo $CON_ID;?>"; </script> <?php } } if($_POST['submit']){ $simage = ($_FILES['image']['name']); $tmp_img = $_FILES['image']['tmp_name']; move_uploaded_file($tmp_img, "images/sub/".$simage); if($_GET['IMG_ID']==""){ $ins = mysql_query("insert into images (IMG_IMG,CON_ID) values('$simage','$CON_ID')"); } if($_GET['IMG_ID']!=""){ if($_FILES['image']['name']!=""){ $upd = mysql_query("update images set IMG_IMG='$simage' where IMG_ID='".$IMG_ID."'"); } if($upd){?> <script>alert("updated sucessfully"); window.location ="mg_images.php?CON_ID=<?echo $CON_ID?>" </script> <?php } if(!$upd){?> <script>alert("Not updated sucessfully"); window.location ="mg_images.php?CON_ID=<?echo $CON_ID?>" </script> <?php } } } ?> <script> function del(id){ var del = confirm("Are you sure Want to delete"); if(del){ window.location.href = "mg_images.php?CON_ID=<?echo $CON_ID?>&del_id="+id+"&del=1"; } else{ window.location.href = "mg_images.php?CON_ID=<?echo $CON_ID?>"; } } </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/styles.css" rel="stylesheet"> <link href="css/bootstrap-table.css" rel="stylesheet"> </head> <body> <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a href="#"><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> <a class="navbar-brand" href="#"><b>Fine Home Delivery Menu</b></a> <ul class="user-menu"> <li class="dropdown pull-right"> <a href="#" class="dropdown-toggle" data-toggle="dropdown"><img src="own.png" style="border-radius:40%;width:35px;height:35px;"> MR. Ramachandran<span class="caret"></span></a> <ul class="dropdown-menu" role="menu"> <li><a href="logou.php" style="color:red;"><span class="glyphicon glyphicon-off"></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> <? include('header.php');?> </div> <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 Individual Gallery Images</li> </ol> </div> <div class="row"> <div class="col-lg-12"> <h2 class="page-header">Add Images</h2> </div> </div> <section class="content"> <div class="row"> <div class="col-xs-12"> <div class="box box-primary"> <div class="container"> <form role="form" method="post" action="" enctype="multipart/form-data"> <div class="box-body"> <div class="form-group col-sm-8"> <label for="exampleInputFile" style="float:right;"><a href="mg_content.php"><img src="back.png" width="40px" > Back to Products</a></label> </div> <div class="form-group col-sm-6"> <label for="exampleInputFile">Choose Image</label> <input type="file" name="image" id="exampleInputFile"> <?php if($IMG_ID){?> <img src = "images/sub/<?php echo $data['IMG_IMG'];?>" height="100" width="100"></img> <?php }?> </div> <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" style="position: absolute;width:100%;"> <div class="col-lg-12"> <div class="panel panel-default"> <div class="panel-heading">Gallery 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="image" data-sortable="true">Image</th> <th data-field="action" data-sortable="true">Action</th> </tr> </thead> <tbody> <?php $table = mysql_query("select * from images where CON_ID='".$CON_ID."'"); $IMG_ID=1; while($row=mysql_fetch_array($table)) { ?> <tr> <td></td> <td><?php echo $IMG_ID;?></td> <td><img src="images/sub/<?php echo $row['IMG_IMG'];?>" height="100" width="100"></td> <td><a href= "mg_images.php?CON_ID=<?echo $CON_ID?>&IMG_ID=<?php echo $row['IMG_ID'];?>">Edit</a>/<a href="#" onclick="del(<?php echo $row['IMG_ID'];?>)">Delete</a></td> </tr> <?php $IMG_ID++; }?> </tbody> </table> </div> </div> </div> </div> </div> <script src="js/jquery-1.11.1.min.js"></script> <script src="js/bootstrap.min.js"></script> <script src="js/bootstrap-table.js"></script> </body> </html>
Simpan