<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: 			*/
// +----------------------------------------------------------------------+
// | PHP version 4/5                                                      |
// +----------------------------------------------------------------------+
// | Copyright (c) 2004-2010 ARMIA INC                                    |
// +----------------------------------------------------------------------+
// | This source file is a part of iScripts VistaCart                     |
// +----------------------------------------------------------------------+
// | Authors: Jipson<jipson.thomas@armiasystems.com>             		  |
// +----------------------------------------------------------------------+
?>
<?php echo $javascript->link('jquery.js'); 

?>
<script language="javascript" type="text/javascript">
    $(document).ready(function(){
       $(".jqPendingProgress").animate({width:'<?php echo $pendingOrdersPerc ?>%'}, 1500) ;
       $(".jqShippedProgress").animate({width:'<?php echo $shippedOrdersPerc ?>%'}, 1500) ;
       $(".jqDeliveredProgress").animate({width:'<?php echo $deliveredOrdersPerc ?>%'}, 1500) ;

    });

</script>
<?php $session->flash(); ?>


				<!--<div align="center" class="admin_subheading">
						  <div align="left">&nbsp;Store @ A Glance</div>
						</div>-->
						
				<div align="left" id="item_details_admin">
				<!--items display area start -->
<div align="center" id="items_display_area">
						
<!-------------****************Akhil Code Area ************----------------------->

               <!-- Order Status Bar section start -->
			   
			
			
			<div class="admin_content_box_container">
			
			
			<div class="admin_content_box withborder">
   <div id="admin_heading" class="newheadingstyle">Order Status</div>
					<div class="status_div">
                                        <!-- Status Bar Delivered open -->
					<div class="statusshipp_div">
					<div class="statustxt">
					Delivered <span><?php echo $deliveredOrdersPerc ?>%</span>
					</div>

					<div class="progress_ship">
					<div class="gree_progress jqDeliveredProgress" style="width:<?php echo 0 ?>%">
					</div>
					<div class="clear"></div>
					</div>
					<div class="clear"></div>
					</div>
					<!-- Status Bar Delivered close -->
					<!-- Status Bar Shipped open -->
					<div class="statusshipp_div">
					<div class="statustxt_blue">
					Shipped <span><?php echo $shippedOrdersPerc ?>%</span>
					</div>

					<div class="progress_ship">
					<div class="blue_progress jqShippedProgress" style="width:<?php echo 0 ?>%">
					</div>
					<div class="clear"></div>
					</div>
					<div class="clear"></div>
					</div>
					<!-- Status Bar Shipped close -->


					<!-- Status Bar Pending open -->
					<div class="statusshipp_div">
					<div class="statustxt_red">
					Pending <span><?php echo $pendingOrdersPerc ?>%</span>
					</div>

					<div class="progress_ship">
					<div class="red_progress jqPendingProgress" style="width:<?php echo 0 ?>%">
					</div>
					<div class="clear"></div>
					</div>
					<div class="clear"></div>
					</div>
					<!-- Status Bar Pending close -->
					<div class="clear"></div>
					</div>
					
					</div>
						<!-- Order Status Bar section end -->
