-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlab_add1.php
47 lines (35 loc) · 1.15 KB
/
lab_add1.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
39
40
41
42
43
44
45
46
<?php
include('db_conn.php');
?>
<?php
$idno = $_POST['field1'];
$erial = $_POST['field2'];
$intdate = $_POST['field3'];
$warrenty = $_POST['field4'];
$type = $_POST['field5'];
$make = $_POST['field6'];
$model = $_POST['field7'];
$yrmanu = $_POST['field8'];
$state = $_POST['field9'];
$discpt = $_POST['field10'];
$query10 = "SELECT * FROM `lab` WHERE `idno`='$idno'";
$result10 = mysql_query($query10);
$count10 = mysql_num_rows($result10);
if($count10!=0){
$message = "Entry already exist";
echo "<script type='text/javascript'>window.confirm('$message');</script>";
/* exit("<script type='text/javascript'>alert('$message');</script>"); */
/* header('location:add_lab.html'); */
echo "<script type='text/javascript'>window.location.href=\"add_lab.html\";</script>";
die();
}
else
{
$query1 = "INSERT INTO lab (idno,serial,intdate,warrenty,type,make,model,yrmanu,state,discpt) VALUES('$idno','$serial','$intdate','$warrenty','$type','$make','$model','$yrmanu','$state','$discpt')";
$result1 = mysql_query($query1);
if($result1)
{
header('location:add_lab.html');
}
}
?>