<?php include("includes/header.php"); ?>
<?php include("includes/auto_out.php"); ?>
<!DOCTYPE html>
<html>
<head>
  <title>Delete User | <?php echo $sitename;  ?></title>
    <link rel="stylesheet" href="bootstrap/css/bootstrap.css">
    <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
  <link rel="stylesheet" href="bootstrap/css/bootstrap-theme.css">
  <link rel="stylesheet" href="bootstrap/css/bootstrap-theme.min.css">

   <!--CSS-->
  <link rel="stylesheet" href="style.css">
  <link rel="stylesheet" href="bootstrap/css/bootstrap.css">
  <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
  <link rel="stylesheet" href="bootstrap/css/bootstrap-theme.css">
  <link rel="stylesheet" href="bootstrap/css/bootstrap-theme.min.css">

    <!-- Bootstrap Core CSS -->
      <link href="css/bootstrap.min.css" rel="stylesheet">

     <!-- Font Awesome -->
    <link rel="stylesheet" href="font-awesome/css/font-awesome.min.css">

      <!-- Custom CSS -->
      <link href="css/blog-home.css" rel="stylesheet">

      <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
      <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
      <!--[if lt IE 9]-->
          <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
          <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
          <script src="js/jquery.js"></script>
          <script src="js/bootstrap.js"></script>



</head>

<body>
  <?php  include("includes/dashboard_navbar.php"); ?>
  <!-- DESTOP Side bar starts here--><!-- DESTOP Side bar starts here--><!-- DESTOP Side bar starts here-->
 <!-- DESTOP Side bar starts here--><!-- DESTOP Side bar starts here--><!-- DESTOP Side bar starts here-->
  <style>
    body{
      background-color: #f5f5f5;
    }
    .destop-siderbar{
      background-color: #131e2a;
      height: 100%;
      width:240px;
      box-shadow: 0 0 4px 0 rgba(0,0,0,.50), 0 2px 4px 0 rgba(0,0,0,.50);
      position: fixed;
      margin-left:-20px;
      padding:50px 25px;
    }
    .destop-siderbar li{
       padding: 30px 20px;
       list-style: none;
    }
    .destop-siderbar li a{
      color: #fff;
      font-size: 17px;
      padding:10px 0px;
    }
    .destop-siderbar li a i{
      color:rgb(45, 156, 219);
      font-weight: lighter;
    }
    .destop-siderbar .active {
      background-color:#123962;
      box-shadow: 0 0 4px 0 rgba(0,0,0,.50), 0 2px 4px 0 rgba(0,0,0,.50);
      
    }
    .destop-siderbar .active a{
      color:#fff;
    }
    .destop-siderbar .active a:hover{
      color:#fff;
    }
    .destop-siderbar li a:hover{
      color: #a5bdd9;
      text-decoration: none;
    }
    .panel{
      border-radius: 0px;
      border-color: transparent;
    }
    .input-danger{
       border:1px solid darkred;
       color:darkred;
     }
     .input-danger::placeholder{
       opacity: 0.6;
       color:darkred;
     }
  </style>

  <div class="container-fluid">
    <div class="row">
      <!-- DESTOP Side bar starts here--><!-- DESTOP Side bar starts here--><!-- DESTOP Side bar starts here-->
      <div class="col-sm-2 hidden-xs" style="height: 100%;">
               <?php include("includes/desktop_side.php"); ?>
      </div>
      <!--/////////////////////// DESTOP Side bar starts here--><!-- DESTOP Side bar starts here--><!-- DESTOP Side bar starts here-->
      <div class="col-sm-10">
        <br><br><br><br>
        <div class="row">
          
        </div>

        <!----------------------------------------------------------------------------------->

        <div class="row">
          <div class="col-sm-8">
            <div class="row">
              

              <div class="col-sm-6">
                 <div class="panel panel-default">
                  <div class="panel-body">
                    <img src="images/5692367.png" width="35">&nbsp;&nbsp;<b>DELETE USER</b>
                <br><hr><br>


                <?php
                     if(isset($_GET["user_id"])){
                       $user_id = $_GET["user_id"];
                       //USE COLL ID TO FETCH DATA
                       $query = mysqli_query($conn, "SELECT * FROM users WHERE id = '$user_id'");
                       $row = mysqli_fetch_assoc($query);

                       $b_firstname = $row["b_firstname"];
                            $b_middlename = $row["b_middlename"];
                            $b_lastname = $row["b_lastname"];
                            $b_email = $row["b_email"];
                            $b_gender = $row["b_gender"];
                            $b_phone = $row["b_phone"];
                            $b_country = $row['b_country'];

                     }else{
                       echo "<script>window.location.assign('all-users.php');</script>";
                     }
                    ?>
                     <h3>Delete <b> <?php echo $b_firstname; ?> <?php echo $b_lastname; ?></b> Bank Account?</h3>
                     <p style="font-size: 16px;">Are you sure you want to delete <b><?php echo $b_firstname; ?> <?php echo $b_lastname; ?></b> Bank Account, this action cannot be undone.</p>
                     <hr>




                     <?php
                       if(isset($_POST["deleteuserbtn"])){

                        $user_id = $_GET["user_id"];

                         
                        //INSER DATA INTO DB
                        $query = mysqli_query($conn, "DELETE FROM users WHERE id = '$user_id'");
                        echo "<div class='alert alert-success'>User Deleted Successfully!</div>";
                        echo "<script>window.location.assign('all-users.php');</script>";


                       }
                     ?>

                     <form action="" method="POST">
                        <div align="right"><button type="submit" name="deleteuserbtn" class="btn btn-lg btn-danger" style="border-radius: 0px;"><i class="fa fa-trash"></i> delete</button></div>
                       </form>


                  </div>
                </div>
              </div>

              <div class="col-sm-6">
                
              </div>

            </div>

            <!--------------------------->







          </div>


          <div class="col-sm-4">
            
            </div>
          </div>
        </div>
        
        
        
        
        
        
      </div>
    </div>
  </div>
</body>
</html>