<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="datatable/data.css">
<script src="datatable/data.js" type="text/javascript"></script>
<script src="datatable/table.js" type="text/javascript"></script>
<script src="datatable/datatable.js"></script>
<link rel="stylesheet" href="datatable/data-boot.css">
<link href="javascript/select2.css" rel="stylesheet" >
<script src="javascript/selectt2.js"></script>

<script src="restriction/secondtrans_restriction.js"></script>

<style>
    
    #navbar
    {
        flex:15%;
        height:100%; 
        flex-direction:row;
        overflow:auto;
        
    }
    #content
    {
        flex:90%;
        overflow:auto;
        padding-left:10px;
        padding-right:10px;
    }
    #fullbody
    {
        display:flex;
        
         height:100%;         
    }
    label
    {
      font-size:20px;
    }
    .edit
    {
        font-size:18px;
        color:green;
        cursor:pointer;
    }
    .dele
    {
        font-size:18px;
        color:red;
        cursor:pointer;
    }
    .edit:hover
    {
        font-size:20px;
        
    }
    .dele:hover
    {
        font-size:20px;
        color:red;
        cursor:pointer;
        
    }
    td
    {
      text-align:center;
    }
    th
    {
      text-align:center;
    }
    li a 
    {
      color:black;
    }
    .page-item.active .page-link {
    
    background-color:yellow;
    border-color: #007bff;
}
select
{
  width:100%;
}
#menu1 input
{
    height:30px;
}
.row input
{
    height:30px;
}
#menu1 select
{
    height:35px;
    /* padding-bottom:8px; */
}
#ticketFetch
{
width:250px;
float:right;
margin-bottom:20px;
}
select,input[type="text"]{
  width:100%;
}
#toShow{
width:100px;
float:left;
}
    @media (max-width: 800px) {
        #fullbody 
    {
        display:flex;
        flex-wrap: wrap;
                 
    }
        #navbar,#content {
    flex: 100%;
  }
}
</style>
<script>
$(document).ready( function () {
    $('#protable').DataTable();
} );
</script>

</head>
<body>
     <div ><?php include "navbar.php"?></div>
    <div id="fullbody"> 

<div id="content">
<br>
<h3>Second Transaction</h3>
<br>

<!-- table -->
<div>
  <!-- tab for rate --><?php 
        $userall=$_SESSION['log'];
        $usper = mysqli_query($connect,"select * from userpermission where username = '$userall'  && filename='secondtransaction'");
