Subversion Repositories SmartDukaan

Rev

Rev 15607 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 15607 Rev 15621
Line 7... Line 7...
7
		$dates[$value[0]['date']] = $value[0]['date'];
7
		$dates[$value[0]['date']] = $value[0]['date'];
8
		$map[$value[0]['date']][$value['brand_preferences']['brand']] = $value[0]['count'];
8
		$map[$value[0]['date']][$value['brand_preferences']['brand']] = $value[0]['count'];
9
	}
9
	}
10
?>
10
?>
11
 
11
 
12
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
12
<!-- <script type="text/javascript" src="https://www.google.com/jsapi"></script> -->
13
 
13
 
14
<script type="text/javascript">
14
<script type="text/javascript">
-
 
15
/*
15
google.load('visualization', '1', {packages: ['corechart', 'line']});
16
google.load('visualization', '1', {packages: ['corechart', 'line']});
16
google.setOnLoadCallback(drawAxisTickColors);
17
google.setOnLoadCallback(drawAxisTickColors);
17
 
18
 
18
function drawAxisTickColors() {
19
function drawAxisTickColors() {
19
      var data = new google.visualization.DataTable();
20
      var data = new google.visualization.DataTable();
Line 70... Line 71...
70
        colors: ['#a52714', '#097138']
71
        colors: ['#a52714', '#097138']
71
      };
72
      };
72
      var chart = new google.visualization.LineChart(document.getElementById('chart_div'));
73
      var chart = new google.visualization.LineChart(document.getElementById('chart_div'));
73
      chart.draw(data, options);
74
      chart.draw(data, options);
74
    }
75
    }
-
 
76
    */
75
</script>
77
</script>
76
 
78
 
77
<div class="table-responsive">
79
<div class="table-responsive">
78
	<table id="example" class="display table table-striped" cellspacing="0" width="100%">
80
	<table id="example" class="display table table-striped" cellspacing="0" width="100%">
79
	    <thead>
81
	    <thead>
80
	        <tr>
82
	        <tr>
81
	            <th>Date</th>
83
	            <th>Brand</th>
-
 
84
              <th>Total</th>
82
	            <?php foreach ($brands as $key => $brand):?>
85
	            <?php foreach ($dates as $key => $date):?>
83
	            <th><?php echo ucfirst($brand);?></th>	
86
	            <th><?php echo ($date);?></th>	
84
	            <?php endforeach;?>
87
	            <?php endforeach;?>
85
	        </tr>
88
	        </tr>
86
	    </thead>
89
	    </thead>
87
	    <tfoot>
90
	    <tfoot>
88
	        <tr>
91
	        <tr>
89
	            <th>Date</th>
92
	            <th>Brand</th>
-
 
93
              <th>Total</th>
90
	            <?php foreach ($brands as $key => $brand):?>
94
	            <?php foreach ($dates as $key => $date):?>
91
	            <th><?php echo ucfirst($brand);?></th>	
95
	            <th><?php echo ($date);?></th>	
92
	            <?php endforeach;?>
96
	            <?php endforeach;?>
93
	        </tr>
97
	        </tr>
94
	    </tfoot>
98
	    </tfoot>
95
	    <tbody>
99
	    <tbody>
96
	    	<?php foreach ($dates as $key => $date):?>
100
	    	<?php foreach ($count as $key => $row):?>
97
	      	<tr>
101
	      	<tr>
-
 
102
            <td><?php echo $row['brand_preferences']['brand'];?></td>
98
	      		<td><?php echo $date;?></td>
103
	      		<td><?php echo $row[0]['count'];?></td>
99
	      		<?php foreach ($brands as $key => $brand) :?>
104
	      		<?php foreach ($dates as $key => $date) :?>
100
	      			<td>
105
	      			<td>
101
		      		<?php if(isset($map[$date][$brand])):?>
106
		      		<?php if(isset($map[$date][$row['brand_preferences']['brand']])):?>
102
		      			<?php echo $map[$date][$brand];?>
107
		      			<?php echo $map[$date][$row['brand_preferences']['brand']];?>
103
		  			<?php else:?>
108
		  			<?php else:?>
104
		  				0
109
		  				0
105
					<?php endif;?>
110
					<?php endif;?>
106
					</td>
111
					</td>
107
	      		<?php endforeach;?>
112
	      		<?php endforeach;?>
Line 109... Line 114...
109
	      <?php endforeach;?>      
114
	      <?php endforeach;?>      
110
		</tbody>
115
		</tbody>
111
	</table>            
116
	</table>            
112
</div>
117
</div>
113
 
118
 
114
<div id="chart_div" style="width: 1200px; height: 900px"><div>
119
<!-- <div id="chart_div" style="width: 1200px; height: 900px"><div> -->
115
 
120
 
116
<script type="text/javascript" src="//cdn.datatables.net/1.10.7/js/jquery.dataTables.min.js"></script>
121
<script type="text/javascript" src="//cdn.datatables.net/1.10.7/js/jquery.dataTables.min.js"></script>
117
<link rel="stylesheet" type="text/css" href="//cdn.datatables.net/1.10.7/css/jquery.dataTables.css"></link>
122
<link rel="stylesheet" type="text/css" href="//cdn.datatables.net/1.10.7/css/jquery.dataTables.css"></link>
118
<script type="text/javascript">
123
<script type="text/javascript">
119
$(document).ready(function() {
124
$(document).ready(function() {
120
    $('#example').DataTable();
125
    var table = $('#example').DataTable();
-
 
126
    table.order( [ 1, 'desc' ] ).draw();
121
} );
127
} );
122
</script>
128
</script>
123
129