<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type"  content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{$language.lblMerchant} : {$language.lblDashboard}</title>
<link rel="stylesheet" type="text/css" href="{$view_styles}/ui.daterangepicker.css" />
<link rel="stylesheet" type="text/css" href="{$view_styles}/chosen.css" />
<link rel="stylesheet" type="text/css" href="{$view_styles}/common.css" />
<link rel="stylesheet" type="text/css" href="{$view_styles}/index.css" />
{include file='CommonJavaScript.tpl'}
</head>
<body class="{$languageDirection}">
<!-- Outer container starts-->
<div id="main" class="outer"> 
{include file='CommonHeader.tpl'}
  <!-- Content Container starts-->
  <div class="content-wrapper">
    <div class="container-fluid">
        <div class="row">
        <div class="col-xs-12 col-md-3">
                <div class="row">
                <div class="col-sm-6 col-xs-12 col-md-12">
                <div class="container-section clearfix">
                <div class="header-content"><h3>{$language.lblYourOrders}</h3></div>
                <div class="status">
                    <div class="row">
                    <div class="view-status col-xs-6">
                        <span class="count">{$resDashBoard.orderPending}</span>
                        <p>{$language.lblPending}</p>
                    </div>
                    <div class="view-status col-xs-6">
                        <span class="count">{$resDashBoard.pending}</span>
                        <p>{$language.lblPendShipAssg}</p>
                    </div>
                    </div>
                </div>
                    <div class="view">
					 {html->anchor class="dark" href="payment/order/" content="{$language.lblViewOurOrders}"}</span>
					</div>
                </div>
                </div>
                <div class="col-sm-6 col-xs-12 col-md-12">
                <div class="container-section clearfix">
                    <div class="header-content"><h3>{$language.lblPerfomance}</h3></div>
                    {if $7daysUserMessageCount}
                    <div class="content-block">
                        <h6>{$language.lblBuyerMessage} {$7daysUserMessageCount}</h6>
                        <p>{$language.lblMessageswaiting}<br>{$language.lblInthelast7days}</p>
                    </div>
                     {/if}
                    {if $OnedayUserMessageCount}
                    <div class="target-content">
                        <h6>{$language.lblUnder24hourTarget} {$OnedayUserMessageCount}</h6>
                    </div>
                    {/if}
                    <div class="content-block">
					<h3>{$language.lblCusomerFeedback}</h3>
                        <span class="feedback-count">{$ratingCount}</span>
                        <span class="star-rating">
                            <span class="rated"  style="width:{16 * $busAvgRating}px;"></span>
                        </span>
                    </div>
                   <div class="target-content border-top">
                        <h6>{$language.lblBusFlwrs}<span class="pull-right">
                                
                                {html->anchor href="business/follow/"  content="{$resDashBoard.follow}"}
                            </span></h6>
                    </div>
                    
                </div>
                </div>
                </div>
            </div>
            <div class="col-xs-12 col-md-6">
                <div class="container-section inventory clearfix">
                    <div class="header-content"><h3>{$language.lblInventory}</h3></div>
                <div class="status">
                    <div class="row">
                    <div class="view-status col-xs-4">
                        <span class="count">{html->anchor href="product/index/dstatus/Active/"  content="{$resDashBoard.upcoming}"}</span>
                        <p>{html->anchor href="product/index/dstatus/Active/"  class="dark" content="{$language.lblActiveProducts}"}</p>
                    </div>
                    <div class="view-status col-xs-4">
                        <span class="count">
                        {html->anchor href="product/inventory/nostock/" content="{$outOfStockCount} "}</span>
                        <p>{html->anchor href="product/inventory/nostock/" content="{$language.lblOutOfStock}"}</p>
                        
                    </div>
                    <div class="view-status col-xs-4">
                        <span class="count">{$resDashBoard.requests}</span>
                        <p>{$language.lblPendingRequests}</p>
                    </div>
                    </div>
                </div>
             
                </div>
                <div class="container-section clearfix">
                    <div class="header-content"><h3>{$language.lblLatstProductOrd}</h3></div>
          {if $resLatestProducts    }
                    <div class="content-block">
          <div  class="grid_table00 dashboard">
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
         
           <thead>
              <tr>
                <th width="100" align="left" valign="middle">
                    <div style="width:110px;">{$language.lblOrderID}</div>
                </th>
                <th width="220" align="left" valign="middle"> 
                    <div style="width:150px;">{$language.lblCusName}</div>
                </th>
                <th width="150" align="left" valign="middle">
                    <div style="width:80px;">{$language.lblSubtotal}</div>
                  </th>
                <th width="300" align="left" valign="middle">
                    <div style="width:130px;">{$language.lblMerchantRevenue}</div>
                </th>
                <th width="250" align="left" valign="middle">
                    <div style="width:100px;">{$language.lblOrderDate}</div>
                </th>
              </tr>
            </thead>
            <tbody>
             {foreach from=$resLatestProducts item="order" key="key1"}
             {assign var="billingAdrress" value=$order.billingAddress|unserialize}  
              <tr>
                <td align="left" valign="middle">
				 {html->anchor class="normal_link" history="yes" caption="<strong>{$order.orderNumber}</strong>" href="payment/show/id/{$order.masterOrderID}/"} 
				</td>
                <td align="left" valign="middle">{$billingAdrress.billingFirstName} {$billingAdrress.billingLastName}</td>
                <td align="left" valign="middle"><div class="dark">{$order.total|price:'':'':$order.purchasedCurrency}</div></td>
                  <td align="left" valign="middle"><div class="dark">{$order.amount|price:'':'':$order.purchasedCurrency}</div></td>
                 <td align="left" valign="middle">{$order.orderDate|date_format:$date_format}<br> {$order.orderDate|date_format:$time_format}</td>
              </tr>
               {/foreach}
            </tbody>
          </table>
          </div>
                    </div>
          {else}
          	<div class="message_info margin" > {$language.msgNoRecords}</div>              
        	{/if}
                </div>
                <div class="container-section clearfix">
                    <div class="header-content"><h3> {$language.lblMessageFromAdmin}</h3></div>
                    <div class="content-block">
                       {if $resMessages} 
					 {foreach from=$resMessages item="message"}
                        <h5> {$message.subject}
						</h5>
                        <p>{$message.message}
						</p>
                     {/foreach}
                         {else}
          	<div class="message_info margin" > {$language.msgNoRecords}</div>              
        	{/if}
                    </div>
                     {if $resMessages} 
                    <div class="view">{html->anchor class="normal_link" history="yes" caption="{$language.lblViewall}" href="user/messages/"} </div>
                    {/if}
                </div>
            </div>
            <div class="col-xs-12 col-md-3">
            <div class="row">
                <div class="col-sm-6 col-xs-12 col-md-12">
            <div class="container-section clearfix">
                <div class="header-content"><h3>{$language.lblPaymentSummary}</h3></div>
                    <div class="content-block">
                        {if $resLastpayment.transactionGrandTotalAmount}
                        <span class="pull-right rupees">
 		{$resLastpayment.transactionGrandTotalAmount|price:'':'':$resLastpayment.purchasedCurrency}</span>
                        <h6>{$language.lblRecentPayment}</h6>
                        <p>{$language.lblLastpaymentmadebyadminon}{$resLastpayment.transactionDate|date_format:$date_format} </p>
                     
                    
                
                <div class="view">
				{html->anchor class="normal_link" history="yes" caption="{$language.lblViewPaymentSummary}" href="payment/paid/"}
                    </div>
                        {else}
          	<div class="message_info margin" > {$language.msgNoRecords}</div>              
        	{/if}
				</div>
               
                </div>
                </div>
                <div class="col-sm-6 col-xs-12 col-md-12">
                <div class="container-section clearfix">
                <div class="header-content"><h3>{$language.lblSaleSummary}</h3></div>
                    <div class="content-block">
                        {if $resTransactionDet} 
                        <div class="product-sale-head row">
                                <div class="col-xs-4">{$language.lblDate}</div>
                                <div class="col-xs-5">{$language.lblOrderedProductSales}</div>
                                <div class="col-xs-3">{$language.lblUnits}</div>
                        
                        </div>
                        <div class="product-sale-contant ">{$transDet}
						    {foreach from=$resTransactionDet item="transDet"}
                            <div class="row sale-content">
                                <div class="col-xs-4">{$transDet.orderCreatedDate|date_format:$date_format}</div>
                                <div class="col-xs-5 text-center">{$transDet.transactionTotal|price:'':'':$resLastpayment.purchasedCurrency}</div>
                                <div class="col-xs-3 text-center">{$transDet.orderQty}</div>
                            </div>
							{/foreach}	
                      
                        </div>
                    </div>
                <div class="view">
				{html->anchor class="normal_link" history="yes" caption="{$language.lblViewsalesstatistics}" href="payment/transaction/"}
				</div>
                    {else}
          	<div class="message_info margin" > {$language.msgNoRecords}</div>              
        	{/if}
                </div>
                </div>
                </div>
            </div>

        </div>
  </div>
  </div>
  <!-- Content Container ends--> 
  <!-- Footer starts-->
  {include file='CommonFooter.tpl'}
  <!-- Footer ends--> 
</div>
<!-- Outer container ends-->
{html->messages_script id="common_message"}
<div   id="blockUILoader" style="display:none;"> <img alt="Loading...." src="{$view_images}/spinner-big.gif"/> </div>
<script type="text/javascript">
 var lblNoMatch   =   '{$language.lblNoMatch}';
</script>
{form->globalpath_script} 
</body>
</html>
