Server IP : 108.170.25.35 / Your IP : 18.190.253.88 Web Server : Apache/2 System : Linux gains.winzonesoftech.com 4.18.0-513.24.1.el8_9.x86_64 #1 SMP Mon Apr 8 11:23:13 EDT 2024 x86_64 User : brindhavan ( 1477) PHP Version : 8.1.28 Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/brindhavan/public_html/bfrtYyuzqhPkRrwz/ |
Upload File : |
<?php include('session.php')?> <?php include('header.php')?> <?php include('connect.php')?> <link href="vendor/datatables/dataTables.bootstrap4.min.css" rel="stylesheet"> <style> img.banner { width: 145px; height: 86px; } .img-ed-hw{ height: auto; width: 117px; padding-bottom: 11px; } </style> <script> function show_confirm() { return confirm("Are You Sure"); } </script> <?php $id=$_GET['id']; $sql1="SELECT * FROM restaurant where id='$id'"; $res1=mysqli_query($conn,$sql1); $row1=mysqli_fetch_array($res1); if(isset($_POST['submit1'])) { $title=$_POST['title']; move_uploaded_file($_FILES['image']['tmp_name'],"img/".$_FILES['image']['name']); $image="img/".$_FILES['image']['name']; if($_FILES['image']['tmp_name'] != "") { $sql2=mysqli_query($conn,"UPDATE restaurant SET image='$image', title='$title' WHERE id='$id'"); } else{ $sql2=mysqli_query($conn,"UPDATE restaurant SET title='$title' WHERE id='$id'"); } if($sql2) { echo "<script>alert('Data Inserted successfully')</script>"; echo "<script>window.location.assign('on_going.php)</script>"; } else{ echo "<script>alert('Failed to submit data')</script>"; } } ?> <body id="page-top"> <!-- Page Wrapper --> <div id="wrapper"> <!-- Sidebar --> <?php include('sidebar.php')?> <!-- End of Sidebar --> <!-- Content Wrapper --> <div id="content-wrapper" class="d-flex flex-column"> <!-- Main Content --> <div id="content"> <!-- Topbar --> <?php include('topbar.php')?> <!-- End of Topbar --> <!-- Begin Page Content --> <div class="container-fluid"> <!-- Page Heading --> <div class="d-sm-flex align-items-center justify-content-between mb-4"> <h1 class="h3 mb-0 text-gray-800">Akshaya Restaurant Image</h1> <a href="restaurant.php"><button style="font-size: 15px;" class="h3 mb-0 text-gray-800">Go Back</button></a> </div> <div class="card shadow mb-4"> <div class="col-lg-7"> <div class="p-5"> <div class="text-center"> </div> <form class="user" action="" method="post" enctype="multipart/form-data"> <div class="form-group row"> <div class="col-sm-12 mb-3 mb-sm-0"> <label for="exampleInputFile">Name</label> <input type="text" class="form-control" id="exampleFirstName" placeholder="Product name" name="title" value="<?php echo $row1['title'];?>"> </div> <div class="col-sm-12 mb-3 mb-sm-0"> <label for="exampleInputFile">Image</label> <div class="img-d"> <img class="img-ed-hw" src="<?php echo $row1['image'];?>"> </div> <input type="file" class="form-control" id="exampleFirstName" placeholder="Offer message" name="image" value="<?php echo $row1['image'];?>"> </div> </div> <input type="submit" class="btn btn-primary btn-user btn-block" name="submit1" value="UPLOAD" style="background-color:#016224 ; border:1px solid #016224;"> </form> </div> </div> </div> <!-- DataTales Example --> <!-- DataTales Example --> <div class="card shadow mb-4"> <div class="card-header py-3"> <h6 class="m-0 font-weight-bold text-primary">DataTable</h6> </div> <div class="card-body"> <div class="table-responsive"> <table class="table table-bordered" id="dataTable" width="100%" cellspacing="0"> <thead> <tr> <th>S.No</th> <th> Name</th> <th> Image</th> <th>delete</th> </tr> </thead> <tbody> <?php $x = 1; $sql=mysqli_query($conn,"SELECT * FROM restaurant"); while($row=mysqli_fetch_array($sql)) { ?> <tr> <td><?php echo $x; ?></td> <td><?php echo $row['title']; ?></td> <td><img src="<?php echo $row['image']; ?>" class="banner"></td> <td> <a title="Delete" href="restaurant_delete.php?id=<?php echo $row['id']; ?>" class="" onclick='return show_confirm();'><img class="" src="img/del.png"></a></td> </tr> <?php $x++; } echo '<script type="text/javascript"> drawChart(); </script>'; ?> </tbody> </table> </div> </div> </div> </div> <!-- /.container-fluid --> </div> <!-- End of Main Content --> <?php include('footer.php')?>