<?php
include('../../includes/databaseLogin.php');
include('../../includes/installedLanguage.php');
$name = htmlentities(mysql_real_escape_string($_GET[name]), ENT_QUOTES);
$add1 = htmlentities(mysql_real_escape_string($_GET[add1]), ENT_QUOTES);
$add2 = htmlentities(mysql_real_escape_string($_GET[add2]), ENT_QUOTES);
$add3 = htmlentities(mysql_real_escape_string($_GET[add3]), ENT_QUOTES);
$telephone = htmlentities(mysql_real_escape_string($_GET[telephone]), ENT_QUOTES);
$fax = htmlentities(mysql_real_escape_string($_GET[fax]), ENT_QUOTES);
$mobile = htmlentities(mysql_real_escape_string($_GET[mobile]), ENT_QUOTES);
$website = htmlentities(mysql_real_escape_string($_GET[website]), ENT_QUOTES);
$email = htmlentities(mysql_real_escape_string($_GET[email]), ENT_QUOTES);
$referent = htmlentities(mysql_real_escape_string($_GET[referent]), ENT_QUOTES);
$queryResult = mysql_query("INSERT INTO suppliers (supplierName, supplierAddress1, supplierAddress2, supplierAddress3, supplierTelephone, supplierFax, supplierMobile, supplierWebSite, supplierMailAddress, supplierReferent) VALUES ('$name', '$add1', '$add2', '$add3', '$telephone', '$fax', '$mobile', '$website', '$email', '$referent') ");
if($queryResult){
$responseArray = array ('opResult'=>0, 'opText'=>_T("NI_p_c_supplier_I"));
}else{
$responseArray = array ('opResult'=>1, 'opText'=>_T("NI_p_c_supplier_II"));
}
echo json_encode($responseArray);
?>