<?php include "layouts/menu.php"; ?>  
 <script>
function add3()
{
var x = document.getElementById("1").value;
var y = document.getElementById("bba").value;
document.getElementById("1").value =(x*1)+(y*1);
}
</script>

  <script>
function add()
{
var x = document.getElementById("txt1").value;
var y = document.getElementById("txt2").value;
document.getElementById("tot").value =(x*1)+(y*1);
}
</script>
<script>
function add1()
{
var x1 = document.getElementById("1").value;
var y1 = document.getElementById("2").value;
document.getElementById("txt2").value =(x1*1)*(y1/100);
}
</script>
<script>
function add2()
{
var x1 = document.getElementById("1").value;
var y1 = document.getElementById("3").value;
document.getElementById("txt1").value =parseInt((x1*1)/(y1*1));
}
</script>
  <!--  page-wrapper -->
           <div class="right_col" role="main">
            <div class="row">
                 <!-- page header -->
                <div class="col-lg-12">
                    <h1 class="page-header  alert alert-danger">Edit Finance Details Form</h1>
                </div>
                <!--end page header -->
            </div>
            <div class="row">
                <div class="col-lg-12">
                    <!-- Form Elements -->
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            Fill the form
                        </div>
                        <div class="panel-body">
						<?php $id=$_REQUEST['id'];?>
                            <div class="row">
                                <div class="col-lg-6">
                                   <?php	$qry=mysqli_query($conn, "select * from mfin where id='$id'");
						$n=mysqli_num_rows($qry);
						$row=mysqli_fetch_array($qry);
						 ?>

    <form name="form1" class="form-horizontal" method="post" action="" enctype="multipart/form-data">
  <div class="form-group">
    <label for="inputPassword3" class="col-sm-4 control-label">Finance Name</label>
    <div class="col-sm-8">
	      <input type="hidden" class="form-control" id="inputPassword3" name="oname" value="<?php echo $row['name'];?>" placeholder="" >
   <input type="text" class="form-control" readonly id="inputPassword3" name="name" value="<?php echo $row['name'];?>" placeholder="" >
    </div>
  </div>
  <div class="form-group">
    <label for="inputPassword3" class="col-sm-4 control-label">Alias (Sort Name)</label>
    <div class="col-sm-8">
      <input type="text" class="form-control" id="inputPassword3" autofocus="autofocus"  name="name2" value="<?php echo $row['name2'];?>" placeholder="" >
    </div>
  </div>
  <div class="form-group">
    <label for="inputPassword3" class="col-sm-4 control-label">License No</label>
    <div class="col-sm-8">
      <input type="text" class="form-control" id="inputPassword3" name="lic" value="<?php echo $row['lic'];?>" placeholder="" >
    </div>
  </div>
  <div class="form-group">
    <label for="inputPassword3" class="col-sm-4 control-label">Address Line 1</label>
    <div class="col-sm-8">
      <input type="text" class="form-control" id="inputPassword3" name="addr" value="<?php echo $row['addr'];?>" placeholder="" >
    </div>
  </div>
   <div class="form-group">
    <label for="inputPassword3" class="col-sm-4 control-label">Address Line 2</label>
    <div class="col-sm-8">
      <input type="text" class="form-control" id="inputPassword3" name="addr1" value="<?php echo $row['addr1'];?>" placeholder="" >
    </div>
  </div>
   <div class="form-group">
    <label for="inputPassword3" class="col-sm-4 control-label">Address Line 3</label>
    <div class="col-sm-8">
      <input type="text" class="form-control" id="inputPassword3" name="addr2" value="<?php echo $row['addr2'];?>" placeholder="" >
    </div>
  </div>
   <div class="form-group">
    <label for="inputPassword3" class="col-sm-4 control-label">Phone Number</label>
    <div class="col-sm-8">
      <input type="text" class="form-control" id="inputPassword3"  name="pno" value="<?php echo $row['pno'];?>" placeholder="" >
    </div>
  </div>
   <div class="form-group">
    <label for="inputPassword3" class="col-sm-4 control-label">Account Name-1</label>
    <div class="col-sm-8">
      <input type="text" class="form-control" id="inputPassword3"  name="acn1" value="<?php echo $row['acn1'];?>" placeholder="" >
    </div>
  </div>
    <div class="form-group">
    <label for="inputPassword3" class="col-sm-4 control-label">Account Number-1</label>
    <div class="col-sm-8">
      <input type="text" class="form-control" id="inputPassword3"  name="acno1" value="<?php echo $row['acno1'];?>" placeholder="" >
    </div>
  </div>
    <div class="form-group">
    <label for="inputPassword3" class="col-sm-4 control-label">Bank Name-1</label>
    <div class="col-sm-8">
      <input type="text" class="form-control" id="inputPassword3"  name="bname1" value="<?php echo $row['bname1'];?>" placeholder="" >
    </div>
  </div>
    <div class="form-group">
    <label for="inputPassword3" class="col-sm-4 control-label">Branch Code-1</label>
    <div class="col-sm-8">
      <input type="text" class="form-control" id="inputPassword3"  name="bco1" value="<?php echo $row['bco1'];?>" placeholder="" >
    </div>
  </div>
  
    <div class="form-group">
    <label for="inputPassword3" class="col-sm-4 control-label">IFSC Code-1</label>
    <div class="col-sm-8">
      <input type="text" class="form-control" id="inputPassword3"  name="ifsc1" value="<?php echo $row['ifsc1'];?>" placeholder="" >
    </div>
  </div>

    <div class="form-group">
    <label for="inputPassword3" class="col-sm-4 control-label">Account Name-2</label>
    <div class="col-sm-8">
      <input type="text" class="form-control" id="inputPassword3"  name="acn2" value="<?php echo $row['acn2'];?>" placeholder="" >
    </div>
  </div>
     <div class="form-group">
    <label for="inputPassword3" class="col-sm-4 control-label">Account Number-2</label>
    <div class="col-sm-8">
      <input type="text" class="form-control" id="inputPassword3"  name="acno2" value="<?php echo $row['acno2'];?>" placeholder="" >
    </div>
  </div>
     <div class="form-group">
    <label for="inputPassword3" class="col-sm-4 control-label">Bank Name-2</label>
    <div class="col-sm-8">
      <input type="text" class="form-control" id="inputPassword3"  name="bname2" value="<?php echo $row['bname2'];?>" placeholder="" >
    </div>
  </div>
     <div class="form-group">
    <label for="inputPassword3" class="col-sm-4 control-label">Branch Code-2</label>
    <div class="col-sm-8">
      <input type="text" class="form-control" id="inputPassword3"  name="bco2" value="<?php echo $row['bco2'];?>" placeholder="" >
    </div>
  </div>
   <div class="form-group">
    <label for="inputPassword3" class="col-sm-4 control-label">IFSC Code-2</label>
    <div class="col-sm-8">
      <input type="text" class="form-control" id="inputPassword3"  name="ifsc2" value="<?php echo $row['ifsc2'];?>" placeholder="" >
    </div>
  </div>
    <div class="form-group">
    <label for="inputPassword3" class="col-sm-4 control-label">Details</label>
    <div class="col-sm-8">
      <textarea class="form-control" rows="3" name="details" value="" placeholder=""><?php echo $row['details'];?></textarea>
    </div>
  </div>  
   
  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-10">
      <button type="submit" class="btn btn-default" name="s2">Update This</button>
    </div>
  </div>
      <div class="alert alert-success">
	 <?php
							if(isset($_POST['s2']))
							{
								extract($_POST);
								
								$update=mysqli_query($conn, "update mfin set name2='$name2',details='$details',lic='$lic',pno='$pno',addr='$addr',addr1='$addr1',addr2='$addr2',acn1='$acn1',acno1='$acno1',bname1='$bname1',bco1='$bco1',ifsc1='$ifsc1',acn2='$acn2',acno2='$acno2',bname2='$bname2',bco2='$bco2',ifsc2='$ifsc2' where  id='$id'");
								if($update)
								{ 
								//$update=mysqli_query($conn, "update customerdetails set fin='$name' where fin='$oname'");
							//	$update=mysqli_query($conn, "update net set fin='$name' where fin='$oname'");

								echo "<script>alert('Updated successfully');window.location.href='mfin.php'</script><br>";
								
								}
								else
								{
									echo "Failure";
								}
							}
?>
	  </div>
</form>
  </div>
 
 
</div>
</div></div>
</div></div></div> <?php include "layouts/footer.php"; ?> </body></html>
</html>
