<?php
 include_once('../common/base.php');

 $response=array();
 $tdata=array();
 $total=0;
 $mId=$_GET['mId'];
 $toolNum=$_GET['toolNum'];
 $sql="select mdc_Offset.*,Equipment.EquNo from mdc_Offset inner join Equipment on Equipment.machineID=mdc_Offset.machineID where mdc_Offset.toolNum='{$toolNum}' and mdc_Offset.machineID='{$mId}'";

 
$stmt=sqlsrv_query($conn, $sql);
if ($stmt) {
    while ($row=sqlsrv_fetch_array($stmt, SQLSRV_FETCH_ASSOC)) {
        $tdata[]=$row;
       
    }
    sqlsrv_free_stmt($stmt);
}

$response['tdata']=$tdata;
$response['code']=200;


echo json_encode($response);

?>