<?php 
ob_start();
session_start();
include("include/connection.php");

@$userid=mysqli_real_escape_string($con,$_POST['userid']);
@$name=mysqli_real_escape_string($con,$_POST['name']);
@$ifsc=mysqli_real_escape_string($con,$_POST['ifsc']);
@$bank=mysqli_real_escape_string($con,$_POST['bank']);
@$account=mysqli_real_escape_string($con,$_POST['account']);
@$mobile=mysqli_real_escape_string($con,$_POST['mobile']);
@$upi_name=mysqli_real_escape_string($con,$_POST['upi_name']);
 //@$action=$_POST['action'];
// @$editid=$_POST['editid'];
$today = date("Y-m-d H:i:s");

 $type=$_POST['type'];
//print_r($_POST);
	

$withdrawalsql= mysqli_query($con,"INSERT INTO tbl_bankdetail(userid,name,ifsc,bankname,account,mobile,upi_name,status) VALUES ('$userid','$name','$ifsc','$bank','$account','$mobile','$upi_name','1')");

//print_r($withdrawalsql);exit;

echo "<script>
alert('Bank details submit sucessfully');
window.location.href='manage_bankcard';
</script>";  

if(isset($_POST['type']))
{
if($_POST['type']=='delete'){	
	$dellid=$_POST['id'];	
	$sqlDel = "Delete from `tbl_bankdetail` where `id` in ($dellid)";
	$querydel=mysqli_query($con,$sqlDel);
	if($querydel){echo "1";}else{echo "0";}
		}
}
?>