<?php
include '../../db_connect.php';


if($_GET['mode']=='insertcustomer')
{
$qry=mysqli_query($con,"select id from commst where compid='$_POST[jobcode]'");
if(mysqli_num_rows($qry)>0)
die('Error :Company Name Already Exits!!');

if(mysqli_query($con,"INSERT INTO `commst` (`id`, `compid`, `name`, `address`, `cmpcity`, `incstax`, `inctoll`,`telephone`,`conper`,`email`, `type`) VALUES (NULL, '$_POST[buyercode]', '$_POST[buyerma]', '$_POST[adress]', '$_POST[city]', '', '','','', '', 'CUSTOMER')"))
{
	$currid=mysqli_insert_id($con);
	echo "Record Inserted Susscessfully!!!";

}
else
echo "Error:".mysqli_error($con);
}
mysqli_close($con);


?>