
<?php
include_once("./config/constants.php");

if (!isset($_SESSION["userid_demo"])) {
  header("location:".DOMAIN."/");
}
 include 'layouts/header.php';
 
include 'layouts/navbar.php';
include 'layouts/commonTools.php';
$_SESSION['title_name'] ='Purchase';
?>

  <style>
	.card{
		width:320px;
	}
	.product{
		color:green;
	}
	.date{
		color:blue;
	}
	.party_name{
		color:red;
	}
	.number{
		color:blue;
	}
	.whatsapp{
		color:#fff;
		background:green;
		padding:0rem .2rem;
		border-radius:5px;
		
	}
	.whatsapp:hover{
		color:#fff;
	}
	.card{
		border-radius:10px;
		width:auto;
	}
  </style>
        <span  data-toggle="tooltip"  title="Logout" class="float-right">
          <a href="logout.php"><button type="button" class="btn  btn-sm  "><i class='fa fa-sign-out-alt' style='font-size:14px'></i></button></a>
        </span>
        <span  data-toggle="tooltip" data-html="true" data-placement="top" title="Add New Record" class="float-right">
			<button type="button" class="btn  btn-sm  " data-toggle="modal" data-target="#myModal"><i class='fas fa-plus' style='font-size:14px'></i></button>
		  </span>
	</div>
</div>
	<hr class="featurette-divider">
	<div class="row font-weight-bold d-flex px-3 py-1" id="essageBox"> 
		<div id="success_message" class="text-white rounded col-sm-12 " style="display: none;" ></div>
		<div id="error_message" class="text-white rounded  col-sm-12" style="display: none;"></div>
	</div>
	<div class="row justify-content-center p-2">
	    <div class="col-6"></div>
         <div class="p-2 col-6 text-right d-flex"><input class="form-control form-control-sm" name="search_option" id="search_option"/> <button type="button" id="search" class="btn  btn-sm  "><i class='fas fa-search' style='font-size:14px'></i></button></div>
    </div>
  
    <div  class="col-sm-12 p-0" id="table-area"> 
	     <table class="table-sm table-bordered border col-sm-12" id="myTable">   
			<thead class="text-left">
			   <!-- <th>Whatsapp</th>-->
				<th>Date</th> 
				<th>Product Name</th>  
				<th>Party Name</th>
				<th>Drums</th>
				<th>Rate</th>
				<th>Dalal</th>
				<th>Condition</th>
				<th>Remark</th>
				<th></th>
			</thead>
		  <tbody id="get_list" class="text-center">
			  
		  </tbody>            
		</table>          
	</div>
	
  </div>

       
