<?php include 'dbcon.php'; ?>
<?php

if(isset($_POST['submit']))
{   $report=$_POST['name'];
    $id=$_POST['hid_id'];
   
    $name=$_FILES['file']['name'];
    $tmp_name=$_FILES['file']['tmp_name'];
    move_uploaded_file($tmp_name,'images/'.$name);
    if($name==''){
        $name=$_POST['hid'];

    }
    $query=mysqli_query($con,"update report set name='$report',photo='$name' where id='$id'");
    if($query){
        echo"<script>alert('completed');</script>";
    }
}
?>
<?php
if(isset($_GET['id'])){
$query=mysqli_query($con,"delete from query where id='".$_GET['id']."'");
if($query){
    echo "<script>alert('Query is Deleted');window.location.href='query_list.php';</script>";
}
}

?>


?>
<!doctype html>
<html class="no-js" lang="">


<!-- Mirrored from www.radiustheme.com/demo/html/psdboss/global-abroadstudy/global-abroadstudy/all-student.html by HTTrack Website Copier/3.x [XR&CO'2014], Tue, 06 Sep 2022 11:11:33 GMT -->
<head>
    <meta charset="utf-8">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <title>global-abroadstudy | Query List</title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- Favicon -->
    <link rel="shortcut icon" type="image/x-icon" href="images/logo-mobile.jpg">
    <!-- Normalize CSS -->
    <link rel="stylesheet" href="css/normalize.css">
    <!-- Main CSS -->
    <link rel="stylesheet" href="css/main.css">
    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <!-- Fontawesome CSS -->
    <link rel="stylesheet" href="css/all.min.css">
    <!-- Flaticon CSS -->
    <link rel="stylesheet" href="fonts/flaticon.css">
    <!-- Animate CSS -->
    <link rel="stylesheet" href="css/animate.min.css">
    <!-- Data Table CSS -->
    <link rel="stylesheet" href="css/jquery.dataTables.min.css">
    <!-- Custom CSS -->
    <link rel="stylesheet" href="style.css">
    <!-- Modernize js -->
    <script src="js/modernizr-3.6.0.min.js"></script>
</head>

<body>
    <!-- Preloader Start Here -->
    <div id="preloader"></div>
    <!-- Preloader End Here -->
    <div id="wrapper" class="wrapper bg-ash">
        <!-- Header Menu Area Start Here -->
        <?php include 'header.php'; ?>
        <!-- Header Menu Area End Here -->
        <!-- Page Area Start Here -->
        <div class="dashboard-page-one">
            <!-- Sidebar Area Start Here -->
        <?php include 'sidebar.php'; ?>
            <!-- Sidebar Area End Here -->
            <div class="dashboard-content-one">
                <!-- Breadcubs Area Start Here -->
                <div class="breadcrumbs-area">
                    <h3>Query List</h3>
                    <ul>
                        <li>
                            <a href="index.html">Home</a>
                        </li>
                        <li>Query List</li>
                    </ul>
                </div>
                <!-- Breadcubs Area End Here -->
                <!-- Student Table Area Start Here -->
                <div class="card height-auto">
                    <div class="card-body">
                        <div class="heading-layout1">
                            <div class="item-title">
                                <h3>All Query</h3>
                            </div>
                            <!-- <div class="dropdown">
                                <a class="dropdown-toggle" href="#" role="button" data-toggle="dropdown"
                                    aria-expanded="false">...</a>

                                <div class="dropdown-menu dropdown-menu-right">
                                    <a class="dropdown-item" href="#"><i
                                            class="fas fa-times text-orange-red"></i>Delete</a>
                                    <a class="dropdown-item" href="#"><i
                                            class="fas fa-cogs text-dark-pastel-green"></i>Edit</a>
                                    <a class="dropdown-item" href="gallery_list.php"><i
                                            class="fas fa-redo-alt text-orange-peel"></i>Refresh</a>
                                </div>
                            </div> -->
                        </div>
                        <!-- <form class="mg-b-20">
                            <div class="row gutters-8">
                                <div class="col-3-xxxl col-xl-3 col-lg-3 col-12 form-group">
                                    <input type="text" placeholder="Search by Roll ..." class="form-control">
                                </div>
                                <div class="col-4-xxxl col-xl-4 col-lg-3 col-12 form-group">
                                    <input type="text" placeholder="Search by Name ..." class="form-control">
                                </div>
                                <div class="col-4-xxxl col-xl-3 col-lg-3 col-12 form-group">
                                    <input type="text" placeholder="Search by Class ..." class="form-control">
                                </div>
                                <div class="col-1-xxxl col-xl-2 col-lg-3 col-12 form-group">
                                    <button type="submit" class="fw-btn-fill btn-gradient-yellow">SEARCH</button>
                                </div>
                            </div>
                        </form> -->
                        <div class="table-responsive">
                            <table class="table display data-table text-nowrap">
                                <thead>
                                    <tr>
                                        <th>
                                           
                                                <!-- <input type="checkbox" class="form-check-input checkAll"> -->
                                               S.NO
                                            
                                        </th>
                                        <th>Name</th>
                                        <th>Email</th>
                                      
                                        <th>Message</th>
                                        <th>Action</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <?php 
                                    include 'dbcon.php'; ?>
                                    <?php
                                    $query=mysqli_query($con,"select * from query");
                                    $a=1;
                                    while($row=mysqli_fetch_array($query)){
                                    ?>
                                    <tr>
                                        <td>
                                           <?php echo $a ?>
                                        </td>
                                        <td class="text-center" ><?php echo $row['name'] ?></td>
                                    
                                        <td class="text-center" ><?php echo $row['email'] ?></td>
                                        <!-- <td class="text-center" ><?php echo $row['number'] ?></td> -->
                                        <!-- <td class="text-center" ><?php echo $row['subject'] ?></td> -->
                                        <td class="text-center" ><?php echo $row['comment'] ?></td>
                                        <td>
                                            <div class="dropdown">
                                                <a href="#" class="dropdown-toggle" data-toggle="dropdown"
                                                    aria-expanded="false">
                                                    <span class="flaticon-more-button-of-three-dots"></span>
                                                </a>
                                                <div class="dropdown-menu dropdown-menu-right">
                                                    <a class="dropdown-item" href="query_list.php?id=<?php echo $row['id']; ?>"><i
                                                            class="fas fa-times text-orange-red" ></i>Delete</a>
                                                   </div>
                                            
                                            </div>
                                        </td>
                                    </tr>
                                    <div class="modal sign-up-modal fade" id="edit<?php echo $row['id']; ?>" tabindex="-1" role="dialog"
                                    aria-hidden="true">
                                    <div class="modal-dialog modal-dialog-centered" role="document">
                                        <div class="modal-content">
                                            <div class="modal-body">
                                                <div class="close-btn">
                                                    <button type="button" class="close" data-dismiss="modal"
                                                        aria-label="Close">
                                                        <span aria-hidden="true">&times;</span>
                                                    </button>
                                                </div>
                                                <div class="item-logo text-center mb-20">
                                                    <img style="height:100px" src="<?php echo 'images/'.$row['photo'] ?>" alt="logo">
                                                </div>
                                                <form class="login-form" method="post" enctype="multipart/form-data">
                                                    <div class="row gutters-15">
                                                    <div class="form-group col-sm-6">
                                                            <input type="hidden" placeholder="Report Name" name="hid_id" class="form-control" value=<?php echo $row['id'] ?>>
                                                        </div>
                                                    
                                                     
                                                        <div class="form-group col-sm-6">
                                                            <input type="hidden" placeholder="City" name="hid" class="form-control" value=<?php echo $row['photo'] ?>>
                                                        </div>
                                                        <div class="form-group col-sm-12">
                                                            <input type="text" placeholder="City" name="name" class="form-control" value=<?php echo $row['name'] ?>>
                                                        </div>
                                                        <div class="form-group col-12">
                                                          
                                                     
                                                        
                                                            <input type="file" name="file" placeholder="Photo" class="form-control">

                                                      
                                                        <div class="form-group col-12 text-center">
                                                            <button type="submit" name="submit" class="border-0 rounded text-light footer-btn bg-linkedin">Edit Report</button>
                                                        </div>
                                                    </div>
                                                </form>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                    <?php  $a++;} ?>
                              
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
                <!-- Student Table Area End Here -->
             <?php include 'footer.php'; ?>
            </div>
        </div>
        <!-- Page Area End Here -->
    </div>
    <!-- jquery-->
    <script src="js/jquery-3.3.1.min.js"></script>
    <!-- Plugins js -->
    <script src="js/plugins.js"></script>
    <!-- Popper js -->
    <script src="js/popper.min.js"></script>
    <!-- Bootstrap js -->
    <script src="js/bootstrap.min.js"></script>
    <!-- Scroll Up Js -->
    <script src="js/jquery.scrollUp.min.js"></script>
    <!-- Data Table Js -->
    <script src="js/jquery.dataTables.min.js"></script>
    <!-- Custom Js -->
    <script src="js/main.js"></script>

</body>


<!-- Mirrored from www.radiustheme.com/demo/html/psdboss/global-abroadstudy/global-abroadstudy/all-student.html by HTTrack Website Copier/3.x [XR&CO'2014], Tue, 06 Sep 2022 11:11:33 GMT -->
</html>