<?php include_once APP_PATH.'admin/template/header.php';?>

<div class="ustatus">
<a class="orders" href="index.php?p=shop&amp;ssp=orders"><?php echo $tl["shop"]["m31"];?></a>
<a class="opaid" href="index.php?p=shop&amp;ssp=orders&amp;sssp=orders-paid"><?php echo $tl["shop"]["m67"];?></a>
<a class="obooked" href="index.php?p=shop&amp;ssp=orders&amp;sssp=booked"><?php echo $tl["shop"]["m59"];?></a>
</div>
<div class="clear"></div>

<section>

<div class="content-border">
<?php if (empty($page2) && !empty($stat1total)) { ?>
<div class="heading_solid">
<h3><?php echo $tl["stat"]["s"];?></h3>
</div>
<div id="chart" style="float: left;width: 1180px; height: 350px;"></div>
<div class="clear"></div>
<?php } ?>
<div class="heading_solid">
<h3><?php echo $tl["menu"]["m1"];?></h3>
</div>
<form class="jak_form" method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
<?php if ($errors) { ?>
<div class="status-failure"><?php echo $errors["e"].$errors["e1"];?></div>
<?php } ?>
<table class="table">
<tr>
<td class="content-title" colspan="2"><?php echo $tl["shop"]["m33"];?></td>
</tr>
<tr>
	<td class="go"><?php echo $tl["shop"]["m72"];?></td>
	<td><input classs="inputbig" type="text" name="jakSH" maxlength="25" value="" /></td>
</tr>
</table>

<div class="ustatus">
<button type="submit" name="search" class="button"><?php echo $tl["general"]["g118"];?></button>
</div>
<div class="clear"></div>

<table class="table">
<tr class="content-title">
<td class="content-go">#</td>
<td class="content-go"><input type="checkbox" id="jak_delete_all" /></td>
<td><?php echo $tl["shop"]["m3"];?></td>
<td><?php echo $tl["general"]["g65"];?></td>
<td><?php echo $tl["shop"]["m32"];?></td>
<td class="content-go"></td>
<td class="content-go"></td>
<td class="content-go"></td>
<td class="content-go"></td>
<td class="content-go"></td>
<td class="content-go"></td>
<td class="content-go"><button type="submit" name="delete" id="button_delete" class="delete-button" onclick="if(!confirm('<?php echo $tl["shop"]["alo"];?>'))return false;"></button></td>
</tr>
<?php if (isset($JAK_ORDERS) && is_array($JAK_ORDERS)) foreach($JAK_ORDERS as $v) { ?>
<tr>
<td class="content-go"><?php echo $v["id"];?></td>
<td class="content-go"><input type="checkbox" name="jak_delete_order[]" class="highlight" value="<?php echo $v["id"];?>" /></td>
<td><a href="index.php?p=shop&amp;sp=orders&amp;ssp=edit&amp;sssp=<?php echo $v["id"];?>" title="<?php echo $tl["shop"]["m42"];?>"><?php echo $v["ordernumber"];?></a></td>
<td><?php echo $v["ordertime"]; ?></td>
<td><?php if ($v["paidtime"] != "0000-00-00 00:00:00") { echo $v["paidtime"]; } else { echo '-'; } ?></td>
<td class="content-go"><a href="index.php?p=shop&sp=orders&ssp=invoice&sssp=<?php echo $v["id"];?>" class="lightbox" title="<?php echo $tl["shop"]["m63"];?>"><img src="img/invoice.png" width="17" height="15" alt="invoice" /></a></td>
<td class="content-go"><a href="index.php?p=shop&sp=orders&ssp=email&sssp=<?php echo $v["id"];?>"><img src="img/nlsend.png" width="17" height="15" alt="send" onclick="if(!confirm('<?php echo $tl["shop"]["se"];?>'))return false;" /></a></td>
<td class="content-go"><a href="index.php?p=shop&amp;sp=orders&amp;ssp=paid&amp;sssp=<?php echo $v["id"];?>&amp;ssssp=<?php echo $v["paid"];?>" title="<?php if ($v["paid"] == '0') { echo $tl["shop"]["m62"]; } else { echo $tl["shop"]["m61"];}?>"><img src="img/<?php if ($v["paid"] == '0') { ?>notpaid<?php } else { ?>paid<?php } ?>.png" width="14" height="16" alt="paid" onclick="if(!confirm('<?php if ($v["paid"] == '0') { echo $tl["shop"]["sp"]; } else { echo $tl["shop"]["spn"]; } ?>'))return false;" /></a></td>
<td class="content-go"><a href="index.php?p=shop&amp;sp=orders&amp;ssp=isbooked&amp;sssp=<?php echo $v["id"];?>&amp;ssssp=<?php echo $v["booked"];?>" title="<?php if ($v["booked"] == 0) { echo $tl["shop"]["m65"]; } else { echo $tl["shop"]["m64"];}?>"><img src="img/<?php if ($v["booked"] == 0) { ?>notbooked<?php } else { ?>booked<?php } ?>.png" width="16" height="16" alt="booked" onclick="if(!confirm('<?php if ($page2 == 'booked') { echo $tl["shop"]["sbn"]; } else { echo $tl["shop"]["sb"]; } ?>'))return false;" /></a></td>
<td class="content-go"><a href="index.php?p=shop&amp;sp=orders&amp;ssp=digital&amp;sssp=<?php echo $v["id"];?>" title="<?php echo $tl["shop"]["m66"];?>"><img src="img/digital.png" width="16" height="16" alt="digital" onclick="if(!confirm('<?php echo $tl["shop"]["sd"];?>'))return false;" /></a></td>
<td class="content-go"><a href="index.php?p=shop&amp;sp=orders&amp;ssp=edit&amp;sssp=<?php echo $v["id"];?>" title="<?php echo $tl["cmenu"]["c7"];?>"><img src="img/edit.png" width="14" height="16" alt="edit" /></a></td>
<td class="content-go"><a href="index.php?p=shop&amp;sp=orders&amp;ssp=delete&amp;sssp=<?php echo $v["id"];?>" title="<?php echo $tl["general"]["g73"];?>"><img src="img/delete.png" width="14" height="16" alt="delete" onclick="if(!confirm('<?php echo $tl["shop"]["alo"];?>'))return false;" /></a></td>
</tr>
<?php } ?>
</table>
</form>
</div>

