<?php
session_start();
if(!isset($_SESSION['user'])) {
	header("location: ../index.php");
	exit;
}

include "../dbconnect.php";
 
include"../header.php";
?>

<link href="../assets/css/analysis.css" rel="stylesheet">
						<div class="row">
							<div class="col-lg-12">

								<div class="row">
									<div class="col-lg-2">
										<div class="form-group">
											<label for="">Financial Year</label>
											<select class="form-control" id="fin" required="">
												<option value="">Select financial year</option>
												<option value="2018-2019">2018-2019</option>
												<option value="2017-2018">2017-2018</option>
												<option value="2016-2017">2016-2017</option>
												<option value="2015-2016">2015-2016</option>
											</select>
										</div>
									</div>

									<div class="col-lg-2">
										<div class="form-group">
											<label for="">Outlet</label>
											<select id="outlet" name="" class="form-control">
                                                <option value="">Select Outlet</option>
                                                <?php
                                                $ut_qry = mysql_query("SELECT `UnitId`, `UnitName` FROM `unit_master` WHERE `IsActive` = '1'");
                                                while ($ut_row = mysql_fetch_array($ut_qry)) {
                                                    ?>
                                                    <option value="<?php echo $ut_row['UnitId']; ?>"><?php echo $ut_row['UnitName']; ?></option>
                                                    <?php
                                                }
                                                ?>
                                            </select>
										</div>
									</div>

									<div class="col-lg-2">
										<div class="form-group">
											<label for="">Order Id</label>
											<input type="text" name="" class="form-control" id="orderid" placeholder="Enter order id" readonly="readonly">
										</div>
									</div>

									<div class="col-lg-2">
										<div class="form-group">
											<label for="">Invoice Number</label>
											<input type="text" name="" class="form-control" id="invoiceno" placeholder="Enter invoice number" readonly="readonly">
										</div>
									</div>
									<div class="col-lg-2">
										<div class="form-group">
											<button type="button" name="" class="btn btn-outline-primary txtbtn-submit" onclick="getOrderInformation('orderinfo', document.getElementById('fin').value, document.getElementById('outlet').value, document.getElementById('orderid').value, document.getElementById('invoiceno').value)">Submit</button>
										</div>
									</div>
								</div>

							</div>
						</div>
						<div class="row">
							<div class="col-lg-12">

								<div class="card">
									<div class="card-header admin-feed">
										Order Information
									</div>
									<div class="card-body">
										<div class="row">
											<div class="col-lg-10">

												<table class="table table-order-info">
													<tbody>
														<tr>
															<td>Name</td>
															<td>
																<input type="text" name="" class="form-control customername" value="">
															</td>

															<td>&nbsp;</td>
													
															<td>Mobile Number</td>
															<td>  
																<input type="text" name="" class="form-control customermobile" value="">
															</td>
														</tr>
														<tr>
															<td>Order Id</td>
															<td>
																<input type="text" name="" class="form-control customerorderid" value="">
															</td>

															<td>&nbsp;</td>

															<td>Invoice Number</td>
															<td>
																<input type="text" name="" class="form-control customerinvno" value="">
															</td>

															<td>&nbsp;</td>

															<td>Order Date</td>
															<td>
																<input type="text" name="" class="form-control customerorderdate" value="">
															</td>
														</tr>
														<tr>
															<td>Order Total Bill</td>
															<td>
																<input type="text" name="" class="form-control ordertotalbill" value="">
															</td>

															<td>&nbsp;</td>

															<td>Payment Mode</td>
															<td>
																<input type="text" name="" class="form-control customerpaymentmode" value="">
															</td>

															<td>&nbsp;</td>

															<td>Order Status</td>
															<td>
																<input type="text" name="" class="form-control customerorderstatus" value="">
															</td>
														</tr>
														<tr>
															<td>Order Source</td>
															<td>
																<input type="text" name="" class="form-control custordersource" value="">
															</td>

															<td>&nbsp;</td>

															<td>Outlet</td>
															<td>
																<input type="text" name="" class="form-control outletname" value="">
															</td>

															<td>&nbsp;</td>

															<td>Locality</td>
															<td>
																<input type="text" name="" class="form-control localityname" value="">
															</td>
														</tr>
														<tr>
															<!-- <td>Product Ordered</td>
															<td>
																<input type="text" name="" class="form-control" value="">
																<input type="text" name="" class="form-control" value="">
																<input type="text" name="" class="form-control" value="">
															</td>
															<td>
																<input type="text" name="" class="form-control" value="">
																<input type="text" name="" class="form-control" value="">
																<input type="text" name="" class="form-control" value="">
															</td> -->
															
														</tr>
													</tbody>
												</table>

											</div>
											<div class="col-lg-5">
												<table class="table table-order-info1">
													<tbody>
														<tr>
															<td style="vertical-align: top;">Product Ordered</td>
															<td class="product-name">
																<input type="text" name="" class="form-control mb-lg" value="">
															</td>
															<td class="product-quantity">
																<input type="text" name="" class="form-control mb-lg pro-qnt" value="">
															</td>
														</tr>
													</tbody>
												</table>
											</div>
										</div>
									</div>
								</div>

							</div>
						</div>

<?php
include"../footer.php";
?>

<script type="text/javascript">
$(document).ready(function(){
	$("#outlet").on("change", function(){
		var outlet = $("#outlet").val();
		if (outlet == '') {
			$("#orderid").attr("readonly","readonly");
			$("#invoiceno").attr("readonly","readonly");
		} else {
			$("#orderid").removeAttr("readonly");
			$("#invoiceno").removeAttr("readonly");
		}
	});
});
</script>