forked from g33kyrash/Online-Banking-system
-
Notifications
You must be signed in to change notification settings - Fork 0
/
customer_issue_atm_process.php
55 lines (43 loc) · 1.65 KB
/
customer_issue_atm_process.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
47
48
49
50
51
52
53
54
55
<?php
session_start();
if(!isset($_SESSION['customer_login']))
header('location:index.php');
?>
<?php
include '_inc/dbconn.php';
$name=$_SESSION['name'];
$account_no=$_SESSION['login_id'];
$option=$_REQUEST['atm'];
$atm_status=$cheque_book_status="NOT REQUESTED";
if($option=='ATM')
$atm_status="PENDING";
else
$cheque_book_status="PENDING";
$sql="SELECT * FROM cheque_book WHERE account_no='$account_no'";
$result=mysql_query($sql) or die(mysql_error());
$rws=mysql_fetch_array($result);
$c_status=$rws[3];
$c_id=$rws[2];
$sql="SELECT * FROM atm WHERE account_no='$account_no'";
$result= mysql_query($sql) or die(mysql_error());
$rws= mysql_fetch_array($result);
$a_status=$rws[3];
$a_id=$rws[2];
if(($option=='ATM' && (($a_status=='PENDING')||($a_status=='ISSUED'))) || ($option=='CHEQUE' && (($c_status=='PENDING')||($c_status=='ISSUED'))))
{
echo '<script>alert("You have already made a request!");';
echo 'window.location= "customer_issue_atm.php";</script>';
}
elseif($option=='ATM'){
$sql="insert into atm values('','$name','$account_no','$atm_status')";
mysql_query($sql) or die(mysql_error());
echo '<script>alert("Request succesfull. You will recieve confirmation from branch very soon.");';
echo 'window.location= "customer_issue_atm.php";</script>';
}
else {
$sql="insert into cheque_book values('','$name','$account_no','$cheque_book_status')";
mysql_query($sql) or die(mysql_error());
echo '<script>alert("Request succesfull. You will recieve confirmation from branch very soon.");';
echo 'window.location= "customer_issue_atm.php";</script>';
}
?>