<?php $action=$_REQUEST['action'];?></nav>
                </div>
                <!--  END TOPBAR  -->

            </ul>

<script language="javascript">







function formcheck()



{



			



			



			if(document.myform.acc.value=="")



			{



				alert("Please Enter A/C No!");



				document.myform.acc.focus()



				return false;



			}



			



			



			if(document.myform.bank_name.value=="")



			{



				alert("Please Enter Bank Name!");



				document.myform.bank_name.focus()



				return false;



			}



			if(document.myform.ifsc.value=="")

			{

				alert("Please Enter IFSC Code!");

				document.myform.ifsc.focus()

				return false;

			}	 



			



			



			



			



			



			



		



			



		return true;



		



		}











</script>


            <ul class="navbar-item flex-row ml-auto">
                <li class="nav-item align-self-center search-animated">
                    <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-search toggle-search"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>
                    <form class="form-inline search-full form-inline search" role="search">
                        <div class="search-bar">
                            <input type="text" class="form-control search-form-control  ml-lg-auto" placeholder="Search...">
                        </div>
                    </form>
                </li>
            </ul>

            <ul class="navbar-item flex-row nav-dropdowns">
               

               

                <li class="nav-item dropdown notification-dropdown">
                    <a href="javascript:void(0);" class="nav-link dropdown-toggle" id="notificationDropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                        <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-bell"><path d="M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"></path><path d="M13.73 21a2 2 0 0 1-3.46 0"></path></svg><span class="badge badge-success"></span>
                    </a>
                    <div class="dropdown-menu position-absolute" aria-labelledby="notificationDropdown">
                        <div class="notification-scroll">
						  <?
		   


							 $query_not = $mysqli->prepare("select heading, content from notice");

													$query_not->execute();

													$query_not->bind_result($heading, $content);
		   
		   ?>
		   <?
		                                 while ($query_not->fetch()){
		                                  ?>

                            <div class="dropdown-item">
                                <div class="media server-log">
                                    <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-server"><rect x="2" y="2" width="20" height="8" rx="2" ry="2"></rect><rect x="2" y="14" width="20" height="8" rx="2" ry="2"></rect><line x1="6" y1="6" x2="6" y2="6"></line><line x1="6" y1="18" x2="6" y2="18"></line></svg>
                                    <div class="media-body">
                                        <div class="data-info">
                                            <h6 class=""><? echo $heading;?></h6>
                                            <p class=""><? echo $content;?></p>
                                        </div>

                                        <div class="icon-status">
                                            <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-x"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>
                                        </div>
                                    </div>
                                </div>
                            </div>
							<? } ?>

                            

                            
                        </div>
                    </div>
                </li>
				
											<?
$member_id=$_SESSION['member_id'];
$qry2=$mysqli->prepare("select name,ewallet  from member where member_id=?");

$qry2->bind_param("s", $member_id);

  $qry2->execute();

$qry2->bind_result($name,$ewallet); 

	while($qry2->fetch())

	{

	
	$name=$name;
	$ewallet=$ewallet;

	}
?>

                <li class="nav-item dropdown user-profile-dropdown order-lg-0 order-1">
                    <a href="javascript:void(0);" class="nav-link dropdown-toggle user" id="user-profile-dropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                        <div class="media">
                            <img src="assets/img/90x90.jpg" class="img-fluid" alt="admin-profile">
                        </div>
                    </a>
                    <div class="dropdown-menu position-absolute" aria-labelledby="userProfileDropdown">
                        <div class="user-profile-section">
                            <div class="media mx-auto">
                                <div class="media-body">
                                    <h5>Name : <? echo $name;?></h5>
                                    <p>Member ID : <? echo $member_id;?></p>
                                </div>
                            </div>
                        </div>
                        <div class="dropdown-item">
                            <a href="update_profile.php">
                                <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-user"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path><circle cx="12" cy="7" r="4"></circle></svg> <span>Profile</span>
                            </a>
                        </div>
                       
                        <div class="dropdown-item">
                            <a href="logout.php">
                                <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-log-out"><path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"></path><polyline points="16 17 21 12 16 7"></polyline><line x1="21" y1="12" x2="9" y2="12"></line></svg> <span>Log Out</span>
                            </a>
                        </div>
                    </div>

                </li>
            </ul>
        </header>
    </div>
    <!--  END NAVBAR  -->

    <!--  BEGIN MAIN CONTAINER  -->
    <div class="main-container" id="container">

        <div class="overlay"></div>
        <div class="search-overlay"></div>
        
        <!--  BEGIN CONTENT PART  -->
        <div id="content" class="main-content">
            <div class="layout-px-spacing">

                <div class="page-header">
                    <div class="page-title">
                        <h3><? echo $name;?>(<? echo $member_id;?>)</h3>
                    </div>
                    
                    <div class="toggle-switch">
                        <label class="switch s-icons s-outline  s-outline-secondary">
                            <input type="checkbox" checked="" class="theme-shifter">
                            <span class="slider round">
                                <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-sun"><circle cx="12" cy="12" r="5"></circle><line x1="12" y1="1" x2="12" y2="3"></line><line x1="12" y1="21" x2="12" y2="23"></line><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line><line x1="1" y1="12" x2="3" y2="12"></line><line x1="21" y1="12" x2="23" y2="12"></line><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line></svg>

                                <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-moon"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path></svg>
                            </span>
                        </label>
                    </div>
                </div>

                <div class="row layout-top-spacing">

           <?



