<?php include("../../include/dbconnect.php");
if(empty($bankcode))
{
	echo("<br><br><center><b>Please select Bank.<br>");
        echo("<a href=edit.php>Back</a></b></center>");
	exit;
}	 

if ( isset($submit) && $submit == "Update")
{
if(isset($bankname) && !empty($bankname))
    {
     $result=mysql_query("update banks set bankname='$bankname' where bankcode='$bankcode'") or
     die(mysql_error());
    }
    
if(isset($address1) && !empty($address1))
    {
     $result=mysql_query("update banks set address1='$address1' where bankcode='$bankcode'") or
     die(mysql_error());
    }

if(isset($address2) && !empty($address2))
    {
     $result=mysql_query("update banks set address2='$address2' where bankcode='$bankcode'") or
     die(mysql_error());
    }

if(isset($city) && !empty($city))
    {
     $result=mysql_query("update banks set city='$city' where bankcode='$bankcode'") or
     die(mysql_error());
    }

if(isset($state) && !empty($state))
    {
     $result=mysql_query("update banks set state='$state' where bankcode='$bankcode'") or
     die(mysql_error());
    }
if(isset($contact) && !empty($contact))
    {
     $result=mysql_query("update banks set contact='$contact' where bankcode='$bankcode'") or
     die(mysql_error());
    }
if(isset($telno) && !empty($telno))
    {
     $result=mysql_query("update banks set telno='$telno' where bankcode='$bankcode'") or
     die(mysql_error());
    }
if(isset($fax) && !empty($fax))
    {
     $result=mysql_query("update banks set fax='$fax' where bankcode='$bankcode'") or
     die(mysql_error());
    }
if(isset($email) && !empty($email))
    {
     $result=mysql_query("update banks set email='$email' where bankcode='$bankcode'") or
     die(mysql_error());
    }
}
elseif (isset($submit) && $submit == "Delete")

{
$result=mysql_query("delete from banks where bankcode='$bankcode'") or
die(mysql_error());
}
?>

<center>
<h2><b>The Bank details are updated </b></h2>
<br>
<br>
<h4><a href="view.php">View Banks</a></h4></center>
