<!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>
<title>{$language.lblAdmin} : {$language.lblShippedOrders}</title>
{include file='CommonStyles.tpl'}
{include file='CommonJavaScript.tpl'}
{include file='CommonCustomStyles.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}/grid_listing.css" media="screen" />
<link rel="stylesheet" type="text/css" href="{$view_styles}/ui.daterangepicker.css" />
<link rel="stylesheet" type="text/css" href="{$view_styles}/colorbox.css" />
{form->basepath_script}
{form->rootpath_script}

</head>
<body>
<div class="outer_container"> {include file='CommonTop.tpl'} 
  <!--End:Header Container--> 
  <!--***********************************************************************END HEADER CONTAINER******************************************************-->
  <div class="content_container">
    <div class="content_wrapper">
      <h2>{$language.lblShippedOrders} </h2>
      <div class="inner_content_wrapper">
        <div id="common_message"></div>
        {form->start name="formShippingSearch" action="" method="post" enctype="multipart/form-data"}
        <div class="search_container">
          <div class="inner wide-box">
           <ul class="clearfix">
                <li class="column">
                  <p class="label-field01">{$language.lblOrderID}</p>
                  <span class="textfield01">
                    {form->textbox name="orderNumber" class="text-box"}
                  </span>
                </li>
				<li class="column">
                  <p class="label-field01">{$language.lblTrackingnumber}</p>
                 <span class="textfield01">
                    {form->textbox name="trackingNumber" class="text-box"}
                  </span>
                </li>
                <li class="column">
                  <p class="label-field01">{$language.lblLogisticPartner}</p>
                  <span class="textfield01">
 						{form->select name="sm_main" options=$resSmServices class="select-box" value="{$smGroupID|default:''}" validate="required" error=$language.lblErrorShippingMethod}
                 </span>
                </li>
                <li class="column">
                  <p class="label-field01">{$language.lblShippingServiceType}</p>
                  <span class="textfield01">
						{form->select name="realtime_sm_services" class="select-box"}
						{form->hidden name="selectedServiceType"}
                  </span>
                </li>
                <li class="column">
                  <p class="label-field01">{$language.lblBusiness}</p>
                  <span class="textfield01 clearfix">
                    {form->hidden id="business" name="business" value=$business}                  
                    {form->select id="searchBusiness" name="searchBusiness" class="business_chk" size="5"  multiple="multiple" options=$resBusiness}
                 </span>
                </li>
                <li class="column">
                  <p class="label-field01">{$language.lblCustomerName}</p>
                  <span class="textfield01">
                    {form->textbox name="certificateName" class="text-box"}
                  </span>
                </li>
                <li class="column">
                  <p class="label-field01">{$language.lblLastUpdatedDate}</p>
                 <span class="textfield01">               
                   <div class="text-box-div-date"> 
                      {form->textbox id="date" name="date" readonly="readonly" class="date-field" value=$hiddenFromDate|default:''}
                   </div>
                 </span>
                </li>
				 <li class="column">
                  <p class="label-field01">{$language.lblShippingBy}</p>
                  <span class="textfield01">
					 {form->select name="shippingSetting"  options="->Any~*admin->{$language.lblAdmin}~*business->{$language.lblBusiness}" class="select-box"}
					 </span>
                </li>
				<li class="column">
                  <p class="label-field01">{$language.lblShippingStatus}</p>
                 <span class="textfield01">
                    {form->select name="shippingStatus" options="Any~*Shipment->Shipment Created~*pickup->Pickup Created~*Dispatched~*Delivered~*Cancelled" class="select-box"}
                  </span>
                </li>
				
                <li class="column">
                  <p class="label-field01">&nbsp;</p>
                {form->submit name="submitSearch" form="formShippingSearch" class="button01" tabindex="1" value={$language.lblSearch}}
                {html->anchor href="/shipping/shipped/" caption="<span class=listall>{$language.lblListAll}</span>" class="action-link"}
                {form->hidden name="productType" id="productType" value=4}
                </li>
              </ul>
            <div class="clear"></div>
          </div>
        </div>
         {if $resNotShippedOrders}
          <div class="clearfix">
          	{form->submit class="button-link01 fixing_right" name="export" value=$language.lblExport}
             </div>
        
          {/if}
        <!--END:sEARCH cONTAINER--> 
        {form->close}
        {if $resNotShippedOrders}
        <div class="grid_table00"> 
          {form->start name="formShipments" action="" method="post" enctype="multipart/form-data"}
          <table width="100%" border="0" cellspacing="0" cellpadding="0"   >
            <tr>{if $labelPrivilege}
              <th align="left" valign="middle"  class="checkbox_column" width="28"> <div class="chekingdiv">
                  <ul>
                    <li>
                    {form->checkbox id="ListStatusLinkCheckbox" class="fixing_left"} 
					{html->anchor href="" id="ListStatusLink" class="status-arw fixing_left"} 
              <ul id="ListStatusSelection"  class="check_status">
                <li> {html->anchor href="" rel="ListPending" content=$language.lblPending}</li>
                <li> {html->anchor href="" rel="ListShipment" content=$language.lblShipmentcreated}</li>
                <li> {html->anchor href="" rel="ListPickup" content=$language.lblPickupCreated}</li>
                <li> {html->anchor href="" rel="ListDispatched" content=$language.lblDispatched}</li>
                <li> {html->anchor href="" rel="ListDelivered" content=$language.lblDelivered}</li>
                <li> {html->anchor href="" rel="ListAll" content=$language.lblSelectAll}</li>
              </ul>
              </li>
              </ul>
                </div>
              </th>{/if}
			  
			  <th align="left" valign="middle"  width="90" class="sort{if $sortByOption eq 'sshipmentid'}{$sortByShipmentID}{/if}">
               {html->anchor href="/shipping/shipped/$normallink/sortby/sshipmentid/orderby/$sortByShipmentID/" title="Shipment ID" content="Shipment ID"}
              </th>

			  <th align="center" valign="middle" class="sort{if $sortByOption eq 'ssdate'}{$sortByOrder}{/if}">
              {html->anchor href="/shipping/shipped/$normallink/sortby/ssdate/orderby/$sortByDate/" title="{$language.lblCreatedDate}" content="{$language.lblCreatedDate}"}
              </th>
              <th align="center" valign="middle" >{$language.lblCustomerName}</th>
			  <th align="left" valign="middle" >{$language.lblOrigin}</th>
			  <th align="left" valign="middle" >{$language.lblDestination}</th>
              <th align="center" valign="middle" >{$language.lblQuantity}</th>
              <th align="center" valign="middle" > {$language.lblLogisticPartner} </th>
              <th align="center" valign="middle" >{$language.lblCurrentStatus}
              </th>
			  {if $shipmentShowPrivilege}
              <th align="left" valign="middle" >&nbsp;</th>
			  {/if}
            </tr>
            {foreach from=$resNotShippedOrders item="order" key="key1"}
            {assign var="orderID" value=$order.masterOrderID}
            {assign var="mOrderID" value=$order.masterOrderID}
			 {assign var="sID" value=$order.shippingID}
            <tr {if $key1%2!=0} class="shade01" {/if}>{if $labelPrivilege}
              <td align="center" valign="middle" class="checkbox_column"> 
			  {form->checkbox name="checkOrderIDs[]" value=$sID class="checkbox01 ListAll List"|cat :{$order.currentShippingStatus}}</td>{/if}
              <td align="center" valign="middle">
              {if $shipmentShowPrivilege}{html->anchor class="normal_link" history="yes" caption="#{$order.shippingID}" href="shipment/show/id/$sID/{if $normallink!=''}{$normallink}{/if}"} {else} {$order.shippingID}{/if}
              </td>
			  <td align="center" valign="middle">
				{$order.shipment_created_date|date_format:$date_format}
			  </td>
			  <td align="center" valign="middle">
				{if $order.userID > 0 && $showUserPrivilege}
					{html->anchor href="user/show/id/{$order.userID}/" caption="{$order.fullName}"} - 
					{if $orderShowprivilage}{html->anchor class="normal_link" history="yes" caption="{$order.orderNumber}" href="order/show/id/$mOrderID/{if $normallink!=''}{$normallink}{/if}"} {else} {$order.orderNumber}{/if}
				{else}
					{$order.fullName} - 
					{if $orderShowprivilage}{html->anchor class="normal_link" history="yes" caption="{$order.orderNumber}" href="order/show/id/$mOrderID/{if $normallink!=''}{$normallink}{/if}"} {else} {$order.orderNumber}{/if}
				{/if}
			  </td>
			  <td align="left" valign="middle">
			  {if $order.shipment_origin_details|default:''}
			 
				{assign var="originArray" value=$order.shipment_origin_details|default:''|@unserialize}
				{$originArray.businessName},<br>
				{$originArray|default:''|@array_slice:1:7|array_values|address_format}
			{/if}
			  </td>
			  <td align="left" valign="middle">
			  {if $order.shipment_destination_address|default:''}
				{$order.shipment_destination_address|default:''|@unserialize|@array_slice:0:9|array_values|address_format}
			{/if}
			  </td>
              <td align="center" valign="middle">{$order.quantity}<!--  / {$order.ItemQuantity} --></td>
              <td align="center" valign="middle">
				{if $order.carrier eq 'other'}
					{$order.other_logistic_partner}
				{else}
					{$order.logisticPartner}
				{/if}
					
				{if $order.shippingService}[ {$order.shippingService} ] {/if} </td>				  
            <td align="center" valign="middle">
				{if $order.trackingNumber != ''}
					<strong>{$language.lblTrackingnumber} - {$order.trackingNumber}</strong><br>
				{/if}
                {if $order.currentShippingStatus== 'Delivered'}
					{$language.lblDelivered}
				{else if $order.currentShippingStatus== 'Pending'}
					{$language.lblPending}
				{else if $order.currentShippingStatus== 'Shipment'}
					{$language.lblShipmentcreated}
				{else if $order.currentShippingStatus== 'Dispatched'}
					{$language.lblDispatched}
				{else if $order.currentShippingStatus== 'Pickup'}
					{$language.lblPickupCreated}
                                {else if $order.currentShippingStatus== 'Cancelled'}
                                {$language.lblCancelled}
				{/if}
				<br>({$order.orderStatusDate|date_format:$date_format} {$order.orderStatusDate|date_format:$time_format})
			</td>
			
              <td align="center" valign="middle"><center>
				{if $shipmentShowPrivilege}
					{html->anchor history="yes" href="shipment/show/id/$sID/{if $normallink!=''}{$normallink}{/if}" title={$language.lblView}|cat:" "|cat:{$language.lblShippedOrder}|cat:" - "|cat: {$order.shippingID} class="preview icon-set" caption=""}
				{/if}
				{if $shipmentEditPrivilege}
					{assign var="href" value= "/shipment/edit/id/"|cat:{$sID}|cat:"/"}
					{html->anchor href="{$href}" title="{$language.lblEdit}"  class="product-preview icon-set edit03"}
				{/if}
				{if $shipmentShowPrivilege}
					{html->anchor history="yes" rel="/shipping/destroy/id/{$sID}/newstatus/Deleted/" class="delete02 icon-set" title="Delete" task='delete'}
				{/if}
				</center></td>
            </tr>
            {/foreach}
          </table>
          
          </div>
		  
          <div class="action_box">
            {if $labelPrivilege}
				{form->button name="createLabel" id="createLabel" class="update_btn_table submitBulkStatus button04" value=$language.lblCreateLabel title=$language.lblCreateLabel}
				{html->anchor href="/shipment/label/" class="listLabels"} 
			{/if}
          </div>
                <div class="fixing_right pagination_outer" > {paginate->layout  key="page" label_record="{$language.lblRecorsFound}" label_pages="{$language.lblPages}"} </div>
                <div class="clear"></div>
  				<fieldset class="FieldBx">
    			<legend>{$language.lblBulkUpdate}</legend>
    			<div class="BulkUpdate">
                {if $shipmentEditPrivilege}
                <div class="form_listing-nw clearfix">
                <div class="left-pane flt-left">
                <ul>
              			<li class="clearfix">
						<span class="leftside01">{$language.lblSelectBulkStatus}</span>
						<span class="rightside01 pos-relative">
						{form->select name="bulkShippingStatus" class="select-box width-55per" post_back="no" options="->Select~*Pickup->Pickup Created~*Dispatched~*Delivered"}
						</span>
			  			</li>
                </ul></div>
                </div>
			<!-- Pickup Details -->
				<div class="contBx Pickup_class common_status">
                <div class="form_listing-nw   clearfix">
           		<div class="left-pane flt-left">
                	<ul>
              			<li class="clearfix">
						<span class="leftside01">{$language.lblPickupDateTime}</span>
						<span class="rightside01 pos-relative">
						{form->textbox name="pickupDate" class="date_picker_field Pickup_class common_status  width-55per" validate="bulkShippingStatus->isequal->Pickup~*required" error="{$language.errDate}" placeholder="{$language.lblPickupDateTime}"}
						</span>
			  			</li>
                        <li class="clearfix">
						<span class="leftside01">{$language.lblPickupClosingTime}</span>
						<span class="rightside01 pos-relative">
						{form->textbox  name="pickupClosingTime" class="date_picker_field Pickup_class common_status  width-55per" validate="bulkShippingStatus->isequal->Pickup~*required" error="{$language.errTime}" placeholder="{$language.lblPickupClosingTime}"}
						</span>
			  			</li>
                	</ul>  
                </div>
                </div>
                </div>
			<!-- Pickup Details End -->
			<!-- Dispatch Details -->
				<div class="contBx Dispatched_class common_status">
                <div class="form_listing-nw   clearfix">
           		<div class="left-pane flt-left">
                	<ul>
              			<li class="clearfix">
						<span class="leftside01">{$language.lblDispatchedDate}</span>
						<span class="rightside01 pos-relative">
						{form->textbox name="dispatchDate" class="date_picker_field  Dispatched_class common_status width-55per" validate="bulkShippingStatus->isequal->Dispatched~*required" error="{$language.errDate}" placeholder="{$language.lblDispatchedDate}"}
						</span>
			  			</li>
                        <li class="clearfix">
						<span class="leftside01">{$language.lblExpectedDeliveryDate}</span>
						<span class="rightside01 pos-relative">
						{form->textbox name="dispatchExpDate" class="date_picker_field  Dispatched_class common_status width-55per" validate="bulkShippingStatus->isequal->Dispatched~*required" error="{$language.errDate}" placeholder="{$language.lblExpectedDeliveryDate}"}
						</span>
			  			</li>
                        <li class="clearfix">
						<span class="leftside01">{$language.lblDispatchStatusDetails}</span>
						<span class="rightside01 pos-relative">
						{form->textarea name="dispatchStatusDetails" class="Dispatched_class common_status width-100per" placeholder="{$language.lblDispatchStatusDetails}"}
						</span>
			  			</li>
                         <li class="clearfix">
						<span class="leftside01"></span>
						<span class="rightside01 pos-relative">
						{form->checkbox name="dispatchNotify" value="Yes" class="Dispatched_class common_status"} <span class="Dispatched_class common_status">{$language.lblNotifyCustomer}</span>
						</span>
			  			</li>
                	</ul>  
                </div>
                </div>
                </div>
			<!-- Dispatch Details End -->
			<!-- Delivered Details -->
				<div class="contBx Delivered_class common_status">
                <div class="form_listing-nw   clearfix">
           		<div class="left-pane flt-left">
                	<ul>
              			<li class="clearfix">
						<span class="leftside01">{$language.lblDeliveredDateTime}</span>
						<span class="rightside01 pos-relative">
						 {form->textbox name="deliveredDate" class="date_picker_field Delivered_class common_status width-55per" validate="bulkShippingStatus->isequal->Delivered~*required" error="{$language.errDate}" placeholder="{$language.lblDeliveredDateTime}"}
						</span>
			  			</li>
                        <li class="clearfix">
						<span class="leftside01">{$language.lblMessage}</span>
						<span class="rightside01 pos-relative">
						{form->textarea name="deliveredComment" class=" Delivered_class common_status width-100per" placeholder="{$language.lblMessage}"}
						</span>
			  			</li>
                         <li class="clearfix">
						<span class="leftside01"></span>
						<span class="rightside01 pos-relative">
						{form->checkbox name="deliveredNotify" value="Yes" class="Delivered_class common_status"} <span class="Delivered_class common_status">{$language.lblNotifyCustomer}</span>
						</span>
			  			</li>
                	</ul>  
                </div>
                </div>
                </div>
			<!-- Delivered Details End -->
                <div class="form_listing-nw clearfix">
                <div class="left-pane flt-left">
                <ul>
              			<li class="clearfix">
						<span class="leftside01"></span>
						<span class="rightside01 pos-relative">
                        <div class="submit-block">
						{form->submit name="submitBulkStatus" id="submitBulkStatus" class="button03" value=$language.lblUpdateStatus title=$language.lblUpdateStatus}
                        </div>
						</span>
			  			</li>
                </ul></div>
                </div>
			{/if}
                </div>
  				</fieldset>
                {form->close}
          {else}
          <div class="message_info"> {$language.msgNoRecords}</div>
          {/if}
        <!--End:Table Listing--> 
      </div>
      <!--End: left Block-->
      <div class="clear"></div>
    </div>
  </div>
  <!--End:Content Container--> 
  {include file='CommonBottom.tpl'}
</div>
<!--End:Outer Container--> 
{include file='CommonJavaScriptBottom.tpl'} 
{html->messages_script id="common_message"} 
{form->validate_script form="formShipments"} 
<script type="text/javascript" src="{$common_js}/validate.plugin.js"></script> 
<script type="text/javascript" src="{$view_javascript}/table.plugin.js"></script>
<script type="text/javascript" src="{$view_javascript}/jquery.multiselect.widget.js"></script> 
<script type="text/javascript" src="{$view_javascript}/shipping.page.js"></script> 
<script type="text/javascript" src="{$common_js}/date.js"></script>
<script type="text/javascript" src="{$view_javascript}/daterangepicker.jQuery.js"></script>
<script type="text/javascript" src="{$view_javascript}/jquery-ui-timepicker-addon.js"></script>
<script type="text/javascript" src="{$view_javascript}/jquery.colorbox.js"></script> 
<script type="text/javascript">
var lblSelectAction			= '{$language.lblSelectAction}';
var lblSelectItem			= '{$language.lblSelectItem}';
var msgSelectSearchCriteria	= '{$language.msgSelectSearchCriteria}';
var lblSelectBusiness		= "{$language.lblSelectBusiness}";
var msgConfirmDelete		= "{$language.msgConfirmDelete}";
{literal}
$(function(){
	 $('#date').daterangepicker({arrows: false});
	 });
{/literal}
</script>

</body>
</html>