ip:".$ip; echo "

port:".$port; echo "

strcd:".$strcd; echo "

frdt:".$frdt; echo "

vencd:".$vencd; echo "

grpcd:".$grpcd; echo "

pn:".$pn; */ include "./../comon/dbconn.inc"; $qr = "SELECT SEQNO, TRTYPE, OUTTYPE, PRTHDR, PRTDTL, PRTDESC, RCPDATA FROM NMRcp " . "WHERE STRCD = '$strcd' AND SALEDT = '$saledt' AND POSNO = '$posno' AND TRNO = $trno AND SEQNO = $seqno "; $ret = mssql_query($qr, $dbconn); if (! $ret) { echo ('{"RET":"QRY", "ERMSG":"조회 오류입니다."}'); mssql_close(); exit(); } $arr = array(); $cnt = mssql_num_rows($ret); if ($cnt > 0) { $arr["RET"] = "OK"; $arr["ROWCNT"] = $cnt; $arr["ERMSG"]="OK"; } else { $arr["RET"] = "NODATA"; $arr["ROWCNT"] = 0; $arr["ERMSG"]=urlencode("자료가 없습니다."); $retData = json_encode($arr); echo $retData; mssql_free_result($ret); mssql_close(); exit(); } $dataArray = array(); // while( $row = mssql_fetch_array( $ret ) ) { $row = mssql_fetch_array( $ret ); $rowArray = array(); $rowArray["SEQNO"] = $row["SEQNO"]; $rowArray["TRTYPE"] = $row["TRTYPE"]; $rowArray["OUTTYPE"] = $row["OUTTYPE"]; $rowArray["PRTHDR"] = $row["PRTHDR"]; $rowArray["PRTDESC"] = $row["PRTDESC"]; $image = $row["RCPDATA"]; echo "UNZIP:"; //$uncompressed = gzuncompress($image); $uncompressed = gzuncompress($image); echo $uncompressed; echo "
\r\n"; echo "SEQNO:". $row["SEQNO"] . "
\r\n"; echo "TRTYPE:". $row["TRTYPE"] . "
\r\n"; echo "OUTTYPE:". $row["OUTTYPE"] . "
\r\n"; echo "PRTHDR:". $row["PRTHDR"] . "
\r\n"; echo "PRTDESC:". $row["PRTDESC"] . "
\r\n"; echo "RCPDATA:". bin2hex( $image ) . "
\r\n"; //$zipdata = pack("H", strlen($image), $image); $myfile = fopen("./testfile.gz", "w"); fwrite($myfile, $image); fclose($myfile); // } /* $inflateContext = inflate_init(ZLIB_ENCODING_DEFLATE); $uncompressed = inflate_add($inflateContext, $image, ZLIB_NO_FLUSH); $uncompressed .= inflate_add($inflateContext, NULL, ZLIB_FINISH); echo "UNCOMPRESS:"; echo $uncompressed; echo "
\r\n"; echo "RCPDATA:". bin2hex( $image ) . "
\r\n"; */ /* $compressed_data = file_get_contents('./testfile.gz'); $uncompressed_data = zlib_decode($compressed_data); echo "UNCOMPRESS:"; echo $uncompressed_data; echo "
\r\n"; */ mssql_free_result($ret); mssql_close(); $a = function_exists('zlib_decode'); print('$a : '); var_dump($a); print('
'); /* $deflateContext = deflate_init(ZLIB_ENCODING_GZIP); $compressed = deflate_add($deflateContext, "Data to compress", ZLIB_NO_FLUSH); $compressed .= deflate_add($deflateContext, ", more data", ZLIB_NO_FLUSH); $compressed .= deflate_add($deflateContext, ", and even more data!", ZLIB_FINISH); // Perform GZIP decompression: $inflateContext = inflate_init(ZLIB_ENCODING_GZIP); $uncompressed = inflate_add($inflateContext, $compressed, ZLIB_NO_FLUSH); $uncompressed .= inflate_add($inflateContext, NULL, ZLIB_FINISH); echo $uncompressed; */ print_r ( get_defined_functions() ); ?>