<?php /* Smarty version 2.6.22, created on 2014-01-29 12:48:50
         compiled from D:/Program+Files/Ampps/www/zipmarket%5Capps%5Creports%5Cadmin/list.html */ ?>
<div class="page-info">
    <div class="container">
      <div id="breadcrumbs">
        <a href="/admin" class="first">Home</a> \ <a href="?m=system&c=list">Settings</a> \
      </div>
      <h1 class="page-title"><?php echo $this->_tpl_vars['lang']['reports']; ?>
</h1>
    </div>
	<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => ($this->_tpl_vars['root_path'])."/zipmarket/apps/admin/admin_tabsy.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
  </div>
    <div id="content">
      <div class="container">
    <div class="content" style="width:984px;">
   <div class="content-box">
	<form action="" class="horizontal-form item-form disable-on-submit" action="" method="post" enctype="multipart/form-data">
	
	 <div class="input-group">
       <label for="datepick"><?php echo $this->_tpl_vars['lang']['from_date']; ?>
</label>
        <div class="inputs">
		 <input type="text" id="datepick" class="" value="<?php echo $_POST['from_date']; ?>
" name="from_date"/>
        </div>
    </div>
	
	 <div class="input-group">
       <label for="datepick2"><?php echo $this->_tpl_vars['lang']['to_date']; ?>
</label>
        <div class="inputs">
		 <input type="text" id="datepick2" class="" value="<?php echo $_POST['to_date']; ?>
" name="to_date"/>
        </div>
    </div>
	
     <div class="form-submit">
      <button type="submit" name="report" class="btn-icon submit auto-width"><?php echo $this->_tpl_vars['lang']['generate_report']; ?>
</button>
     </div>

	</form>
	


	

			<?php if ($this->_tpl_vars['reportData']): ?>

	 <div class="input-group">
       <label for="datepick"><?php echo $this->_tpl_vars['lang']['results']; ?>
</label>
        <div class="inputs">
		 <div id="placeholder" style="width:600px;height:300px;float:left;"></div>
	    <p id="choices" style="float: left;"><?php echo $this->_tpl_vars['lang']['graph']; ?>
:</p>  
        </div>
    </div>
	
	
