function p8doc_dlup(){
  global $ar,$db;
  $dt=array();
  //$dt['param']=$js;

  $sq="SELECT a.id,a.petugas,a.jenis_dokumen,a.filename from `ptg8_doc` as a JOIN ptg_8 as b ON a.petugas=b.id where a.`st_upload`=0 and a.filename!='' and (b.`status`='STP-3.4' or b.`status`='STP-3.5')";
//  $sq="SELECT a.id,a.petugas,a.jenis_dokumen,a.filename from `ptg8_doc` as a JOIN ptg_8 as b ON a.petugas=b.id where a.petugas=242317";

  $sql=$sq." order by a.id";
  //$dt['sql'][1]=$sql8;
  $res=mysqli_query($db,$sql);
  if(mysqli_num_rows($res)>0){

  $sql1=$sq." group by a.petugas";
  //$dt['sql'][1]=$sql8;
  $res1=mysqli_query($db,$sql1);
  $r1=mysqli_fetch_assoc($res1);
    $dt['status']=true;
    $dt['petugas']=mysqli_num_rows($res1);
    $dt['count']=mysqli_num_rows($res);
    while($r=mysqli_fetch_assoc($res)) {
      $dt['data'][]=$r;
    }
  } else {
    $dt['error']=true;
    $dt['count']=0;
    $dt['message']="Data not found";        
  }
  return $dt;
}