<?php
$conn=mysqli_connect("localhost","primarysales","S5L7lF01EQZvQrGK","primarysales_diana");
if(isset($_POST["save"])){
$invoice=$_POST["invnumberr"];
$agnt=$_POST["agentname"];
$remks=$_POST["chqsts"];

if($remks=='PAYMENT NR' || $remks=='ALTERNATION' || $remks=='UNLD UNDLV ISSUE' || $remks=='CASH NOT DEPOSIT' || $remks=='INV COPY NR' || $remks=='OVER DATE' ){
$psts='1';   
}else{
$psts='0';    
}


$qq=mysqli_query ($conn,"update rc_invoices set payments='".$remks."' where invoice_number='".$invoice."' and agent_names='".$agnt."'");

$qqy=mysqli_query ($conn,"update rc_invoices set paysts='".$psts."' where invoice_number='".$invoice."' and agent_names='".$agnt."'");

$qqt=mysqli_query ($conn,"update st_paymode set payments='".$remks."' where invoice_number='".$invoice."' and agent_names='".$agnt."'");

header("Location: addrecpay.php");
}
?>



	