<?php echo '
<script id="source" language="javascript" type="text/javascript">
$(function () {

	var datasets = {
			"Total": {
	      label: "'; ?>
<?php echo $this->_tpl_vars['lang']['grid_total']; ?>
<?php echo '",
	      data: ['; ?>
<?php $_from = $this->_tpl_vars['reportData']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['foo'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['foo']['total'] > 0):
    foreach ($_from as $this->_tpl_vars['k'] => $this->_tpl_vars['r']):
        $this->_foreach['foo']['iteration']++;
?>[<?php echo ($this->_foreach['foo']['iteration']-1); ?>
, <?php echo $this->_tpl_vars['r']['total']; ?>
]<?php if (! ($this->_foreach['foo']['iteration'] == $this->_foreach['foo']['total'])): ?>,<?php endif; ?><?php endforeach; endif; unset($_from); ?><?php echo ']
		  },        
			"Receive": {
	      label: "'; ?>
<?php echo $this->_tpl_vars['lang']['grid_receive']; ?>
<?php echo '",
	      data: ['; ?>
<?php $_from = $this->_tpl_vars['reportData']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['foo'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['foo']['total'] > 0):
    foreach ($_from as $this->_tpl_vars['k'] => $this->_tpl_vars['r']):
        $this->_foreach['foo']['iteration']++;
?>[<?php echo ($this->_foreach['foo']['iteration']-1); ?>
, <?php echo $this->_tpl_vars['r']['receive']; ?>
]<?php if (! ($this->_foreach['foo']['iteration'] == $this->_foreach['foo']['total'])): ?>,<?php endif; ?><?php endforeach; endif; unset($_from); ?><?php echo ']
		  },        
			"Referal": {
	      label: "'; ?>
<?php echo $this->_tpl_vars['lang']['grid_referal']; ?>
<?php echo '",
	      data: ['; ?>
<?php $_from = $this->_tpl_vars['reportData']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['foo'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['foo']['total'] > 0):
    foreach ($_from as $this->_tpl_vars['k'] => $this->_tpl_vars['r']):
        $this->_foreach['foo']['iteration']++;
?>[<?php echo ($this->_foreach['foo']['iteration']-1); ?>
, <?php echo $this->_tpl_vars['r']['referal']; ?>
]<?php if (! ($this->_foreach['foo']['iteration'] == $this->_foreach['foo']['total'])): ?>,<?php endif; ?><?php endforeach; endif; unset($_from); ?><?php echo ']
		  },        
			"Win": {
	      label: "'; ?>
<?php echo $this->_tpl_vars['lang']['grid_win']; ?>
<?php echo '",
	      data: ['; ?>
<?php $_from = $this->_tpl_vars['reportData']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['foo'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['foo']['total'] > 0):
    foreach ($_from as $this->_tpl_vars['k'] => $this->_tpl_vars['r']):
        $this->_foreach['foo']['iteration']++;
?>[<?php echo ($this->_foreach['foo']['iteration']-1); ?>
, <?php echo $this->_tpl_vars['r']['win']; ?>
]<?php if (! ($this->_foreach['foo']['iteration'] == $this->_foreach['foo']['total'])): ?>,<?php endif; ?><?php endforeach; endif; unset($_from); ?><?php echo ']
		  },
			"Deposit": {
	      label: "'; ?>
<?php echo $this->_tpl_vars['lang']['grid_deposit']; ?>
<?php echo '",
	      data: ['; ?>
<?php $_from = $this->_tpl_vars['reportData']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['foo'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['foo']['total'] > 0):
    foreach ($_from as $this->_tpl_vars['k'] => $this->_tpl_vars['r']):
        $this->_foreach['foo']['iteration']++;
?>[<?php echo ($this->_foreach['foo']['iteration']-1); ?>
, <?php echo $this->_tpl_vars['r']['deposit']; ?>
]<?php if (! ($this->_foreach['foo']['iteration'] == $this->_foreach['foo']['total'])): ?>,<?php endif; ?><?php endforeach; endif; unset($_from); ?><?php echo ']
		  },        			         
			"Withdraw": {
	      label: "'; ?>
<?php echo $this->_tpl_vars['lang']['grid_withdraw']; ?>
<?php echo '",
	      data: ['; ?>
<?php $_from = $this->_tpl_vars['reportData']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['foo'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['foo']['total'] > 0):
    foreach ($_from as $this->_tpl_vars['k'] => $this->_tpl_vars['r']):
        $this->_foreach['foo']['iteration']++;
?>[<?php echo ($this->_foreach['foo']['iteration']-1); ?>
, <?php echo $this->_tpl_vars['r']['withdraw']; ?>
]<?php if (! ($this->_foreach['foo']['iteration'] == $this->_foreach['foo']['total'])): ?>,<?php endif; ?><?php endforeach; endif; unset($_from); ?><?php echo ']
		  }        			         
	};
	
	var options = {
		xaxis: { mode: "time", ticks: ['; ?>
<?php $_from = $this->_tpl_vars['reportData']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['foo'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['foo']['total'] > 0):
    foreach ($_from as $this->_tpl_vars['k'] => $this->_tpl_vars['r']):
        $this->_foreach['foo']['iteration']++;
?>[<?php echo ($this->_foreach['foo']['iteration']-1); ?>
, "<?php echo $this->_tpl_vars['k']; ?>
"]<?php if (! ($this->_foreach['foo']['iteration'] == $this->_foreach['foo']['total'])): ?>,<?php endif; ?><?php endforeach; endif; unset($_from); ?><?php echo '] },
		selection: { mode: "xy" },
		grid: { hoverable: true, clickable: true },
		series: { lines: { show: true }, points: { show: true } }
	};
			
	var plot = $.plot($("#placeholder"), datasets, options);	

	function showTooltip(x, y, contents) {
		$(\'<div id="tooltip">\' + contents + \'</div>\').css( {
			position: \'absolute\',
			display: \'none\',
			top: y + 5,
			left: x + 5,
			border: \'1px solid #fdd\',
			padding: \'2px\',
			\'background-color\': \'#fee\',
			opacity: 0.80
		}).appendTo("body").fadeIn(200);
	}

	var previousPoint = null;
  $("#placeholder").bind("plothover", function (event, pos, item) {
		$("#x").text(pos.x.toFixed(2));
		$("#y").text(pos.y.toFixed(2));

		if(item) {
			if(previousPoint != item.datapoint) {
				previousPoint = item.datapoint;
			    
				$("#tooltip").remove();
				var x = item.datapoint[0].toFixed(2),
						y = item.datapoint[1].toFixed(2);
			    
				showTooltip(item.pageX, item.pageY, item.series.label + " ('; ?>
<?php echo $this->_tpl_vars['currency']['symbol']; ?>
<?php echo ' " + y + ")");
			}
	  }
		else {
			$("#tooltip").remove();
			previousPoint = null;            
	  }
  });

  var i = 0;
  $.each(datasets, function(key, val) {
      val.color = i;
      ++i;
  });

  var choiceContainer = $("#choices");
  $.each(datasets, function(key, val) {
      choiceContainer.append(\'<br/><input type="checkbox" name="\' + key +
                             \'" checked="checked" id="id\' + key + \'">\' +
                             \'<label for="id\' + key + \'">\'
                              + val.label + \'</label>\');
  });
  choiceContainer.find("input").click(plotAccordingToChoices);

  
  function plotAccordingToChoices() {
      var data = [];

      choiceContainer.find("input:checked").each(function () {
          var key = $(this).attr("name");
          if (key && datasets[key])
              data.push(datasets[key]);
      });

      if (data.length > 0)
          $.plot($("#placeholder"), data, options);
  }

  plotAccordingToChoices();
    
});
</script>	
'; ?>

			
	<?php endif; ?>
    </div>
   </div>
  </div>
 </div>
 
	<script type="text/javascript" src="<?php echo $this->_tpl_vars['data_server']; ?>
/admin/js/jquery.datepick.pack.js"></script>
	<script type="text/javascript" src="<?php echo $this->_tpl_vars['data_server']; ?>
/admin/js/jquery.datepick-en-GB.js"></script> 
	<?php echo '
	<script type="text/javascript">
	jQuery(document).ready(function() {
		Administry.dateInput(\'#datepick, #datepick2\');
	});
	</script>
	'; ?>