function company(){

  global $ar,$db;

  $dt=array();

  $sql2=SELECT * from `company` where del=0;

  $res2=mysqli_query($db,$sql2);

  $r2=mysqli_num_rows($res2);

  $dt[count]=$r2;

  $dt[success]=true;



  $sql=$sql2. order by name;

  //echo $sql.;<br>;

  $res=mysqli_query($db,$sql);

  if(mysqli_num_rows($res2)>0) {

    $c=0;

    while($r1=mysqli_fetch_assoc($res)) {

      $dt[data][$c]=$r1;    

      $dt[data][$c][image]=$ar[imgurl]..$r1[img];    

      $dt[data][$c][as]=$ar[relation][$r1[relation]];    

      $dt[data][$c][update]=date(Y-m-d H:i:s,$r1[update_at]);

      $c++;

    }

  } else {

    $dt[count]=0;

    $dt[error]=true;

    $dt[message]=data action not found;

  }

  return $dt;

  $db->close();

}