<div class="admin_content_box_2 withborder" >

		   <!--Sales garph area start -->
                 <div id="admin_heading" class="newheadingstyle">Sales Graph</div>
                 <?php
                // print_r($fusionCharts);
                 if(isset ($fusionCharts))
                 echo $fusionCharts->render('Column3D Chart');
                 ?>
				 <!--  <?php// echo $fusionCharts->render('Column3D Chart'); ?>-->
                 </div>
		  <div align="left" class="float_clear"><?php echo $html->image('/img/clear.gif');?></div>
                    <!--Sales garph area end -->
					</div>
					<div class="clear_class"></div>
					</div>
					
					
					
					
					
					
					
					
					
					
					
					
					
					
					
					
					
					
		<!--mainbody area end -->

   <!--Recent Orders listing -->
   <div id="admin_heading" class="newheadingstyle" >Recent Orders</div>
   <div align="center" id="items_display_area_admin">

       <div id="list_admin_top">
           <div class="list9"><strong>#</strong></div>
           <div class="list16"><strong><?php echo $paginator->sort('Order Number', 'Order.id'); ?></strong></div>
           <div class="list16">
               <strong><?php
                   $pval='';
                   if(isset($this->passedArgs['page']))
                       $pval=$this->passedArgs['page'];
                   echo $html->link(__('Name', true), array(
                   'controller' => 'orders',
                   'action' => 'index',
                   'page' => $pval,
                  // 'cmbSearchType'=>$cmbSearchType,
                 //  'txtSearch'=>$txtSearch,
                   'sort' => 'USR.uname',
                   'direction' => (empty($this->passedArgs['direction']) || $this->passedArgs['direction'] == 'asc')?'desc' : 'asc'

                   ));
                   ?></strong>
           </div>
           <div class="list16"><strong><?php echo $paginator->sort('Date', 'Order.date'); ?></strong></div>
           <div class="list16"><strong><?php echo $paginator->sort('Total', 'Order.total_price'); ?></strong></div>
           <div class="list16"><strong><?php echo $paginator->sort('Order Status', 'OrderStatus.name'); ?></strong></div>
           <div class="list17"><strong>Options</strong></div>
           <div align="left" class="float_clear"><?php echo $html->image('/img/clear.gif', array('width' => 1, 'height' => 1));?></div>
       </div>
              <?php
            /*  if(!empty($passedarg) && !isset($passedarg["page"]))
                  $cnt=1;
              else if(!empty($passedarg) && $passedarg["page"]==1)
                  $cnt=1;
              else
                  $cnt=((($passedarg["page"]-1)*($passedarg["limit"]))+1);*/
              if(!empty($odr)) {
                  foreach ($odr as $oder) {?>
       <div id="list_admin">
           <div class="list9"><?php echo (1+$cnt++);?></div>
           <div class="list16">
                              <?php echo $html->link($oder['Order']['id'],
                              "/orders/details/".$oder['Order']['id']); ?>
           </div>

           <div class="list16">
                              <?php echo Sanitize::html($oder['USR']['uname']); ?>
           </div>

           <div class="list16">
                              <?php $dt	= strtotime($oder['Order']['date']);
               echo date("m-d-Y",$dt ); ?>
           </div>
           <div class="list16">
               <?php echo Sanitize::html($curlogo . $oder['Order']['total_price']); ?>
           </div>
           <div class="list16">
               <?php echo Sanitize::html($oder['ORS']['name']); ?>
           </div>
           <div class="list17">
                              <?php echo $html->link('View Details',
                                      "/orders/details/".$oder['Order']['id']);
                              //." / ".$html->link('Delete',"/orders/delete/".$oder['Order']['id'],null,'Are you sure you want to delete this Order'); ?>
           </div>
           <div align="left" class="float_clear"><?php echo $html->image('/img/clear.gif', array('width' => 1, 'height' => 1));?></div>
       </div>
                      <?php
           } ?>
       
           <?php } else { ?>
       <div id="list_admin">
           <div>&nbsp;</div>
           <div><strong>Sorry no orders found!</strong></div>
           <div align="left" class="float_clear"><?php echo $html->image('/img/clear.gif', array('width' => 1, 'height' => 1));?></div>
       </div>
                  <?php } ?>
              


   </div>


  <!--Recent Orders listing ends -->

<!-------------****************Akhil Code Area Ends************----------------------->
<!--*************** Orders ************----->

<div align="center" class="item_block_adminbox">
    <div id="admin_heading" class="newheadingstyle" >Orders</div>
    <div align="center" class="displaybottom">

        <div class="maintext">
            <div class="smallfont">
                <div align="left">Status Summary</div>
            </div>
        </div>
    </div>


    <div class="displaybottom">
        <div class="maintext1_admin">
            <div class="adminbox_left">Today</div>
            <div class="adminbox_right"><a href="<?php echo $html->url('/orders/index/');?>"><?php echo $todays_order; ?></a></div>
            <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>

        </div>
    </div>


    <div class="displaybottom">
        <div class="maintext1_admin">
            <div class="adminbox_left">This Month</div>
            <div class="adminbox_right"><a href="<?php echo $html->url('/orders/index/');?>"><?php echo $thisMonth_order; ?></a></div>
            <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>

        </div>
    </div>

    <div class="displaybottom">
        <div class="maintext1_admin">
            <div class="adminbox_left">Last Month</div>
            <div class="adminbox_right"><a href="<?php echo $html->url('/orders/index/');?>"><?php echo $lastMonth_order; ?></a></div>
            <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>

        </div>
    </div>

    <div class="displaybottom">
        <div class="maintext1_admin">
            <div class="adminbox_left">Change</div>
            <div class="adminbox_right"><a href="<?php echo $html->url('/orders/index/');?>"><?php echo $order_change; ?></a></div>
            <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>

        </div>
    </div>
    <div class="displaybottom">
        <div class="maintext1_admin">
            <div class="adminbox_left">Pending Orders</div>
            <div class="adminbox_right"><a href="<?php echo $html->url('/orders/index/');?>"><?php echo $pending_order; ?></a></div>
            <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>

        </div>
    </div>
    <div class="displaybottom">
        <div class="maintext1_admin">
            <div class="adminbox_left">Total</div>
            <div class="adminbox_right"><a href="<?php echo $html->url('/orders/index/');?>"><?php echo $total_order; ?></a></div>
            <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>

        </div>
    </div>
    