<?php if ($JAK_PAGINATE) { ?>
<div class="paginate">
<?php echo $JAK_PAGINATE;?>
</div>
<?php } ?>

<div class="clear"></div>

</section>

<!-- JavaScript for select all -->

<script type="text/javascript">
		$(document).ready(function()
		{
			$("#jak_delete_all").click(function() {
			$("#button_lock").toggleClass("highlight-lock");
			$("#button_delete").toggleClass("highlight-delete");
				var checked_status = this.checked;
				$(".highlight").each(function()
				{
					this.checked = checked_status;
				});
			});
			$(".highlight").click(function() {
			$("#button_lock").addClass("highlight-lock");
			$("#button_delete").addClass("highlight-delete");
			});
			
			$(".lightbox").colorbox({opacity:0.9,width:1000,height:600});				
		});
</script>

<?php if (empty($page2) && !empty($stat1total)) { ?>

<!-- First Stat -->
<script type="text/javascript">
var chart;
$(document).ready(function() {
	chart = new Highcharts.Chart({
		chart: {
			renderTo: 'chart',
			defaultSeriesType: 'column'
		},
		title: {
			text: '<?php echo $tl["stat"]["s"];?>'
		},
		xAxis: {
			categories: ['<?php echo $stat1month;?>']
		},
		yAxis: {
			min: 0,
			title: {
				text: '<?php echo $tl["general"]["g77"];?>'
			},
			stackLabels: {
				enabled: true,
				style: {
					fontWeight: 'bold',
					color: (Highcharts.theme && Highcharts.theme.textColor) || 'gray'
				}
			}
		},
		legend: {
			align: 'right',
			x: -100,
			verticalAlign: 'top',
			y: 20,
			floating: true,
			backgroundColor: (Highcharts.theme && Highcharts.theme.legendBackgroundColorSolid) || 'white',
			borderColor: '#CCC',
			borderWidth: 1,
			shadow: false
		},
		tooltip: {
			formatter: function() {
				return '<b>'+ this.x +'</b><br/>'+
					this.series.name +': '+ Highcharts.numberFormat(this.y, 2);
			}
		},
		plotOptions: {
			column: {
				stacking: 'normal',
				dataLabels: {
					enabled: true,
					color: (Highcharts.theme && Highcharts.theme.dataLabelsColor) || 'white'
				}
			}
		},
		series: [{
			name: '<?php echo JAK_CURRENCY;?>',
			data: [<?php echo $stat1total;?>]
		}<?php if ($currency_two[0]) { ?>, {
			name: '<?php echo $currency_two[0];?>',
			data: [<?php echo $stat2total;?>]
		}<?php } if ($currency_three[0]) { ?>, {
			name: '<?php echo $currency_three[0];?>',
			data: [<?php echo $stat3total;?>]
		}<?php } ?>]
	});
});
</script>

<script type="text/javascript" src="charts/highcharts.js"></script>
<script type="text/javascript" src="charts/exporting.js"></script>

<?php } ?>

		
<?php include_once APP_PATH.'admin/template/footer.php';?>