<? include "top.php"; ?>
<!DOCTYPE html>
<html>
<head>
	<?php include('include/head.php'); ?>
	<title>Bill List Bill Date Wise</title>
	<link rel="stylesheet" type="text/css" href="https://sarmac.b-cdn.net/plugins/datatables/media/css/jquery.dataTables.css">
	<link rel="stylesheet" type="text/css" href="https://sarmac.b-cdn.net/plugins/datatables/media/css/dataTables.bootstrap4.css">
	<link rel="stylesheet" type="text/css" href="https://sarmac.b-cdn.net/plugins/datatables/media/css/responsive.dataTables.css">
	<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/sweetalert2@9"></script>
</head>
<body>
	<?php include('include/header.php'); ?>
	<?php include('include/sidebar.php'); 

	


	?>
	<style type="text/css">
		.msmall{

			width: 50px;
			font-size: 12px;
		}
		.smallf{

			font-size: 12px;
		}
		tr{
			width: 100%;
		}
		td{
			width: 20%;
		}
		input[type="text"]:focus { 
    
    border: 2px solid red;   
    }
    select:focus{

         border: 2px solid red;  
    }
    textarea:focus{
        border: 2px solid red; 
    }

    input[type="checkbox"]:focus { 
    
    border: 1px solid red;   
    }
    .form-control:focus{
        border: 1px solid red;

    }
    .btn:focus{
        border: 1px solid red;

    }
	</style>
	<script type="text/javascript">
		function addtotal(){

			var a=document.getElementById('chquan').value;
			var b=document.getElementById('chrates').value;
			
			//document.getElementById('chtotal').value=c;
			var d=document.getElementById('weight').value;
			var c=parseFloat(d)*parseFloat(b);
			var e=document.getElementById('carry').value;
			var f=parseFloat(d)*parseFloat(e);
			var g=parseFloat(c)+parseFloat(f);
			var h=parseFloat(d)/parseFloat(a);
			document.getElementById('avrbdw').value=h;
			document.getElementById('billamt').value=g;




		}
	</script>
	<? include "ajax.php"; ?>
	<div class="main-container">
		<div class="pd-ltr-20 customscroll customscroll-10-p height-100-p xs-pd-20-10">
			<div class="min-height-200px">
				<div class="page-header">
					<div class="row">
						<div class="col-md-6 col-sm-12">
							<div class="title">
								<h4></h4>
							</div>
							<!-- <nav aria-label="breadcrumb" role="navigation">
								<ol class="breadcrumb">
									<li class="breadcrumb-item"><a href="rbpayment-list.php">VIEW PAYMENTS</a></li>
									<li class="breadcrumb-item active" aria-current="page"><a href="ready-bird-sales.list.php">NEW READYBIRD SALES</a></li>
								</ol>
							</nav> -->
						</div>
						<div class="col-md-6 col-sm-12 text-right">
							<!-- <div class="dropdown">
								<a class="btn btn-secondary dropdown-toggle" href="#" role="button" data-toggle="dropdown">
									January 2018
								</a>
								<div class="dropdown-menu dropdown-menu-right">
									<a class="dropdown-item" href="#">Export List</a>
									<a class="dropdown-item" href="#">Policies</a>
									<a class="dropdown-item" href="#">View Assets</a>
								</div>
							</div> -->
						</div>
					</div>
				</div>
				<form action="billlists.php" target="_blank" method="POST">
				<div class="pd-20 bg-white border-radius-4 box-shadow mb-30">

					<div class="row">
					<div class="col-lg-12">
						<h4>Bill List Bill Date Wise</h4>
						<hr>
					</div>
						<div class="col-lg-6">

							<div class="form-group row">
								<label class="col-sm-12 col-md-4">Start Date</label>
								<div class="col-sm-12 col-md-8">
									<input type="date" class="form-control" name="stdt" id="csdate" value="<? echo date('Y-m-d');?>">
								</div>
							</div>
							<div class="form-group row">
								<label class="col-sm-12 col-md-4">End Date</label>
								<div class="col-sm-12 col-md-8">
									<input type="date" class="form-control" name="enddt" id="csdate" value="<? echo date('Y-m-d');?>">
								</div>
							</div>
							<div class="form-group row">
								<label class="col-sm-12 col-md-4">Financial Year</label>
								<div class="col-sm-12 col-md-8">
									<select class="form-control" name="financial_year">
										<option value="0">All Financial Years</option>
										<?php
											$getfy=mysqli_query($con,"SELECT * FROM tbl_financial_year_master ORDER BY fy_start_date DESC");
											while($fyarr=mysqli_fetch_array($getfy)){
												$selected = ($fyarr['fy_is_active']=='1') ? 'selected' : '';
												echo '<option value="'.$fyarr['fy_id'].'" '.$selected.'>'.$fyarr['fy_label'].'</option>';
											}
										?>
									</select>
								</div>
							</div>


						</div>
						<?php 
						
						$csadded=$_SESSION['murgibhai'];
						$getlog=f(q("SELECT * FROM tbl_login WHERE l_uid='$csadded'"));
						$ltype=$getlog['l_type'];
						
						if($ltype==1 || $ltype==2){  
							
							$csadded=$_SESSION['murgibhai'];
									//echo "SELECT * FROM tbl_login WHERE l_uid='$csadded'";	
									$getlog=f(q("SELECT * FROM tbl_login WHERE l_uid='$csadded'"));
									$readv=$getlog['l_read'];
							?>
						<div class="col-lg-6">
							<div class="form-group row">
								<label class="col-sm-12 col-md-4">Choose User</label>
								<div class="col-sm-12 col-md-8">
									<select class="form-control" name="logusers" <?php if($ltype==2){?> disabled <?php } ?>>
										<option value="0" <?php if($readv=='admin'){ ?>selected<?php } ?>>All Users</option>
										<?php 

											$getusr=mysqli_query($con,"SELECT * FROM tbl_login WHERE l_type=1 or l_type=2");
											while($arru=mysqli_fetch_array($getusr)){ ?>

												<option value="<?php echo $arru['l_read']?>" <?php  if($readv==$arru['l_read'] && $readv!='admin'){?> selected <?php } ?>><?php echo $arru['l_name']?></option>

												

										<?php		
											}
										
										?>
									</select>

								</div>
							</div>
						</div>
						<?php } ?>

					</div>
						<div class="clearfix">
						<div class="pull-left">
							<!-- <h4 class="text-blue">Default Basic Forms</h4>
							<p class="mb-30 font-14">All bootstrap element classies</p> -->
						</div>
						<div class="pull-right">
							<button type="submit" class="btn btn-primary btn-sm"><i class="fa fa-save"></i> Show</button>
							<!-- <a href="#basic-form1" class="btn btn-primary btn-sm scroll-click" rel="content-y"  data-toggle="collapse" role="button"><i class="fa fa-code"></i> Source Code</a> -->
						</div>
						</div>
				</div>
				<!-- Default Basic Forms Start -->
				
				</form>
				<hr>
				<form action="sbilllists.php" target="_blank" method="POST">
				<div class="pd-20 bg-white border-radius-4 box-shadow mb-30">

					<div class="row">
					<div class="col-lg-12">
						<h4>Bill List Start Date Wise</h4>
						<hr>
					</div>
						<div class="col-lg-6">
							
							<div class="form-group row">
								<label class="col-sm-12 col-md-4">Start Date</label>
								<div class="col-sm-12 col-md-8">
									<input type="date" class="form-control" name="stdt" id="csdate" value="<? echo date('Y-m-d');?>">
								</div>
							</div>
							<div class="form-group row">
								<label class="col-sm-12 col-md-4">End Date</label>
								<div class="col-sm-12 col-md-8">
									<input type="date" class="form-control" name="enddt" id="csdate" value="<? echo date('Y-m-d');?>">
								</div>
							</div>
							

						</div>
						<?php 
						
						$csadded=$_SESSION['murgibhai'];
						$getlog=f(q("SELECT * FROM tbl_login WHERE l_uid='$csadded'"));
						$ltype=$getlog['l_type'];
						
						if($ltype==1 || $ltype==2){  
							
							$csadded=$_SESSION['murgibhai'];
									//echo "SELECT * FROM tbl_login WHERE l_uid='$csadded'";	
									$getlog=f(q("SELECT * FROM tbl_login WHERE l_uid='$csadded'"));
									$readv=$getlog['l_read'];
							?>
						<div class="col-lg-6">
							<div class="form-group row">
								<label class="col-sm-12 col-md-4">Choose User</label>
								<div class="col-sm-12 col-md-8">
									<select class="form-control" name="logusers" <?php if($ltype==2){?> disabled <?php } ?>>
										<option value="0" <?php if($readv=='admin'){ ?>selected<?php } ?>>All Users</option>
										<?php 

											$getusr=mysqli_query($con,"SELECT * FROM tbl_login WHERE l_type=1 or l_type=2");
											while($arru=mysqli_fetch_array($getusr)){ ?>

												<option value="<?php echo $arru['l_read']?>" <?php  if($readv==$arru['l_read'] && $readv!='admin'){?> selected <?php } ?>><?php echo $arru['l_name']?></option>

												

										<?php		
											}
										
										?>
									</select>

								</div>
							</div>
						</div>
						<?php } ?>

					</div>
						<div class="clearfix">
						<div class="pull-left">
							<!-- <h4 class="text-blue">Default Basic Forms</h4>
							<p class="mb-30 font-14">All bootstrap element classies</p> -->
						</div>
						<div class="pull-right">
							<button type="submit" class="btn btn-primary btn-sm"><i class="fa fa-save"></i> Show</button>
							<!-- <a href="#basic-form1" class="btn btn-primary btn-sm scroll-click" rel="content-y"  data-toggle="collapse" role="button"><i class="fa fa-code"></i> Source Code</a> -->
						</div>
						</div>
				</div>
				<!-- Default Basic Forms Start -->
				
				</form>


				<hr>
				<form action="custbilllist.php" target="_blank" method="POST">
				<div class="pd-20 bg-white border-radius-4 box-shadow mb-30">

					<div class="row">
					<div class="col-lg-12">
						<h4>Bill List Of a Customer</h4>
						<hr>
					</div>
						<div class="col-lg-6">
							
							<div class="form-group row">
								<label class="col-sm-12 col-md-4">A/C No</label>
								<div class="col-sm-12 col-md-8">
									<input type="text" class="form-control" name="acno"  value="" required>
								</div>
							</div>
							
							

						</div>
						

					</div>
						<div class="clearfix">
						<div class="pull-left">
							<!-- <h4 class="text-blue">Default Basic Forms</h4>
							<p class="mb-30 font-14">All bootstrap element classies</p> -->
						</div>
						<div class="pull-right">
							<button type="submit" class="btn btn-primary btn-sm"><i class="fa fa-save"></i> Show</button>
							<!-- <a href="#basic-form1" class="btn btn-primary btn-sm scroll-click" rel="content-y"  data-toggle="collapse" role="button"><i class="fa fa-code"></i> Source Code</a> -->
						</div>
						</div>
				</div>
				<!-- Default Basic Forms Start -->
				
				</form>
				
				

			</div>
			<?php include('include/footer.php'); ?>
		</div>
	</div>
	<?php include('include/script.php'); ?>

	<script src="src/plugins/datatables/media/js/jquery.dataTables.min.js"></script>
	<script src="src/plugins/datatables/media/js/dataTables.bootstrap4.js"></script>
	<script src="src/plugins/datatables/media/js/dataTables.responsive.js"></script>
	<script src="src/plugins/datatables/media/js/responsive.bootstrap4.js"></script>
	<!-- buttons for Export datatable -->
	<script src="src/plugins/datatables/media/js/button/dataTables.buttons.js"></script>
	<script src="src/plugins/datatables/media/js/button/buttons.bootstrap4.js"></script>
	<script src="src/plugins/datatables/media/js/button/buttons.print.js"></script>
	<script src="src/plugins/datatables/media/js/button/buttons.html5.js"></script>
	<script src="src/plugins/datatables/media/js/button/buttons.flash.js"></script>
	<script src="src/plugins/datatables/media/js/button/pdfmake.min.js"></script>
	<script src="src/plugins/datatables/media/js/button/vfs_fonts.js"></script>
	<script>
		$('document').ready(function(){ document.getElementById('csdate').focus();
			$('.data-table').DataTable({
				scrollCollapse: true,
				autoWidth: false,
				responsive: true,
				columnDefs: [{
					targets: "datatable-nosort",
					orderable: false,
				}],
				"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]],
				"language": {
					"info": "_START_-_END_ of _TOTAL_ entries",
					searchPlaceholder: "Search"
				},
			});
			$('.data-table-export').DataTable({
				scrollCollapse: true,
				autoWidth: false,
				responsive: true,
				columnDefs: [{
					targets: "datatable-nosort",
					orderable: false,
				}],
				"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]],
				"language": {
					"info": "_START_-_END_ of _TOTAL_ entries",
					searchPlaceholder: "Search"
				},
				dom: 'Bfrtip',
				buttons: [
				'copy', 'csv', 'pdf', 'print'
				]
			});
			var table = $('.select-row').DataTable();
			$('.select-row tbody').on('click', 'tr', function () {
				if ($(this).hasClass('selected')) {
					$(this).removeClass('selected');
				}
				else {
					table.$('tr.selected').removeClass('selected');
					$(this).addClass('selected');
				}
			});
			var multipletable = $('.multiple-select-row').DataTable();
			$('.multiple-select-row tbody').on('click', 'tr', function () {
				$(this).toggleClass('selected');
			});
		});
	</script>
	<script type="text/javascript">
		
	</script>
</body>
</html>