<?php
ob_start();
include "head.php";
include "dbconfig.php";

error_reporting(E_ALL); 
?>
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
  <script src="//code.jquery.com/jquery-1.10.2.js"></script>
  <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<body>
<section id="main-content">
<section class="wrapper">
<!-- page start-->
<div class="row">
<div class="col-sm-12">
<section class="panel">
<header class="panel-heading"> Create New Transaction </header>
<div class="panel-body">

      <form action="ajax/create_transaction.php" method="post" id="myform">
        <div class="form form-register dark form-horizontal col-sm-12 col-xs-12">
          <h4 class="head_back"> Transaction Details </h4>
          <div class="form-group">
      <label for="email" class="col-sm-4 col-xs-12 control-label">Date<font class="red-alert">*</font></label>
      <div class="col-sm-4 col-xs-12">
        <input type="date" class="form-control" id="transaction_date" value="<?php echo date("Y-m-d");?>" name="transaction_date">
      </div>
    </div>
          <div class="form-group">
            <div class="col-sm-4 col-xs-12"></div>
          </div>
          <div class="form-group">
            <label for="email" class="col-sm-4 col-xs-12 control-label">Transaction Type<font class="red-alert">*</font></label>
            <div  class="col-sm-2 col-xs-2">
              
               <Select name="payment_type" id="payment_type" class="form-control required">
			   <option>Select</option>
                                                          <option value="dr">Paying Money to Someone</option>
                                                          <option value="cr">Recieving Money from Someone</option>
                                                          
                                                     
                                                      </Select>
            </div>
          </div>
          <div class="form-group">
            <label for="email" class="col-sm-4 col-xs-12 control-label">Select a Client/Driver<font class="red-alert">*</font></label>

               <div id="pay_type" class="col-sm-2 col-xs-2">
               <select name="source_id" id="source_id" class="form-control required">
              
               
               </select>
              </div>
                      </div>
          
		   <div class="form-group">
            <label for="email" class="col-sm-4 col-xs-12 control-label">Mode of Payment<font class="red-alert">*</font></label>
            <div  class="col-sm-2 col-xs-2">
              
               <Select name="mode_of_payment" id="mode_of_payment" class="form-control required">
			   <option>Select</option>
                                                          <option value="Cash">Cash</option>
                                                          <option value="Cheque">Cheque</option>
														  <option value="Card">Card</option>
                                                          
                                                     
                                                      </Select>
            </div>
          </div>
		  
		  
		  
          <div class="form-group">
            <label for="email" class="col-sm-4 col-xs-12 control-label">Amount<font class="red-alert">*</font></label>
            <div class="col-sm-2 col-xs-2">
              <input type="text" class="form-control required" name="amount" id="fullname" placeholder="Amount">
            </div>
          </div>
          <div class="form-group">
            <label for="email" class="col-sm-4 col-xs-12 control-label">Transaction Details<font class="red-alert">*</font></label>
            <div class="col-sm-2 col-xs-2">
              <textarea name="details" rows="5" cols="32"></textarea>
            </div>
          </div>
        </div>
        
          
          <div class="col-sm-offset-4">
            <button type="button" class="btn btn-primary"><i class="fa fa-times"></i> Cancel</button>
            <input type="submit" name="update" value="Submit Details" class="btn btn-success" id="reAllocate">
         
        </div>
        </div>
        </section>
        </div>
        </div>
        <!-- page end-->
        </section>
        </section>
        </section>
        <!--main content end-->
        <!--right sidebar start-->
        <!--right sidebar end-->
      </form>
      </section>
<script type="text/javascript">
	/*	$(document).ready(
		  function () {
			$('#transaction_date').datepicker({
        changeMonth: true,//this option for allowing user to select month
        changeYear: true, //this option for allowing user to select from year range
        dateFormat: 'dd/mm/yy'
      });
		  }
		
		);*/
		$("#payment_type").change(function() {
			var pay_type=$("#payment_type option:selected").val();
			var url11 = 'payment_type.php?'+new Date().getTime();
                          $.ajax({
                              type:"post",
                              url:url11,
                              data:{pay_type:pay_type},
                              success:function(data){
							  //alert(data);
                              $("#source_id").html(data);
                              }    
                          });
    });
</script>
</body>
</html>