<?php
    include '_connect.php';
    // $lineid = $_REQUEST["lineid"];

    $lineid = 'Ue7755e5ad9b0b66baf75a8b756f2850f';

    $sqlx = "SELECT ct_no,ps_name,ct_mobileno FROM EHONGDB.dbo.PERSON a
    left outer join (SELECT * FROM EHONGDB.dbo.hps_ctmain) b on (a.PS_PHONE=b.ct_mobileno)
    WHERE lineid IN ('$lineid')
    ORDER BY b.CT_DATE";
    $selectx=$conn->prepare($sqlx);
    $selectx->execute();
    $sql_array = array();
    while ($fetchx=$selectx->fetch()) {
        $sql_array[] = $fetchx;
    }
    $echo_json = json_encode($sql_array);
    echo $echo_json;
    
?>