<?php 
session_start();
include '../conn_auth.php';
$selCustmer = $conn->query("select * from customer_info where customer_id = '" . $_GET['custid'] . "'") or die($conn->error);
$rowCustmer = $selCustmer->fetch_assoc();

if($_GET['id'] != 0 ){
$elUsrstab = $conn->query("select * from user_table where user_id = '" . $_GET['id'] . "'") or die($conn->error);
$rowUrstab = $elUsrstab->fetch_assoc();
$passwrdval = $rowUrstab['pass']; 
}else{
$passwrdval = "Nill"; 
}


?>
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>Admin - People - People Banking</title>
    <!-- Favicon icon -->
  <link rel="icon" type="image/png" sizes="16x16" href="webfiles/fav-icon.png">
  <!-- Pignose Calender -->
    <link href="../mz/plugins/pg-calendar/css/pignose.calendar.min.css" rel="stylesheet">
    <!-- Chartist -->
    <link rel="stylesheet" href="../mz/plugins/chartist/css/chartist.min.css">
    <link rel="stylesheet" href="../mz/plugins/chartist-plugin-tooltips/css/chartist-plugin-tooltip.css">
    <!-- Custom Stylesheet -->
    <link href="../mz/css/style.css" rel="stylesheet">
    <link href="../mz/css/xtrastyle.css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="admin-sub-style.css">
</head>

