<?php include "layouts/menu.php"; ?> 

    <script>
  $(function() {
   $("#datepicker9").datepicker({ dateFormat: 'dd-mm-yy' });
  });
  </script>
  <link rel="stylesheet" href="assets/css/jquery-ui.css" />
  <script type="text/javascript" src="assets/scripts/jquery-1.9.1.js"></script>
  <script type="text/javascript" src="assets/scripts/jquery-ui.js"></script>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
  </head>
  <body>
  <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;

document.getElementById("txt2").value =(x1*1)-((x1/1000)*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">New Registration For Daily Collection</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">
                            <div class="row">
                                <div class="col-lg-6">
                                   
   <form role="form" name="form1" method="post" action="dregister1.php" enctype="multipart/form-data">
   <div class="form-group has-success has-feedback">
    <label for="inputPassword3" >HPL</label>
      <input type="text" class="form-control" id="inputPassword3" name="hpl" value="" placeholder="E.g 1008" required>
<span class="glyphicon glyphicon-user form-control-feedback"></span> 
 </div>
  <div class="form-group has-success has-feedback">
    <label for="inputEmail3" >Upload Image</label>
    <input type="file" id="exampleInputFile" name="uimg" >
    <p class="help-block">Upload Passport size Photo here.</p>
	<span class="glyphicon glyphicon-cloud-upload form-control-feedback"></span>
  </div>  
  <div class="form-group has-success has-feedback">
    <label for="inputPassword3" >H.P Amount</label>
      <input type="text" class="form-control" id="1" name="hpamount"  value="" placeholder="H.P Amount">
   <span class="glyphicon glyphicon-usd form-control-feedback"></span>
  </div>
  <div class="form-group has-success has-feedback">
    <label for="inputPassword3" class="control-label">H.P Date</label>
      <input type="text" class="form-control" id="datepicker"  name="hpdate" value="" placeholder="H.P Date" onfocus="insertDate(this,'DD-MM-YYYY')">
 <span class="glyphicon glyphicon-calendar form-control-feedback"></span>
    </div>
   <div class="form-group has-success has-feedback">
    <label for="inputPassword3" >Due Days</label>
      <input type="text" class="form-control" id="3" name="duemnt" value="100" placeholder="Due Days">
  <span class="glyphicon glyphicon-time form-control-feedback"></span>
  </div>
  <div class="form-group has-success has-feedback">
    <label for="txt1" >Due Amount</label>
      <input type="text" class="form-control" id="txt1"  name="dueamt" value="" placeholder="Due Amount"  onclick="add2()" onChange="add()">
   <span class="glyphicon glyphicon-usd form-control-feedback"></span>
  </div>
  <div class="form-group has-success has-feedback">
    <label for="txt2" >Given Payment</label>
      <input type="text" class="form-control" id="txt2"  name="interest" value="" placeholder="Given Payment"  onClick="add1()">
   <span class="glyphicon glyphicon-usd form-control-feedback"></span>
  </div>
  </div>
                                <div class="col-lg-6">  
  <div class="form-group has-success has-feedback">
    <label for="inputPassword3" >Name</label>
      <input type="text" class="form-control" id="inputPassword3" name="name" value="" placeholder="name">
 <span class="glyphicon glyphicon-user form-control-feedback"></span>
  </div>
    <div class="form-group has-success has-feedback">
    <label for="inputPassword3" >Phone Number</label>
      <input type="text" class="form-control" id="inputPassword3" name="pno" value="" placeholder="name">
 <span class="glyphicon glyphicon-phone-alt form-control-feedback"></span>
  </div>
  <div class="form-group has-success has-feedback">
    <label for="inputPassword3" >Address</label>
      <textarea class="form-control" rows="3" name="address" value="" placeholder="Address"></textarea>
  <span class="glyphicon glyphicon-home form-control-feedback"></span>
  </div>
   
    <div class="form-group has-success has-feedback">
    <label for="inputPassword3" >Co-Obligant Details</label>
      <textarea class="form-control" rows="3" name="co" value="" placeholder=""></textarea>
    <span class="glyphicon glyphicon-user form-control-feedback"></span>
  </div>
  <div class="form-group has-warning has-feedback">
    <label for="inputEmail3" >Upload Image</label>
    <input type="file" id="exampleInputFile" name="img" >
    <p class="help-block">Upload Co-Obligant Passport size Photo here.</p>
	<span class="glyphicon glyphicon-cloud-upload form-control-feedback"></span>
  </div>  
  <div class="form-group">
   
      <button type="submit" class="btn btn-success btn-lg btn-block" name="s2">Register</button>

</div>
      <div class="alert alert-success">
	<?php
							if(isset($_POST['s2']))
							{
								extract($_POST);
								$uimg=$_FILES['uimg']['name'];
								$img=$_FILES['img']['name'];
								$insert=mysqli_query($conn, "insert into dcc(mfin,scode,hpl,uimg,hpamount,hpdate,duemnt,dueamt,interest,name,pno,address,co,img)
																 values('$mfin','$scode','$hpl','$uimg','$hpamount','$hpdate','$duemnt','$dueamt','$interest','$name','$pno','$address','$co','$img')");
								if($insert)
								{
									$move=move_uploaded_file($_FILES['uimg']['tmp_name'],"user/".$uimg);
									$move1=move_uploaded_file($_FILES['img']['tmp_name'],"user/".$img);
									if($move&&$move1)
									{
										echo "Registered successfully";
									}
									else
									{
										echo "Registered successfully Image Upload failure";
									}
								}
								else
								{
									echo "Failure";
								}
							}
?>
	  </div>
</form>
  </div>
 
 
</div>
</div></div>
</div></div></div> <?php include "layouts/footer.php"; ?></body></html>
