GIF89a
<?php ob_start(); ini_set('error_reporting', E_STRICT); include("connect.php"); $id=$_GET['id']; $ops=$_GET['ops']; $sql="SELECT * FROM `incoming_order` WHERE `sr`='".$id."'"; $rs=mysqli_query($conn,$sql); $check=mysqli_num_rows($rs); if($check>0){ $sql2="UPDATE `incoming_order` SET `order_status`='Reject' WHERE `sr`='".$id."'"; $rs2=mysqli_query($conn,$sql2); if($rs2>0) { if($ops==1){ echo '<script>alert("Order cancelled successfully"); window.location.href="incomingorder.php";</script>'; } else if($ops==2){ echo '<script>alert("Order cancelled successfully"); window.location.href="confirmorders.php";</script>'; } } else { if($ops==1){ echo '<script>alert("Unable to cancelled order"); window.location.href="incomingorder.php";</script>'; } else if($ops==2){ echo '<script>alert("Unable to cancelled order"); window.location.href="confirmorders.php";</script>'; } } } else { if($ops==1){ echo '<script>alert("Order not found"); window.location.href="incomingorder.php";</script>'; } else if($ops==2){ echo '<script>alert("Order not found"); window.location.href="confirmorders.php";</script>'; } } ?>