<?PHP 
include("header.php");
//session_start();
//error_reporting(0);
include "checksession.php";
include "include/db-connect.php";

if(isset($_REQUEST['submit']))
 {
	$start_date=$_REQUEST['from_date'];
	 $end_date=$_REQUEST['to_date']; 
	  ?>
     <script>
	 window.location='search_cash_view.php?sdate=<? echo $start_date ?>&&edate=<? echo $end_date ?>';
	 </script>
     <? } ?>
     
<!----------------Start Date Picker Code-------->
<script type="text/javascript" src="JavaScript/calendar.js">
</script>
<script type="text/javascript" src="JavaScript/calendar-en.js">
</script>
<script type="text/javascript" src="JavaScript/calendar-setup.js">
</script>
<link rel="stylesheet" type="text/css" media="all" href="JavaScript/calendar-win2k-cold-1.css" title="win2k-cold-1" />
<!----------------End Date Picker Code-------->


  <div id="content">
  <div class="breadcrumb">
       <!-- <a href="http://amarasudhan.com/admin/index.php?route=common/home&amp;token=b735cc089ec2d51abb9a8e1901f501fb">Home</a>-->
      </div>
              <div class="box">
    <div class="heading">
      <h1><img src="view/image/home.png" alt="" /> Total Sales</h1>
    </div>
    <div class="content">
     
      
      <div class="overview" style="width:50%; height:250px; margin-left:200px;">
        <div class="dashboard-heading">  Cash Report By Date</div>
        <div class="dashboard-content">
      
        
<div style="margin-bottom:10px; margin-top:10px; margin-left:20px;"><!--<a href="javascript: history.go(-1)"><img src="images/bac.jpg"></a>--></div>
</article>

 <form method="post" id="client" enctype="multipart/form-data">
  				<!--<script type="text/javascript" src="../prototype.js"></script> 
  				<script type="text/javascript" src="../validation.js"></script>
  -->
                
                <div class="mainrow" style="margin-left:100px;">
                <div class="maintext">Start Date<font color="#FF0000"><b> *</b></font> </div>
                <div class="maintextbox">
                <input type="text" required class="TextBox" value="<? echo date("Y-m-d"); ?>" name="from_date" id="f_date_b1">
				<img src="images/cal.gif" id="f_trigger_b1" >
				<script type="text/javascript">
				Calendar.setup({inputField :"f_date_b1",ifFormat:"%Y-%m-%d",showsTime:true,button:"f_trigger_b1",singleClick:true});
				</script>
                </div>
                </div>
                <br />
                <div class="mainrow" style="margin-left:100px;">
                <div class="maintext">End Date<font color="#FF0000"><b> * </b></font> </div>
                <div class="maintextbox">
                <input type="text" required class="TextBox" value="<? echo date("Y-m-d"); ?>" name="to_date" id="f_date_b2">
				<img src="images/cal.gif" id="f_trigger_b2" >
				<script type="text/javascript">
				Calendar.setup({inputField :"f_date_b2",ifFormat:"%Y-%m-%d",showsTime:true,button:"f_trigger_b2",singleClick:true});
				</script>
                </div>                 
                </div>
                <br />
                
                <div class="mainrow" style="margin-left:100px;">
    			<div class="maintext"><font color="#FF0000"><b></b></font> </div>
                <div class="maintextbox"><input type="submit" name="submit" value="Search" style="background:#090;color:#FFF;width:80px;height:30px;border:0px;border-radius:10px 6px;cursor:pointer;"></div>
                </div>
                
 				</form> </div>
                  </div>
                </div>
      
         
                  
                
                
                </div></div>
                
                
                
                 
 				</form>
                 <script type="text/javascript">
						function formCallback(result, form) 
						{
							window.status = "valiation callback for form '" + form.id + "': result = " + result;
						}
						
						var valid = new Validation('profit_id', {immediate : true, onFormValidate : formCallback});
						Validation.addAllThese([
							['validate-password-confirm', 'Your confirmation password does not match your first password, please try again.', {
								equalToField : 'confirm_password'

							}]
						]);
					</script>


      </div></div></div>
      
      
      
      
      
      
      
      
      
      
      
      
      
    </div>
  </div>
</div>
<!--[if IE]>
<script type="text/javascript" src="view/javascript/jquery/flot/excanvas.js"></script>
<![endif]--> 
<script type="text/javascript" src="view/javascript/jquery/flot/jquery.flot.js"></script> 
<script type="text/javascript"><!--
function getSalesChart(range) {
	$.ajax({
		type: 'get',
		url: 'index.php?route=common/home/chart&token=b735cc089ec2d51abb9a8e1901f501fb&range=' + range,
		dataType: 'json',
		async: false,
		success: function(json) {
			var option = {	
				shadowSize: 0,
				lines: { 
					show: true,
					fill: true,
					lineWidth: 1
				},
				grid: {
					backgroundColor: '#FFFFFF'
				},	
				xaxis: {
            		ticks: json.xaxis
				}
			}

			$.plot($('#report'), [json.order, json.customer], option);
		}
	});
}

getSalesChart($('#range').val());
//--></script> 
</div>
<?  include("footer.php"); ?>