<?php

 include 'conexion.php';

   if(!$coneccion){
      echo "ERROR en la conexion";
   }

   $id_empresa =    $_POST[id];  
   $mes     =   $_POST[mes];
   $anio    =   $_POST[anio];
    

  $_pagi_sql = "select * from det_cobros where id_empresa = " . $id_empresa . " and mes = " . $mes . " and anio = " . $anio ;  

  $query = mysqli_query($coneccion ,  $_pagi_sql);
   $row_cnt = $query->num_rows; 
   $row = mysqli_fetch_array($query);
     
    mysqli_close($coneccion);

    if($row_cnt == 1) {         
     echo $row['total'];  
 
    }else{if($row_cnt > 1) {
          
          echo "-1";   
         }else{
           echo  "0";
         }   
    
    }

 
?>