function olahxls_kruki($FILES) {
  global $ar,$db;
  require_once $ar['path_core'].'dom/simplexls.php';
  $dt=[];          
  $firstrow=0; 
  if ($xlsx=ShuchkinSimpleXLS::parse($FILES["xlsfile"]["tmp_name"])) {
    $cell=$xlsx->rows();
    foreach( $xlsx->rows() as $k=>$r ) {
      if($k>3 && $r[5]==0 && (is_numeric($r[0]))) {
        $dt[$k-3] = [
          'urut' => $r[0],
          'lantai' => $r[1],
          'kamar' => $r[2],
          'kapasitas' => $r[3],
          'type' => $r[4],
          'status' => $r[5],
          'kloter' => $r[6],
          'rumah'=>$cell[1][2],
          'gedung'=>$cell[2][2],
          'filename' => $FILES['xlsfile']['name'],
        ];           
      }
    }     
    echo '<textarea class="form-control" rows="10">'.json_encode($dt).'></textarea>';
    echo "rows: ".count($dt)."<br>";
    //echo "<pre>"; print_r($dt[1]); echo "</pre>";
    /*
    foreach ($dt as $k => $v) {
      if(strlen($v['rumah'])>3) {
        $sek=substr($v['rumah'],0,2);
      } else {
        $sek=substr($v['rumah'],0,1);
      }
      $idt=array(
        'daker'=>$_POST['daker'],
        'gel'=>$_POST['gel'],
        'rumah'=>$v['rumah'],
        'sektor'=>$sek,
        'gedung'=>$v['gedung'],
        'urut'=>$v['urut'],
        'lantai'=>$v['lantai'],
        'kamar'=>$v['kamar'],
        'kapasitas'=>$v['kapasitas'],
        'type'=>$v['type'],
        'status'=>$v['status'],
        'kloter'=>$v['kloter'],
        'filename'=>$v['filename'],
        'update_at'=>time(),
      );
      $udt=array(
        'gel'=>$_POST['gel'],
        'sektor'=>$sek,
        'urut'=>$v['urut'],
        'lantai'=>$v['lantai'],
        'kamar'=>$v['kamar'],
        'kapasitas'=>$v['kapasitas'],
        'type'=>$v['type'],
        'status'=>$v['status'],
        'kloter'=>$v['kloter'],
        'filename'=>$v['filename'],
        'update_at'=>time(),
      );
      InsertUpdate($db,"kruki",$idt,$udt,1);
    }
    /* */
  }   
}