       <?php
        require_once("models/res_users.class.php");
        $result = "";
        if ( isset($_POST['name'])) {

            $id = $_POST['id'];
            $name = $_POST['name'];
            $email = $_POST['email'];
            $address = $_POST['address'];
            $role_id = $_POST['role_id'];
            $role = new ResUsers($id, $name, $email, $password = null, $address, $role_id, null );
            $result = $role->update();
           
        }
        if (isset($_GET["id"])) {
            $res = ResUsers::readById($_GET["id"]);

            // print_r($res);
        }
        ?>



       <form method="post">
           <div class="card-body">
               <input type="hidden" name="id" value="<?php echo $res['id']; ?>">
               <div class="form-group">
                   <label for="name">Name</label>
                   <input type="text" class="form-control" name="name" value="<?php echo $res['name']; ?>">
               </div>
               <div class="form-group">
                   <label for="name">Email</label>
                   <input type="text" class="form-control" name="email" value="<?php echo $res['email']; ?>">
               </div>
               <div class="form-group">
                   <label for="name">Address</label>
                   <input type="text" class="form-control" name="address" value="<?php echo $res['address']; ?>">
               </div>
               <div class="form-group">
                   <label for="name">Role Id</label>
                   <input type="text" class="form-control" name="role_id" value="<?php echo $res['role_id']; ?>">
               </div>
           </div>
           <!-- /.card-body -->
           <div class="card-footer">
               <button type="submit" class="btn btn-primary">Update</button>
           </div>
       </form>