D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
thread-self
/
root
/
proc
/
self
/
root
/
home
/
shubmkcj
/
urbane.createerp.com
/
Filename :
insert-tax-manager.php
back
Copy
<?php ob_start(); session_start(); include 'config.php'; if(isset($_SESSION["source_id"])){ $source_id = $_SESSION['source_id']; } $country = $_POST['country']; $tax_name = $_POST['tax_name']; $applicable_tax = $_POST['applicable_tax']; $set = $_POST['set']; $applicable_tax_india = $_POST['applicable_tax_india']; $sql1 = "SELECT * FROM tax_manager WHERE source_id = '$source_id'"; $result = $conn->query($sql1); if(mysqli_num_rows($result) > 0){ $sql = "UPDATE tax_manager SET country = '$country', tax_name = '$tax_name', applicable_tax = '$applicable_tax', applicable_tax_india = '$applicable_tax_india', set_default_value = '$set' WHERE source_id = '$source_id'"; } else{ $sql = "INSERT INTO tax_manager(country, tax_name, applicable_tax, applicable_tax_india, set_default_value, source_id ) VALUES ('$country','$tax_name','$applicable_tax','$applicable_tax_india','$set', '$source_id')"; } if ($conn->query($sql) === TRUE) { echo '<script>localStorage.setItem("TaxSaved", "true");</script>'; echo '<script>location.replace("add-tax-manager.php")</script>' ; } else { echo "Error: " . $sql . "<br>" . $conn->error; } ?>