<?php

require_once('connect.php');

 $us_id=$_POST['id'];


$query = mysqli_query($conn, "SELECT Id,agent_id, fio, boshagan, telefon, parol, region_idlar, kontr_idlar, gruppa_idlar, brend_idlar, zakaz, tolov, otchot, OstTov, dostavshikmi FROM agentlar WHERE agent_id = '$us_id'");


while($row = mysqli_fetch_assoc($query)){

     $responce['Id']=$row['Id'];
     $responce['agent_id']=$row['agent_id'];
      $responce['fio']=$row['fio'];
       $responce['boshagan']=$row['boshagan'];
        $responce['region_id']=$row['region_idlar'];
         $responce['kontr_id']=$row['kontr_idlar'];
          $responce['gruppa_id']=$row['gruppa_idlar'];
           $responce['brend_id']=$row['brend_idlar'];
           $responce['zakaz']=$row['zakaz'];
           $responce['tolov']=$row['tolov'];
           $responce['otchot']=$row['otchot'];
           $responce['telefon']=$row['telefon'];
           $responce['parol']=$row['parol'];
           $responce['OstTov']=$row['OstTov'];
           $responce['dostavshikmi']=$row['dostavshikmi'];

     $responce['success']=true;
     $responce['message']="Successfully";


}

echo json_encode($responce);

?>
