function ptg8_view_v1($q,$col,$q1,$col1,$q2,$col2,$q3,$col3,$q4,$col4,$sortby,$pg) {
  global $db,$db1,$ar;
  
  //print_r($ar);
  ?>
  <h3 class="fw-900">Pendaftar Petugas Haji 2027</h3>
  <div class="row">
      <?php
      $sql = "select * from ptg_8 where id>0 ";

      if($col!='') {
        $sql .= " and `".$col."`='".$q."' ";
      }
      
      if($col1!='') {
        $sql .= " and `".$col1."`='".$q1."' ";
      }

      if($col2!='') {
        $sql .= " and `".$col2."`='".$q2."' ";
      }

      if($col3!='') {
        $sql .= " and `".$col3."`='".$q3."' ";
      }      

      if($col4!='') {
        $sql .= " and `".$col4."`='".$q4."' ";
      }      

      if($lcol!='') {
        $sql .= " and `".$lcol."` like '".$lq."%' ";
      }      

      if($ncol!='') {
        $sql .= " and `".$ncol."` like '%".$nq."%' ";
      }      
      
      if($lc!='') {
        $sql .= " and `".$lc."` like '%".$nq."%' ";
      }      
      $sql2=$sql;
      if($lc!='') {
        $sql .= " and `".$lc."`<='".$lv."' ";
        $sql2 .= " and `".$lc."`='".$lv."' ";
      }      

      $start=($page-1)*$limit;
      $limit=12;
      $sql .= " order by ".$sortby." $sort limit $start,$limit";
      //$sql .= " order by ".$sortby." desc limit ".$limit;
      $res = mysqli_query($db, $sql);
      $res2 = mysqli_query($db, $sql2);
      $total_records=mysqli_num_rows($res2);
      $total_pages=ceil($total_records/$limit);
      
      $page_url = "op=ptg8&op2=view&q=".$q."&col=".$col."&q1=".$q1."&col1=".$col1."&q2=".$q2."&col2=".$col2."&q3=".$q3."&col4=".$col4."&sortby=".$sortby;

      //echo $sql;
      while($rw = mysqli_fetch_assoc($res)) {  
        if($rw['mcu_upload']>0) {
          $mmc='<a href="?op=p8docmcu&op2=list&col=petugas&q='.$rw['id'].'" target="_blank">'.$rw['nama'].'</a>';
        } else {
          $mmc=$rw['nama'];
        }
      ?>      
        <div class="col-lg-1 col-sm-3 col-xs-6">
          <a href="#">
            <div class="centered-image cropped" style="background-image: url(https://api-petugas.haji.go.id/ptgsapi/petugashaji/files/img/<?=$rw['photo_filename'];?>);">
              <img src="https://api-petugas.haji.go.id/ptgsapi/petugashaji/files/img/<?=$rw['photo_filename'];?>" width="100%" class="img img-responsive" alt="<?=$rw['nama'];?>">
            </div>
          </a>
          <div>
            <p>Nama: <?=$rw['nama'];?><br></p>
          </div>
        </div>
      <?php
      }
      echo paginate($limit, $pg, $total_records, $total_pages, $page_url);
      ?>        
    </div>
  <br><?=$sql;?><br>
  <?php   
}