-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathloan2.php
42 lines (30 loc) · 946 Bytes
/
loan2.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
<?php
include('db_conn.php');
?>
<?php
$isdate = $_POST['field1'];
$id = $_POST['field2'];
$type = $_POST['field3'];
$rcvdept = $_POST['field4'];
$rmrk = $_POST['field5'];
$query10 = "SELECT * FROM `loan` 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=\"loan_add.html\";</script>";
die();
}
else
{
$query6 = "INSERT INTO loan (issdate,idno,type,rcvdept,remark) VALUES('$isdate','$id','$type','$rcvdept','$rmrk')";
$result6 = mysql_query($query6);
if($result6)
{
header('location:loan_add.html');
}
}
?>