<main>
  <div class="container-fluid mt-3">
    <div class="row">
      <div class="col-10">
  <?php
  switch($op2) {

      case "fr2";
        //echo "<pre>"; print_r($_POST); echo "</pre>";
        fbeauty($_POST['fr']);
        break;
      case "list";
      default;
        fbeauty("");
    }          
          
  ?>
      </div>
      <div class="col-2 small">
      </div>
    </div>          
  </div>
</main>



<?php

function fbeauty($fr) {
  global $ar,$db;
  if($fr!='') {
    
    require_once $ar['path_core'].'dom/htmlbeauty.php';
    $beautify = new Beautify_Html(array(
      'indent_inner_html' => false,
      'indent_char' => " ",
      'indent_size' => 2,
      'wrap_line_length' => 32786,
      'unformatted' => ['code', 'pre'],
      'preserve_newlines' => false,
      'max_preserve_newlines' => 32786,
      'indent_scripts'  => 'normal', // keep|separate|normal
    ));    
    $frm2=htmlspecialchars($beautify->beautify($fr));
    $frm=htmlspecialchars($fr);
  } else {
    $frm="";
  }
  ?>
  <form action="index.php?op=beauty&op2=fr2" method="post">
    <div class="row">
      <div class="col-5">
        <textarea class="form-control" rows="20" name="fr"><?=$frm;?></textarea>        
      </div>
      <div class="col-6">
      <textarea class="prism-live language-html line-numbers" rows="20" data-start="1"  id="body" name="body" style="--max-height: 30em"><?=$frm2;?></textarea>        
      </div>
      <div class="col-1">
        <button type="submit" name="submit" class="btn btn-block btn-primary">Save</button>
      </div>
    </div>
  </form>
  <?php
}

?>

/home/u1731472/public_html/
sub/cpapp_ekbis/htmbeauty.php