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
27
28
29
30
31
32
33
34
35
|
<?php require("checkuser.php"); ?> <? $custid = $_POST['custid']; $custname = $_POST['custname']; $address = htmlspecialchars($_POST['address'], ENT_QUOTES); $contactperson = $_POST['contactperson']; $telno = $_POST['telno']; $email = $_POST['email']; $status = $_POST['status'];
$creationby = $_SESSION['userid']; $creationdate = date("Ymdgis"); $updatedby = $_SESSION['userid']; $updateddate = date("Ymdgis");
include("configure.php");
$sql = "select * from CM_CUSTOMER_HDR where custid = '".$custid."'"; $result = mysql_query($sql); if ($row = mysql_fetch_array($result,MYSQL_ASSOC)) { die("<br>Customer already exist!"); }
$sql = "insert into CM_CUSTOMER_HDR "; $sql .= "(custid, custname, address, contactperson, telno, email, status, creationby, creationdate) "; $sql .= "values ($custid, '$custname', '$address', '$contactperson', '$telno', '$email', $status, '$creationby', '$creationdate') ";
$result = mysql_query($sql); if (!$result) { die('Invalid query: ' . mysql_error()); } header("Location: customerlist.php"); ?>
|