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





          <!----MODAL-------------------->
          <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
            <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
            <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.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-->
  <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 class="col-sm-12">
            <div class="row">


              <div class="col-sm-9">
                 <div class="panel panel-default">
                  <div class="panel-body">
                       <span style="font-size: 16px; font-weight: bold;"><i class="fa fa-caret-left" style="font-size: 18px;"></i> <i class="fa fa-caret-right" style="font-size: 18px;"></i> EDIT WITHDRAWAL</span>
                       <br><br>

                       <?php
                         if(isset($_GET["trans_id"])){
                          $trans_id = $_GET["trans_id"];
                          $z_username = $_GET["z_username"];

                          //USER TRANS ID TO TRACK TRANSACTION
                          $query = mysqli_query($conn, "SELECT * FROM withdraw WHERE id = '$trans_id'");
                          $row = mysqli_fetch_assoc($query);

                          $z_user_id = $row["z_user_id"];
                          $trans_id = $row["id"];
                          $w_date = $row["w_date"];
                          $w_order_id = $row["w_order_id"];
                          $w_desc = $row["w_desc"];
                          $w_amount = $row["w_amount"];
                          $w_status = $row["w_status"];

                         }
                       ?>

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

                         
                          $status = $_POST["status"];



                             //UPDATE STATUS ON TRANSACTIONS
                             $query = mysqli_query($conn, "UPDATE withdraw SET w_status = '$status' WHERE id = '$trans_id'");

                            
                             echo "<div class='alert alert-success'>Updated</div>";
                             echo "<script>window.location.assign('all-withdrawal.php');</script>";


                   

                        }
                       ?>


                       <form action="" method="POST">

                         <div class="form-group">

                           <label>Status</label>
                            <select type="text" class="form-control input-lg" name="status" style="border-radius: 0px; width: 50%;" required>
                              <option>Select Status</option>
                              <option>SUCCESS</option>
                              <option>PENDING</option>
                              <option>DECLINED</option>
                            </select>

                            <br>

                            <button type="submit" name="confirmnairabtn" class="btn btn-lg btn-primary" style="border-radius: 0px;">CONFIRM</button>

                          
                         </div>
                       </form>
 
                   
                    <br>
                  </div>
                </div>
              </div>
              

              <div class="col-sm-3">
                 <div class="panel panel-default">
                  <div class="panel-body">
                    <img src="images/1468183.png" width="50px">&nbsp;&nbsp;<b><?php echo $_GET["z_username"]; ?> | <?php echo $w_order_id; ?></b>
                    <hr>
                    <table class="table table-bordered">
                        <tbody>
                          <tr>
                            <td><b>USERNAME</b></td>
                            <td><span style="color:#ff9800; font-size: 14px;"><?php echo $z_username; ?></span></td>
                          </tr>
                          <tr>
                            <td><b>ORDER ID</b></td>
                            <td><span style="color:#ff9800; font-size: 14px;"><?php echo $w_order_id; ?></span></td>
                          </tr>
                          <tr>
                            <td><b>AMOUNT</b></td>
                            <td><span style="color:#ff9800; font-size: 14px;">$<?php echo number_format($w_amount, 2); ?></span></td>
                          </tr>
                          <tr>
                            <td><b>STATUS</b></td>
                            <td><span style="color:#ff9800; font-size: 14px;"><?php echo $w_status; ?></span></td>
                          </tr>
                          <tr>
                            <td><b>DATE</b></td>
                            <td><span style="color:#ff9800; font-size: 14px;"><?php echo $w_date; ?></span></td>
                          </tr>
                        </tbody>
                      </table>
                    <div align="right">
                    </div>
                  </div>
                </div>
              </div>

            </div>

            

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

            






          </div>








          </div>
        </div>
        
        
        
        
        
        
      </div>
    </div>
  </div>
</body>
</html>