<?php
    include_once 'opendb.php';
    
    if (isset($_POST["Entry_No"]))
    {
        $Entry_No=$_POST["Entry_No"] ;
         if (isset($_POST["RejectMess"]))
         {
              $RejectMess=$_POST["RejectMess"] ; 
              $sql = "update sale_order set ordStatus=3, Status_message='".$RejectMess."' , synced_Status=0 WHERE Entry_No = ".$Entry_No.";";
                   if ($conn->query($sql) === TRUE)
                   {
                      $mess="OK";
                   } else
                   {
                      $mess= "Error: " . $sql . "<br>" . $conn->error;
                   } 
        
        }
        else {
                $mess= "Error : No parameters!";
        }
    }
    else
    {
        $mess= "Error : No parameters!";
    }
    echo $mess;
    $conn->close();
?>