<?PHP 
include("header.php");
//session_start();
//error_reporting(0);

include "checksession.php";

include ("include/db-connect.php");

if(isset($_REQUEST['submit']))
 {
	  $bname=$_REQUEST['bname'];
	  $account=$_REQUEST['account'];
	  $aname=$_REQUEST['aname'];
	  $branch=$_REQUEST['branch'];
	  $ifsc=$_REQUEST['ifsc'];
	   //upload file1
	   $small_jpg=$_FILES['small_jpg']['name'];
	   $viewid="select * from ".$PRODUCT." order by `serial` desc";
       $resultid=mysql_query($viewid);
	   $rowid= mysql_fetch_row($resultid);
	  
	     $id=$rowid[0];
		if(!$id)
		{
		$id=$id;
		}
		else
		{
		$id=$id+1;
		}
	 
	$filename=$id.$small_jpg;
    $uploaddir = 'sample/';
    $uploadfile = $uploaddir . $filename;
	move_uploaded_file($_FILES['small_jpg']['tmp_name'], $uploadfile);
	 //end  

    $insert=("insert into bank_det(bname,account,aname,branch,ifsc,image)
			values ('$bname','$account','$aname','$branch','$ifsc','$uploadfile')");
 
    $exce=mysql_query($insert);
		                   
						   ?>
                           <script>
						   window.location='add_product.php?add=success';
						   </script>
                           <?
   // header("location:add_product.php?add=success"); 
}
 ?>
  <div id="content">
  <div class="breadcrumb">
       <!-- <a href="http://amarasudhan.com/admin/index.php?route=common/home&amp;token=b735cc089ec2d51abb9a8e1901f501fb">Home</a>-->
      </div>
              <div class="box">
    <div class="heading">
      <h1><img src="view/image/home.png" alt="" />Dashboard > <? echo $array['menu'] ?> Add Bank Details</h1>
    </div>
    <div class="content">
      <div class="overview" style="width:50%; margin-left:300px;">
        <div class="dashboard-heading"> Bank Details</div>
        <div class="dashboard-content">
        
 
  <?php
if($_REQUEST['add'] == 'success') {echo $result= '<h4 class="alert_success"> Added Successfully </h4>';}

elseif($_REQUEST['add'] == 'fail'){echo $result= '<h4 class="alert_error"> Already Exit</h4>';}

?>	
 

  <form action="" method="post" enctype="multipart/form-data" id="question" >
  <!--<script type="text/javascript" src="../prototype.js"></script>
  <script type="text/javascript" src="../validation.js"></script>   
  <script src="../ckeditor.js"></script>
  -->
      
		<div class="add_row" style="margin-top:20px"><div id="wrapper">
		<div class="wrap_box">
        
        
                        
                            <div style="float:left;width:200px;">Bank Name&nbsp;<font color="#FF0000">*</font>	</div> 
							<div id="txtHintstate" style="margin-left:200px;">
                            <input  type="text"  name="bname" size="19" class="required">
                            </div><div class="spacer"></div>
                            
                         <br />
                           
                            <div style="float:left;width:200px;">Account No.&nbsp;<font color="#FF0000">*</font>	</div> 
							<div id="txtHintstate" style="margin-left:200px;">
                            <input  type="text"  name="account" size="19" class="required">
                            </div><div class="spacer"></div><div class="spacer">
                            
                          <br />
                            
                            <div style="float:left;width:200px;">Account Name&nbsp;<font color="#FF0000">*</font>	</div> 
							<div id="txtHintstate" style="margin-left:200px;">
                            <input  type="text"  name="aname" size="19" class="required">
                            </div><div class="spacer"></div>
                             <br />
                            
                            
                            <div style="float:left;width:200px;">Branch&nbsp;<font color="#FF0000">*</font>	</div> 
							<div id="txtHintstate" style="margin-left:200px;">
                            <input  type="text"  name="branch" size="19" class="required">
                            </div><div class="spacer"></div>
                            
                          <br />
                            <div style="float:left;width:200px;">IFSC Code&nbsp;<font color="#FF0000">*</font>	</div> 
							<div id="txtHintstate" style="margin-left:200px;">
                            <input  type="text"  name="ifsc" size="19" class="required">
                            </div><div class="spacer"></div>
                             <br />
                            
                            
                            <div style="float:left;width:200px;">Bank Logo&nbsp;<font color="#FF0000">*</font>	</div> 
							<div id="txtHintstate" style="margin-left:200px;">
                            <input  type="file"  name="small_jpg" size="55" class="required">
                            </div><div class="spacer"></div>
                            
                            
                       <br />
                                                        

                       <div class="add_row" style="margin-left:195px; margin-top:20px;">
                      <p><span class="maintextbox"> <input type="submit" name="submit" id="button" value="Submit" > </span></p>
                      </div></div><!-- End option--></div><!-- End add_row-->
                      </div>
 
 
   </form>
   
        </div>
      </div>
      
      
    </div>
  </div>
</div>
<!--[if IE]>
<script type="text/javascript" src="view/javascript/jquery/flot/excanvas.js"></script>
<![endif]--> 
<script type="text/javascript" src="view/javascript/jquery/flot/jquery.flot.js"></script> 
<script type="text/javascript"><!--
function getSalesChart(range) {
	$.ajax({
		type: 'get',
		url: 'index.php?route=common/home/chart&token=b735cc089ec2d51abb9a8e1901f501fb&range=' + range,
		dataType: 'json',
		async: false,
		success: function(json) {
			var option = {	
				shadowSize: 0,
				lines: { 
					show: true,
					fill: true,
					lineWidth: 1
				},
				grid: {
					backgroundColor: '#FFFFFF'
				},	
				xaxis: {
            		ticks: json.xaxis
				}
			}

			$.plot($('#report'), [json.order, json.customer], option);
		}
	});
}

getSalesChart($('#range').val());
//--></script> 
</div>
<div id="footer">Copyright &copy; 2014 | Powered by <a href="http://linikantech.com/" target="_blank">Linikantech</a><!--<a href="http://www.opencart.com">OpenCart</a> &copy; 2009-2016 All Rights Reserved.<br />Version 1.5.6.4--></div>
</body></html>