</div>
<!--*************** Orders Ends************----->

<!--*************** Sales ************----->
<div align="center" class="item_block_adminbox">
    <div id="admin_heading" class="newheadingstyle">Sales</div>
    <div align="center" class="displaybottom">
        <div class="maintext">
            <div class="smallfont">
                <div align="left">Status Summary</div>
            </div>
        </div>
    </div>
    <div class="displaybottom">
        <div class="maintext1_admin">
            <div class="adminbox_left">Today</div>
            <div class="adminbox_right"><a href="<?php echo $html->url('/orders/index/');?>"><?php echo $salesToday; ?></a></div>
            <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
        </div>
    </div>
    <div class="displaybottom">
        <div class="maintext1_admin">
            <div class="adminbox_left">This Month</div>
            <div class="adminbox_right"><a href="<?php echo $html->url('/orders/index/');?>"><?php echo $salesThisMonth; ?></a></div>
            <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
        </div>
    </div>
    <div class="displaybottom">
        <div class="maintext1_admin">
            <div class="adminbox_left">Last Month</div>
            <div class="adminbox_right"><a href="<?php echo $html->url('/orders/index/');?>"><?php echo $salesLastMonth; ?></a></div>
            <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
        </div>
    </div>
    <div class="displaybottom">
        <div class="maintext1_admin">
            <div class="adminbox_left">Change</div>
            <div class="adminbox_right"><a href="<?php echo $html->url('/orders/index/');?>"><?php echo $sales_change; ?></a></div>
            <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
        </div>
    </div>
    <div class="displaybottom">
        <div class="maintext1_admin">
            <div class="adminbox_left">Total</div>
            <div class="adminbox_right"><a href="<?php echo $html->url('/orders/index/');?>"><?php echo $totalSales; ?></a></div>
            <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
        </div>
    </div>
</div>

<!--*************** Sales Ends************----->
<!--*************** Users Ends************----->
<div align="center" class="item_block_adminbox">
    <div id="admin_heading" class="newheadingstyle">Users</div>
    <div align="center" class="displaybottom">
        <div class="maintext">
            <div class="smallfont">
                <div align="left">Status Summary</div>
            </div>
        </div>
    </div>
    <div class="displaybottom">
        <div class="maintext1_admin">
            <div class="adminbox_left">Today</div>
            <div class="adminbox_right"><a href="<?php echo $html->url('/users/index/');?>"><?php echo $usrToday; ?></a></div>
            <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
        </div>
    </div>
    <div class="displaybottom">
        <div class="maintext1_admin">
            <div class="adminbox_left">This Month</div>
            <div class="adminbox_right"><a href="<?php echo $html->url('/users/index/');?>"><?php echo $usrThisMonth; ?></a></div>
            <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
        </div>
    </div>
    <div class="displaybottom">
        <div class="maintext1_admin">
            <div class="adminbox_left">Last Month</div>
            <div class="adminbox_right"><a href="<?php echo $html->url('/users/index/');?>"><?php echo $usrLastMonth; ?></a></div>
            <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
        </div>
    </div>
    <div class="displaybottom">
        <div class="maintext1_admin">
            <div class="adminbox_left">Change</div>
            <div class="adminbox_right"><a href="<?php echo $html->url('/users/index/');?>"><?php echo $users_change; ?></a></div>
            <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
        </div>
    </div>
    <div class="displaybottom">
        <div class="maintext1_admin">
            <div class="adminbox_left">Total Users</div>
            <div class="adminbox_right"><a href="<?php echo $html->url('/users/index/');?>"><?php echo $usrnum; ?></a></div>
            <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div>
        </div>
    </div>
</div>
<!--*************** Users Ends************----->


</div>
				  <!--items display area end -->