<?php include "layouts/menu.php"; ?> 
<style>
.form-control::placeholder { 
color: black;
font-weight: bolder;
font-size: 16px; }
.form-control { 
font-weight: bolder;
display: block;
    width: 100%;
    height: 39px;
    padding: 6px 12px;
    font-size: 16px;
    line-height: 1.42857143;
    color: #555;
    background-color: #fff;
    background-image: none;
    border: 1px solid #ccc; } 
	/* WebKit, Blink, Edge */
.form-control:-moz-placeholder { color: blue; }  /* Mozilla Firefox 4 to 18 */
.form-control::-moz-placeholder { color: blue; }  /* Mozilla Firefox 19+ */
.form-control:-ms-input-placeholder { color: blue; }  /* Internet Explorer 10-11 */
.form-control::-ms-input-placeholder { color: blue; }  /* Microsoft Edge */


}
.form-control-feedback {
    right: 18px;
    size: 11px;
    font-size: larger;
	color: #3c763d;
	margin-top: 8px;
    height: 23px;
    color: #bbb;
    line-height: 24px;
    font-size: 15px;
}
</style>
	 <script>
	function autocomp() {
	var min_length = 0; // min caracters to display the autocomplete
	var keyword = $('#didn').val();
	if (keyword.length >= min_length) {
		$.ajax({
			url: 'ajax_sname.php',
			type: 'POST',
			data: {keyword:keyword},
			success:function(data){
				$('#dname').show();
				$('#dname').html(data);
			}
		});
	} else {
		$('#dname').hide();
	}
}

// set_item : this function will be executed when we select an item
function set_itemm(item) {
	// change input value
	$('#didn').val(item);
	// hide proposition list
	$('#dname').hide();
}
	</script>
		 <script>
	function autocomplett() {
	var min_length = 0; // min caracters to display the autocomplete
	var keyword = $('#zxcvb').val();
	if (keyword.length >= min_length) {
		$.ajax({
			url: 'ajax_broker.php',
			type: 'POST',
			data: {keyword:keyword},
			success:function(data){
				$('#qwertyu').show();
				$('#qwertyu').html(data);
			}
		});
	} else {
		$('#qwertyu').hide();
	}
}
// set_item : this function will be executed when we select an item
function set_itemmm(item) {
	// change input value
	$('#zxcvb').val(item);
	// hide proposition list
	$('#qwertyu').hide();
}
	</script>
    <!--  page-wrapper -->
          <div class="right_col" role="main">
						
   	<?php $name=$_REQUEST['name'];?>
            <div class="row">
                <div class="col-lg-12">
                    <!-- Form Elements -->
                    <div class="panel panel-default">
                        <div class="panel-heading">
                           Scheme Master
                        </div>
                        <div class="panel-body">
                            <div class="row">
                        
                                   <?php	$qry=mysqli_query($conn, "select * from msch where name='$name' && mfin='$mfin'");
						$n=mysqli_num_rows($qry);
						$row=mysqli_fetch_array($qry);
						 ?>
   <form role="form" class="form-horizontal" name="form1" method="post" action="" enctype="multipart/form-data">
   <div class="form-group">
    <label for="inputPassword3" class="col-sm-2 control-label">Name</label>
    <div class="col-sm-4">
      <input type="text" class="form-control" id="inputPassword3" name="name" readonly value="<?php echo $row['name'];?>" placeholder="" >
  </div>
  </div>
        <div class="form-group">
    <label for="inputPassword3" class="col-sm-2 control-label">Gold /Silver</label>
    <div class="col-sm-4">
      <select type="text" class="form-control" id="inputPassword3" name="details" value="" placeholder="" required>
<option><?php echo $row['details'];?></option><option>Gold</option><option>Silver</option></select>
    </div>
  </div>
 <div class="form-group">
    <label for="inputPassword3" class="col-sm-2 control-label">Interest %</label>
    <div class="col-sm-4">
      <input type="text" class="form-control" id="inputPassword3" name="inter" value="<?php echo $row['inter'];?>" placeholder="" >
    </div>
  </div>
  <div class="form-group">
    <label for="inputPassword3" class="col-sm-2 control-label">Loan Value%(in Gold Rate)</label>
    <div class="col-sm-4">
      <input type="text" class="form-control" id="inputPassword3" name="pgram" value="<?php echo $row['pgram'];?>" placeholder="" >
    </div>
  </div>
   <div class="form-group">
    <label for="inputPassword3" class="col-sm-2 control-label">Reduction in gram(916H)</label>
    <div class="col-sm-4">
      <input type="text" class="form-control" id="inputPassword3" name="hh" value="<?php echo $row['hh'];?>" placeholder="" >
    </div>
  </div>
    <div class="form-group">
    <label for="inputPassword3" class="col-sm-2 control-label">Reduction in gram(Ordinary)</label>
    <div class="col-sm-4">
      <input type="text" class="form-control" id="inputPassword3" name="oo" value="<?php echo $row['oo'];?>" placeholder="" >
    </div>
  </div>
    <div class="form-group">
    <label for="inputPassword3" class="col-sm-2 control-label">Valitity in Months</label>
    <div class="col-sm-4">
      <input type="text" class="form-control" id="inputPassword3" name="edate" value="<?php echo $row['edate'];?>" placeholder="" >
    </div>
  </div> 
  <div class="form-group">
    <label for="inputPassword3" class="col-sm-2 control-label">Interest After Valitity</label>
    <div class="col-sm-4">
      <input type="text" class="form-control" id="inputPassword3" name="inter2" value="<?php echo $row['inter2'];?>" placeholder="" >
    </div>
  </div>   
  
  
  
    <div class="form-group">
    <label for="inputPassword3" class="col-sm-2 control-label">Interest Calc _ Month Onces</label>
    <div class="col-sm-4">
      <input type="text" class="form-control" id="inputPassword3" name="interm" value="<?php echo $row['interm'];?>" placeholder="" >
    </div>
  </div>   
      <div class="form-group">
    <label for="inputPassword3" class="col-sm-2 control-label">Interest Taken On Loan</label>
    <div class="col-sm-4">
      <select type="text" class="form-control" id="inputPassword3" name="intert" value="<?php echo $row['intert'];?>" placeholder="" >
	 <option><?php echo $row['intert'];?></option>  <option>Yes</option>
	  <option>No</option></select>
    </div>
  </div>

      <input type="hidden" class="form-control" id="inputPassword3" name="prec" value="<?php echo $row['prec'];?>" placeholder="" >
  
 <div class="form-group">
    <label for="inputPassword3" class="col-sm-2 control-label">Processing Charges %</label>
    <div class="col-sm-4">
      <input type="text" class="form-control" id="inputPassword3" name="pros" value="<?php echo $row['pros'];?>" placeholder="" >
    </div>
  </div>  

  </div>
  <div class="form-group">
   
      <button type="submit" class="btn btn-success btn-lg btn-block" name="s2">Update</button>

</div>
      <div class="alert alert-success">
	 <?php
							if(isset($_POST['s2']))
							{
								extract($_POST);
								
								$update=mysqli_query($conn, "update msch set name='$name',pros='$pros',details='$details',pgram='$pgram',inter='$inter',edate='$edate',hh='$hh',oo='$oo',inter2='$inter2',prec='$prec',interm='$interm',intert='$intert' where name='$name'");
								if($update)
								{ 
								echo "Updated successfully";
								
								}
								else
								{
									echo "Failure";
								}
							}
?>
	  </div>
</form>
 


</div></div>
</div></div></div></div></div></div> <?php include "layouts/footer.php"; ?></body></html>
