<?php
include './connection.php';
include 'header.php'; 

$check=$_POST["c"];

if($_POST["inf"])
{
  
          $date= $_POST["instdate"] ; 
  
       
  
   
    $query="UPDATE caseinfo SET caseno='".$_POST["caseno"]."',instdate='".$date."',casetitle='".$_POST["title"]."',casetype='".$_POST["casetype"]."', casenature='".$_POST["casenature"]."' WHERE ID=". $_POST["cid"]."  ";

 			if(mysqli_query($conn,$query))
 			{
 			 
 					 echo '<script>alert("Case Information Has been Updated."); window.location.assign("./addnew.php");  </script>';
 						exit();
 			}
 		else
 			{
 			    echo '<script>alert("Case information Can not  Updated."); window.location.assign("./addnew.php");  </script>';
 	    	}
    
}else 
    {
        $qq="UPDATE tbl_criminal SET   ps='".$_POST["fps"]."',fir_no='".$_POST["fno"]."',fir_date='".$_POST["fdate"]."' WHERE case_id='".$_POST["id"]."'";
 
 	if(mysqli_query($conn,$qq))
 			{
 				
 					 echo '<script>alert("Case FIR,PS,FIR Date Has been Updated."); window.location.assign("./addnew.php");  </script>';
 						exit();
 			}
 		else
 			{
 			    echo '<script>alert("Case information Can not  Updated."); window.location.assign("./addnew.php");  </script>';
 	    	}
 
 
    }

?>
