<?php
header('Content-Type: application/json');
  $company_id = $_GET['company_id'];
  $account_number = $_GET['account_number'];
  include("dbConfig.php");
      $sql_daily_restt="SELECT * FROM daily_restriction_tbl where company_id='$company_id' and account_number='$account_number' and opening_balance='0' order by document_date desc";
      $result_daily_ress = $conn->query($sql_daily_restt);

      if ($result_daily_ress->num_rows > 0) {
        while ($row_daily_restt = $result_daily_ress->fetch_assoc()) {
         $a[] = array(
            'success' => true,
            'maden' => $row_daily_restt["maden"],
            'daen' => $row_daily_restt["daen"],
            'definition' => $row_daily_restt["definition"],
            'details' => $row_daily_restt["details"],
            'document_date' => $row_daily_restt["document_date"],
            
        );
        }
        
    $response = [
        'success' => true,
        'data' => $a,
    ];
    
      } else {
    $a = array();
    $response = [
        'success' => true,
        'msg' => "not found",
        'data' => $a,
    ];
}
  echo json_encode($response);

?>