<?php
 	session_start(); 

	if(!isset($_SESSION['tulsilogin']))
	{
		header('Location: index.php');
		return;
	}
	
	





$_SESSION['_token']=bin2hex(openssl_random_pseudo_bytes(16));

	

	

	include("connect.php");


$packagemid= $_POST['packagemid'];
	
	$packagename=str_replace ("'","\'",$_POST['packagename']);
	$packagename=str_replace ('"','\"',$packagename);
	$pdescription=str_replace ("'","\'",$_POST['pdescription']);
	$pdescription=str_replace ('"','\"',$pdescription);
	$pcurrency=str_replace ("'","\'",$_POST['pcurrency']);
	$pcurrency=str_replace ('"','\"',$pcurrency);
	$pcurrencyrate=str_replace ("'","\'",$_POST['pcurrencyrate']);
	$pcurrencyrate=str_replace ('"','\"',$pcurrencyrate);
	$pcurrencyinr=str_replace ("'","\'",$_POST['pcurrencyinr']);
	$pcurrencyinr=str_replace ('"','\"',$pcurrencyinr);
	if($_SESSION['utype']=="admin")
	{ 
	$branchmid=str_replace ("'","\'",$_POST['branchmid']);
	}
	else
	{
		$branchmid= $_SESSION['branchid'];
	};
	

	

	 $eve = "update res_package_master set packagename='$packagename',pdescription='$pdescription',pcurrency='$pcurrency',pcurrencyrate='$pcurrencyrate',pcurrencyinr='$pcurrencyinr',branchmid='$branchmid'  where packagemid='$packagemid'";

	

	if ($conn->query($eve) === TRUE)

	{		

		$_SESSION['msg'] = "package Record Updated succesfully";

		header('Location: package.php');		

	} 

	else 

	{

			

		$_SESSION['msg'] = "Error";

		header('Location: package.php');

	}

?>