       <?php
        require_once("models/res_roles.class.php");
        $result = "";
        if (isset($_POST['id']) && isset($_POST['name'])) {
            $id = $_POST['id'];
            $name = $_POST['name'];
            $role = new ResRoles($id, $name);
            $result = $role->update();
        }
        if (isset($_GET["id"])) {
            $res = ResRoles::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>
           <!-- /.card-body -->
           <div class="card-footer">
               <button type="submit" class="btn btn-primary">Update</button>
           </div>
       </form>