-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnewClient.php
38 lines (30 loc) · 1020 Bytes
/
newClient.php
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
36
37
38
<?php
session_start();
include './connect.php';
if(isset($_POST['submit'])){
$name = $_POST['name'];
$address = $_POST['address'];
$mobile = $_POST['mob'];
$GST = $_POST['gst'];
if($GST!=''){
$query = "select * from clientlist where GST = '".$GST."'";
$result = mysqli_query($con,$query);
if(mysqli_num_rows($result)>0){
echo "<script>alert('GST Number already present');</script>";
return;
}
}
$query = "insert into clientlist values(NULL,'".$name."','".$GST."','".$address."','".$mobile."')";
$result = mysqli_query($con,$query);
if($result){
echo "<script>alert('Client Added Successfully');</script>";
}else{
echo "<script>alert('Error while adding Client');</script>";
}
echo "
<script>
location.replace('./newClient.html');
</script>
";
}
?>