<?php include("includes/header.php"); ?>
<?php include("includes/auto_out.php"); ?>
<!DOCTYPE html>
<html>
<head>
  <title><?php echo $sitename; ?> | Online Banking.</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>

          <style></style>

</head>


<body>


<!-- Modal -->
<div id="uploadImage" class="modal show" role="dialog">
  <div class="modal-dialog modal-sm">
   <form action="" method="POST" enctype="multipart/form-data"> 
    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <h4 class="modal-title">UPLOAD IMAGES</h4>
      </div>
      
      <div class="modal-body">

        <div class="alert alert-info">Select image with dimension/size between 150X150 to 200X200 (PX)</div>

        

         <input type="hidden" name="user_id" class="form-control input-lg" style="border-radius: 0px; color:red;" value="<?php echo $u_dbid; ?>">
        <input type="file" name="profile_pics" class="form-control input-lg" style="border-radius: 0px;">

         
        

      </div>
      <div class="modal-footer">
        <input type="submit" name="submitbtn" class="btn btn-danger" value="UPLOAD" style="border-radius: 0px;">
      </div>
    </div>
    </form>
   

  </div>
</div>
<?php
         if(isset($_POST["submitbtn"])){
             
           $user_id = $_POST["user_id"];
  $profile_pics = $_FILES["profile_pics"]["name"];

  if(!empty($profile_pics)){
        $target = "userphotos/".basename($_FILES["profile_pics"]["name"]);

        move_uploaded_file($_FILES["profile_pics"]["tmp_name"], $target);

        $query = mysqli_query($conn, "UPDATE users SET b_profile_pics = '$profile_pics' WHERE id = '$u_dbid'");
        

        echo "<script>window.location.assign('myaccount.php');</script>";
  }else{
        echo "<script>alert('Select Images');</script>";
  }
         }else{

         }
        ?>
        
        </body>
        </html>