$member_id=$_SESSION['member_id'];


									$query1=$mysqli->prepare("select bank,bank_branch,acc_no,ifcs,acc_type,payee_name,bank_country,swift_code from user where member_id=?");



										 $query1->bind_param("s", $member_id);



										  $query1->execute();



								  $query1->bind_result($bank,$bank_branch,$acc_no,$ifcs,$acc_type,$payee_name,$bank_country,$swift_code);



								  while($query1->fetch())



									{



									$bank=$bank;$bank_branch=$bank_branch;$acc_no=$acc_no;$ifcs=$ifcs;$acc_type=$acc_type;



									$payee_name=$payee_name;$bank_country=$bank_country;$swift_code=$swift_code;



									}



									 $qry=$mysqli->prepare("select intro_id,title,name, address,mob,block_chain_add,etherium_address from member where member_id=?");



										  $qry->bind_param("s", $member_id);



										   $qry->execute();



								  $qry->bind_result($intro_id, $title, $name, $address, $mob,$block_chain_add,$etherium_address);



								  while($qry->fetch())



									{



									$intro_id=$intro_id;



									$title=$title;



									$name=$name;



									$address=$address;



									$mob=$mob;
									$block_chain_add=$block_chain_add;
									$etherium_address=$etherium_address;



									



									}

 ?>
     <div id="basic" class="col-lg-12 col-sm-12 col-12 layout-spacing">
                            <div class="statbox widget box box-shadow">
                                <div class="widget-header">                                
                                    <div class="row">
                                        <div class="col-xl-12 col-md-12 col-sm-12 col-12">
                                            <h4>Update Bank Details </h4>
                                        </div>
                                    </div>
                                </div>
								<?php



						  if($_SESSION['msg_box']!="")



						  {?>
                                <div class="alert alert-light-success border-0 mb-4" role="alert"> <font color="#FF3300"><? echo $_SESSION['msg_box'];?> </font></div>
								<?	} 



						 unset($_SESSION['msg_box']);





						?>
						 <form class="form-horizontal" action="update_bank.php?action=process" method="post" enctype="multipart/form-data"  name="myform" onSubmit="return formcheck();">
                                <div class="widget-content widget-content-area">
                                    

                                   <div class="input-group mb-4">
                                                  <div class="input-group-prepend">
                                                    <span class="input-group-text" id="basic-addon5">Beneficiary Name</span>
                                                  </div>
                                                  <input type="text" class="form-control" placeholder="Beneficiary Name" value="<? echo $name;?>" name="name" aria-label="Beneficiary Name" readonly="">
                                                </div>
												
												
                                                
												
                                                
                                                
                                                
												<div class="input-group mb-4">
                                                  <div class="input-group-prepend">
                                                    <span class="input-group-text" id="basic-addon5">Bank Name</span>
                                                  </div>
                                                  <input type="text" class="form-control" placeholder="Bank Name" value="<? if($bank!="NULL"){ echo $bank;}?>" aria-label="Bank Name" name="bank_name">
                                                </div>
												<div class="input-group mb-4">
                                                  <div class="input-group-prepend">
                                                    <span class="input-group-text" id="basic-addon5">A/C No</span>
                                                  </div>
                                                 <input type="text" class="form-control" placeholder="A/C No" name="acc" value="<? if($acc_no!="NULL"){ echo $acc_no;}?>">
                                                </div>
												<div class="input-group mb-4">
                                                  <div class="input-group-prepend">
                                                    <span class="input-group-text" id="basic-addon5">IFSC Code</span>
                                                  </div>
                                               <input type="text" class="form-control"  placeholder="IFSC Code" name="ifsc" value="<? if($ifcs!="NULL"){ echo $ifcs;}?>">
                                                </div>
                                                <div class="row">
                                                    <div class="col text-sm-left text-center">
                                                        <button class="btn btn-primary mt-4">Submit</button>
                                                    </div>
                                                </div>

                                   
                                </div>
								</form>
                            </div>
                        </div>

                    
                

                    

                    

                </div>
				
		   <?php



if($action=="process")



{



$member_id=$_SESSION['member_id'];
$payee_name=$_REQUEST['name'];
if($payee_name==""){$payee_name="NULL";}
$bank_name=$_REQUEST['bank_name'];
if($bank_name==""){$bank_name="NULL";}
$bk_address=$_REQUEST['b_address'];
if($bk_address==""){$bk_address="NULL";}


$acc=$_REQUEST['acc'];
if($acc==""){$acc="NULL";}
$ifcs=$_REQUEST['ifsc'];
if($ifcs==""){$ifcs="NULL";}






 $query_chk = $mysqli->prepare("select update_status from member where member_id=?");
$query_chk->bind_param("s", $member_id);
$query_chk->execute();
$query_chk->bind_result($update_status);
while($query_chk->fetch()) 
{
$update_status=$update_status;
}



 $query_chk->close();

  $acc_type=$_REQUEST['acc_type'];

if($acc_type==""){$acc_type="NULL";}

 



  if($update_status=="y")



 {



 $qry2=$mysqli->prepare("update user set payee_name=?,bank=?,ifcs=?,acc_no=? where member_id=?");



						$qry2->bind_param('sssss',$payee_name,$bank_name,$ifcs,$acc,$member_id);



			$qry2->execute();



			$qry2->close();

$update_status="n";



			 $updat_mem=$mysqli->prepare("update member set update_status=? where member_id=?");



			$updat_mem->bind_param('ss', $update_status,$member_id);



			$updat_mem->execute();



			$updat_mem->close();




		 $_SESSION['msg_box']="Bank Details Updated Successfully.";	



header("location:update_bank.php?tab_id=tab1&default=update_bank");  



}



else



{



$_SESSION['msg_box']="You Can Update Your Profile For One time Only";



header("location:update_bank.php?tab_id=tab1&default=update_bank");



}



}	  


?>
