D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
thread-self
/
root
/
home
/
shubmkcj
/
urbane.createerp.com
/
Filename :
insert_add_new_contact.php
back
Copy
<?php ob_start(); session_start(); include 'config.php'; $taxno = $_POST['taxno']; $customer_type = addslashes(stripslashes($_POST['customer_type'])); $bill_display_name = $conn -> real_escape_string($_POST['bill_display_name']); $contact_person = addslashes(stripslashes($_POST['contact_person'])); $designation = addslashes(stripslashes($_POST['designation'])); $address = $_POST['address']; $city = $_POST['city']; $state = $_POST['state']; $country = $_POST['country']; $pin = $_POST['pin']; $iecno = $conn -> real_escape_string($_POST['iecno']); $gstin = $_POST['gstin']; $email = $_POST['email']; $phone = $_POST['phone']; $type = $_POST['type']; $currency = $_POST['currency']; $bank_charges = $conn -> real_escape_string($_POST['bank_charges']); $panno = $_POST['panno']; $opening_balance = $conn -> real_escape_string($_POST['opening_balance']); $terms_condtion = $conn -> real_escape_string($_POST['terms_condtion']); $sourceId = $_POST['sourceId']; $length = sizeof($address); $sql = "INSERT INTO `contact`(`customer_type`, `bill_display_name`, `contact_person_name`, `contact_person_designation`, `data_delete`, `source_id`) VALUES ('$customer_type','$bill_display_name','$contact_person','$designation','No','$sourceId')"; if ($conn->query($sql) === TRUE) { $contactId = $conn->insert_id; for($i = 0; $i < $length; $i++){ $tax = ""; $address1 = addslashes(stripslashes($address[$i])); $city1 = addslashes(stripslashes($city[$i])); $state1 = addslashes(stripslashes($state[$i])); $pin1 = addslashes(stripslashes($pin[$i])); $email1 = addslashes(stripslashes($email[$i])); $phone1 = addslashes(stripslashes($phone[$i])); $country1 = addslashes(stripslashes($country[$i])); $gstin1 = addslashes(stripslashes($gstin[$i])); $iecno1 = addslashes(stripslashes($iecno[$i])); $type1 = addslashes(stripslashes($type[$i])); $panno1 = addslashes(stripslashes($panno[$i])); $currency1 = addslashes(stripslashes($currency[$i])); $bank_charges1 = addslashes(stripslashes($bank_charges[$i])); $opening_balance1 = addslashes(stripslashes($opening_balance[$i])); $terms_condtion1 = addslashes(stripslashes($terms_condtion[$i])); $sql1 = "INSERT INTO `contact_address`(`contact_id`, `address`, `city`, `state`, `pin`, `email`, `phone`, `country`, `gstin`, `iecno`, `type`, `panno`, `currency`, `bank_charges`, `opening_balance`, `terms_condtion`) VALUES ('$contactId', '$address1', '$city1', '$state1', '$pin1', '$email1', '$phone1', '$country1', '$gstin1','$iecno1','$type1','$panno1','$currency1','$bank_charges1','$opening_balance1','$terms_condtion1')"; $conn->query($sql1); } echo '<script>localStorage.setItem("ContactAdded", "true");</script>' ; echo '<script>location.replace("contact.php")</script>' ; } else { echo '<script>alert("Error !")</script>'; } ?>