<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{$language.lblBusiness} : {$language.lblProductOrders}</title>
{include file='CommonStyles.tpl'}
{include file='CommonJavaScript.tpl'}
<link href="{$view_styles}/jquery-ui-1.8.19.custom.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="{$view_styles}/listing.css" />
</head>
<body class="{$languageDirection}">
<div class="outer" id="main">
  {include file='CommonHeader.tpl'}
  <!--End:Header Container-->  <!--***********************************************************************END HEADER CONTAINER******************************************************-->
  <div class="content-wrapper">
  	<div class="container-fluid">

      <div class="clearfix">
        <div class="pull-right right">
          {include file='ContentLanguageOptions.tpl'}
        </div>
      </div>
   
 <!--End: Right Block-->
          <div id="common_message"></div>
        <div class="container-section status-01">
             <h3 class="border-bottom">{$language.lblProductOrders}</h3>
          {form->start name="formOrderSearch" action="" method="post" enctype="multipart/form-data"}
          <div class="search_container content-block">
            <div class="inner">
             <div class="row">
                 <div class="clearfix">
                <div class="form-group col-xs-12 col-sm-3">
                    <label>{$language.lblOrderID}</label>
                  <span class="form-field01">
                       {form->textbox name="orderNumber" class="form-control "}
                    </span>
                 </div>
                <div class="form-group col-xs-12 col-sm-3">
                  <label>{$language.lblPaymentStatus}</label>
                  <span class="form-field01">
                      {form->select name="paymentStatus" class="form-control" caption="->{$language.lblAny}" options="Pending->{$language.lblPending}~*Denied->{$language.lblDenied}~*Received->{$language.lblReceived}~*Refunded->{$language.lblRefunded}~*Error->{$language.lblError}"}
                   </span>
                 </div>
                
              
               <div class="form-group col-xs-12 col-sm-3">
                  <label>{$language.lblProductIDTitle}</label>
                  <span class="form-field01">
                     {form->textbox name="productKey" class="form-control"}
                   </span>
                 </div>
               <div class="form-group col-xs-12 col-sm-3">
                  <label>{$language.lblOrderStatus}</label>
                  <span class="form-field01">
                      {form->select name="orderStatus" value="Any" caption="Any->{$language.lblAny}" class="form-control" options=$dynamicOrdersStatus}
                    </span>
                 </div>
                 </div>
                 <div class="clearfix">
              <div class="form-group col-xs-12 col-sm-3">
                  <label>{$language.lblDate}</label>
                  <span class="form-field01">
                        <div class="text-box-div-date"> 
                      {form->textbox id="orderStatusDate" readonly="readonly" name="orderStatusDate" class="form-control date-picker" value=$orderStatusDate}
                      </div>
                    </span>
                 </div>
                <div class="form-group col-xs-12 col-sm-3">
                  <label>{$language.lblOrderSource}</label>
                  <span class="form-field01">
                        <div class="text-box-div-date"> 
                      {form->select id="orderSource" name="orderSource" class="form-control" caption="->{$language.lblAny}" options="web->{$language.lblWeb}~*mobile->{$language.lblMobile}~*flipkart->{$language.lblFlipkart}~*amazon->{$language.lblAmazon}"}
                      </div>
                    </span>
                 </div>
               <div class="form-group col-xs-12 col-sm-3 clearfix">
                  <label>{$language.lblCustomerName}</label>
                  <span class="form-field01">
                      {form->textbox name="certificateName" class="form-control"} </span>
                 </div>
               {* <div class="form-group col-xs-12 col-sm-3 clearfix">
                  <p class="label-field01">{$language.lblOrderedMethod}</p>
                  <span class="form-field01">
                      {form->select id="orderMethod" name="orderMethod"  class="select-box form-control" options="->{$language.lblAny}~*prescription_upload->{$language.lblPrescriptionUpload}~*purchase_order->{$language.lblPurchasedOrders}"}
                  </span>
                </div>*}
                  {*<div class="form-group col-xs-12 col-sm-3 clearfix">
                  <p class="label-field01">{$language.lblPrescritionStatus}</p>
                  <span class="form-field01">
                      {form->select id="prescriptionstatus" name="prescriptionstatus"  class="select-box form-control" options="->{$language.lblAny}~*na->{$language.lblNotApplicable}~*{$language.lblSkipped}->{$language.lblSkipped}~*{$language.lblCompleted}->{$language.lblCompleted}"}
                  </span>
                </div>*}
                 <div class="col-sm-5 col-xs-12">
                    <label>&nbsp;</label>
                  	{form->hidden name="formName" id="formName" value="formOrderSearch"}                    
                    {form->submit name="submitSearch" form="formOrderSearch" tabindex="1" value={$language.lblSearch} class="btn-sm btn btn-primary"}
                    {html->anchor href="/payment/order/" caption="<span class=listall>{$language.lblListAll}</span>" class="action-link"}
                     </div>
                     </div>
              </div>
            </div>
          </div>
      </div>
          <!--END:sEARCH cONTAINER-->
     
          {form->close}
          {if $resOrders}
          {form->start name="formOrder" action="" method="post" enctype="multipart/form-data"}
          {if $resOrders}
          <div class="text-right">
          	{form->submit class="btn btn-sm btn-primary" name="export" value=$language.lblExport}
           
          </div>
          {/if}
          
          <div class="container-section shiped-wrapper">
        <div class="grid_table00 product-list order-list">
              
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>     
                   {if $sortkey == "" &&  $sortkey1 == "" && $sortkey2 == "" && $sortkey3 == "" && $sortkey4 == "" && $sortkey5 == ""}
                       {assign var ="sortkey" value="asc"}
                    {/if}
                    {if $sortkey=="asc"}
                   		{assign var="sortimg" value="sortdesc"} 
            		{else}  
            			{assign var="sortimg" value="sortasc"}
            		{/if}
            		{if $sortkey1=="asc" }
            			{assign var="sortimg1" value="sortdesc"} 
            		{else}  
            			{assign var="sortimg1" value="sortasc"}
            		{/if}
            		{if $sortkey2=="asc"}
            			{assign var="sortimg2" value="sortdesc"} 
            		{else}  
            			{assign var="sortimg2" value="sortasc"}
            		{/if}
                    {if $sortkey3=="asc"}
            			{assign var="sortimg3" value="sortdesc"} 
            		{else}  
            			{assign var="sortimg3" value="sortasc"}
            		{/if}
                    {if $sortkey4=="asc"}
            			{assign var="sortimg4" value="sortdesc"} 
            		{else}  
            			{assign var="sortimg4" value="sortasc"}
            		{/if}
                    {if $sortkey5=="asc"}
            			{assign var="sortimg5" value="sortdesc"} 
            		{else}  
            			{assign var="sortimg5" value="sortasc"}
            		{/if}
                    
            <th align="left" valign="middle"  width="10%" {if $sortkey!=""}class={$sortimg}{else}class="sort" {/if}>{html->anchor href="{$normallink}sortby/sorderid/orderby/{if $sortkey==''}desc{else}{$sortkey}{/if}/" title={$language.lblOrderID} content={$language.lblOrderID}}</th>
              <th align="left" width="18%" valign="middle"   {if $sortkey2!=""}class={$sortimg2}{else}class="sort" {/if}>{html->anchor href="{$normallink}sortby/scustomer/orderby/{if $sortkey2==''}desc{else}{$sortkey2}{/if}/" title={$language.lblCustomerName} content={$language.lblCustomerName}}</a></th>
              <th align="left" valign="middle" width="8%" class="unsortable">{$language.lblQuantity}</th>

              <th align="left" width="200" valign="middle" class="unsortable">{$language.lblOrderAmount}</th>

              <th align="left" valign="middle"  width="14%" {if $sortkey3!=""}class={$sortimg3}{else}class="sort" {/if}>{html->anchor href="{$normallink}sortby/sostatus/orderby/{if $sortkey3==''}desc{else}{$sortkey3}{/if}/" title={$language.lblOrderStatus} content={$language.lblOrderStatus}}</th>

              <th align="left" valign="middle"  width="15%" {if $sortkey4!=""}class={$sortimg4}{else}class="sort" {/if}>{html->anchor href="{$normallink}sortby/spstatus/orderby/{if $sortkey4==''}desc{else}{$sortkey4}{/if}/" title={$language.lblPaymentStatus} content={$language.lblPaymentStatus}}</th>

              <th align="left" valign="middle"  width="18%" {if $sortkey5!=""}class={$sortimg5}{else}class="sort" {/if}>{html->anchor href="{$normallink}sortby/ssdate/orderby/{if $sortkey5==''}desc{else}{$sortkey5}{/if}/" title={$language.lblLastUpdate} content={$language.lblLastUpdate}}</th>
			  <th>&nbsp;</th>
            </tr>
            {foreach from=$resOrders item="order" key="key1"}
            
            {assign var="orderID" value=$order.orderID|default:0}
            <tr>
              <td align="left" valign="middle">
              {html->anchor class="normal_link" history="yes" caption="<strong>{$order.orderNumber}</strong>" href="payment/show/id/{$order.masterOrderID}/{if $nofrmallink!=''}{$normallink}{/if}"} 
             </td>
              <td align="left" valign="middle"> {$order.fullName}</td>
              <td align="left" valign="middle">
                  {$order.orderQty}
               </td>
              <td align="left" valign="middle"> {$order.orderTotalAmount|price:'':'':$order.purchasedCurrency} </td>
              <td align="left" valign="middle"><span class="status"> {$getDynOrderStatusByKey[$order.dynamicOrderStatus]}
              </span></td>
              <td align="left" valign="middle">
                  <span class="recieved">{* {$order.paymentStatus} *}
                        {if $order.paymentStatus == 'Received'}
                            {$language.lblReceived}
                        {else if $order.paymentStatus == 'Refunded '}
                            {$language.lblRefunded}
                        {else if $order.paymentStatus == 'Denied'}
                            {$language.lblDenied}
                        {else if $order.paymentStatus == 'Pending'}
                            {$language.lblPending}
                        {else}
                            {$order.paymentStatus}
                        {/if}
                  </span> <br />
               </td>
              <td align="left" valign="middle">
                {$order.orderStatusDate|date_format:$date_format} {$order.orderStatusDate|date_format:$time_format}
			  </td>
			  <td align="left" valign="middle">
				{if $order.shippedIDs|default:'' gt 0}
					{assign var="shippedArray" value=','|explode:$order.shippedIDs}
					{foreach from=$shippedArray item="shippedId"}
						{html->anchor href="/shipment/show/id/{$shippedId}/" caption="#{$shippedId|default:''}" class="normal_link" title="Show"}
					{/foreach}
				{/if}
				
			  </td>
            </tr>
            {/foreach}
          </table>
          </div>
    </div>

         <div class="pagination_outer pull-right" > {paginate->layout  key="page" results_per_page="{$language.lblResultsperpage}" label_record="{$language.lblRecorsFound}" label_pages="{$language.lblPages}"} </div>
            

          {form->close}
          
          {else}
          <div class="message_info"> {$language.msgNoRecords}</div>
          {/if} 
        <!--End:Table Listing-->
  </div>
</div>
<!--End:Content Container-->
   {include file='CommonFooter.tpl'}
</div>
<!--End:Outer Container--> 
{include file='CommonJavaScriptBottom.tpl'}
{html->messages_script id="common_message"}
{form->rootpath_script}
{form->basepath_script}
<script>
var lblSelectItem ="{$language.lblSelectItem}";
var lblFrom="{$language.lblFrom}";
var lblTo="{$language.lblTo}";
var lblCancel="{$language.lblCancel}";
var applyLabel="{$language.applyLabel}";
var customRangeLabel="{$language.customRangeLabel}";
</script>
<script type="text/javascript" src="{$view_javascript}/moment.min.js"></script>
<script type="text/javascript" src="{$view_javascript}/daterangepicker.js"></script>
<script type="text/javascript" src="{$view_javascript}/jquery.colorbox.js"></script>
<script type="text/javascript" src="{$view_javascript}/shipping.page.js"></script>
</body>
</html>