[go: up one dir, main page]

Menu

[r10]: / pages / create / supplier.php  Maximize  Restore  History

Download this file

27 lines (21 with data), 1.4 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?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);
?>