<?php

session_start();


include_once("connectioni.php");




if ($_GET["Command"] == "pass_itno") {
    header('Content-Type: text/xml');
    echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";


    $ResponseXML = "";
    $ResponseXML .= "<salesdetails>";



    $sql = mysqli_query($GLOBALS['dbinv'], "Select * from s_mas where stk_no='" . $_GET['itno'] . "'") or die(mysqli_error());

    if ($row = mysqli_fetch_array($sql)) {


        $ResponseXML .= "<str_code><![CDATA[" . $row['STK_NO'] . "]]></str_code>";
        
        
        $desc = trim($row['PART_NO']) . " " . trim($row['DESCRIPT']) . " " . trim($row['GEN_NO']) . " " . trim($row['SUBSTITUTE']) . " " . trim($row['PART_NO']);
        
        $ResponseXML .= "<str_description><![CDATA[" .  $desc  . "]]></str_description>";
        $ResponseXML .= "<actual_selling><![CDATA[" . $row['SELLING'] . "]]></actual_selling>";

         
    }




    $ResponseXML .= "</salesdetails>";
    echo $ResponseXML;
}
?>
