<?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='dashboard.php';</script>";
}
}

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


<!-- Mirrored from www.radiustheme.com/demo/html/psdboss/global-abroadstudy/global-abroadstudy/index.html by HTTrack Website Copier/3.x [XR&CO'2014], Tue, 06 Sep 2022 11:10:04 GMT -->
<head>
    <meta charset="utf-8">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <title>PPM | Home </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="https://perfectpostmedia.com/assets/img/ppm.png">
    <!-- 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">
    <!-- Full Calender CSS -->
    <link rel="stylesheet" href="css/fullcalendar.min.css">
    <!-- Animate CSS -->
    <link rel="stylesheet" href="css/animate.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>Admin Dashboard</h3>
                    <ul>
                        <li>
                            <a href="dashboard.php">Home</a>
                        </li>
                        <li>Admin</li>
                    </ul>
                </div>
                <!-- Breadcubs Area End Here -->
                <!-- Dashboard summery Start Here -->
              
                <!-- Dashboard Content End Here -->
                <!-- Social Media Start Here -->
                <div class="row gutters-20">
                  <div class="col-lg-12 col-md-12 col-sm-12">
                  <a href="gallery_list.php">  <div class="card dashboard-card-seven">
                            <div class="social-media bg-fb hover-fb">
                                <div class="media media-none--lg">
                                    <div class="social-icon">
                                        <i class="fa fa-user"></i>
                                    </div>
                                    <div class="media-body space-sm">
                                        <h6 class="item-title">Blog</h6>
                                    </div>
                                </div>
                                <?php include 'dbcon.php';
                                $query=mysqli_query($con,"select * from blog");
                                $row=mysqli_num_rows($query); ?>
                                <div class="social-like"><?php echo $row ?></div>
                            </div>
                        </div></a>
                    </div>
              
                  
                </div>
           
                <!-- Dashboard summery End Here -->
                <!-- Dashboard Content Start Here -->
                <div class="row gutters-20">
                 
                
                
                    <div class="col-lg-12 col-xl-12 col-12-xxxl">
                    <div class="card height-auto">
                    <div class="card-body">
                        <div class="heading-layout1">
                            <div class="item-title">
                                <h3>All Blog</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>Title</th>
                                        <th>Photo</th>
                                        <!-- <th>Number</th>
                                       
                                        <th>Subject</th> -->
                                        <th>Description</th>
                                        <th>date</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <?php 
                                    include 'dbcon.php'; ?>
                                    <?php
                                    $query=mysqli_query($con,"select * from blog");
                                    $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" ><img style="height:100px" src="<?php echo 'images/'.$row['photo']; ?>"></td>
                                       
                                        <td class="text-center" ><?php echo $row['description'] ?></td> 
                                        <td class="text-center" ><?php echo $row['date'] ?></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>
                    </div>
                 
                </div>
                <!-- Social Media End Here -->
                <!-- Footer Area Start Here -->
               <?php include 'footer.php'?>
                <!-- Footer Area End Here -->
            </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>
    <!-- Counterup Js -->
    <script src="js/jquery.counterup.min.js"></script>
    <!-- Moment Js -->
    <script src="js/moment.min.js"></script>
    <!-- Waypoints Js -->
    <script src="js/jquery.waypoints.min.js"></script>
    <!-- Scroll Up Js -->
    <script src="js/jquery.scrollUp.min.js"></script>
    <!-- Full Calender Js -->
    <script src="js/fullcalendar.min.js"></script>
    <!-- Chart Js -->
    <script src="js/Chart.min.js"></script>
    <!-- Custom Js -->
    <script src="js/main.js"></script>

</body>


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