<div class="modal fade hide " id="myModal" role="dialog">
    <div class="modal-dialog modal-md modal-dialog-scrollable">
		<div class="modal-content ">
			<div class="modal-body">
				<div class="row">
					<div class="col"><h6 class="text-bold">Purchase</h6></div>
						<div class="col text-right">
							<input class="btn btn-sm btns form-control-sm mr-1" type="submit" id="addButton" name="addButton" value="Save">
							<input type="button" class="btn btn-sm  btn_close form-control-sm" id="closeButton" data-dismiss="modal" value="Close">
						</div>
				</div>
				<hr class="featurette-divider">
          
				<div class="row font-weight-bold " id="messageBox"> 

					<div id="success_message_modal" class="text-white rounded col-sm-12 " style="display: none;" ></div>
					<div id="error_message_modal" class="text-white rounded col-sm-12 " style="display: none;"></div>
                 
				</div>
				<div id="form-content">
					<form id="myForm" onsubmit="return false" class="p-2 entryform form">
						<input type="hidden" name="pid" id="pid" value="0">
						<div class="row p-1">
						    <div class="col-6">
						        <div class="row">
						            <label for="purchase_date" class="col-sm-4">Date*</label>
        							<div class="col-sm-8">
        								<input type="date" id="purchase_date" name="purchase_date" class="form-control form-control-sm " value="<?php echo date('Y-m-d')?>" />
        							</div>
						        </div>
						    </div>
							<div class="col-6 px-0">
							    <label for="purchase_product" class="col-sm-4">Product*</label>
    							<div class="col-sm-8">
    								<select class="form-control form-control-sm " id="purchase_product" name="purchase_product">
    								  
    								</select>      
    							 </div>
							</div>
						</div>        
						<div class="row p-1">
							<label for="purchase_party" class="col-sm-4">Party*</label>
							<div class="col-sm-8">
							    <input class="form-control form-control-sm " type="text" id="purchase_party" name="purchase_party"  list="party_list"  autocomplete="off"/> 
								<datalist id="party_list"></datalist> 
								
							</div>
						</div>
						<div class="row p-1">
						    <div class="col-6">
						        <div class="row">
						            <label for="drum_qty" class="col-sm-4">Drum </label>
            						  <div class="col-sm-8">
            							<input class="form-control form-control-sm " type="text" id="drum_qty" name="drum_qty" inputmode="numeric" autocomplete="off" />          
            						  </div>
						        </div>
						    </div>
						    <div class="col-6">
						        <div class="row">
						            <label for="total_drum_qty" class="col-sm-4"> Quantity</label>
            						  <div class="col-sm-8">
            							<input class="form-control form-control-sm " type="text" id="total_drum_qty" name="total_drum_qty" disabled />          
            						  </div>
						        </div>
						    </div>
						  <!--<label for="drum_qty" class="col-sm-4">Drum </label>
						  <div class="col-sm-8">
							<input class="form-control form-control-sm " type="text" id="drum_qty" name="drum_qty" inputmode="numeric />          
						  </div>-->
						</div>
						<div class="row p-1">
						  <!--<label for="total_drum_qty" class="col-sm-4">Drum Quantity</label>
						  <div class="col-sm-8">
							<input class="form-control form-control-sm " type="text" id="total_drum_qty" name="total_drum_qty" disabled />          
						  </div>-->
						</div>
						<div class="row p-1">
						  <label for="purchase_rate" class="col-sm-4">Rate</label>
						  <div class="col-sm-8">
							<input class="form-control form-control-sm " type="text" id="purchase_rate" name="purchase_rate" inputmode="numeric"  autocomplete="off" />          
						  </div>
						</div>
						<div class="row p-1">
						  <label for="purchase_condition" class="col-sm-4">Condition</label>
						  <div class="col-sm-8">
							<input class="form-control form-control-sm " type="text" id="purchase_condition" name="purchase_condition"  />          
						  </div>
						</div>
						<div class="row p-1">
						  <label for="purchase_dalal" class="col-sm-4">Dalal</label>
						  <div class="col-sm-8">
							<input class="form-control form-control-sm " type="text" id="purchase_dalal" name="purchase_dalal"  />          
						  </div>
						</div> 
						<div class="row">
						  <label for="purchase_remarks" class="col-sm-4">Remarks</label>
						  <div class="col-sm-8">
							<textarea  id="purchase_remarks" name="purchase_remarks" class="form-control form-control-sm " ></textarea>              
						  </div>
						</div>                    
						<div class="row" id="modal-bottom">
						  <div class="col-sm-6 ">
							  <small class="font-normal float-left">Fill required fields(*)</small>
							</div>
						</div>
					</form>
				</div>
			</div>
		</div>
    </div>
</div>
<footer class="footer col-sm-12 px-2" >
	<small id="companyName"> Licenced to : <b></b></small>
	<small id="copyright">&#9400;Copyright, <b>Zero Error Zone</b></small> 
</footer>

<script src="lib/jquery.min.js"></script>
<script src="lib/popper.min.js"></script>

<script src="js/bootstrap.min.js"></script>
<script src="js/purchasePageJs.js"></script>

</body>
</html>
