<?php
  include_once 'opendb.php';
   $mret="Error";
     
    if (isset($_POST["AppID"]) &&  isset($_POST["CompCode"]))
    {
	
        $AppID=$_POST["AppID"] ;
        $coCode=$_POST["CompCode"] ;
        $sql = "SELECT * FROM company WHERE  comp_code like '".$coCode."'";
        $sresult = $conn->query($sql);
        if ($sresult->num_rows > 0 )
        { 
               if($srow = $sresult->fetch_assoc())
                 {
                   $mret=""; //sale so rec ret quote req priclock
                   
                    if ($srow["is_Sales"]!=0) $mret.="1"; else $mret.="0";
                     if ($srow["is_SO"]!=0)   $mret.="1"; else $mret.="0";
                     if ($srow["is_Rec"]!=0)  $mret.="1"; else $mret.="0"; 
                     if ($srow["is_SRet"]!=0) $mret.="1"; else $mret.="0"; 
                     if ($srow["is_Quote"]!=0) $mret.="1";else $mret.="0";
                     if ($srow["is_Request"]!=0) $mret.="1"; else $mret.="0";
                     if ($srow["is_pricelock"]!=0) $mret.="1"; else $mret.="0";
                } 
        } 
        else {
                 $mret="xxxxxxx";
        }
        
  
    }
    else
    {
        $mret = "No Data for company code";
    }
    
    $conn->close();
    echo $mret;
    ?>

