<?PHP

ob_start();

session_start();

include 'connect.php';

if(isset($_SESSION['adminemail']))

{

$user=$_SESSION['adminemail'];



$gtp=mysql_query("select * from admin where username='$user'");

$gtp1=mysql_fetch_array($gtp);



include 'top.php';

?>







<div class="main-content">

				<div class="main-content-inner">

					<div class="breadcrumbs ace-save-state" id="breadcrumbs">

						<ul class="breadcrumb">

							<li>

								<i class="ace-icon fa fa-home home-icon"></i>

								<a href="#">Home</a>

							</li>

							<li class="active">Bank</li>

						</ul><!-- /.breadcrumb -->

					</div>



					<div class="page-content">

			



						<div class="page-header">

							<h1>

								Bank

							</h1>

						</div><!-- /.page-header -->

<br />



						<div class="row">

							<div class="col-xs-12">

                            

								<!-- PAGE CONTENT BEGINS -->

                                

<script src="assets/js/jquery.js"></script>

<script>

	

jQuery(function($){

		   

	// simple jQuery validation script

	$('#work').submit(function(){

		

		var valid = true;

		var errormsg = 'This field is required!';

		var errorcn = 'error';

		

		$('.' + errorcn, this).remove();			

		

		$('#required', this).each(function(){

			var parent = $(this).parent();

			if( $(this).val() == '' ){

				var msg = $(this).attr('title');

				msg = (msg != '') ? msg : errormsg;

				$('<span style="font-size:13px;color:#FF0000; padding-left:3px;" class="'+ errorcn +'">'+ msg +'</span>')

					.appendTo(parent)

					.fadeIn('fast')

					.click(function(){ $(this).remove(); });

				valid = false;

			};

		});

		

		return valid;

		

		$('button:submit').prop('disabled', true);

		

	});

	

});	



</script>







<?php



	



if(isset($_POST['submit']))







{







$bank=$_POST['bank'];



$name=$_POST['name'];



$acno=$_POST['acno'];



$ifsc=$_POST['ifsc'];



$branch=$_POST['branch'];





if($bank)







{







$insert="INSERT into bank(bank,accountname,accountno,ifsc,branch,createdby) values('$bank','$name','$acno','$ifsc','$branch','$user')";







mysql_query($insert) or die(mysql_error());







}











if($insert){







header("location:bank.php?s=1" . urlencode($Message));







}







else{







echo "<script type='text/javascript'>alert('Field Missing.');</script><META HTTP-EQUIV = 'Refresh' Content = '1; URL =bank.php'>";







}







}







else



{



if (isset($_GET['s'])) 



	{



	 $status=$_GET['s'];



		 if($status=='1')



		 {



		 echo '<div class="alert alert-success">



				<a class="close" data-dismiss="alert">x</a>



					Bank Added Successfully !



			  </div>';



		}



	}







echo '<form action="bank.php" method="post" id="work">



<center><table width="70%" id="page" style="line-height:35px;">



<tr><td id="page">Bank <span class="red">*</span></td><td width="2%">:</td> <td id="page"><input size="25" type="text" name="bank" autocomplete="off" id="required" title="*" /></td></tr>



<tr><td id="page">Branch <span class="red">*</span></td><td width="2%">:</td> <td id="page"><input size="25" type="text" name="branch" autocomplete="off" id="required" title="*" /></td></tr>



<tr><td id="page">Account No <span class="red">*</span></td><td width="2%">:</td> <td id="page"><input size="25" type="text" name="acno" autocomplete="off" id="required" title="*" /></td></tr>



<tr><td id="page">Account Name <span class="red">*</span></td><td width="2%">:</td> <td id="page"><input size="25" type="text" name="name" autocomplete="off" id="required" title="*" /></td></tr>



<tr><td id="page">IFSC Code </td><td width="2%">:</td> <td id="page"><input size="25" type="text" name="ifsc" autocomplete="off" /></td></tr>



<tr><td align="right" id="page"></td><td align="right" id="page"></td><td id="page"><button type="submit" class="btn btn-sm btn-primary" name="submit" value="Add">Save</button></td></tr>



</table></center>



</form>';







}



	



?>                        

                               

							<br>

<br>

	



								<!-- PAGE CONTENT ENDS -->

							</div><!-- /.col -->

						</div><!-- /.row -->

					



</div><!-- /.page-content -->

				</div>

			</div><!-- /.main-content -->





<?php

include 'bottom.php';

}

else

{



 header("location:login.php");

}

ob_flush();

?>