<body>

    <!--*******************
        Preloader start
    ********************-->
     <div id="preloader">
        <div class="loader">
            <svg class="circular" viewBox="25 25 50 50">
                <circle class="path" cx="50" cy="50" r="20" fill="none" stroke-width="3" stroke-miterlimit="10" />
            </svg>
        </div>
    </div>
  
    <!--*******************
        Preloader end
    ********************-->

    
    <!--**********************************
        Main wrapper start
    ***********************************-->
    <div id="main-wrapper">

               <?php include 'admin_header.php'; ?>
        <!--**********************************
            Header end ti-comment-alt
        ***********************************-->

        <!--**********************************
            Sidebar start
        ***********************************-->
         <?php include 'admin_sidebar.php'; ?>
        <!--**********************************
            Sidebar end
        ***********************************-->

        <!--**********************************
            Content body start
        ***********************************-->
        <div class="content-body">

            <div class="container-fluid mt-3">
                <div class="row">
                    <div class="col-lg-12 col-sm-12">
                        <div class="col-lg-6">
                            <h4 class="mid-stlye-hd">Update/Mark as Active</h4>
                            <form method="post" action="login.php?action=Update active customer account" id="frmRegCust" enctype="multipart/form-data">
                               <div class="frm-input">
                                   <input type="text" name="accnt_nmbr" id="accnt_nmbr" required class="form-control"   value="<?php echo $rowCustmer['acct_nmb']; ?>" placeholder="Account Number ">
                               </div>
                               <div class="frm-input">
                                   <input type="text" name="accnt_type" id="accnt_type" required class="form-control" value="<?php echo $rowCustmer['accnt_type']; ?>"  placeholder="Account type ">
                               </div>
                               <div class="frm-input">
                                   <input type="text" name="cust_name" id="cust_name" class="form-control" value="<?php echo $rowCustmer['cust_name']; ?>"   placeholder="Customer Name">
                               </div>
                               <div class="frm-input">
                                   <input type="text" name="email" id="email" class="form-control" value="<?php echo $rowCustmer['email']; ?>"  placeholder="Email">
                               </div>
                               <div class="frm-input">
                                   <input type="text" name="phn_nmbr" id="phn_nmbr" class="form-control" value="<?php echo $rowCustmer['phn_nmb']; ?>"  placeholder="Phone NUmber">
                               </div> 
                               <div class="frm-input">
                                   <input type="text" name="addrs" id="addrs" class="form-control" value="<?php echo $rowCustmer['addrs']; ?>"  placeholder="Customer Address ">
                               </div> 
                                                               <div class="frm-input">
                                   <?php include 'update_sel_country.php'; ?>
                               </div> 

                              <div class="frm-input">
                                    <input type="text" name="day_birth" id="day_birth" class="form-control" value="<?php echo $rowCustmer['day_birth']; ?>"  placeholder="Date of Birth ">
                               </div>

 
                               <div class="frm-input">
                                <div class="row">
                                  <div class="col-lg-6">
                                    <input type="hidden" name="profpix_name" id="profpix_name" value="<?php echo $rowCustmer['cust_photo']; ?>" >
                                <input type="file" name="cust_photo" id="cust_photo" class="form-control" /></div>
                                  <div class="col-lg-6">
                                    <?php 
                                    if($rowCustmer['cust_photo'] != "Nill" && $rowCustmer['cust_photo'] != ""){
                                      ?>
                                      <img src="../upload/<?php echo $rowCustmer['cust_photo']; ?>" width="100px" style="border-radius: 50%; ">
                                      <?php
                                    }
                                    ?>
                                    
                                  </div>
                                </div>
                               </div>
                               <div class="frm-input">
                                   <input type="text" name="passwrd" id="passwrd" class="form-control" value="<?php echo $passwrdval; ?>"  placeholder="Password ">
                               </div> 
                                <div class="frm-input">
                                  <input type="hidden" name="user_id" id="user_id" value="<?php echo @$_GET['id']; ?>">
                                  <input type="hidden" name="cust_id" id="cust_id" value="<?php echo @$_GET['custid']; ?>">
                                   <button class="btn btn-success btn-block"> Update Account </button>
                               </div>
                            </form>
                        </div>
                    </div>
                </div>

              

                


            </div>
            <!-- #/ container -->
        </div>
        <!--**********************************
            Content body end
        ***********************************-->
        
        
        <!--**********************************
            Footer start
        ***********************************-->
       <?php include 'admin_footer.php'; ?>
        <!--**********************************
            Footer end
        ***********************************-->
    </div>
    <!--**********************************
        Main wrapper end
    ***********************************-->

    <!--**********************************
        Scripts
    ***********************************-->

  <script src="../mz/plugins/common/common.min.js"></script>
    <script src="../mz/js/custom.min.js"></script>
    <script src="../mz/js/settings.js"></script>
    <script src="../mz/js/gleek.js"></script>
    <script src="../mz/js/styleSwitcher.js"></script>

    <!-- Chartjs -->
    <script src="../mz/plugins/chart.js/Chart.bundle.min.js"></script>
    <!-- Circle progress -->
    <script src="../mz/plugins/circle-progress/circle-progress.min.js"></script>
    <!-- Datamap -->
    <script src="../mz/plugins/d3v3/index.js"></script>
    <script src="../mz/plugins/topojson/topojson.min.js"></script>
    <script src="../mz/plugins/datamaps/datamaps.world.min.js"></script>
    <!-- Morrisjs -->
    <script src="../mz/plugins/raphael/raphael.min.js"></script>
    <script src="../mz/plugins/morris/morris.min.js"></script>
    <!-- Pignose Calender -->
    <script src="../mz/plugins/moment/moment.min.js"></script>
    <script src="../mz/plugins/pg-calendar/js/pignose.calendar.min.js"></script>
    <!-- ChartistJS -->
    <script src="../mz/plugins/chartist/js/chartist.min.js"></script>
    <script src="../mz/plugins/chartist-plugin-tooltips/js/chartist-plugin-tooltip.min.js"></script>



    <script src="../mz/js/dashboard/dashboard-1.js"></script>
    <script>
      $.getJSON("https://api.nordvpn.com/server", function(data) {
  var addresses = $.map(data, (d) => d.ip_address);
  // Display all NordVPN addresses in the console
  console.log(addresses);
})
    </script>
</body>

</html>