-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtransfer2.php
41 lines (29 loc) · 911 Bytes
/
transfer2.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
<?php
include('db_conn.php');
?>
<?php
$trnsdate = $_POST['field1'];
$id = $_POST['field2'];
$type = $_POST['field3'];
$rcvdept = $_POST['field4'];
$query10 = "SELECT * FROM `trans` WHERE `idno`='$id'";
$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=\"trans_add.html\";</script>";
die();
}
else
{
$query7 = "INSERT INTO trans (trsdate,idno,type,rcvdept) VALUES('$trnsdate','$id','$type','$rcvdept')";
$result7 = mysql_query($query7);
if($result7)
{
header('location:trans_add.html');
}
}
?>