<?php


 $id = intval($_GET['id']);
    include '../rdb/conn.php';
    include '../comunes_php/cors.php';

    $sql= " select count(*) from vw_contratos where id = $id";
    
    $rs = mysqli_query( $conn,$sql);
    $row = mysqli_fetch_row($rs);
    $result["total"] = $row[0];
    
    $sql="select * from vw_contratos where id=$id order by id";

    $rs = mysqli_query( $conn,$sql);
    $items = array();
    $row = mysqli_fetch_array($rs);
    echo json_encode($row);

  
    
?>