

    <?php include("inc/header.php") ?>


  <body data-spy="scroll" data-target="#navSection" data-offset="100">

    <?php include("inc/sidebar.php") ?>
    
    
    <!-- sidebar -->

    <div class="content">
      <div class="header">
        <div class="header-left">
          <a href="#" class="burger-menu"><i data-feather="menu"></i></a>

        </div><!-- header-left -->

        <div class="header-right">
          
          <div class="dropdown dropdown-loggeduser">
            <a href="#" class="dropdown-link" data-toggle="dropdown">
              <div class="avatar avatar-sm">
                <img src="assets/img/img1.jpg" class="rounded-circle" alt="">
              </div><!-- avatar -->
            </a>
            <div class="dropdown-menu dropdown-menu-right">
              <div class="dropdown-menu-header">
                <div class="media align-items-center">
                  <div class="avatar">
                    <img src="assets/img/img1.jpg" class="rounded-circle" alt="">
                  </div><!-- avatar -->
                  <div class="media-body mg-l-10">
                    <h6>Louise Kate Lumaad</h6>
                    <span>Administrator</span>
                  </div>
                </div><!-- media -->
              </div>
              <div class="dropdown-menu-body">
                <a href="#" class="dropdown-item"><i data-feather="user"></i> View Profile</a>
                
                <a href="../Login/" class="dropdown-item"><i data-feather="log-out"></i> Sign Out</a>
              </div>
            </div><!-- dropdown-menu -->
          </div>
        </div><!-- header-right -->
      </div><!-- header -->
      <div class="content-header">
        <div>
          
        <h4 class="content-title" style="padding-left:30px;">Edit client details here ...</h4>
        </div>
      </div><!-- content-header -->
     
      <div class="content-body content-body-components">
	   
          
           
            <div class="card card-body">
            <div class="table-responsive">
                <table class="table table-striped table-advance table-hover">
                
                
                <thead>
                  <tr>
                    <th>Customer Name</th>
                    <th class="hidden-phone">Email</th>
                    <th>Document</th>
                    <th>Status</th>
                   <th>Action</th>
                  </tr>
                </thead>
                
                <?
                $db="select * from User where status='1'";
                        $query=mysqli_query($conn, $db);
                        while(($row=mysqli_fetch_array($query))>0)
                        {
                            
                            $user=$row['user_id'];
                            $name=$row['firstname'];
                            $name2=$row['lastname'];
                            $fname2=$name.''.$name2;
                            $phone=$row['phone'];
                            $email2=$row['email'];
                            $currency=$row['currency'];
                            $plan=$row['plan'];
                            $curr=$currency.$plan;
                            $account=$row['account'];
                            $statuss=$row['status'];
                            $photo=$row['image'];
                            
                
                ?>
                
                
                <tbody>
                            <tr>
                           <td><? echo $fname2; ?></td>
                           <td><? echo $email2; ?></td>
                           <td><img src="../../SignUp/images/<? echo $photo; ?>" class="img-responsive" style="max-width:80px;"/></td>
                           <td>Approved</td>
                            <td>
                            <? echo '<button class="btn btn-success btn-xs" data-toggle="modal" data-target="#myModal-1'.$user.'">MODIFY</button>
                           
                            </td>
                            </tr>';
                        
                        
                        echo '<div id="myModal-1'.$user.'" class="modal fade" role="dialog">
  <div class="modal-dialog modal-lg">

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
         
        <h4 class="modal-title">System Information</h4>
      </div>
      <div class="modal-body">
          
        <div class="row">
            <div class="col-md-8">
                
                <h4>Edit/Modify Client Details</h4>
                 <div class="alert alert-success">
  <strong>Are you really sure its necessary to edit customer info</strong>  
</div>';

                $dbb="select * from User where user_id='$user'";
                $que=mysqli_query($conn, $dbb);
                $row=mysqli_fetch_array($que);
                $fname=$row['lastname'];
                $emaill=$row['email'];
                $status=$row['status'];
                $img=$row['image'];
                
                
                echo '<br>
                <label class="">Customer Full Name</label>
                <input type="text" class="form-control" placeholder="'.$fname.'" name="fname" />
                <label class="">Customer Email</label>
                 <input type="text" class="form-control" placeholder="'.$emaill.'" name="email" />
                 <label class="">Status</label>
                  <input type="text" readonly class="form-control" placeholder="Approved" />
                  <br>
                  <form method="post">
                  <input type="hidden" value="'.$user.'" name="pass"/>
                  <button class="btn btn-primary" type="submit" name="update">Update Details</button>
                  </form>
            </div>
             <div class="col-md-4">
                <br>
                <center>
                    
                    <img src="../../SignUp/images/'.$photo.'" class="img-responsive" style="max-width:230px;"/>
                </center>
                
                
            </div>
           
            
        </div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
      </div>
    </div>

  </div>
</div>';
                        
                  ?>            
                           
                            
                </tbody>
                
                <?
                }
                
                if(isset($_POST['update'])){
                    $userr=$_POST['pass'];
                    $funame=$_POST['fname'];
                    $ema=$_POST['email'];
                    $upd="update User set lastname='$funame',email='$ema' where user_id='$userr'";
                    $up=mysqli_query($conn, $upd);
                    if($up){
                        $url = 'account_verify.php';   
    
            echo '<META HTTP-EQUIV=Refresh CONTENT="0; URL='.$url.'">';
                    }
                }
                ?>
                
              </table>
            </div><!-- table-responsive -->
          </div>
            
            
       
		  <nav aria-label="Page navigation example" style="float:right; margin-top:10px; margin-right:10px;">
            <ul class="pagination pagination-outline mg-b-0">
              <li class="page-item disabled"><a class="page-link page-link-icon" href="#"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-left"><polyline points="15 18 9 12 15 6"></polyline></svg></a></li>
              <li class="page-item active"><a class="page-link" href="#">1</a></li>
              <li class="page-item"><a class="page-link" href="#">2</a></li>
              <li class="page-item"><a class="page-link" href="#">3</a></li>
              <li class="page-item"><a class="page-link page-link-icon" href="#"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-right"><polyline points="9 18 15 12 9 6"></polyline></svg></a></li>
            </ul>
          </nav>
        
	  
	  
         
      </div><!-- content-body -->
     
    </div><!-- content -->

	
	
	
	
	
		
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
    <script src="lib/jquery/jquery.min.js"></script>
    <script src="lib/bootstrap/js/bootstrap.bundle.min.js"></script>
    <script src="lib/feather-icons/feather.min.js"></script>
    <script src="lib/perfect-scrollbar/perfect-scrollbar.min.js"></script>
    <script src="lib/prismjs/prism.js"></script>
    <script src="lib/js-cookie/js.cookie.js"></script>

    <script src="assets/js/cassie.js"></script>
    <script>
      $(function(){

        'use strict'

      })
    </script>
	
	<script>
      $(function(){

        'use strict'

        $('#modal6').on('show.bs.modal', function (event) {

          var animation = $(event.relatedTarget).data('animation');
          $(this).addClass(animation);
        })

        // hide modal with effect
        $('#modal6').on('hidden.bs.modal', function (e) {
          $(this).removeClass (function (index, className) {
              return (className.match (/(^|\s)effect-\S+/g) || []).join(' ');
          });
        });

      })
    </script>
  </body>

</html>
