	<?php 
include '../../connection.php';

// Check if the form is submitted
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    $BankName = $_POST['BankName'];
    $AcName = $_POST['AcName'];
    $AcNo = $_POST['AcNo'];
    $BranchName = $_POST['BranchName'];
    $Address = $_POST['Address'];
    $Country = $_POST['Country'];
    


    // Insert the new offer data into the database
    $insertSql = "INSERT INTO bank_info (bank_name, acc_name, acc_no, branch_name, address,country) 
										VALUES (?, ?, ?, ?, ?, ?)";
    
    $stmt = $con->prepare($insertSql);
    $stmt->bind_param("ssssss", $BankName, $AcName, $AcNo, $BranchName,$Address, $Country);

    if ($stmt->execute()) {
        $success_message = "New Bank added successfully.";
    } else {
        $error_message = "Error: " . $stmt->error;
    }

    $stmt->close();
}
?>
	
	<?php include 'header-link.php' ?>
	
	<?php include 'nav-bar.php' ?>

	
	<?php include 'header-top-chat.php' ?>
	
	
	<!-- [ Main Content ] start -->
<div class="pcoded-main-container">
    <div class="pcoded-wrapper">
        <div class="pcoded-content">
            <div class="pcoded-inner-content">
                <div class="main-body">
                    <div class="page-wrapper">
                        <!-- [ breadcrumb ] start -->
                        <div class="page-header text-center">
                            <div class="page-block">
                                <div class="row align-items-center">
                                    <div class="col-md-12">
                                        <div class="page-header-title">
                                            <h5 class="m-b-10"> Bank info Add </h5>
                                        </div>
                                      
                                    </div>
                                </div>
                            </div>
                        </div>
                        <!-- [ Main Content ] start -->
                        <div class="row justify-content-center">
                            <!-- [ form-element ] start -->
                            <div class="col-lg-6">
                                <div class="card">
                                    <div class="card-header">
                                        <h5> Add New Bank Info </h5>
                                    </div>
                                    <div class="card-body">
									 <?php if (!empty($success_message)): ?>
                                            <div class="alert alert-success"><?php echo $success_message; ?></div>
                                        <?php endif; ?>
                                        <?php if (!empty($error_message)): ?>
                                            <div class="alert alert-danger"><?php echo $error_message; ?></div>
                                        <?php endif; ?>
									
                                        <form action="" method="POST">
                                            <div class="form-group">
                                                <label class="form-label"> Bank Name </label>
                                                <input type="text" name="BankName" class="form-control" placeholder="Enter Bank Name">
                                                
                                            </div>
											
											<div class="form-group">
                                                <label class="form-label"> Account Name </label>
                                                <input type="text" name="AcName" class="form-control" placeholder="Enter Account Name">
                                                
                                            </div>
											
											<div class="form-group">
                                                <label class="form-label"> Account No </label>
                                                <input type="text" name="AcNo" class="form-control" placeholder="Enter Account No ">
                                                
                                            </div>
											
											<div class="form-group">
                                                <label class="form-label"> Branch Name </label>
                                                <input type="text" name="BranchName" class="form-control" placeholder="Enter Branch Name">
                                                
                                            </div>
											
											<div class="form-group">
                                                <label class="form-label"> Address </label>
                                                <input type="text" name="Address" class="form-control" placeholder="Enter Address ">
                                                
                                            </div>
											
											
											<div class="form-group">
                                                <label class="form-label"> Country </label>
                                                <input type="text" name="Country" class="form-control" placeholder="Enter Country Name">
                                                
                                            </div>
											
											
											
											<div class="card-footer">
												<button type="submit" class="btn btn-primary me-2">Submit</button>
												<a href="bank-info.php" class="btn btn-light">Clear</a>
											</div>
											
                                        </form>
                                    </div>
                                    
                                </div>
                               
                               
                            </div>

                           
                        </div>
                        <!-- [ Main Content ] end -->
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- [ Main Content ] end -->
	
	
	<?php include 'footer.php' ?>

