<?php include "layouts/menu.php"; ?>
  <!--  page-wrapper -->
           <div class="right_col" role="main">
            
            <div class="row">
                <div class="col-lg-12">
                    <!-- Form Elements -->
                    <div class="panel panel-default">
                        <div class="panel-heading">
                             Company Creation
                        </div>
                        <div class="panel-body">
                            <div class="row">
   <form name="form1" class="form-horizontal" method="post" action="" enctype="multipart/form-data">
  <div class="form-group">
    <label for="inputPassword3" class="col-sm-2 control-label">Finance Name</label>
    <div class="col-sm-4">
      <input type="text" class="form-control" id="inputPassword3" autofocus="autofocus"  name="name" value="" placeholder="" >
    </div>
  </div>
  <div class="form-group">
    <label for="inputPassword3" class="col-sm-2 control-label">Alias (Sort Name)</label>
    <div class="col-sm-4">
      <input type="text" class="form-control" id="inputPassword3" autofocus="autofocus"  name="name2" value="" placeholder="" >
    </div>
  </div>
  <div class="form-group">
    <label for="inputPassword3" class="col-sm-2 control-label">License No</label>
    <div class="col-sm-4">
      <input type="text" class="form-control" id="inputPassword3" name="lic" value="" placeholder="" >
    </div>
  </div>
  <div class="form-group">
    <label for="inputPassword3" class="col-sm-2 control-label">Address Line 1</label>
    <div class="col-sm-4">
      <input type="text" class="form-control" id="inputPassword3" name="addr" value="" placeholder="" >
    </div>
  </div>
   <div class="form-group">
    <label for="inputPassword3" class="col-sm-2 control-label">Address Line 2</label>
    <div class="col-sm-4">
      <input type="text" class="form-control" id="inputPassword3" name="addr1" value="" placeholder="" >
    </div>
  </div>
   <div class="form-group">
    <label for="inputPassword3" class="col-sm-2 control-label">Address Line 3</label>
    <div class="col-sm-4">
      <input type="text" class="form-control" id="inputPassword3" name="addr2" value="" placeholder="" >
    </div>
  </div>
   <div class="form-group">
    <label for="inputPassword3" class="col-sm-2 control-label">Phone Number</label>
    <div class="col-sm-4">
      <input type="text" class="form-control" id="inputPassword3"  name="pno" value="" placeholder="" >
    </div>
  </div>
   <div class="form-group">
    <label for="inputPassword3" class="col-sm-2 control-label">Account Name-1</label>
    <div class="col-sm-4">
      <input type="text" class="form-control" id="inputPassword3"  name="acn1" value="" placeholder="" >
    </div>
  </div>
    <div class="form-group">
    <label for="inputPassword3" class="col-sm-2 control-label">Account Number-1</label>
    <div class="col-sm-4">
      <input type="text" class="form-control" id="inputPassword3"  name="acno1" value="" placeholder="" >
    </div>
  </div>
    <div class="form-group">
    <label for="inputPassword3" class="col-sm-2 control-label">Bank Name-1</label>
    <div class="col-sm-4">
      <input type="text" class="form-control" id="inputPassword3"  name="bname1" value="" placeholder="" >
    </div>
  </div>
    <div class="form-group">
    <label for="inputPassword3" class="col-sm-2 control-label">Branch Code-1</label>
    <div class="col-sm-4">
      <input type="text" class="form-control" id="inputPassword3"  name="bco1" value="" placeholder="" >
    </div>
  </div>
  
    <div class="form-group">
    <label for="inputPassword3" class="col-sm-2 control-label">IFSC Code-1</label>
    <div class="col-sm-4">
      <input type="text" class="form-control" id="inputPassword3"  name="ifsc1" value="" placeholder="" >
    </div>
  </div>

    <div class="form-group">
    <label for="inputPassword3" class="col-sm-2 control-label">Account Name-2</label>
    <div class="col-sm-4">
      <input type="text" class="form-control" id="inputPassword3"  name="acn2" value="" placeholder="" >
    </div>
  </div>
     <div class="form-group">
    <label for="inputPassword3" class="col-sm-2 control-label">Account Number-2</label>
    <div class="col-sm-4">
      <input type="text" class="form-control" id="inputPassword3"  name="acno2" value="" placeholder="" >
    </div>
  </div>
     <div class="form-group">
    <label for="inputPassword3" class="col-sm-2 control-label">Bank Name-2</label>
    <div class="col-sm-4">
      <input type="text" class="form-control" id="inputPassword3"  name="bname2" value="" placeholder="" >
    </div>
  </div>
     <div class="form-group">
    <label for="inputPassword3" class="col-sm-2 control-label">Branch Code-2</label>
    <div class="col-sm-4">
      <input type="text" class="form-control" id="inputPassword3"  name="bco2" value="" placeholder="" >
    </div>
  </div>
   <div class="form-group">
    <label for="inputPassword3" class="col-sm-2 control-label">IFSC Code-2</label>
    <div class="col-sm-4">
      <input type="text" class="form-control" id="inputPassword3"  name="ifsc2" value="" placeholder="" >
    </div>
  </div>
    <div class="form-group">
    <label for="inputPassword3" class="col-sm-2 control-label">Details</label>
    <div class="col-sm-4">
      <textarea class="form-control" rows="3" name="details" value="" placeholder=""></textarea>
    </div>
  </div>  
    <div class="form-group">
    <label for="inputPassword3" class="col-sm-2 control-label">Activation Code</label>
    <div class="col-sm-4">
      <input type="text" class="form-control" id="inputPassword3" required  name="ccode" value="" placeholder="Call 9952292120 For Your Code" >
    </div>
  </div>
  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-10">
      <button type="submit" class="btn btn-default" name="s1">Save This</button>
    </div>
  </div>
      <div class="alert alert-success">
	 <?php
							if(isset($_POST['s1']))
							{
								extract($_POST);
								if($ccode == '22121710') {
								$insert=mysqli_query($conn, "insert into mfin(`name2`,`addr1`,`addr2`,`name`,`details`,`lic`,`addr`,`pno`,`acn1`,`acno1`,`bname1`,`bco1`,`ifsc1`,`acn2`,`acno2`,`bname2`,`bco2`,`ifsc2`)
											 values('$name2','$addr1','$addr2','$name','$details','$lic','$addr','$pno','$acn1','$acno1','$bname1','$bco1','$ifsc1','$acn2','$acno2','$bname2','$bco2','$ifsc2')");
								
								if($insert)
								{
										echo "<script>alert('Registered successfully');window.location.href='mfin.php'</script><br>";
														
								}
								else
								{
										echo "<script>alert('Failure');window.location.href='mfin.php'</script><br>";
						
								}
								}
								else {
										echo "<script>alert('Invalid Activation Code Get Code From INFOSSEL');window.location.href='mfin.php'</script><br>";
								
								}
							}
?>
	  </div>
</form>
</div>
     <?php
					
						$qry=mysqli_query($conn, "select * from mfin");
						$n=mysqli_num_rows($qry);
						if($n==0)
						{
							echo "Nothing To Display";
						}
						else
						
					{ 
						?>
                <!-- Main content -->
                <section class="content">
                    <div class="row">
                        <div class="col-xs-12"> 
                            <div class="box">
                               <!-- /.box-header -->
                                <div class="box-body table-responsive">
                                    <table id="table2" class="table table-bordered table-striped">
                                        <thead>
                                            <tr>
							<th>Name</th>
							<th>Alias</th><th>LICENCE</th>
							<th>Address</th>
							<th>Bank 1</th>
							<th>Bank 2</th>
							<th>-</th>
							
	
                                            </tr>
                                        </thead>
										<?php 
					while($row2=mysqli_fetch_array($qry))
						{
					?>
                                        <tbody>
                                           <tr>
                         <td><?php echo $row2['name'];?></td>						
                       <td><?php echo $row2['name2'];?></td>  <td><?php echo $row2['lic'];?></td>						
                         <td><?php echo $row2['addr'];?></br><?php echo $row2['addr1'];?></br><?php echo $row2['addr2'];?></td>						
						<td><?php echo $row2['acn1']; ?></br><?php echo $row2['acno1']; ?></br><?php echo $row2['bname1']; ?></br><?php echo $row2['bco1']; ?></br><?php echo $row2['ifsc1']; ?></td>
						<td><?php echo $row2['acn2']; ?></br><?php echo $row2['acno2']; ?></br><?php echo $row2['bname2']; ?></br><?php echo $row2['bco2']; ?></br><?php echo $row2['ifsc2']; ?></td>
						<td><a href='mfin2.php?id=<?php echo $row2['id']; ?>'><input type="button" value="Edit" name="submit">
						<a href='deletefin.php?id=<?php echo $row2['id']; ?>' onclick="return confirm('Are you sure WANT TO DELETE?');"><input type="button" value="Delete" name="submit"></td>

						
                                            </tr>
                                          </tbody>
                                        <?php
						}
					}
				
					?>
					                    
                                    </table>		
                                </div><!-- /.box-body -->
                            </div><!-- /.box -->
 
</div>
</div></div>
</div></div></div> <?php include "layouts/footer.php"; ?> </body></html>