<?php $this->load->view("partial/header"); ?>
<div id="content-header" class="hidden-print">
	<h1><i class="icon fa fa-dashboard"></i> <?php echo lang('common_dashboard'); ?></h1>
</div>
<div id="breadcrumb" class="hidden-print">
	<?php echo create_breadcrumb(); ?>
	
</div>
<div class="clear"></div>
<div style="">
<script src="<?php echo base_url();?>js/jquery.flot.min.js?<?php echo APPLICATION_VERSION; ?>" type="text/javascript" language="javascript" charset="UTF-8"></script>
<script src="<?php echo base_url();?>js/jquery.flot.pie.min.js?<?php echo APPLICATION_VERSION; ?>" type="text/javascript" language="javascript" charset="UTF-8"></script>
<script src="<?php echo base_url();?>js/jquery.flot.time.min.js?<?php echo APPLICATION_VERSION; ?>" type="text/javascript" language="javascript" charset="UTF-8"></script>

</div>

<div class="text-center">					
	<h3><strong style="font-size: 15px; color: #0000CC;">Ordering Ware House Management System</strong></h3>
	<?php if (!$this->config->item('hide_dashboard_statistics')) { ?>
    
    <ul class="quick-actions">
		<?php foreach($allowed_modules->result() as $module) { ?>
		<li <?php echo $module->module_id==$this->uri->segment(1)  ? 'class="active"' : ''; ?>  > 
			<a class="right" href="<?php echo site_url("$module->module_id");?>">	<i class="text-info fa fa-<?php echo $module->icon; ?> left fa "></i> <?php echo lang("module_".$module->module_id) ?></a>
		</li>
		<?php } ?>
	</ul>

	
	
		<div class="row">
			<div class="widget-box">
				<div class="widget-title"><span class="icon"><i class="fa fa-signal"></i></span><h5> Statistics</h5></div>
				<div class="widget-content">
					<div class="row">
						<div class="col-md-4">
							<ul class="site-stats">
								<li><a href="<?php echo site_url('items'); ?>"><h3><i class="fa fa-shopping-cart"></i>  <?php echo lang('common_total')." ".lang('module_items'); ?> : <strong><?php echo $total_items; ?></strong></h3></a> </li>
								<li><a href="<?php echo site_url('item_kits'); ?>"><h3> <i class="fa fa-inbox"></i>  <?php echo lang('common_total')." ".lang('module_item_kits'); ?>  :  <strong><?php echo $total_item_kits; ?></strong></h3></a></li>
							</ul>
						</div>
						<div class="col-md-4">
							<ul class="site-stats">
								<li>  <a href="<?php echo site_url('customers'); ?>"><h3> <i class="fa fa-group"></i>  <?php echo lang('common_total')." ".lang('module_customers'); ?>  : <strong><?php echo $total_customers; ?></strong></h3></a></li>
								<li> <a href="<?php echo site_url('employees'); ?>"><h3> <i class="fa fa-user"></i>  <?php echo lang('common_total')." ".lang('module_employees'); ?>  :  <strong><?php echo $total_employees; ?></strong></h3></a></li>
							</ul>
						</div>
						<div class="col-md-4">
							<ul class="site-stats">
								<li> <a href="<?php echo site_url('sales'); ?>"><h3> <i class="fa fa-download"></i>  <?php echo lang('common_total')." ".lang('module_sales'); ?>  : <strong><?php echo $total_sales; ?></strong> </h3></a></li>
								<li>  <a href="<?php echo site_url('giftcards'); ?>"><h3> <i class="fa fa-credit-card"></i>  <?php echo lang('common_total')." ".lang('module_giftcards'); ?>  : <strong><?php echo $total_giftcards; ?></strong></h3></a></li>
							</ul>
						</div>
					</div>							
				</div>

			</div>		
		</div>
	<?php } 
        $current_location_id = $this->session->userdata('employee_current_location_id');
        //if($current_location_id == 1){
        ?>
        <div class="row" style="display:none">
            <div class="widget-box">
                <div class="widget-title"><span class="icon"><i class="fa fa-signal"></i></span><h5>Sales graph</h5></div>
                    <div class="widget-content">
                        <div class="row">
                            <div class="col-md-12">
                                <div id="chart_wrapper">  
                                    <div id="chart"></div>
                                </div>
                                <script type="text/javascript">
                                $.getScript('<?php echo $graph_file; ?>');
                                </script>
                            </div>
                           
                            </div>							
                    </div>

            </div>		
        </div>
        
        
         <div class="row" style="display:none">
            <div class="widget-box">
                <div class="widget-title"><span class="icon"><i class="fa fa-signal"></i></span><h5>Receiving graph</h5></div>
                    <div class="widget-content">
                        <div class="row">
                            <div class="col-md-12">
                                <div id="chart_wrapper">
                                    <div id="chart1"></div>
                                </div>
                                <script type="text/javascript">
                                $.getScript('<?php echo $graph_file_receive; ?>');
                                </script>
                            </div> 
                        </div>							
                    </div>
            </div>		
        </div>
        
        
        <div class="row">
            <div class="widget-box">
                <div class="widget-title"><span class="icon"><i class="fa fa-signal"></i></span><h5>Low Stock Graph (Low 15)</h5></div>
                    <div class="widget-content">
                        <div class="row">
                            <div class="col-md-12">
                                <div id="chart_wrapper">
                                    <div id="barChart"></div>
                                </div>
                                <script type="text/javascript">
                                $.getScript('<?php echo $graph_file_bar; ?>');
                                </script>
                            </div> 
                        </div>							
                    </div>
            </div>		
        </div>
        
                
   
        
         <div class="row" >
            <div class="widget-box">
                <div class="widget-title"><span class="icon"><i class="fa fa-signal"></i></span><h5>High Stock Graph (Top 15)</h5></div>
                    <div class="widget-content">
                        <div class="row">
                            <div class="col-md-12">
                                <div id="chart_wrapper">
                                    <div id="barChartStockOut"></div>
                                </div>
                                <script type="text/javascript">
                                $.getScript('<?php echo $graph_file_bar_highstock; ?>');
                                </script>
                            </div> 
                        </div>							
                    </div>
            </div>		
        </div>
        
        <div class="row" style="display:none">
            <div class="widget-box">
                <div class="widget-title"><span class="icon"><i class="fa fa-signal"></i></span><h5>Due Payment</h5></div>
                    <div class="widget-content">
                        <div class="row">
                            <div class="col-md-12">
                                <div id="barcharPayment">
                                    <div id="barChartStockOut"></div>
                                </div>
                                <script type="text/javascript">
                                $.getScript('<?php echo $graph_payment_due; ?>');
                                </script>
                            </div> 
                        </div>							
                    </div>
            </div>		
        </div>
        
        <div class="row" style="display:none">
            <div class="widget-box">
                <div class="widget-title"><span class="icon"><i class="fa fa-signal"></i></span><h5>Collect Payment</h5></div>
                    <div class="widget-content">
                        <div class="row">
                            <div class="col-md-12">
                                <div id="barcharCollectPayment">
                                    <div id="barChartStockOut"></div>
                                </div>
                                <script type="text/javascript">
                                $.getScript('<?php echo $graph_collect_payment; ?>');
                                </script>
                            </div> 
                        </div>							
                    </div>
            </div>		
        </div>
        
        <?php // }?>
	</div>

<?php $this->load->view("partial/footer"); ?>