while($per=mysqli_fetch_array($usper))
{
          ?>
          
<span id="print" style="display:none"><?php echo $per['dataprint'] ?></span>
<span id="edit" style="display:none"><?php echo $per['dataedit'] ?></span>
  <ul class="nav nav-pills" role="tablist">
  <li class="nav-item">
  <?php if($per['dataadd'] =='1'){ ?>     <a <?php if($per['dataadd'] !='1'){echo'class="nav-link "'; }else{echo'class="nav-link active "';}  ?> data-toggle="pill" href="#menu1"><span style="color:#000000;">Entry</span></a><?php }?>
    </li>
    <li class="nav-item">
      <a  <?php if($per['dataadd'] !='1'){echo'class="nav-link active "'; }else{echo'class="nav-link  "';}  ?> data-toggle="pill" href="#home"><span style="color:#000000;">List</span></a>
    </li>
   
    
    
  </ul>

  <!-- Tab panes -->
  <div class="tab-content" style="border:1px solid lightgrey">
    <!--  -->
    <div id="home"  <?php if($per['dataadd'] !='1'){echo'class="container tab-pane active"'; }else{echo'class="container tab-pane fade"';}  ?>  ><br>
    <!-- entry list div -->
    <select  id="toShow" class="form-control"><option>10</option><option>25</option><option>50</option><option>100</option><option>200</option><option>500</option><option>750</option><option>1000</option></select>
    &nbsp;<!--<button id="deleteSelected" class="btn btn-danger">-->
  Delete Selected
</button>
    <input type="text" id="ticketFetch" class="form-control" placeholder="Search">
    <table class="table table-bordered table-hover " style="border:1px solid lightgrey" id="protabl">
    <thead >
<tr>
<th>Date</th>
  <th>Time</th>
    <th>Ticket</th>
    <th>Invoice&nbsp;No</th>
    <th>Customer</th>
    <th>GSTIN</th>
    <th>Material</th>
    
    <th>Net Total</th>
    <?php if($per['dataprint'] =='1'){?>   <th>Dc-Print</th><?php }?>
    <?php if($per['dataprint'] =='1'){?>   <th>Print</th><?php }?>
    <?php //if($per['dataprint'] =='1'){?>  <!-- <th>Delete</th>--><?php //}?>
    <?php if($per['dataprint'] =='1'){?>   <th>E-Invoice</th><?php }?>
    
      <?php if($per['dataprint'] =='1'){?><th>Edit</th><?php }?>
    <!-- <th>Delete</th> -->
</tr>
    </thead>
    <!-- <span id="print"><?php echo $per['dataprint'] ?></span><span id="edit"><?php echo $per['dataedit'] ?></span> -->
    <tbody id="tableTbody">
    <td align="center" colspan="11"><div class="spinner-border text-primary spintext" style="padding:1%"></div></td>
    </tbody>



</table>
<h5>Total Entries:&nbsp;<span id="currentRow"></span>&nbsp; of &nbsp;<span id="totalRow"></span></h5>
    <!-- entry div table -->
    </div>
    <!-- entrydiv -->
    <script>
    function printsl()
    
{
  document.getElementById("addsubmit").disabled=true;
  var salestype = document.getElementById("loadType").value;
  //var billtype = document.getElementById("billtypeedit").value;
  console.log(salestype);
  var billtype = "Gst";
// alert(salestype);
// alert (billtype);
  // if(salestype == "Out" &&  billtype == "Est")
  // {
    
	// var varBillNumber = document.getElementById("salescodeest").value;
  // var customer = document.getElementById("customeradd").value;
  // var product = document.getElementById("productadd").value;
  // var date = document.getElementById("entrydate").value;
  // var price = document.getElementById("priceadd").value;
  // var vehicle = document.getElementById("vehicleno").value;
  // var destination = document.getElementById("deliveryadd").value;  
  //   var quantity = document.getElementById("netqtyadd").value;
  //   var total = document.getElementById("totalamtadd").value;
  // window.open("billeston.php?sales="+varBillNumber+"&&customer="+customer+"&&product="+product+"&&date="+date+"&&quantity="+quantity+"&&price="+price+"&&total="+total+"&&vehicle="+vehicle+"&&delivery="+destination+" ","OriginalWindowa40",'width=722,height=950,toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=1,resizable=1,left=25,top=25');
  // }
  if(salestype == "Empty" &&  billtype == "Gst")
  {
    
	var varBillNumber = document.getElementById("billType").value == 'gst' ? document.getElementById("salescodegst").value : document.getElementById('salescodeest').value;
  var customer = document.getElementById("customerAdd").value;
  var product = document.getElementById("productAdd").value;
  //var date = document.getElementById("entrydate").value;
  var price = document.getElementById("priceadd").value;
  var vehicle = document.getElementById("vehicleAdd").value;
  var destination = document.getElementById("deliveryAdd").value; 
    var quantity = document.getElementById("netQtyAdd").value;
    var total = document.getElementById("totalAmtAdd").value;
    var dateSecond = document.getElementById("dateSecond").value;
    var timeSecond = document.getElementById("timeSecond").value;
    var modeTrans = document.getElementById("modeTrans").value;
  window.open("billgston.php?sales="+varBillNumber+"&&customer="+customer+"&&product="+product+"&&quantity="+quantity+"&&price="+price+"&&total="+total+"&&vehicle="+vehicle+"&&delivery="+destination+"&&date="+dateSecond+"&&time="+timeSecond+"&&modetrans="+modeTrans+" ","OriginalWindowa40",'width=722,height=950,toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=1,resizable=1,left=25,top=25');
  }
  // if(salestype == "In" &&  billtype == "Est" )
  // {
    
	// var varBillNumber = document.getElementById("salescodeest").value;
  // var customer = document.getElementById("customerAdd").value;
  // var product = document.getElementById("productadd").value;
  // var date = document.getElementById("entrydate").value;
  // var price = document.getElementById("priceadd").value;
  
  // var destination = document.getElementById("deliveryAdd").value; 
  //   var quantity = document.getElementById("netqtyadd").value;
  //   var total = document.getElementById("totalamtadd").value;
  //   var vehicle = document.getElementById("vehicleno").value;
  //   var ticket = document.getElementById("ticketselect").value;
  //   var empty =document.getElementById("emptyweightadd").value;
  //   var load =document.getElementById("loadweightadd").value;
  //   var netweight =document.getElementById("netweightadd").value;
  // window.open("billpuron.php?sales="+varBillNumber+"&&customer="+customer+"&&product="+product+"&&date="+date+"&&quantity="+quantity+"&&price="+price+"&&total="+total+"&&vehicle="+vehicle+"&&ticket="+ticket+"&&empty="+empty+"&&load="+load+"&&netweight="+netweight+" ","OriginalWindowa40",'width=722,height=950,toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=1,resizable=1,left=25,top=25');
  // }
  if(salestype == "Load" &&  (billtype == "Gst" || billtype == "Est"))
  {
  	var varBillNumber = document.getElementById("purchasecode").value;
  var customer = document.getElementById("customerAdd").value;
   var ticketadd = document.getElementById("ticketselect").value;
  var product = document.getElementById("productAdd").value;
  //var date = document.getElementById("entrydate").value;
  var price = document.getElementById("priceadd").value;
  var vehicle = document.getElementById("vehicleAdd").value;
  var destination = document.getElementById("deliveryAdd").value; 
    var quantity = document.getElementById("netQtyAdd").value;
    var total = document.getElementById("totalAmtAdd").value;
    var dateSecond = document.getElementById("dateSecond").value;
    var timeSecond = document.getElementById("timeSecond").value;
    var modeTrans = document.getElementById("modeTrans").value;
  window.open("billpuron.php?sales="+varBillNumber+"&&customer="+customer+"&&product="+product+"&&quantity="+quantity+"&&ticketadd="+ticketadd+"&&price="+price+"&&total="+total+"&&vehicle="+vehicle+"&&delivery="+destination+"&&date="+dateSecond+"&&time="+timeSecond+"&&modetrans="+modeTrans+" ","OriginalWindowa40",'width=722,height=950,toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=1,resizable=1,left=25,top=25');
  }
}
</script>




    <div id="menu1"<?php if($per['dataadd'] !='1'){echo'class="container tab-pane fade"'; }else{echo'class="container tab-pane active"';}  ?>   ><br>
    <!-- enter the entry list -->
   
<form action="insertsecondtrans.php" id="form1"  method="post">
<div class="row">
  <div class="col-sm-2"><label>Vehicle/Tkt-no</label></div>:
              <div class="col-sm-3"><select class="form-control selectpro" id="ticketselect" name="ticketadd">
              <option value="0">--Select ticket--</option>
              <?php 
$tktedit=mysqli_query($connect,"select ticket,vehicleno from ticket where status !='deleted'&& process!='completed' && loadtype != 'Cancel' order by concat(date,time) desc");
while($fstktshowedi = mysqli_fetch_array($tktedit))
{
  $frsttkt = $fstktshowedi['ticket'];
  $vehtkt = $fstktshowedi['vehicleno'];
  
?>
<option value="<?php echo $frsttkt;  ?>"><?php echo $frsttkt;  ?>/<?php echo $vehtkt;  ?></option>
<?php }?>
              </select></div>
</div><br>
    <div class="row">
         <div class="col-sm-2"><label>Bill-Type</label></div>:
  <div class="col-sm-3"><select class="required " id="billType" name="billtype">
              <option value="">--Select Billing--</option>
              <!--<option value="Purchase" >Purchase</option>
              <option value="gst" >Sale</option>
               <option value="est" >Quotation</option> -->
              </select></div>
              
              <!-- salescode -->
              
        <?php
        include "financial_year_calculation.php";
        $accountyear    = $financialYearStart."-".$financialYearEnd;
        $year_code = substr($financialYearEnd,2);
		$year_code_start = substr($financialYearStart,2);
           $procount = mysqli_query($connect,"select count(salescode)as code,CURRENT_DATE()as date from second_transaction where second_transaction.status!='deleted' && financialyear='$accountyear'");
           while($dis = mysqli_fetch_array($procount))
           {
               $salescode = ($dis['code']+1);
               $sales_code = 'YSS'.$year_code_start.$year_code.'/'.$salescode;
		}
    $procount_pur = mysqli_query($connect,"select count(salescode)as code,CURRENT_DATE()as date from purchasedetails where purchasedetails.status!='deleted' && financialyear='$accountyear'");
    while($dis = mysqli_fetch_array($procount_pur))
    {
        $purchasecode = ($dis['code']+1);
        $purchase_code = 'PUR/'.$purchasecode;
}
    $procount_est = mysqli_query($connect,"select count(salescode)as code,CURRENT_DATE()as date from second_transaction_est where second_transaction_est.status!='deleted' && financialyear='$accountyear'");
    while($dis = mysqli_fetch_array($procount_est))
    {
        $salescode_est = ($dis['code']+1);
        $sales_code_est = $year_code_start.'-'.$year_code.'/'.$salescode_est;
    $date = $dis['date'];
$datefr = date_create($date);
$datefrom = date_format($datefr,"d-m-Y");
}
        ?>
        <input type="hidden" id="salescodegst" value="<?php  echo  $sales_code  ?>">
        <input type="hidden" id="salescodeest" value="<?php  echo  $sales_code_est  ?>">
        <input type="hidden" id="purchasecode" value="<?php  echo  $purchase_code  ?>">
        <!-- salescode -->
        
        <div class="col-sm-2"><label>Vehicle No</label></div>:
     <div class="col-sm-3"><select class="form-control selectpro" id="vehicleAdd" name="vehicleno" required>
              <option value="">--Select Vehicle--</option>
              <?php 
$veh=mysqli_query($connect,"select distinct vehicleno from cftdetails where status !='deleted'");
while($vehshow = mysqli_fetch_array($veh))
{
?>
<option value="<?php echo $vehshow['vehicleno'] ?>"><?php  echo $vehshow['vehicleno'] ?></option>
        <?php }?>          
  
              </select></div>
            </div><br>
            <!--  -->
            <div class="row">
    <div class="col-sm-2"><label>Chakka Type</label></div>:
     <div class="col-sm-3"><select class="required" name="chakkaname" id="chakkaType" required></select></div>
     <div class="col-sm-2"><label> Load Type</label></div>:
              <div class="col-sm-3"><select class="required " id="loadType" name="loadtype">
              <option value="">--Select weight--</option>
              <!--<option value="Empty">Out</option>
              <option value="Load">In</option>-->
              </select></div>
           
                          </div><br>
                          <div class="row">
                          <div class="col-sm-2"><label>Customer</label></div>:
              <div class="col-sm-3"><select class="form-control selectpro"  name="customeradd" id="customerAdd">
              <option value="0">--Select Customer--</option>
              </select>
              <input type="hidden" class="form-control"  autocomplete="off"name="customerori" id="customeraddori"  >
                          </div>
                          <div class="col-sm-2"><label>Block Date</label></div>
	<div class="col-sm-3"><input type="text" class="required" name="blockdate" placeholder="Block Date" readonly id="blockDate"></div>
           
            </div><br>
    <!--  -->
    <div class="row">
     <div class="col-sm-2"><label>Delivery/Intake&nbsp;place</label></div>:
     <div class="col-sm-3"><!--<input type="text" class="required deliveryOri"  autocomplete="off"name="delivery" id="deliveryAdd" style="background:#FFFF40" >-->
	 
	 <select class="form-control selectpro deliveryOri"  name="delivery" id="deliveryAdd">
              <option value="0">--Select Customer--</option>
              </select>
	 <input type="hidden" class="form-control deliveryOri"  autocomplete="off"name="deliveryori"  ></div>
     <div class="col-sm-2"><label id="limitName">Credit Limit</label></div>:
     <div class="col-sm-3"><input type="text" class="required"  autocomplete="off"name="limitvalue" id="limitValue" readonly><input type="hidden" class=""  autocomplete="off"name="" id="advanceLimitValue"></div>
    </div><br>
            
    <div class="row">
              <div class="col-sm-2"><label>Material</label></div>:
              <div class="col-sm-3"><select class="selectpro" name="productadd" id="productAdd">
              <option value="0">--Select Product--</option>
              
              </select></div>
              <input type="hidden" id="productadddori"  name="productaddori">
              <input type="hidden" id="productnameadd" name="productnameadd">
              <!-- <div class="col-sm-2"><label>Delivery-Site</label></div>:
     <div class="col-sm-3">
       <input type="text" class="form-control"  autocomplete="off"name="delivery" id="deliveryadd"  ></div> -->
	   
	    
       <?php 
        $userall=$_SESSION['log'];
        $usper = mysqli_query($connect,"select * from userpermission where username = '$userall'  && filename='readonly'");
while($per=mysqli_fetch_array($usper))
{
          ?>
               <div class="col-sm-2"><label>Discount Amount</label></div>:
     <div class="col-sm-3">
       <input type="number" class="required"   autocomplete="off" name="discount_amount" id="discount_amount" value="0" style="background:#FFFF40">
      
     </div> 
            </div><br>
           
    <!--  -->
    <!--  -->
	
	<div class="row">
    <div class="col-sm-2"><label>Discount&nbsp;Price</label></div>:
     <div class="col-sm-3"> <input type="text" class="required"   autocomplete="off"name="priceadd" id="priceadd" readonly=""></div>
     <div class="col-sm-2"><label>Actual Price</label></div>:
     <div class="col-sm-3"><input type="text" class="form-control"  autocomplete="off"name="priceaddori" id="priceaddori" readonly=""></div>
    
    </div> <br>
  
    <div class="row">
     <div class="col-sm-2"><label>Empty Weight</label></div>:
     <div class="col-sm-3"><input type="text" class="required"  autocomplete="off"name="emptyweightadd" id="emptyWeightAdd" <?php echo $per['datashow']==1?"":"readonly" ?>></div>
     <div class="col-sm-2"><label>Load Weight</label></div>:
     <div class="col-sm-3"><input type="text" class="required"  autocomplete="off"name="loadweightadd" id="loadWeightAdd" <?php echo $per['datashow']==1?"":"readonly" ?>><br><span id="previous_weight" style="color:#FF0000; font-weight:bold;"></span></div>
     <div class="col-sm-1"><input type="button" class="btn btn-warning" id="getweightbutton" value="Get Weight" style="height:40px;"></div>
     <input type="hidden" id="unitConversion" name="unitvalue" >
     <input type="hidden" id="dateOri" >
    </div><br>
    <!--  -->
   
    <div class="row">
     <div class="col-sm-2"><label>Nett Weight</label></div>:
     <div class="col-sm-3"><input type="text" class="required"  autocomplete="off"name="netweightadd" id="netWeightAdd" <?php echo $per['datashow']==1?"":"readonly" ?>></div>
     <div class="col-sm-2"><label>Nett Qty</label></div>:
     <div class="col-sm-3"><input type="text" class="required"  autocomplete="off"name="netqtyadd" id="netQtyAdd" style="background:#FFFF40">
     <input type="hidden" id="netQtyOri" name="netqtyori" ></div>
     <!--  -->
  
    </div><br>   
    <div class="row">
    <div class="col-sm-2"><label>Total Amount</label></div>:
     <div class="col-sm-3"><input type="text" class="required"  autocomplete="off"name="totalamtadd" id="totalAmtAdd" <?php echo $per['datashow']==1?"":"readonly" ?> readonly>
     <input type="hidden" class="form-control"  autocomplete="off"name="totalamtaddold" id="oldtotalamtadd" readonly></div>
     <div class="col-sm-2"><label>Vehicle Capacity</label></div>:
              <div class="col-sm-3"><input type="text" readonly class="required" autocomplete="off" id="cft" name="cft">                        </div>      
</div>
      <br>
      
      <div class="row">
	
	<div class="col-sm-2"><label>Driver Amount</label></div>:
     <div class="col-sm-3"><input type="number" class="required"  autocomplete="off" name="driver_amount" style="background:#FFFF40"></div>
	<div class="col-sm-2"><label>Mode Of Transaction:</label></div>
	<div class="col-sm-3"><select class="required" id="modeTrans" name="modetrans" style="background:#FFFF40">
    <option value="">--Select Mode--</option>
    <option value="cash">Cash</option>
    <option value="credit">Credit</option>
    <option value="BANK-GPAY">BANK-GPAY</option>
    <option value="donation">Donation</option>
    <option value="purchase">Purchase</option>
	<option value="Crushing">Crushing</option>
  </select></div>
	
	</div><br>

<div class="row">
    <div class="col-sm-2"><label>No.Of.Permit</label></div>:
     <div class="col-sm-3"> <input type="text" class="required"   autocomplete="off"name="permit" id="permit" style="background:#FFFF40"></div>
     <div class="col-sm-2"><label>Permit Price</label></div>:
     <div class="col-sm-3"><input type="text" class="form-control"  autocomplete="off"name="permit_price" id="permit_price" style="background:#FFFF40"></div>
    
    </div> <br>
     
	  <div class="row">
	<?php 
	$datetime = mysqli_query($connect,"select CURRENT_DATE()as dat,CURRENT_TIME()as tme ");
while($datime = mysqli_fetch_array($datetime))
{
	?>
	<div class="col-sm-2" style="display:none"><label>Date/time</label></div>
	<div class="col-sm-3" style="display:none"><input type="date" id="dateSecond" class="form-control" name="datesecd" placeholder="Date"  <?php echo $per['datashow']==1?"":"readonly" ?>><input type="text" id="timeSecond" class="form-control" name="timesecd" placeholder="Time"  <?php echo $per['datashow']==1?"":"readonly" ?>><span>In HH:MM:SS</span></div>
	<div class="col-sm-2"><label>Remarks</label></div>
	<div class="col-sm-3"><input type="text" class="required"  autocomplete="off"name="remarkadd" oninput="this.value = this.value ? this.value.trimStart() : ''"></div>
	<?php }}?>
	</div><br>
   <br><br>
<!-- Dispatch Details -->
<div id="einvoiceSection">
  <div class="row">
      <div class="col-sm-12"><h5>Dispatch Details </h5></div>
      <br><br>
      <div class="col-sm-2"><label>District</label></div>:
      <div class="col-sm-3"><input type="text" data-gst='true'  placeholder="District" autocomplete="off"name="dispatchdistrict" id="dispatchDistrict"></div>
      <input type="hidden"  class="required" value="33"  placeholder="State Code" autocomplete="off" id="cft" name="dispatchStateCode">     
      <!-- <div class="col-sm-2"><label>State Code</label></div>:
      <div class="col-sm-3"><input type="number" data-gst='true' value="33" class="required" placeholder="State Code" autocomplete="off" id="cft" name="dispatchStateCode">       </div><br><br> -->
      <!-- <div class="col-sm-2"><label>State</label></div>:
      <div class="col-sm-3"> -->
      <input type="hidden" data-gst='true' class="required" placeholder="Pincode" value="TamilNadu" autocomplete="off" id="dispatchStateName" name="dispatchStateName">
      <!-- <select class="selectpro" data-show-subtext="true" data-gst='true' data-live-search="true" id="dispatchStateName" name="dispatchStateName">
          <option value="SELECT STATE">SELECT STATE</option>
          <option value="Andhra Pradesh">Andhra Pradesh</option>
          <option value="Arunachal Pradesh">Arunachal Pradesh</option>
          <option value="Assam">Assam</option>
          <option value="Bihar">Bihar</option>
          <option value="Chhattisgarh">Chhattisgarh</option>
          <option value="Dadra and Nagar Haveli">Dadra and Nagar Haveli</option>
          <option value="Daman and Diu">Daman and Diu</option>
          <option value="Delhi">Delhi</option><option value="Goa">Goa</option>
          <option value="Gujarat">Gujarat</option>
          <option value="Haryana">Haryana</option>
          <option value="Himachal Pradesh">Himachal Pradesh</option>
          <option value="Jammu and Kashmir">Jammu and Kashmir</option>
          <option value="Jharkhand">Jharkhand</option>
          <option value="Karnataka">Karnataka</option>
          <option value="Kerala">Kerala</option>
          <option value="Madhya Pradesh">Madhya Pradesh</option>
          <option value="Maharashtra">Maharashtra</option>
          <option value="Manipur">Manipur</option>
          <option value="Meghalaya">Meghalaya</option>
          <option value="Mizoram">Mizoram</option>
          <option value="Nagaland">Nagaland</option>
          <option value="Orissa">Orissa</option>
          <option value="Puducherry">Puducherry</option>
          <option value="Punjab">Punjab</option>
          <option value="Rajasthan">Rajasthan</option>
          <option value="Sikkim">Sikkim</option>
          <option value="TamilNadu">Tamil Nadu</option>
          <option value="Telangana">Telangana</option>
          <option value="Tripura">Tripura</option>
          <option value="Uttar Pradesh">Uttar Pradesh</option>
          <option value="Uttarakhand">Uttarakhand</option>
          <option value="West Bengal">West Bengal</option>
          </select>   
      </div> -->
      <div class="col-sm-2"><label>Pincode</label></div>:
      <div class="col-sm-3"><input type="text" data-gst='true'  placeholder="Pincode" autocomplete="off" id="dispatchPincode" name="dispatchPincode">       </div>      
  </div><br>
      <!-- Dispatch Details -->
    <!-- Eway Details -->
  <div class="row">
      <div class="col-sm-12"><h5>E-way Bill-<span  id="cugst">123456789GST</span></h5></div>
      <br><br>
      <div class="col-sm-2"><label>Transport Id</label></div>:
      <div class="col-sm-3"><input type="text" data-gst='true'  placeholder="Transport Id"  autocomplete="off" name="transportId" id="transportId"></div>
      <div class="col-sm-2"><label>Transport Name</label></div>:
      <div class="col-sm-3"><input type="text" data-gst='true'  placeholder="Transport Name" autocomplete="off" id="transportName" name="transportName"></div><br><br>
      <div class="col-sm-2"><label>Distance</label></div>:
      <div class="col-sm-3"><input type="text" data-gst='true'  placeholder="Distance" autocomplete="off"name="distance" id="distance"></div>
      </div><br>
</div>
    <!-- Eway Details -->
            <input type="button" class="btn btn-success"  style="float:left;margin-left:10px;height:40px;" value="Submit" id="validationButton">
            <input type="hidden" class="btn btn-success" data-toggle="modal" data-target="#addpro" style="float:left;margin-left:10px;height:40px;" value="Submit" id="submitButton">
    </div><br><br>
     
    <!--  -->
    
   
    
    <!--  -->
    
    <!-- enter the entry list -->
           
            <!-- entry div over  -->
        </div>
          <!-- modal for add confirm -->
                
<div class="modal fade" id="addpro">
    <div class="modal-dialog modal-sm">
      <div class="modal-content" style="background-color:rgba(77, 219, 106,0.9)">
      
        <!-- Modal Header -->
        
        
        <!-- Modal body -->
        <div class="modal-body">
          <span style="color:white"><i class="fas fa-check" style="font-size:24px"></i> Second Transaction Have Been Generated Successfully</span>
        </div>
        
        <!-- Modal footer -->
        <div class="modal-footer">
          <button type="submit"  type="button" id="addsubmit" class="btn btn-warning" > <span class="spinner-border spinner-border-sm subspin2"></span>Ok</button>
        </div>
        
      </div>
    </div>
  </div>
  
<!-- modal for add confirm -->
<input type="button" class="btn btn-success close"data-toggle="modal"  data-backdrop="static" style="display:none" id="priceshowbutton" data-target="#priceshow" >
<div class="modal" id="priceshow">
    <div class="modal-dialog modal-sm">
      <div class="modal-content bg-warning ">
      
        <!-- Modal Header -->
       
        
        <!-- Modal body -->
        <div class="modal-body ">
          <!-- nodal entry -->
          <lable>Product</lable>:<h3 class="productdisplay"></h3>
          <lable>unit Price</lable>:<h3 class="pricedisplay"></h3>
          <lable>Bill Type</lable>:<h3 class="bill_jtype"></h3>
          <!-- modal entry -->
</div>
        
        
        <!-- Modal footer -->
        <div class="modal-footer">
        <a href="secondtransaction.php" class="btn btn-danger"  >Cancel</a>
          <button type="button" class="btn btn-secondary" data-dismiss="modal">Ok</button>
        </div>
        
      </div>
    </div>
  </div>
        <!-- modal to display price -->
              
        <!--overall entry div over  -->
        
        
    </div>
   <!--  -->
  </div>
</div>
</form>
  <!-- tab for rate -->
 
</div>
<!-- tab for entry area-->
<!-- modal to blockdate -->
<button type="button" class="btn btn-primary" id="alertAdvance" data-toggle="modal" data-target="#advanceLimit" style="display:none">
      </button>

  <!-- The Modal -->
  <div class="modal fade" id="advanceLimit">
    <div class="modal-dialog modal-lg">
     <div class="alert alert-danger alert-dismissible fade show">
    <button type="button" class="close"  data-dismiss="alert">&times;</button>
    <strong>Advance Limit Exceeds</strong>
  </div>
  </div>
  </div>
        

<!-- modal for blockdate -->
<input type="button" class="btn btn-success close"data-toggle="modal"  data-backdrop="static" style="display:none" id="blockButton" data-target="#block" >
<div class="modal" id="block">
    <div class="modal-dialog modal-sm">
      <div class="modal-content bg-warning ">
      
        <!-- Modal Header -->
       
        
        <!-- Modal body -->
        <div class="modal-body ">
         <h4>Reached Block Date</h4>
</div>
        
        
        <!-- Modal footer -->
        <div class="modal-footer">
          <button type="button" class="btn btn-secondary reloadPage"  data-dismiss="modal">Ok</button>
        </div>
        
      </div>
    </div>
  </div>
        
<!-- modal for delete -->
<!-- modal for credit -->

<input type="button" class="btn btn-success close"data-toggle="modal"  data-backdrop="static" style="display:none" id="creditButton" data-target="#creditLimitChk" >
<div class="modal" id="creditLimitChk">
    <div class="modal-dialog modal-sm">
      <div class="modal-content " style="background-color:rgba(237, 140, 123)">
      
        <!-- Modal Header -->
       
        
        <!-- Modal body -->
        <div class="modal-body ">
         <h4>Credit Limit Exceeds</h4>
</div>
        
        
        <!-- Modal footer -->
        <div class="modal-footer">
          <button type="button" class="btn btn-secondary reloadPage"  data-dismiss="modal">Ok</button>
        </div>
        
      </div>
    </div>
  </div>
        <!-- modal to credit -->

      
<!-- modal for delete -->
<!-- The Modal -->
<div class="modal fade" id="prd-1">
    <div class="modal-dialog modal-sm">
      <div class="modal-content" style="background-color:rgba(247, 2, 80,0.9)">
      
        <!-- Modal Header -->
        
        
        <!-- Modal body -->
        <div class="modal-body" >
         Are You Sure Want To Delete !.
        </div>
        
        <!-- Modal footer -->
        <div class="modal-footer">
        <a href="#?dele=1"><button type="button" class="btn btn-success" data-dismiss="modal">Yes</button></a>
          <button type="button" class="btn btn-warning" data-dismiss="modal">No</button>
        </div>
        
      </div>
    </div>
  </div>
<!-- ,odal for delete -->
<!-- table -->
 

<!-- main-content-div -->
</div>
<!-- main-content-div -->
</div>
<?php }?>
<script>
    $('.selectpro').select2({ width: '100%',height:'420px;' });
    
</script>
<script>
  $(document).ready(function(){
    $(".subspin").hide();
    $(".subspin2").hide();
$("#addsubmit").click(function(){
$(".subspin2").show();
});
$("#editsubmit").click(function(){
$(".subspin").show();
//$(".subspin2").hide();
});
  });
</script>
<script src="js/secondtrans.js"></script>
</body>