Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
17375 naman 1
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
2
  <!--<script src="//code.jquery.com/jquery-1.10.2.js"></script>-->
3
  <!--<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>-->
4
  <script type="text/javascript" src="<?php echo $base_url;?>js/jquery-ui.js"></script>
5
<script>
6
	$(document).ready(function(){
7
		$('#hit').click(function(){
8
			// var date_val = $('#time_val').val();
9
 
10
			var date_val = $('#datepicker').val();
11
			// alert(date_val);
12
			// var date = "03/05/2013";
13
			// var newdate = date_val.split("/").reverse().join("-");
14
			if(date_val=='')
15
			{
16
				alert("Enter some value");
17
			}
18
			else
19
			{
20
				$.ajax({
21
					method: "GET",
22
					url: "<?php echo $base_url;?>reports/getDetails/"+date_val,
23
				},'json')
24
				.done(function( msg ) {
25
					var obj = $.parseJSON(msg);
26
					$('#amount').empty();
27
					$('#amount').append(obj['amount']);
28
					$('#quantity').empty();
29
					$('#quantity').append(obj['quantity']);
30
      			});
31
 
32
			}
33
		});
34
	});
35
	$(function() {
36
		$( "#datepicker" ).datepicker({
37
			dateFormat: "yy-mm-dd"
38
		});
39
	});
40
 
41
</script>
42
 
43
<div class = 'row'>
44
		<div class='col-xs-12'><h2>Today's Sale</h2></div>
45
		<div class='col-xs-2'><b>Amount</b></div><div class='col-xs-10'><b>Quantity</b></div>
46
		<div class='col-xs-2'><?php echo $result['amount'];?></div><div class='col-xs-10' ><?php echo $result['quantity']?></div>
47
</div>
48
 
49
<br><br><br><h2>Check by date:</h2>
50
<p>Date: <input type="text" id="datepicker"><input type='button' value='Check' id='hit'></p>
51
<div id='content'>
52
	<div class = 'row'>
53
		<div class='col-xs-2'><b>Amount</b></div><div class='col-xs-10'><b>Quantity</b></div>
54
		<div class='col-xs-2' id='amount'>0</div><div class='col-xs-10' id='quantity'>0	</div>
55
	</div>
56
</div>