D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
ipuco
/
www
/
superadmin
/
Filename :
list-of-all-comments-data.php
back
Copy
<?php ob_start(); session_start(); include('include/connection.php'); $emailid=$_SESSION['emailid']; $adminid=$_SESSION['id']; $per=mysqli_query($conn,"select * from admin where id='".$adminid."'"); $perq1=mysqli_fetch_array($per); if (!(isset($_SESSION['emailid']) && $_SESSION['emailid'] != '')) { header ("Location: index.php"); } if(isset($_GET['referesh'])) { $status1 =$_REQUEST['status1']; mysqli_query($conn, "DELETE FROM comments where comments_id='$status1'") or die(mysql_error()); header("Location: list-of-all-comments-data.php"); } if(isset($_POST['update'])) { date_default_timezone_set('Asia/Kolkata'); $name=addslashes($_POST['name']); $email=addslashes($_POST['email']); $phone=addslashes($_POST['phone']); if($_FILES['file1']['name']=="") { $new_file_name1 = $_POST['file1']; } else { $file_name1 = $_FILES['file1']['name']; //$random_digit1 = rand(0000,9999); $new_file_name1 = $random_digit1.$file_name1; $path1 = "../cmt/".$new_file_name1; copy($_FILES['file1']['tmp_name'], $path1); } $comment=addslashes($_POST['comment']); $postdate=date("Y-m-d"); $posttime=date('H:i:s'); $status=$_POST['status']; $comments_id=addslashes($_POST['comments_id']); if(mysqli_query($conn,"update comments set name = '$name',email = '$email',phone = '$phone',file1 = '$new_file_name1', comment = '$comment', postdate = '$postdate',posttime = '$posttime',status = '$status' where comments_id='$comments_id'")) { ?><script type="text/javascript"> //alert("Data Inserted Successfully"); window.location='list-of-all-comments-data.php'; </script><?php } else { ?><script type="text/javascript"> alert("Error! Data Not Updated"); window.location='list-of-all-comments-data.php'; </script><?php echo mysql_error(); } } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0,minimal-ui"> <title>IPU - Comments Data </title> <meta content="Admin Dashboard" name="description"> <meta content="Themesbrand" name="author"> <link rel="shortcut icon" href="assets/images/favicon.ico"> <link href="assets/css/bootstrap.min.css" rel="stylesheet" type="text/css"> <link href="assets/css/metismenu.min.css" rel="stylesheet" type="text/css"> <link href="assets/css/icons.css" rel="stylesheet" type="text/css"> <link href="assets/css/style.css" rel="stylesheet" type="text/css"> <script src="https://cdn.ckeditor.com/4.14.0/standard/ckeditor.js"></script> <link rel="stylesheet" href="https://cdn.datatables.net/1.10.23/css/dataTables.bootstrap.min.css"> <style> .dataTables_length, .dataTables_paginate, .dataTables_info { display: block !important; } .blink_me { animation: blinker 1s linear infinite; } @keyframes blinker { 50% { opacity: 0; } } </style> </head> <body> <!-- Begin page --> <div id="wrapper"> <!-- Top Bar Start --> <?php include('include/top-header.php');?> <!-- Top Bar End --> <!-- ========== Left Sidebar Start ========== --> <div class="left side-menu"> <?php include('include/left-menu.php');?> <!-- Sidebar -left --> </div> <!-- Left Sidebar End --> <!-- ============================================================== --> <!-- Start right Content here --> <!-- ============================================================== --> <div class="content-page"> <!-- Start content --> <div class="content"> <div class="container-fluid"> <div class="page-title-box"> <div class="row align-items-center"> <div class="col-sm-10"> <h4 class="page-title">Comments Data Management</h4> <ol class="breadcrumb"> <li class="breadcrumb-item"><a href="dashboard.php">Dashboard</a></li> <li class="breadcrumb-item active">List Of Comments Data</li> </ol> </div> <div class="col-sm-2"> </div> </div> </div> <!-- end row --> <div class="row"> <div class="col-12"> <div class="card"> <div class="card-body"> <h4 class="mt-0 header-title"><i class="ti-agenda text-primary mr-2"></i>List of Comments Data </h4> <p class="text-muted m-b-30"></p> <p class="text-muted m-b-30"></p> <div class="table-responsive"> <table id="example" class="table table-bordered mb-0"> <thead> <tr> <th># </th> <th>Name </th> <th>E-Mail Id </th> <th>Mobile No. </th> <th>Photo </th> <th>Comment </th> <th>Post Date/Time </th> <th>Status </th> <th>Action </th> </tr></thead><tbody> <?php $i=1; $select=mysqli_query($conn,"SELECT * FROM comments order by comments_id DESC"); while($result=mysqli_fetch_array($select)) { ?> <tr> <th scope="row"><?php echo $i; ?></th> <td><?php echo $result['name']; ?></td> <td><?php echo $result['email']; ?></td> <td><?php echo $result['phone']; ?></td> <td> <?php $file1=$result['file1']; if($file1 !='') { ?> <img src="../cmt/<?php echo $result['file1']; ?>" width="50px" height="50px"></td> <?php } else { ?> <img src="college/3-dummy.jpg" width="50px" height="50px"></td> <?php } ?> </td> <td><?php echo $result['comment']; ?></td> <td><?php echo $result['postdate']; ?> <?php echo $result['posttime']; ?></td> <td> <?php $status=$result['status']; if($status !='0') { echo "Active"; } else { echo "Not Active"; } ?> </td> <td> <a href="#edit<?php echo $result['comments_id'];?>" data-toggle="modal" ><i class="far fa-edit"></i></a> <a href="list-of-all-comments-data.php?referesh=delete&&status1=<?php echo $result['comments_id'];?>" onclick="return confirm('Are you sure you want to delete this College Listing ?');"> <i class="far fa-trash-alt"></i> </a> </td> </tr> <!--Update Code--> <div class="modal fade" id="edit<?php echo $result['comments_id'];?>" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> </div> <div class="modal-body"> <?php $fetch=mysqli_query($conn,"select * from comments where comments_id='".$result['comments_id']."'"); $fetch1=mysqli_fetch_array($fetch); ?> <div class="container-fluid"> <form method="POST" action="" enctype="multipart/form-data"> <input type="hidden" name="comments_id" value="<?php echo $result['comments_id'];?>" /> <div class="form-group"><label>Name</label> <input type="text" class="form-control" name="name" value="<?php echo $result['name'];?>" /> </div> <div class="form-group"><label>Email</label> <input type="text" class="form-control" name="email" value="<?php echo $result['email'];?>" /> </div> <div class="form-group"><label>Phone No.</label> <input type="text" class="form-control" name="phone" value="<?php echo $result['phone'];?>" /> </div> <div class="form-group"><label>Photo </label> <input type="hidden" name="file1" value="<?php echo $fetch1['file1'];?>" /> <input type="file" name="file1" class="form-control" /> <br /> <img src="../cmt/<?php echo $fetch1['file1']; ?>" alt="" height="50" width="50"> </div> <div class="form-group"><label>Comment</label> <textarea name="comment" id="editor12" class="form-control"><?php echo $result['comment'];?></textarea> </div> <div class="form-group"><label>Status</label> <select class="form-control" name="status"> <option value="">Status</option> <option value="1">Active</option> <option value="0">In Active</option> </select> </div> </div> </div> <div class="modal-footer"> <div class="form-group"> <label></label> <button type="submit" class="btn btn-success waves-effect waves-light" name="update">Update</button> </div> </div> </form> </div> </div> </div> <!--Update Code--> <?php $i++; } ?> </tbody> </table> </div> </div> </div> </div> <!-- end col --> </div> <!-- container-fluid --> </div> <!-- content --> <?php include_once('include/admin-footer.php'); ?> </div> <!-- ============================================================== --> <!-- End Right content here --> <!-- ============================================================== --> </div> <!-- END wrapper --> <!-- jQuery --> <script src="assets/js/jquery.min.js"></script> <script src="assets/js/bootstrap.bundle.min.js"></script> <script src="assets/js/metisMenu.min.js"></script> <script src="assets/js/jquery.slimscroll.js"></script> <script src="assets/js/waves.min.js"></script> <!-- App js --> <script src="assets/js/app.js"></script> <script> CKEDITOR.replace( 'editor12' ); </script> <script src="https://cdn.datatables.net/1.10.23/js/jquery.dataTables.min.js"></script> <script src="https://cdn.datatables.net/1.10.23/js/dataTables.bootstrap.min.js"></script> <script> $(document).ready(function() { $('#example').DataTable(); } ); </script> </body> </html>