<?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="" />Bank Details</h1>
    </div>
    <div class="content">
      <div class="overview" style="width:80%; margin-left:200px;">
        <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>';}

?>	
 

  <table class="list" cellspacing="0" > 
			<thead> 
				
                
                 <tr>
                <td class="left">S.No</td>
                <td class="left">Bank Name</td>
                <td class="left">Account no.</td>
                <td class="left">Account Name</td>
                 <td class="right">Branch</td>
                 <td class="left">IFSC Code</td>
                <td class="left">Bank Logo</td>
                <td class="left">Action</td>
              </tr>
			</thead> 
			<tbody> 
            
            
            
			<?php 
			
	  $qur="SELECT * FROM bank_det" ; 

		$result = mysql_query($qur);
		while ($row_section = mysql_fetch_array($result)) 
			{
			   
	   $id=$row_section['id'];
	   $bname=$row_section['bname'];
	   $category=$row_section['account'];
	
	   $sub_category=$row_section['aname'];
	   $name=$row_section['branch'];
	   $ifsc=$row_section['ifsc'];
	   $image=$row_section['image'];
	 
	   
							
			  ?>	    
				 
			    <tr align="left"> 
   					<td class="left"><?php echo $id; ?></td>
    				<td class="left"><?php echo $bname; ?></td>
                     <td class="left"><?php echo $category; ?></td>
                    <td class="left"><?php echo $sub_category; ?></td>
                    <td class="left"><?php echo $name; ?></td>                   
                    <td class="left"><?php echo $ifsc; ?></td>
                    <td class="left"><img src="<?php echo $image; ?>" border="0" height="60" width="80"/></td>
                                       

   				  <td class="left" ><a href="editproduct.php?id=<?php echo $row_section['id'];?>">
                    <input type="image" src="images/edit.jpg" title="Edit" width="30" height="30"></a>
                    
                     <a href="deleteproduct.php?id=<?php echo $row_section['id'];?>" 
                     onClick="return confirm('Are you sure you want to delete?')">
                     <input type="image" src="images/delete.jpg" title="Delete" width="20" height="20"></a></td> 
				</tr> 	 
				 
<?php } ?> 
 
			</tbody> 
			</table>
   
        </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>